Skip to contentSkip to conversation

xt_cgroup: initialize info->priv in cgroup_mt_check_v1()

PATCH Applied Cong Wang 2 participants 2 messages Jan 31, 2018 – Feb 2, 2018

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 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.

Fixes c38c4597e4bf ("netfilter: implement xt_cgroup cgroup2 path match")
Cc Pablo Neira Ayuso <[email protected]>
---
 net/netfilter/xt_cgroup.c | 1 +
 1 file changed, 1 insertion(+)
net/netfilter/xt_cgroup.c +1 -0
index 1db1ce59079f..891f4e7e8ea7 100644
@@ -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)) {
Signature · 1 line
2.13.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Cong Wang

xt_cgroup_info_v1->priv is an internal pointer only used for kernel, we should not trust what user-space provides.

Applied, thanks Cong.