Netfilter/IPVS fixes for net
Subsystems (6)
Pablo Neira Ayuso
maintainercover Netfilter/IPVS fixes for net
Hi,
The following patchset contains Netfilter fixes for net:
1) Crash due to missing initialization of timer data in xt_IDLETIMER, from Juhee Kang.
2) NF_CONNTRACK_SECMARK should be bool in Kconfig, from Vegard Nossum.
3) Skip netdev events on netns removal, from Florian Westphal.
4) Add testcase to show port shadowing via UDP, also from Florian.
5) Remove pr_debug() code in ip6t_rt, this fixes a crash due to unsafe access to non-linear skbuff, from Xin Long.
6) Make net/ipv4/vs/debug_level read-only from non-init netns, from Antoine Tenart.
7) Remove bogus invocation to bash in selftests/netfilter/nft_flowtable.sh also from Florian.
There will be a relatively simple conflict between net-next and net after this pull-request, as reported by Stephen Rothwell.
net/netfilter/ipvs/ip_vs_ctl.c +0 -0
@@@ -4090,11 -4096,8 +4096,13 @@@ static int __net_init ip_vs_control_net
tbl[idx++].data = &ipvs->sysctl_conn_reuse_mode; tbl[idx++].data = &ipvs->sysctl_schedule_icmp; tbl[idx++].data = &ipvs->sysctl_ignore_tunneled;
+ ipvs->sysctl_run_estimation = 1;
+ tbl[idx++].data = &ipvs->sysctl_run_estimation;
+#ifdef CONFIG_IP_VS_DEBUG
+ /* Global sysctls must be ro in non-init netns */
+ if (!net_eq(net, &init_net))
+ tbl[idx++].mode = 0444;
+#endif
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit 8d6c414cd2fb74aa6812e9bfec6178f8246c4f3a:
net: prefer socket bound to interface when not in VRF (2021-10-07 07:27:55 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git HEAD
for you to fetch changes up to d9aaaf223297f6146d9d7f36caca927c92ab855a:
netfilter: ebtables: allocate chainstack on CPU local nodes (2021-10-18 00:23:57 +0200)
----------------------------------------------------------------
Antoine Tenart (1):
netfilter: ipvs: make global sysctl readonly in non-init netns
Davidlohr Bueso (1):
netfilter: ebtables: allocate chainstack on CPU local nodes
Florian Westphal (3):
netfilter: nf_tables: skip netdev events generated on netns removal
selftests: nft_nat: add udp hole punch test case
selftests: netfilter: remove stray bash debug line
Juhee Kang (1):
netfilter: xt_IDLETIMER: fix panic that occurs when timer_type has garbage value
Vegard Nossum (1):
netfilter: Kconfig: use 'default y' instead of 'm' for bool config option
Xin Long (1):
netfilter: ip6t_rt: fix rt0_hdr parsing in rt_mt6
net/bridge/netfilter/ebtables.c | 4 +- net/ipv6/netfilter/ip6t_rt.c | 48 +------ net/netfilter/Kconfig | 2 +- net/netfilter/ipvs/ip_vs_ctl.c | 5 + net/netfilter/nft_chain_filter.c | 9 +- net/netfilter/xt_IDLETIMER.c | 2 +- tools/testing/selftests/netfilter/nft_flowtable.sh | 1 - tools/testing/selftests/netfilter/nft_nat.sh | 145 +++++++++++++++++++++ 8 files changed, 164 insertions(+), 52 deletions(-)
Pablo Neira Ayuso
maintainerPATCH 1/8 netfilter: xt_IDLETIMER: fix panic that occurs when timer_type has garbage value
From: Juhee Kang <[email protected]>
Currently, when the rule related to IDLETIMER is added, idletimer_tg timer structure is initialized by kmalloc on executing idletimer_tg_create function. However, in this process timer->timer_type is not defined to a specific value. Thus, timer->timer_type has garbage value and it occurs kernel panic. So, this commit fixes the panic by initializing timer->timer_type using kzalloc instead of kmalloc.
Test commands:
# iptables -A OUTPUT -j IDLETIMER --timeout 1 --label test
$ cat /sys/class/xt_idletimer/timers/test
KilledSplat looks like:
BUG: KASAN: user-memory-access in alarm_expires_remaining+0x49/0x70
Read of size 8 at addr 0000002e8c7bc4c8 by task cat/917
CPU: 12 PID: 917 Comm: cat Not tainted 5.14.0+ #3 79940a339f71eb14fc81aee1757a20d5bf13eb0e
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014
Call Trace:
dump_stack_lvl+0x6e/0x9c
kasan_report.cold+0x112/0x117
? alarm_expires_remaining+0x49/0x70
__asan_load8+0x86/0xb0
alarm_expires_remaining+0x49/0x70
idletimer_tg_show+0xe5/0x19b [xt_IDLETIMER 11219304af9316a21bee5ba9d58f76a6b9bccc6d]
dev_attr_show+0x3c/0x60
sysfs_kf_seq_show+0x11d/0x1f0
? device_remove_bin_file+0x20/0x20
kernfs_seq_show+0xa4/0xb0
seq_read_iter+0x29c/0x750
kernfs_fop_read_iter+0x25a/0x2c0
? __fsnotify_parent+0x3d1/0x570
? iov_iter_init+0x70/0x90
new_sync_read+0x2a7/0x3d0
? __x64_sys_llseek+0x230/0x230
? rw_verify_area+0x81/0x150
vfs_read+0x17b/0x240
ksys_read+0xd9/0x180
? vfs_write+0x460/0x460
? do_syscall_64+0x16/0xc0
? lockdep_hardirqs_on+0x79/0x120
__x64_sys_read+0x43/0x50
do_syscall_64+0x3b/0xc0
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f0cdc819142
Code: c0 e9 c2 fe ff ff 50 48 8d 3d 3a ca 0a 00 e8 f5 19 02 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 24
RSP: 002b:00007fff28eee5b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007f0cdc819142
RDX: 0000000000020000 RSI: 00007f0cdc032000 RDI: 0000000000000003
RBP: 00007f0cdc032000 R08: 00007f0cdc031010 R09: 0000000000000000
R10: 0000000000000022 R11: 0000000000000246 R12: 00005607e9ee31f0
R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000--- net/netfilter/xt_IDLETIMER.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/xt_IDLETIMER.c +1 -1
@@ -137,7 +137,7 @@ static int idletimer_tg_create(struct idletimer_tg_info *info) {int ret; - info->timer =kmalloc (sizeof (*info->timer),GFP_KERNEL ); + info->timer =kzalloc (sizeof (*info->timer),GFP_KERNEL );if (!info->timer) { ret = -ENOMEM ; goto out;
Signature · 1 line
2.30.2
Re: [PATCH net 1/8] netfilter: xt_IDLETIMER: fix panic that occurs when timer_type has garbage value
This series was applied to netdev/net.git (master) by Pablo Neira Ayuso <[email protected]>:
Hello:
This series was applied to netdev/net.git (master) by Pablo Neira Ayuso <[email protected]>:
Quoted 10 lines · On Thu, 21 Oct 2021 12:08:14 +0200 you wrote:
From: Juhee Kang <[email protected]>
Currently, when the rule related to IDLETIMER is added,
idletimer_tgtimer structure is initialized by kmalloc on executingidletimer_tg_createfunction. However, in this processtimer->timer_typeis not defined to a specific value. Thus,timer->timer_typehas garbage value and it occurs kernel panic. So, this commit fixes the panic by initializingtimer->timer_typeusing kzalloc instead of kmalloc.[...]
Here is the summary with links:
- [net,1/8] netfilter: xt_IDLETIMER: fix panic that occurs when timer_type has garbage value
https://git.kernel.org/netdev/net/c/902c0b188752 - [net,2/8] netfilter: Kconfig: use 'default y' instead of 'm' for bool config option https://git.kernel.org/netdev/net/c/77076934afdc - [net,3/8] netfilter: nf_tables: skip netdev events generated on netns removal https://git.kernel.org/netdev/net/c/68a3765c659f - [net,4/8] selftests: nft_nat: add udp hole punch test case https://git.kernel.org/netdev/net/c/465f15a6d1a8 - [net,5/8] netfilter: ip6t_rt: fix rt0_hdr parsing in rt_mt6 https://git.kernel.org/netdev/net/c/a482c5e00a9b - [net,6/8] netfilter: ipvs: make global sysctl readonly in non-init netns https://git.kernel.org/netdev/net/c/174c37627894 - [net,7/8] selftests: netfilter: remove stray bash debug line https://git.kernel.org/netdev/net/c/3e6ed7703dae - [net,8/8] netfilter: ebtables: allocate chainstack on CPU local nodes https://git.kernel.org/netdev/net/c/d9aaaf223297
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Pablo Neira Ayuso
maintainerPATCH 2/8 netfilter: Kconfig: use 'default y' instead of 'm' for bool config option
In reply to Pablo Neira AyusoFrom: Vegard Nossum <[email protected]>
This option, NF_CONNTRACK_SECMARK, is a bool, so it can never be 'm'.
--- net/netfilter/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/Kconfig +1 -1
@@ -109,7 +109,7 @@ config NF_CONNTRACK_MARK config NF_CONNTRACK_SECMARK bool 'Connection tracking security mark support' depends on NETWORK_SECMARK - default m if NETFILTER_ADVANCED=n + default y if NETFILTER_ADVANCED=n help This option enables security markings to be applied to connections. Typically they are copied to connections from
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 3/8 netfilter: nf_tables: skip netdev events generated on netns removal
In reply to Pablo Neira AyusoFrom: Florian Westphal <[email protected]>
syzbot reported following (harmless) WARN:
WARNING: CPU: 1 PID: 2648 at net/netfilter/core.c:468 nft_netdev_unregister_hooks net/netfilter/nf_tables_api.c:230 [inline] nf_tables_unregister_hook include/net/netfilter/nf_tables.h:1090 [inline] __nft_release_basechain+0x138/0x640 net/netfilter/nf_tables_api.c:9524 nft_netdev_event net/netfilter/nft_chain_filter.c:351 [inline] nf_tables_netdev_event+0x521/0x8a0 net/netfilter/nft_chain_filter.c:382
reproducer:
unshare -n bash -c 'ip link add br0 type bridge; nft add table netdev t ; \
nft add chain netdev t ingress \{ type filter hook ingress device "br0" \
priority 0\; policy drop\; \}'
Problem is that when netns device exit hooks create the UNREGISTER event, the .pre_exit hook for nf_tables core has already removed the base hook. Notifier attempts to do this again.
The need to do base hook unregister unconditionally was needed in the past, because notifier was last stage where reg->dev dereference was safe.
Now that nf_tables does the hook removal in .pre_exit, this isn't needed anymore.
--- net/netfilter/nft_chain_filter.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
net/netfilter/nft_chain_filter.c +3 -6
@@ -342,12 +342,6 @@ static void nft_netdev_event(unsigned long event, struct net_device *dev,return ; } -/* UNREGISTER events are also happening on netns exit. -* -* Although nf_tables core releases all tables/chains, only this event -* handler provides guarantee that hook->ops.dev is still accessible, -* so we cannot skip exiting net namespaces. -*/ __nft_release_basechain (ctx); }
@@ -366,6 +360,9 @@ static int nf_tables_netdev_event(struct notifier_block *this, event != NETDEV_CHANGENAME)return NOTIFY_DONE ; +if (!check_net (ctx.net)) +return NOTIFY_DONE ; + nft_net =nft_pernet (ctx.net);mutex_lock (&nft_net->commit_mutex);list_for_each_entry (table, &nft_net->tables, list) {
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 4/8 selftests: nft_nat: add udp hole punch test case
In reply to Pablo Neira AyusoFrom: Florian Westphal <[email protected]>
Add a test case that demonstrates port shadowing via UDP.
ns2 sends packet to ns1, from source port used by a udp service on the router, ns0. Then, ns1 sends packet to ns0:service, but that ends up getting forwarded to ns2.
Also add three test cases that demonstrate mitigations:
1. disable use of $port as source from 'unstrusted' origin
2. make the service untracked. This prevents masquerade entries from having any effects.
3. add forced PAT via 'random' mode to translate the "wrong" sport into an acceptable range.
--- tools/testing/selftests/netfilter/nft_nat.sh | 145 +++++++++++++++++++ 1 file changed, 145 insertions(+)
tools/testing/selftests/netfilter/nft_nat.sh +145 -0
@@ -741,6 +741,149 @@ EOF return $lret } +# test port shadowing. +# create two listening services, one on router (ns0), one +# on client (ns2), which is masqueraded from ns1 point of view. +# ns2 sends udp packet coming from service port to ns1, on a highport. +# Later, if n1 uses same highport to connect to ns0:service, packet +# might be port-forwarded to ns2 instead. + +# second argument tells if we expect the 'fake-entry' to take effect +# (CLIENT) or not (ROUTER). +test_port_shadow() +{ + local test=$1 + local expect=$2 + local daddrc="10.0.1.99" + local daddrs="10.0.1.1" + local result="" + local logmsg="" + + echo ROUTER | ip netns exec "$ns0" nc -w 5 -u -l -p 1405 >/dev/null 2>&1 & + nc_r=$! + + echo CLIENT | ip netns exec "$ns2" nc -w 5 -u -l -p 1405 >/dev/null 2>&1 & + nc_c=$! + + # make shadow entry, from client (ns2), going to (ns1), port 41404, sport 1405. + echo "fake-entry" | ip netns exec "$ns2" nc -w 1 -p 1405 -u "$daddrc" 41404 > /dev/null + + # ns1 tries to connect to ns0:1405. With default settings this should connect + # to client, it matches the conntrack entry created above. + + result=$(echo "" | ip netns exec "$ns1" nc -w 1 -p 41404 -u "$daddrs" 1405) + + if [ "$result" = "$expect" ] ;then + echo "PASS: portshadow test $test: got reply from ${expect}${logmsg}" + else + echo "ERROR: portshadow test $test: got reply from \"$result\", not $expect as intended" + ret=1 + fi + + kill $nc_r $nc_c 2>/dev/null + + # flush udp entries for next test round, if any + ip netns exec "$ns0" conntrack -F >/dev/null 2>&1 +} + +# This prevents port shadow of router service via packet filter, +# packets claiming to originate from service port from internal +# network are dropped. +test_port_shadow_filter() +{ + local family=$1 + +ip netns exec "$ns0" nft -f /dev/stdin <<EOF +table $family filter { + chain forward { + type filter hook forward priority 0; policy accept; + meta iif veth1 udp sport 1405 drop + } +} +EOF + test_port_shadow "port-filter" "ROUTER" + + ip netns exec "$ns0" nft delete table $family filter +} + +# This prevents port shadow of router service via notrack. +test_port_shadow_notrack() +{ + local family=$1 + +ip netns exec "$ns0" nft -f /dev/stdin <<EOF +table $family raw { + chain prerouting { + type filter hook prerouting priority -300; policy accept; + meta iif veth0 udp dport 1405 notrack + udp dport 1405 notrack + } + chain output { + type filter hook output priority -300; policy accept; + udp sport 1405 notrack + } +} +EOF + test_port_shadow "port-notrack" "ROUTER" + + ip netns exec "$ns0" nft delete table $family raw +} + +# This prevents port shadow of router service via sport remap. +test_port_shadow_pat() +{ + local family=$1 + +ip netns exec "$ns0" nft -f /dev/stdin <<EOF +table $family pat { + chain postrouting { + type nat hook postrouting priority -1; policy accept; + meta iif veth1 udp sport <= 1405 masquerade to : 1406-65535 random + } +} +EOF + test_port_shadow "pat" "ROUTER" + + ip netns exec "$ns0" nft delete table $family pat +} + +test_port_shadowing() +{ + local family="ip" + + ip netns exec "$ns0" sysctl net.ipv4.conf.veth0.forwarding=1 > /dev/null + ip netns exec "$ns0" sysctl net.ipv4.conf.veth1.forwarding=1 > /dev/null + + ip netns exec "$ns0" nft -f /dev/stdin <<EOF +table $family nat { + chain postrouting { + type nat hook postrouting priority 0; policy accept; + meta oif veth0 masquerade + } +} +EOF + if [ $? -ne 0 ]; then + echo "SKIP: Could not add add $family masquerade hook" + return $ksft_skip + fi + + # test default behaviour. Packet from ns1 to ns0 is redirected to ns2. + test_port_shadow "default" "CLIENT" + + # test packet filter based mitigation: prevent forwarding of + # packets claiming to come from the service port. + test_port_shadow_filter "$family" + + # test conntrack based mitigation: connections going or coming + # from router:service bypass connection tracking. + test_port_shadow_notrack "$family" + + # test nat based mitigation: fowarded packets coming from service port + # are masqueraded with random highport. + test_port_shadow_pat "$family" + + ip netns exec "$ns0" nft delete table $family nat +} # ip netns exec "$ns0" ping -c 1 -q 10.0.$i.99 for i in 0 1 2; do
@@ -861,6 +1004,8 @@ reset_counters $test_inet_nat && test_redirect inet $test_inet_nat && test_redirect6 inet +test_port_shadowing + if [ $ret -ne 0 ];then echo -n "FAIL: " nft --version
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 5/8 netfilter: ip6t_rt: fix rt0_hdr parsing in rt_mt6
In reply to Pablo Neira AyusoFrom: Xin Long <[email protected]>
In rt_mt6(), when it's a nonlinear skb, the 1st skb_header_pointer() only copies sizeof(struct ipv6_rt_hdr) to _route that rh points to. The access by ((const struct rt0_hdr *)rh)->reserved will overflow the buffer. So this access should be moved below the 2nd call to skb_header_pointer().
Besides, after the 2nd skb_header_pointer(), its return value should also be checked, othersize, *rp may cause null-pointer-ref.
v1->v2:
- clean up some old debugging log.
--- net/ipv6/netfilter/ip6t_rt.c | 48 +++++------------------------------- 1 file changed, 6 insertions(+), 42 deletions(-)
net/ipv6/netfilter/ip6t_rt.c +6 -42
@@ -25,12 +25,7 @@ MODULE_AUTHOR("Andras Kis-Szabo <[email protected]>");static inline bool segsleft_match (u_int32_t min,u_int32_t max,u_int32_t id,bool invert) { -bool r; -pr_debug ("segsleft_match:%c 0x%x <= 0x%x <= 0x%x\n" , - invert ?'!' :' ' , min, id, max); - r = (id >= min && id <= max) ^ invert; -pr_debug (" result %s\n" , r ?"PASS" :"FAILED" ); -return r; +return (id >= min && id <= max) ^ invert; }static bool rt_mt6 (const struct sk_buff *skb,struct xt_action_param *par)
@@ -65,30 +60,6 @@ static bool rt_mt6(const struct sk_buff *skb, struct xt_action_param *par)return false; } -pr_debug ("IPv6 RT LEN %u %u " , hdrlen, rh->hdrlen); -pr_debug ("TYPE %04X " , rh->type); -pr_debug ("SGS_LEFT %u %02X\n" , rh->segments_left, rh->segments_left); - -pr_debug ("IPv6 RT segsleft %02X " , -segsleft_match (rtinfo->segsleft[0 ], rtinfo->segsleft[1 ], - rh->segments_left, - !!(rtinfo->invflags &IP6T_RT_INV_SGS ))); -pr_debug ("type %02X %02X %02X " , - rtinfo->rt_type, rh->type, - (!(rtinfo->flags &IP6T_RT_TYP ) || - ((rtinfo->rt_type == rh->type) ^ - !!(rtinfo->invflags &IP6T_RT_INV_TYP )))); -pr_debug ("len %02X %04X %02X " , - rtinfo->hdrlen, hdrlen, - !(rtinfo->flags &IP6T_RT_LEN ) || - ((rtinfo->hdrlen == hdrlen) ^ - !!(rtinfo->invflags &IP6T_RT_INV_LEN ))); -pr_debug ("res %02X %02X %02X " , - rtinfo->flags &IP6T_RT_RES , - ((const struct rt0_hdr *)rh)->reserved, - !((rtinfo->flags &IP6T_RT_RES ) && - (((const struct rt0_hdr *)rh)->reserved))); - ret = (segsleft_match (rtinfo->segsleft[0 ], rtinfo->segsleft[1 ], rh->segments_left, !!(rtinfo->invflags & IP6T_RT_INV_SGS))) &&
@@ -107,22 +78,22 @@ static bool rt_mt6(const struct sk_buff *skb, struct xt_action_param *par) reserved),sizeof (_reserved), &_reserved); +if (!rp) { + par->hotdrop = true; +return false; + } ret = (*rp ==0 ); } -pr_debug ("#%d " , rtinfo->addrnr);if (!(rtinfo->flags &IP6T_RT_FST )) {return ret; }else if (rtinfo->flags &IP6T_RT_FST_NSTRICT ) { -pr_debug ("Not strict " );if (rtinfo->addrnr > (unsigned int )((hdrlen -8 ) /16 )) { -pr_debug ("There isn't enough space\n" );return false; }else {unsigned int i =0 ; -pr_debug ("#%d " , rtinfo->addrnr);for (temp =0 ; temp < (unsigned int )((hdrlen -8 ) /16 ); temp++) {
@@ -138,26 +109,20 @@ static bool rt_mt6(const struct sk_buff *skb, struct xt_action_param *par)return false; } -if (ipv6_addr_equal (ap, &rtinfo->addrs[i])) { -pr_debug ("i=%d temp=%d;\n" , i, temp); +if (ipv6_addr_equal (ap, &rtinfo->addrs[i])) i++; - }if (i == rtinfo->addrnr)break ; } -pr_debug ("i=%d #%d\n" , i, rtinfo->addrnr);if (i == rtinfo->addrnr)return ret;else return false; } }else { -pr_debug ("Strict " );if (rtinfo->addrnr > (unsigned int )((hdrlen -8 ) /16 )) { -pr_debug ("There isn't enough space\n" );return false; }else { -pr_debug ("#%d " , rtinfo->addrnr);for (temp =0 ; temp < rtinfo->addrnr; temp++) { ap =skb_header_pointer (skb, ptr
@@ -173,7 +138,6 @@ static bool rt_mt6(const struct sk_buff *skb, struct xt_action_param *par)if (!ipv6_addr_equal (ap, &rtinfo->addrs[temp]))break ; } -pr_debug ("temp=%d #%d\n" , temp, rtinfo->addrnr);if (temp == rtinfo->addrnr && temp == (unsigned int )((hdrlen -8 ) /16 ))return ret;
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 6/8 netfilter: ipvs: make global sysctl readonly in non-init netns
In reply to Pablo Neira AyusoFrom: Antoine Tenart <[email protected]>
Because the data pointer of net/ipv4/vs/debug_level is not updated per netns, it must be marked as read-only in non-init netns.
--- net/netfilter/ipvs/ip_vs_ctl.c | 5 +++++ 1 file changed, 5 insertions(+)
net/netfilter/ipvs/ip_vs_ctl.c +5 -0
@@ -4090,6 +4090,11 @@ static int __net_init ip_vs_control_net_init_sysctl(struct netns_ipvs *ipvs) tbl[idx++].data = &ipvs->sysctl_conn_reuse_mode; tbl[idx++].data = &ipvs->sysctl_schedule_icmp; tbl[idx++].data = &ipvs->sysctl_ignore_tunneled; +#ifdef CONFIG_IP_VS_DEBUG +/* Global sysctls must be ro in non-init netns */ +if (!net_eq (net, &init_net)) + tbl[idx++].mode =0444 ; +#endif ipvs->sysctl_hdr =register_net_sysctl (net,"net/ipv4/vs" , tbl);if (ipvs->sysctl_hdr ==NULL ) {
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 7/8 selftests: netfilter: remove stray bash debug line
In reply to Pablo Neira AyusoFrom: Florian Westphal <[email protected]>
This should not be there.
--- tools/testing/selftests/netfilter/nft_flowtable.sh | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/netfilter/nft_flowtable.sh +0 -1
@@ -199,7 +199,6 @@ fi # test basic connectivity if ! ip netns exec ns1 ping -c 1 -q 10.0.2.99 > /dev/null; then echo "ERROR: ns1 cannot reach ns2" 1>&2 - bash exit 1 fi
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 8/8 netfilter: ebtables: allocate chainstack on CPU local nodes
In reply to Pablo Neira AyusoFrom: Davidlohr Bueso <[email protected]>
Keep the per-CPU memory allocated for chainstacks local.
--- net/bridge/netfilter/ebtables.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/bridge/netfilter/ebtables.c +3 -1
@@ -926,7 +926,9 @@ static int translate_table(struct net *net, const char *name,return -ENOMEM ;for_each_possible_cpu (i) { newinfo->chainstack[i] = -vmalloc (array_size (udc_cnt,sizeof (*(newinfo->chainstack[0 ])))); +vmalloc_node (array_size (udc_cnt, +sizeof (*(newinfo->chainstack[0 ]))), +cpu_to_node (i));if (!newinfo->chainstack[i]) {while (i)vfree (newinfo->chainstack[--i]);
Signature · 1 line
2.30.2