diff mbox series

[net] xt_cgroup: initialize info->priv in cgroup_mt_check_v1()

Message ID 20180131230247.1417-1-xiyou.wangcong@gmail.com
State Accepted
Delegated to: Pablo Neira
Headers show
Series [net] xt_cgroup: initialize info->priv in cgroup_mt_check_v1() | expand

Commit Message

Cong Wang Jan. 31, 2018, 11:02 p.m. UTC
xt_cgroup_info_v1->priv is an internal pointer only used for kernel,
we should not trust what user-space provides.

Reported-by: <syzbot+4fbcfcc0d2e6592bd641@syzkaller.appspotmail.com>
Fixes: c38c4597e4bf ("netfilter: implement xt_cgroup cgroup2 path match")
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/netfilter/xt_cgroup.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Pablo Neira Ayuso Feb. 2, 2018, 11:58 a.m. UTC | #1
On Wed, Jan 31, 2018 at 03:02:47PM -0800, Cong Wang wrote:
> xt_cgroup_info_v1->priv is an internal pointer only used for kernel,
> we should not trust what user-space provides.

Applied, thanks Cong.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/net/netfilter/xt_cgroup.c b/net/netfilter/xt_cgroup.c
index 1db1ce59079f..891f4e7e8ea7 100644
--- a/net/netfilter/xt_cgroup.c
+++ b/net/netfilter/xt_cgroup.c
@@ -52,6 +52,7 @@  static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
 		return -EINVAL;
 	}
 
+	info->priv = NULL;
 	if (info->has_path) {
 		cgrp = cgroup_get_from_path(info->path);
 		if (IS_ERR(cgrp)) {