Skip to contentSkip to conversation

netfilter: lwtunnel: expose read-only sysctl nf_hooks_lwtunnel for non init-netns

PATCH Superseded Pablo Neira Ayuso 1 participant 1 message Oct 29

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH v2 1/1 netfilter: lwtunnel: expose read-only sysctl nf_hooks_lwtunnel for non init-netns

Expose nf_hooks_lwtunnel sysctl with 0444 mode from non init-netns instead of 0644, sashiko reports this is exposing a global static branch to modification by unprivileged users.

Fixes 7a3f5b0de364 ("netfilter: add netfilter hooks to SRv6 data plane")

---
v2: rebase on top of nf.git

 net/netfilter/nf_hooks_lwtunnel.c | 2 ++
 1 file changed, 2 insertions(+)
net/netfilter/nf_hooks_lwtunnel.c +2 -0
index 40c6fce14a63..154c33ef257b 100644
@@ -76,6 +76,8 @@ static int __net_init nf_lwtunnel_net_init(struct net *net)
 				GFP_KERNEL_ACCOUNT);
 		if (!table)
 			goto err_alloc;
+
+		table->mode = 0444;
 	}
 
 	hdr = register_net_sysctl_sz(net, "net/netfilter", table,
Signature · 1 line
2.47.3