netfilter: lwtunnel: expose read-only sysctl nf_hooks_lwtunnel for non init-netns
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 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")
Signed-off-by Pablo Neira Ayuso <[email protected]>
---
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
@@ -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