Commit c6f3be75 authored by Cong Wang's avatar Cong Wang Committed by Greg Kroah-Hartman

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

commit ba7cd5d9 upstream.

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: c38c4597 ("netfilter: implement xt_cgroup cgroup2 path match")
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4ec264d8
...@@ -52,6 +52,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par) ...@@ -52,6 +52,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
return -EINVAL; return -EINVAL;
} }
info->priv = NULL;
if (info->has_path) { if (info->has_path) {
cgrp = cgroup_get_from_path(info->path); cgrp = cgroup_get_from_path(info->path);
if (IS_ERR(cgrp)) { if (IS_ERR(cgrp)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment