netfilter: xt_cgroup: initialize info->priv in cgroup_mt_check_v1()

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/ba7cd5d95f25cc6005f687dabdb4e7a6063adda9
Commit:     ba7cd5d95f25cc6005f687dabdb4e7a6063adda9
Parent:     6be3bcd75afb673a37a82e18ba46d50430f172c1
Refname:    refs/heads/master
Author:     Cong Wang <[email protected]>
AuthorDate: Wed Jan 31 15:02:47 2018 -0800
Committer:  Pablo Neira Ayuso <[email protected]>
CommitDate: Fri Feb 2 18:26:37 2018 +0100

    netfilter: xt_cgroup: initialize info->priv in cgroup_mt_check_v1()
    
    xt_cgroup_info_v1->priv is an internal pointer only used for kernel,
    we should not trust what user-space provides.
    
    Reported-by: <[email protected]>
    Fixes: c38c4597e4bf ("netfilter: implement xt_cgroup cgroup2 path match")
    Cc: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Cong Wang <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
---
 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)) {
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.