Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e153ebfe authored by xiaocong.gu's avatar xiaocong.gu
Browse files

Integrate security patch 2021-12-05-CVE-2021-0961

Change-Id: Ice7acbe7aca4448be8ef3f147f6ea0c8e2540142
parent db9b09d2
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -106,23 +106,17 @@ static void quota2_log(unsigned int hooknum,
		return;
	}
	pm = nlmsg_data(nlh);
	memset(pm, 0, sizeof(*pm));
	if (skb->tstamp == 0)
		__net_timestamp((struct sk_buff *)skb);
	pm->data_len = 0;
	pm->hook = hooknum;
	if (prefix != NULL)
		strlcpy(pm->prefix, prefix, sizeof(pm->prefix));
	else
		*(pm->prefix) = '\0';
	if (in)
		strlcpy(pm->indev_name, in->name, sizeof(pm->indev_name));
	else
		pm->indev_name[0] = '\0';

	if (out)
		strlcpy(pm->outdev_name, out->name, sizeof(pm->outdev_name));
	else
		pm->outdev_name[0] = '\0';

	NETLINK_CB(log_skb).dst_group = 1;
	pr_debug("throwing 1 packets to netlink group 1\n");
@@ -162,6 +156,8 @@ static ssize_t quota_proc_write(struct file *file, const char __user *input,
	if (copy_from_user(buf, input, size) != 0)
		return -EFAULT;
	buf[sizeof(buf)-1] = '\0';
       if (size < sizeof(buf))
               buf[size] = '\0';

	spin_lock_bh(&e->lock);
	e->quota = simple_strtoull(buf, NULL, 0);
@@ -348,6 +344,7 @@ static struct xt_match quota_mt2_reg[] __read_mostly = {
		.match      = quota_mt2,
		.destroy    = quota_mt2_destroy,
		.matchsize  = sizeof(struct xt_quota_mtinfo2),
		.usersize   = offsetof(struct xt_quota_mtinfo2, master),
		.me         = THIS_MODULE,
	},
	{
@@ -358,6 +355,7 @@ static struct xt_match quota_mt2_reg[] __read_mostly = {
		.match      = quota_mt2,
		.destroy    = quota_mt2_destroy,
		.matchsize  = sizeof(struct xt_quota_mtinfo2),
		.usersize   = offsetof(struct xt_quota_mtinfo2, master),
		.me         = THIS_MODULE,
	},
};