netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net] xt_cgroup: initialize info->priv in cgroup_mt_check_v1()
@ 2018-01-31 23:02 Cong Wang
  2018-02-02 11:58 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Cong Wang @ 2018-01-31 23:02 UTC (permalink / raw)
  To: netdev; +Cc: netfilter-devel, Cong Wang, Pablo Neira Ayuso

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(+)

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)) {
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch net] xt_cgroup: initialize info->priv in cgroup_mt_check_v1()
  2018-01-31 23:02 [Patch net] xt_cgroup: initialize info->priv in cgroup_mt_check_v1() Cong Wang
@ 2018-02-02 11:58 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2018-02-02 11:58 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, netfilter-devel

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-02 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-31 23:02 [Patch net] xt_cgroup: initialize info->priv in cgroup_mt_check_v1() Cong Wang
2018-02-02 11:58 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).