[PATCH net-next 1/7] net: inetdevice: provide replacement iterators for in_ifaddr walk

2019-05-29 Thread Florian Westphal
fields lack the proper __rcu annotation. Signed-off-by: Florian Westphal --- include/linux/inetdevice.h | 10 +- net/ipv4/devinet.c | 31 --- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/include/linux/inetdevice.h b/include/linux

[PATCH net-next 2/7] devinet: use in_dev_for_each_ifa_rcu in more places

2019-05-29 Thread Florian Westphal
inet_ifa_byprefix(). I do not understand why they should ignore secondary addresses. Why would a secondary address not be considered 'on link'? When matching a prefix, why ignore a matching secondary address? Other places get converted as well, but gain "->flags & SECONDARY" che

[PATCH net-next 7/7] net: ipv4: provide __rcu annotation for ifa_list

2019-05-29 Thread Florian Westphal
ifa_list is protected by rcu, yet code doesn't reflect this. Add the __rcu annotations and fix up all places that are now reported by sparse. I've done this in the same commit to not add intermediate patches that result in new warnings. Reported-by: Eric Dumazet Signed-off-by: Floria

[PATCH net-next 3/7] afs: switch to in_dev_for_each_ifa_rcu

2019-05-29 Thread Florian Westphal
ate a temporary buffer needlessly and pass an always-false bool argument. So fold this into the calling function and fill dst buffer directly. Compile tested only. Cc: David Howells Cc: linux-...@lists.infradead.org Signed-off-by: Florian Westphal --- fs/afs/Makefile | 1 - fs/afs/cmserv

[PATCH net-next 0/7] net: add rcu annotations for ifa_list

2019-05-29 Thread Florian Westphal
rcu use to free ifa_list predates the git era. Florian Westphal (7): net: inetdevice: provide replacement iterators for in_ifaddr walk devinet: use in_dev_for_each_ifa_rcu in more places afs: switch to in_dev_for_each_ifa_rcu netfilter: use in_dev_for_each_ifa_rcu

[PATCH net-next 4/7] netfilter: use in_dev_for_each_ifa_rcu

2019-05-29 Thread Florian Westphal
Netfilter hooks are always running under rcu read lock, use the new iterator macro so sparse won't complain once we add proper __rcu annotations. Signed-off-by: Florian Westphal --- net/ipv4/netfilter/nf_tproxy_ipv4.c| 9 +++-- net/netfilter/nf_conntrack_broadcast.c | 9 +++--

[PATCH net-next 5/7] net: use new in_dev_ifa iterators

2019-05-29 Thread Florian Westphal
Use in_dev_for_each_ifa_rcu/rtnl instead. This prevents sparse warnings once proper __rcu annotations are added. Signed-off-by: Florian Westphal t di# Last commands done (6 commands done): --- net/ipv4/fib_frontend.c | 24 +--- net/ipv4/igmp.c | 5 +++-- net/ipv6

[PATCH net-next 6/7] drivers: use in_dev_for_each_ifa_rtnl/rcu

2019-05-29 Thread Florian Westphal
Like previous patches, use the new iterator macros to avoid sparse warnings once proper __rcu annotations are added. Compile tested only. Signed-off-by: Florian Westphal --- drivers/infiniband/core/roce_gid_mgmt.c | 5 +++-- drivers/infiniband/hw/cxgb4/cm.c

Re: [PATCH net-next 3/7] afs: switch to in_dev_for_each_ifa_rcu

2019-05-29 Thread Florian Westphal
David Howells wrote: > Actually, whilst thanks are due for doing the work - it looks nicer now - I'm > told that there's not really any point populating the list. Current OpenAFS > ignores it, as does AuriStor - and IBM AFS 3.6 will do the right thing. [..] > On that basis, feel free to make it

[PATCH net-next v2 0/7] net: add rcu annotations for ifa_list

2019-05-31 Thread Florian Westphal
seem to be urgent to fix this -- rcu use to free ifa_list predates the git era. Florian Westphal (7): afs: do not send list of client addresses net: inetdevice: provide replacement iterators for in_ifaddr walk devinet: use in_dev_for_each_ifa_rcu in more places netfil

[PATCH net-next v2 1/7] afs: do not send list of client addresses

2019-05-31 Thread Florian Westphal
parse warnings once the proper __rcu annotations get added in struct in_device later. But, in light of the above, just remove afs_get_ipv4_interfaces. Compile tested only. Cc: David Howells Cc: linux-...@lists.infradead.org Signed-off-by: Florian Westphal --- fs/afs/Makefile |

[PATCH net-next v2 3/7] devinet: use in_dev_for_each_ifa_rcu in more places

2019-05-31 Thread Florian Westphal
inet_ifa_byprefix(). I do not understand why they should ignore secondary addresses. Why would a secondary address not be considered 'on link'? When matching a prefix, why ignore a matching secondary address? Other places get converted as well, but gain "->flags & SECONDARY" che

[PATCH net-next v2 4/7] netfilter: use in_dev_for_each_ifa_rcu

2019-05-31 Thread Florian Westphal
Netfilter hooks are always running under rcu read lock, use the new iterator macro so sparse won't complain once we add proper __rcu annotations. Signed-off-by: Florian Westphal --- net/ipv4/netfilter/nf_tproxy_ipv4.c| 9 +++-- net/netfilter/nf_conntrack_broadcast.c | 9 +++--

[PATCH net-next v2 7/7] net: ipv4: provide __rcu annotation for ifa_list

2019-05-31 Thread Florian Westphal
ifa_list is protected by rcu, yet code doesn't reflect this. Add the __rcu annotations and fix up all places that are now reported by sparse. I've done this in the same commit to not add intermediate patches that result in new warnings. Reported-by: Eric Dumazet Signed-off-by: Floria

[PATCH net-next v2 6/7] drivers: use in_dev_for_each_ifa_rtnl/rcu

2019-05-31 Thread Florian Westphal
Like previous patches, use the new iterator macros to avoid sparse warnings once proper __rcu annotations are added. Compile tested only. Signed-off-by: Florian Westphal --- drivers/infiniband/core/roce_gid_mgmt.c | 5 +++-- drivers/infiniband/hw/cxgb4/cm.c

[PATCH net-next v2 5/7] net: use new in_dev_ifa iterators

2019-05-31 Thread Florian Westphal
Use in_dev_for_each_ifa_rcu/rtnl instead. This prevents sparse warnings once proper __rcu annotations are added. Signed-off-by: Florian Westphal t di# Last commands done (6 commands done): --- net/ipv4/fib_frontend.c | 24 +--- net/ipv4/igmp.c | 5 +++-- net/ipv6

[PATCH net-next v2 2/7] net: inetdevice: provide replacement iterators for in_ifaddr walk

2019-05-31 Thread Florian Westphal
fields lack the proper __rcu annotation. Signed-off-by: Florian Westphal --- include/linux/inetdevice.h | 10 +- net/ipv4/devinet.c | 31 --- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/include/linux/inetdevice.h b/include/linux

[PATCH net-next v3] net: add rcu annotations for ifa_list

2019-05-31 Thread Florian Westphal
ery long time (2004), so it doesn't seem to be urgent to fix this -- rcu use to free ifa_list predates the git era. Florian Westphal (7): afs: do not send list of client addresses net: inetdevice: provide replacement iterators for in_ifaddr walk devi

[PATCH net-next v3 1/7] afs: do not send list of client addresses

2019-05-31 Thread Florian Westphal
parse warnings once the proper __rcu annotations get added in struct in_device later. But, in light of the above, just remove afs_get_ipv4_interfaces. Compile tested only. Cc: David Howells Cc: linux-...@lists.infradead.org Signed-off-by: Florian Westphal Tested-by: David Howells --- fs/a

[PATCH net-next v3 3/7] devinet: use in_dev_for_each_ifa_rcu in more places

2019-05-31 Thread Florian Westphal
inet_ifa_byprefix(). I do not understand why they should ignore secondary addresses. Why would a secondary address not be considered 'on link'? When matching a prefix, why ignore a matching secondary address? Other places get converted as well, but gain "->flags & SECONDARY" che

[PATCH net-next v3 4/7] netfilter: use in_dev_for_each_ifa_rcu

2019-05-31 Thread Florian Westphal
Netfilter hooks are always running under rcu read lock, use the new iterator macro so sparse won't complain once we add proper __rcu annotations. Signed-off-by: Florian Westphal --- net/ipv4/netfilter/nf_tproxy_ipv4.c| 9 +++-- net/netfilter/nf_conntrack_broadcast.c | 9 +++--

[PATCH net-next v3 6/7] drivers: use in_dev_for_each_ifa_rtnl/rcu

2019-05-31 Thread Florian Westphal
Like previous patches, use the new iterator macros to avoid sparse warnings once proper __rcu annotations are added. Compile tested only. Signed-off-by: Florian Westphal --- drivers/infiniband/core/roce_gid_mgmt.c | 5 +++-- drivers/infiniband/hw/cxgb4/cm.c

[PATCH net-next v3 5/7] net: use new in_dev_ifa iterators

2019-05-31 Thread Florian Westphal
Use in_dev_for_each_ifa_rcu/rtnl instead. This prevents sparse warnings once proper __rcu annotations are added. Signed-off-by: Florian Westphal t di# Last commands done (6 commands done): --- net/ipv4/fib_frontend.c | 24 +--- net/ipv4/igmp.c | 5 +++-- net/ipv6

[PATCH net-next v3 2/7] net: inetdevice: provide replacement iterators for in_ifaddr walk

2019-05-31 Thread Florian Westphal
fields lack the proper __rcu annotation. Signed-off-by: Florian Westphal --- include/linux/inetdevice.h | 10 +- net/ipv4/devinet.c | 31 --- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/include/linux/inetdevice.h b/include/linux

[PATCH net-next v3 7/7] net: ipv4: provide __rcu annotation for ifa_list

2019-05-31 Thread Florian Westphal
ifa_list is protected by rcu, yet code doesn't reflect this. Add the __rcu annotations and fix up all places that are now reported by sparse. I've done this in the same commit to not add intermediate patches that result in new warnings. Reported-by: Eric Dumazet Signed-off-by: Floria

Re: [PATCH net-next v2 1/7] afs: do not send list of client addresses

2019-05-31 Thread Florian Westphal
David Howells wrote: > Florian Westphal wrote: > > > David Howell says: > > "Howells" My bad. > Apart from that: > > Tested-by: David Howells Thanks, a lot, I've re-submitted this as v3 retaining your tested-by.

Re: [PATCH nf-next] netfilter: add support for matching IPv4 options

2019-06-01 Thread Florian Westphal
Pablo Neira Ayuso wrote: > > » iph = skb_header_pointer(skb, *offset, sizeof(_iph), &_iph); > > » if (!iph || skb->protocol != htons(ETH_P_IP)) > > » » return -EBADMSG; > > I mean, you make this check upfront from the _eval() path, ie. > > static void nft_exthdr_ipv4_eval

Re: [PATCH nf-next] netfilter: add support for matching IPv4 options

2019-06-01 Thread Florian Westphal
Pablo Neira Ayuso wrote: > > > if (skb->protocol != htons(ETH_P_IP)) > > > goto err; > > > > Wouldn't it be preferable to just use nft_pf() != NFPROTO_IPV4? > > Then IPv4 options extension won't work from bridge and netdev families > too, right? Ah, right.

[PATCH net-next] net: ipv4: fix rcu lockdep splat due to wrong annotation

2019-06-03 Thread Florian Westphal
+bad6e32808a3a97b1...@syzkaller.appspotmail.com Fixes: 2638eb8b50cf ("net: ipv4: provide __rcu annotation for ifa_list") Signed-off-by: Florian Westphal --- net/ipv4/devinet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/devinet.c b/net/ipv4/devin

Re: [ipsec-next:testing 4/6] net/xfrm/xfrm_state.c:1792:9: error: '__xfrm6_tmpl_sort_cmp' undeclared; did you mean 'xfrm_tmpl_sort'?

2019-06-05 Thread Florian Westphal
kbuild test robot wrote: > tree: > https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git > testing > head: ca78a3eaad69bd08ba41c144c21881dc694d4a32 > commit: 8dc6e3891a4be64c0cca5e8fe2c3ad33bc06543e [4/6] xfrm: remove state and > template sort indirections from xfrm_state_

Re: [ipsec-next:testing 4/6] net/xfrm/xfrm_state.c:1792:9: error: '__xfrm6_tmpl_sort_cmp' undeclared; did you mean 'xfrm_tmpl_sort'?

2019-06-06 Thread Florian Westphal
Steffen Klassert wrote: > On Wed, Jun 05, 2019 at 02:40:45PM +0200, Florian Westphal wrote: > > > > Steffen, as this is still only in your testing branch, I suggest you > > squash this snipped into commit 8dc6e3891a4be64c0cca5e8fe2c3ad33bc06543e > > ("xfrm

Re: [RFC net-next v2 1/1] net: sched: protect against loops in TC filter hooks

2019-06-06 Thread Florian Westphal
John Hurley wrote: > TC hooks allow the application of filters and actions to packets at both > ingress and egress of the network stack. It is possible, with poor > configuration, that this can produce loops whereby an ingress hook calls > a mirred egress action that has an egress hook that redire

Re: [RFC net-next v2 1/1] net: sched: protect against loops in TC filter hooks

2019-06-06 Thread Florian Westphal
John Hurley wrote: > On Thu, Jun 6, 2019 at 1:58 PM Florian Westphal wrote: > > I dislike this, why can't we just use a pcpu counter? > > > > The only problem is with recursion/nesting; whenever we > > hit something that queues the skb for later we're saf

Re: [RFC net-next v2 1/1] net: sched: protect against loops in TC filter hooks

2019-06-06 Thread Florian Westphal
David Miller wrote: > From: Florian Westphal > Date: Thu, 6 Jun 2019 14:58:18 +0200 > > >> @@ -827,6 +828,7 @@ struct sk_buff { > >>__u8tc_at_ingress:1; > >>__u8tc_redirected:1; > >>__u8

Re: [PATCH] netfilter: nft_paylaod: add base type NFT_PAYLOAD_LL_HEADER_NO_TAG

2019-06-10 Thread Florian Westphal
we...@ucloud.cn wrote: > From: wenxu > > nft add rule bridge firewall rule-100-ingress ip protocol icmp drop nft --debug=netlink add rule bridge firewall rule-100-ingress ip protocol icmp drop bridge firewall rule-100-ingress [ payload load 2b @ link header + 12 => reg 1 ] [ cmp eq reg 1 0

Re: [PATCH] Fix dumping vlan rules

2019-07-13 Thread Florian Westphal
michael-...@fami-braun.de wrote: > From: "M. Braun" > > Given the following bridge rules: > 1. ip protocol icmp accept > 2. ether type vlan vlan type ip ip protocol icmp accept > > The are currently both dumped by "nft list ruleset" as > 1. ip protocol icmp accept > 2. ip protocol icmp accept

[RFC net] net: generate icmp redirects after netfilter forward hook

2019-07-18 Thread Florian Westphal
f a proper alternative to filtering such traffic. PREROUTING would work, but at that point we lack the "packet will be forwarded from ppp0 to ppp0" information that we only have available in FORWARD. Compile tested only. Cc: Jason Muskat Signed-off-by: Florian Westphal --- net/ip

Re: [PATCH net-next 1/3] flow_offload: move tc indirect block to flow offload

2019-07-25 Thread Florian Westphal
we...@ucloud.cn wrote: > From: wenxu > > move tc indirect block to flow_offload.c. The nf_tables > can use the indr block architecture. ... to do what? Can you please illustrate how this is going to be used/useful?

Re: [PATCH net-next 2/3] flow_offload: Support get tcf block immediately

2019-07-25 Thread Florian Westphal
we...@ucloud.cn wrote: > From: wenxu > > It provide a callback to find the tcf block in > the flow_indr_block_dev_get Can you explain why you're making this change? This will help us understand the concept/idea of your series. The above describes what the patch does, but it should explain why

Re: [PATCH net] inet: frags: re-introduce skb coalescing for local delivery

2019-08-06 Thread Florian Westphal
d be extended in the future if need be, as > more scenarios would probably benefit from it. No objections from my side, so: Acked-by: Florian Westphal

[PATCH ipsec] xfrm: policy: avoid warning splat when merging nodes

2019-08-12 Thread Florian Westphal
e5f6972910...@syzkaller.appspotmail.com Signed-off-by: Florian Westphal --- net/xfrm/xfrm_policy.c | 6 -- tools/testing/selftests/net/xfrm_policy.sh | 7 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_poli

Re: [PATCH net] netfilter: ebtables: Fix argument order to ADD_COUNTER

2019-08-12 Thread Florian Westphal
; byte counts from the kernel. Please send netfilter patches to netfilter-de...@vger.kernel.org . Fixes: d72133e628803 ("netfilter: ebtables: use ADD_COUNTER macro") Acked-by: Florian Westphal

Re: [PATCH net-next 3/3] net: core: Namespace-ify sysctl_rmem_max and sysctl_wmem_max

2021-01-20 Thread Florian Westphal
menglong8.d...@gmail.com wrote: > From: Menglong Dong > > For now, sysctl_wmem_max and sysctl_rmem_max are globally unified. > It's not convenient in some case. For example, when we use docker > and try to control the default udp socket receive buffer for each > container. > > For that reason,

Re: kernel BUG at lib/string.c:LINE! (6)

2020-12-22 Thread Florian Westphal
Linus Torvalds wrote: > On Tue, Dec 22, 2020 at 6:44 AM syzbot > wrote: > > > > The issue was bisected to: > > > > commit 2f78788b55ba ("ilog2: improve ilog2 for constant arguments") > > That looks unlikely, although possibly some constant folding > improvement might make the fortify code notice

[PATCH nf] netfilter: xt_RATEEST: reject non-null terminated string from userspace

2020-12-22 Thread Florian Westphal
sed. Reported-by: syzbot+e86f7c428c8c50db6...@syzkaller.appspotmail.com Fixes: 5859034d7eb8793 ("[NETFILTER]: x_tables: add RATEEST target") Signed-off-by: Florian Westphal --- RATEEST test in iptables.git still passes, syzbot repro setsockopt fails with -ENAMETOOLONG. diff --git a/

Re: [PATCH nf] netfilter: xt_RATEEST: reject non-null terminated string from userspace

2020-12-22 Thread Florian Westphal
Linus Torvalds wrote: > On Tue, Dec 22, 2020 at 2:24 PM Florian Westphal wrote: > > > > strlcpy assumes src is a c-string. Check info->name before its used. > > If strlcpy is the only problem, then the fix is to use strscpy(), > which doesn't have the design mis

[PATCH net-next 0/3] mptcp: reject invalid mp_join requests right away

2020-11-30 Thread Florian Westphal
At the moment MPTCP can detect an invalid join request (invalid token, max number of subflows reached, and so on) right away but cannot reject the connection until the 3WHS has completed. Instead the connection will complete and the subflow is reset afterwards. To send the reset most information i

[PATCH net-next 1/3] security: add const qualifier to struct sock in various places

2020-11-30 Thread Florian Westphal
lso possible to add a const qualifier to security_inet_conn_request instead. Signed-off-by: Florian Westphal --- The code churn is unfortunate. Alternative would be to change the function signature of ->route_req: struct dst_entry *(*route_req)(struct sock *sk, ... [ i.e., drop 'const'

[PATCH net-next 2/3] tcp: merge 'init_req' and 'route_req' functions

2020-11-30 Thread Florian Westphal
b to the merged function at the same time. 'send reset on unknown mptcp join token' is added in next patch. Suggested-by: Paolo Abeni Cc: Eric Dumazet Signed-off-by: Florian Westphal --- include/net/tcp.h| 9 - net/ipv4/tcp_input.c | 9 ++--- net/ipv4/tcp_ipv4.c |

[PATCH net-next 3/3] mptcp: emit tcp reset when a join request fails

2020-11-30 Thread Florian Westphal
) with an "MPTCP specific error" reason code. mptcp-next doesn't support MP_TCPRST yet, this can be added in another change. Signed-off-by: Florian Westphal --- net/mptcp/subflow.c | 47 ++--- 1 file changed, 36 insertions(+), 11 deletions(-

Re: [Race] data race between eth_heder_cache_update() and neigh_hh_output()

2020-11-30 Thread Florian Westphal
Gong, Sishuai wrote: > Hi, > > We found a data race in linux kernel 5.3.11 that we are able to reproduce in > x86 under specific interleavings. We are not sure about the consequence of > this race now but it seems that the two memcpy() can lead to some > inconsistency. We also noticed that bot

Re: [PATCH] mptcp: print new line in mptcp_seq_show() if mptcp isn't in use

2020-12-04 Thread Florian Westphal
Jianguo Wu wrote: > From: Jianguo Wu A brief explanation would have helped. This is for net tree. > Signed-off-by: Jianguo Wu Fixes: fc518953bc9c8d7d ("mptcp: add and use MIB counter infrastructure") Acked-by: Florian Westphal

Re: [PATCH net-next,v4 3/9] net: resolve forwarding path from virtual netdevice and HW destination address

2020-11-18 Thread Florian Westphal
Pablo Neira Ayuso wrote: > +#define NET_DEVICE_PATH_STACK_MAX5 > + > +struct net_device_path_stack { > + int num_paths; > + struct net_device_path path[NET_DEVICE_PATH_STACK_MAX]; > +}; [..] > +int dev_fill_forward_path(const struct net_device *dev, const u8 *dad

Re: [PATCH net-next,v4 2/9] netfilter: flowtable: add xmit path types

2020-11-18 Thread Florian Westphal
Pablo Neira Ayuso wrote: > - if (unlikely(dst_xfrm(&rt->dst))) { > + rt = (struct rtable *)tuplehash->tuple.dst_cache; > + > + if (unlikely(tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_XFRM)) { > memset(skb->cb, 0, sizeof(struct inet_skb_parm)); > IPCB(sk

Re: [PATCH net] netfilter: ipset: prevent uninit-value in hash_ip6_add

2020-11-19 Thread Florian Westphal
Eric Dumazet wrote: > From: Eric Dumazet > > syzbot found that we are not validating user input properly > before copying 16 bytes [1]. > Using NLA_BINARY in ipaddr_policy[] for IPv6 address is not correct, > since it ensures at most 16 bytes were provided. Thanks Eric. Looks like this is the o

Re: [PATCH v2] aquantia: Remove the build_skb path

2020-11-19 Thread Florian Westphal
Ramsay, Lincoln wrote: > The build_skb path fails to allow for an SKB header, but the hardware > buffer it is built around won't allow for this anyway. What problem is being resolved here?

Re: [PATCH v2] aquantia: Remove the build_skb path

2020-11-19 Thread Florian Westphal
Ramsay, Lincoln wrote: > > Ramsay, Lincoln wrote: > > > The build_skb path fails to allow for an SKB header, but the hardware > > > buffer it is built around won't allow for this anyway. > > > > What problem is being resolved here? > > Sorry... Do I need to re-post the context? (I thought the r

Re: [PATCH v3] aquantia: Remove the build_skb path

2020-11-19 Thread Florian Westphal
Ramsay, Lincoln wrote: > When performing IPv6 forwarding, there is an expectation that SKBs > will have some headroom. When forwarding a packet from the aquantia > driver, this does not always happen, triggering a kernel warning. > > The build_skb path fails to allow for an SKB header, but the ha

Re: [PATCH v4] aquantia: Remove the build_skb path

2020-11-19 Thread Florian Westphal
Ramsay, Lincoln wrote: [ patch looks good to me, I have no further comments ] > > For build_skb path to work the buffer scheme would need to be changed > > to reserve headroom, so yes, I think that the proposed patch is the > > most convenient solution. > > I don't know about benefits/feasibili

Re: [PATCH net-next v2] net: openvswitch: Be liberal in tcp conntrack.

2020-11-19 Thread Florian Westphal
hich > > sets this flag for both the directions of the nf_conn. > > > > Suggested-by: Florian Westphal > > Signed-off-by: Numan Siddique > > Florian, LGTY? Sorry, this one sailed past me. Acked-by: Florian Westphal

Re: [PATCH 015/141] netfilter: Fix fall-through warnings for Clang

2020-11-20 Thread Florian Westphal
Gustavo A. R. Silva wrote: > In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple > warnings by explicitly adding multiple break statements instead of just > letting the code fall through to the next case. Acked-by: Florian Westphal Feel free to carry this in next

Re: [PATCH 108/141] netfilter: ipt_REJECT: Fix fall-through warnings for Clang

2020-11-20 Thread Florian Westphal
Gustavo A. R. Silva wrote: > In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning > by explicitly adding a break statement instead of letting the code fall > through to the next case. Acked-by: Florian Westphal

Re: [PATCH v5 2/3] net: add kcov handle to skb extensions

2020-11-21 Thread Florian Westphal
Ido Schimmel wrote: > On Thu, Oct 29, 2020 at 05:36:19PM +, Aleksandr Nogikh wrote: > > From: Aleksandr Nogikh > > > > Remote KCOV coverage collection enables coverage-guided fuzzing of the > > code that is not reachable during normal system call execution. It is > > especially helpful for f

Re: [Patch stable] netfilter: clear skb->next in NF_HOOK_LIST()

2020-11-21 Thread Florian Westphal
Cong Wang wrote: > From: Cong Wang > > NF_HOOK_LIST() uses list_del() to remove skb from the linked list, > however, it is not sufficient as skb->next still points to other > skb. We should just call skb_list_del_init() to clear skb->next, > like the rest places which using skb list. > > This h

Re: [PATCH net-next] netfilter: bridge: reset skb->pkt_type after NF_INET_POST_ROUTING traversal

2020-11-23 Thread Florian Westphal
PACKET_HOST > and returns early). > > If the comment is right and no one cares about the value of > skb->pkt_type after br_dev_queue_push_xmit (which isn't true), resetting > it to its original value should be safe. That comment is 18 years old, safe bet noone thought of ipv6-in-tunnel-interface-added-as-bridge-port back then. Reviewed-by: Florian Westphal

[PATCH net-next] mptcp: put reference in mptcp timeout timer

2020-11-24 Thread Florian Westphal
mptcp_sk_clone+0x33/0x1a0 [..] subflow_syn_recv_sock+0x2b1/0x690 [..] Fixes: e16163b6e2b7 ("mptcp: refactor shutdown and close") Cc: Paolo Abeni Cc: Davide Caratti Signed-off-by: Florian Westphal --- net/mptcp/protocol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ne

Re: [PATCH v6 0/3] net, mac80211, kernel: enable KCOV remote coverage collection for 802.11 frame handling

2020-11-25 Thread Florian Westphal
Marco Elver wrote: [..] > v6: > * Revert usage of skb extensions due to potential memory leak. Patch 2/3 is > now > idential to that in v2. > * Patches 1/3 and 3/3 are otherwise identical to v5. The earlier series was already applied to net-next, so you need to rebase on top of net-next and i

Re: [PATCH net-next] netfilter: bridge: reset skb->pkt_type after NF_INET_POST_ROUTING traversal

2020-11-28 Thread Florian Westphal
Jakub Kicinski wrote: > On Mon, 23 Nov 2020 19:32:53 +0100 Florian Westphal wrote: > > That comment is 18 years old, safe bet noone thought of > > ipv6-in-tunnel-interface-added-as-bridge-port back then. > > > > Reviewed-by: Florian Westphal > > Sounds like

Re: [net-next] netfiler: conntrack: Add the option to set ct tcp flag - BE_LIBERAL per-ct basis.

2020-11-09 Thread Florian Westphal
of > tcp_in_window() check error or because it doesn't belong to an > existing connection. > > An earlier attempt (see the link) tried to solve this problem for > openvswitch in a different way. Florian Westphal instead suggested > to be liberal in openvswitch for tcp packets

Re: [net-next] netfiler: conntrack: Add the option to set ct tcp flag - BE_LIBERAL per-ct basis.

2020-11-10 Thread Florian Westphal
Numan Siddique wrote: > On Tue, Nov 10, 2020 at 3:06 AM Florian Westphal wrote: > Thanks for the comments. I actually tried this approach first, but it > doesn't seem to work. > I noticed that for the committed connections, the ct tcp flag - > IP_CT_TCP_FLAG_BE_LIBER

Re: [net-next] netfiler: conntrack: Add the option to set ct tcp flag - BE_LIBERAL per-ct basis.

2020-11-10 Thread Florian Westphal
Numan Siddique wrote: > On Tue, Nov 10, 2020 at 5:55 PM Florian Westphal wrote: > > > > Numan Siddique wrote: > > > On Tue, Nov 10, 2020 at 3:06 AM Florian Westphal wrote: > > > Thanks for the comments. I actually tried this approach first, but it > >

Re: [PATCH net-next v4] net: linux/skbuff.h: combine SKB_EXTENSIONS + KCOV handling

2020-11-16 Thread Florian Westphal
Matthieu Baerts wrote: > > --- linux-next-20201113.orig/include/linux/skbuff.h > > +++ linux-next-20201113/include/linux/skbuff.h > > @@ -4137,7 +4137,6 @@ static inline void skb_set_nfct(struct s > > #endif > > } > > -#ifdef CONFIG_SKB_EXTENSIONS > > enum skb_ext_id { > > #if IS_ENABLED(C

Re: [PATCH net-next v4] net: linux/skbuff.h: combine SKB_EXTENSIONS + KCOV handling

2020-11-16 Thread Florian Westphal
Randy Dunlap wrote: > On 11/16/20 7:30 AM, Jakub Kicinski wrote: > > On Mon, 16 Nov 2020 15:31:21 +0100 Florian Westphal wrote: > >>>> @@ -4151,12 +4150,11 @@ enum skb_ext_id { > >>>> #if IS_ENABLED(CONFIG_MPTCP) > >>>> SKB_EXT_MPT

Re: [PATCH net-next v5] net: linux/skbuff.h: combine SKB_EXTENSIONS + KCOV handling

2020-11-16 Thread Florian Westphal
in the header file. Thanks Randy. Acked-by: Florian Westphal

Re: [PATCH] xfrm: Fix wraparound in xfrm_policy_addr_delta()

2020-12-29 Thread Florian Westphal
Visa Hankala wrote: > Use three-way comparison for address elements to avoid integer > wraparound in the result of xfrm_policy_addr_delta(). > > This ensures that the search trees are built and traversed correctly > when the difference between compared address elements is larger > than INT_MAX.

Re: [PATCH] xfrm: Fix wraparound in xfrm_policy_addr_delta()

2020-12-30 Thread Florian Westphal
Visa Hankala wrote: > On Tue, Dec 29, 2020 at 05:01:27PM +0100, Florian Westphal wrote: > > This is suspicious. Is prefixlen == 0 impossible? > > > > If not, then after patch > > mask = ~0U << 32; > > > > ... and function returns 0. > > With

Re: [PATCH] selftests: xfrm: fix test return value override issue in xfrm_policy.sh

2020-12-30 Thread Florian Westphal
o $? > 0 > > This is because the $lret in check_xfrm() is not a local variable. Acked-by: Florian Westphal

Re: [PATCH v2] xfrm: Fix wraparound in xfrm_policy_addr_delta()

2020-12-30 Thread Florian Westphal
0. > Prefix /0 has only one equivalence class. Acked-by: Florian Westphal

[PATCH net 2/3] net: fix pmtu check in nopmtudisc mode

2021-01-05 Thread Florian Westphal
stack then sends an error to itself because the packet exceeds the device MTU. Fixes: 23a3647bc4f93 ("ip_tunnels: Use skb-len to PMTU check.") Cc: Stefano Brivio Signed-off-by: Florian Westphal --- net/ipv4/ip_tunnel.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) dif

[PATCH net 0/3] net: fix netfilter defrag/ip tunnel pmtu blackhole

2021-01-05 Thread Florian Westphal
Christian Perle reported a PMTU blackhole due to unexpected interaction between the ip defragmentation that comes with connection tracking and ip tunnels. Unfortunately setting 'nopmtudisc' on the tunnel breaks the test scenario even without netfilter. Christinas setup looks like this: +

[PATCH net 3/3] net: ip: always refragment ip defragmented packets

2021-01-05 Thread Florian Westphal
t") Reported-by: Christian Perle Signed-off-by: Florian Westphal --- net/ipv4/ip_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 89fff5f59eea..2ed0b01f72f0 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_outpu

[PATCH net 1/3] selftests: netfilter: add selftest for ipip pmtu discovery with enabled connection tracking

2021-01-05 Thread Florian Westphal
Convert Christians bug description into a reproducer. Cc: Shuah Khan Cc: Pablo Neira Ayuso Reported-by: Christian Perle Signed-off-by: Florian Westphal --- tools/testing/selftests/netfilter/Makefile| 3 +- .../selftests/netfilter/ipip-conntrack-mtu.sh | 206 ++ 2 files

Re: [PATCH] tcp: remove obsolete paramter sysctl_tcp_low_latency

2021-01-07 Thread Florian Westphal
Jakub Kicinski wrote: > > Got it. But a question: why tcp_tw_recycle can be removed totally? > > it is also part of uAPI > > Good question, perhaps with tcp_tw_recycle we wanted to make sure users > who depended on it notice removal, since the feature was broken by > design? > > tcp_low_latency

Re: 5.10.4+ hang with 'rmmod nf_conntrack'

2021-01-07 Thread Florian Westphal
Ben Greear wrote: > I noticed my system has a hung process trying to 'rmmod nf_conntrack'. > > I've generally been doing the script that calls rmmod forever, > but only extensively tested on 5.4 kernel and earlier. > > If anyone has any ideas, please let me know. This is from 'sysrq t'. I > d

Re: [PATCH net] netfilter: conntrack: fix reading nf_conntrack_buckets

2021-01-08 Thread Florian Westphal
esults in > sysctl net/netfilter/nf_conntrack_buckets shows the wrong value when users > update via the old way. Oh, right! Acked-by: Florian Westphal

Re: [PATCH] netfilter: Fix memleak in nf_nat_init

2021-01-09 Thread Florian Westphal
Dinghao Liu wrote: > When register_pernet_subsys() fails, nf_nat_bysource > should be freed just like when nf_ct_extend_register() > fails. Acked-by: Florian Westphal

Re: [PATCH nf 2/2] netfilter: use actual socket sk rather than skb sk when routing harder

2020-10-29 Thread Florian Westphal
ceives the sk as part of its normal > functionality. So we make sure to plumb state->sk through the various > route_me_harder functions, and then make correct use of it following the > example of __ip_queue_xmit(). Reviewed-by: Florian Westphal

Re: WARNING in dst_release

2021-02-18 Thread Florian Westphal
syzbot wrote: > Hello, > > syzbot has tested the proposed patch and the reproducer did not trigger any > issue: > > Reported-and-tested-by: syzbot+b53bbea2ad64f9cf8...@syzkaller.appspotmail.com #syz-fix: mptcp: reset last_snd on subflow close [ This patch is currently in mptcp-next ]

Re: [PATCH] xfrm: Fix incorrect types in assignment

2021-02-19 Thread Florian Westphal
Yang Li wrote: > Fix the following sparse warnings: > net/xfrm/xfrm_policy.c:1303:22: warning: incorrect type in assignment > (different address spaces) > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > net/xfrm/xfrm_policy.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >

Re: [PATCH][next] netfilter: nf_log_bridge: Fix missing assignment of ret on a call to nf_log_register

2021-03-31 Thread Florian Westphal
Colin King wrote: > From: Colin Ian King > > Currently the call to nf_log_register is returning an error code that > is not being assigned to ret and yet ret is being checked. Fix this by > adding in the missing assignment. Thanks for catching this. Acked-by: Florian Westphal

Re: [PATCH net 2/2] mptcp: revert "mptcp: provide subflow aware release function"

2021-04-01 Thread Florian Westphal
subflow aware release function") > Signed-off-by: Paolo Abeni Paolo, thanks for passing this to -net. Acked-by: Florian Westphal

Re: [PATCH netfilter] netfilter: xt_IDLETIMER: fix idletimer_tg_helper non-kosher casts

2021-04-02 Thread Florian Westphal
Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > The code is relying on the identical layout of the beginning > of the v0 and v1 structs, but this can easily lead to code bugs > if one were to try to extend this further... What is the concern? These structs are part of ABI, they cann

[PATCH net-next] net: dccp: use net_generic storage

2021-04-08 Thread Florian Westphal
DCCP is virtually never used, so no need to use space in struct net for it. Put the pernet ipv4/v6 socket in the dccp ipv4/ipv6 modules instead. Signed-off-by: Florian Westphal --- include/net/net_namespace.h | 4 include/net/netns/dccp.h| 12 net/dccp/ipv4.c

Re: [BUG / question] in routing rules, some options (e.g. ipproto, sport) cause rules to be ignored in presence of packet marks

2021-04-09 Thread Florian Westphal
Michal Soltys wrote: > On 3/29/21 10:52 PM, Ido Schimmel wrote: > > > > ip_route_me_harder() does not set source / destination port in the > > flow key, so it explains why fib rules that use them are not hit after > > mangling the packet. These keys were added in 4.17, but I > > don't think this

Re: linux-next: build failure after merge of the net-next tree

2021-04-12 Thread Florian Westphal
Stephen Rothwell wrote: > net/bridge/netfilter/ebtables.c:1248:33: error: 'struct netns_xt' has no > member named 'tables' > 1248 | list_for_each_entry(t, &net->xt.tables[NFPROTO_BRIDGE], list) { > | ^ > include/linux/list.h:619:20: note: in definition of m

Re: [PATCH] netfilter: nf_conntrack: Add conntrack helper for ESP/IPsec

2021-04-14 Thread Florian Westphal
Cole Dishington wrote: > Introduce changes to add ESP connection tracking helper to netfilter > conntrack. The connection tracking of ESP is based on IPsec SPIs. The > underlying motivation for this patch was to allow multiple VPN ESP > clients to be distinguished when using NAT. > > Added config

[PATCH ipsec-next 2/3] xfrm: remove stray synchronize_rcu from xfrm_init

2021-04-14 Thread Florian Westphal
This function is called during boot, from ipv4 stack, there is no need to set the pointer to NULL (static storage duration, so already NULL). No need for the synchronize_rcu either. Remove both. Signed-off-by: Florian Westphal --- net/xfrm/xfrm_policy.c | 3 --- 1 file changed, 3 deletions

[PATCH ipsec-next 1/3] flow: remove spi key from flowi struct

2021-04-14 Thread Florian Westphal
xfrm session decode ipv4 path (but not ipv6) sets this, but there are no consumers. Remove it. Signed-off-by: Florian Westphal --- include/net/flow.h | 3 --- net/xfrm/xfrm_policy.c | 39 --- 2 files changed, 42 deletions(-) diff --git a/include/net

[PATCH ipsec-next 0/3] xfrm: minor cleanup and synchronize_rcu removal

2021-04-14 Thread Florian Westphal
. Third patch avoids a synchronize_rcu during netns destruction. Florian Westphal (3): flow: remove spi key from flowi struct xfrm: remove stray synchronize_rcu from xfrm_init xfrm: avoid synchronize_rcu during netns destruction include/net/flow.h | 3 --- net/xfrm/xfrm_policy.c | 42

[PATCH ipsec-next 3/3] xfrm: avoid synchronize_rcu during netns destruction

2021-04-14 Thread Florian Westphal
Use the new exit_pre hook to NULL the netlink socket. The net namespace core will do a synchronize_rcu() between the exit_pre and exit/exit_batch handlers. Signed-off-by: Florian Westphal --- net/xfrm/xfrm_user.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/net

  1   2   3   4   5   6   7   8   9   10   >