Re: [PATCH] net: check skb partial checksum offset after trim

2020-12-14 Thread Vasily Averin
On 12/15/20 12:07 AM, Willem de Bruijn wrote: > On Mon, Dec 14, 2020 at 3:56 PM Jakub Kicinski wrote: >> >> On Sun, 13 Dec 2020 20:59:54 -0500 Willem de Bruijn wrote: >>> On Sun, Dec 13, 2020 at 2:37 PM Vasily Averin wrote: >>>>>> On 12/11/20 6:37 PM, Va

[PATCH v2] net: drop bogus skb with CHECKSUM_PARTIAL and offset beyond end of trimmed packet

2020-12-14 Thread Vasily Averin
tps://syzkaller.appspot.com/bug?id=b419a5ca95062664fe1a60b764621eb4526e2cd0 Reported-by: syzbot+7010af67ced6105e5...@syzkaller.appspotmail.com Signed-off-by: Vasily Averin --- v2: drop bogus packets instead change its CHECKSUM_PARTIAL to CHECKSUM_NONE net/core/skbuff.c | 6 ++ 1 file changed, 6 inserti

Re: [PATCH] net: check skb partial checksum offset after trim

2020-12-13 Thread Vasily Averin
On 12/13/20 2:49 AM, Willem de Bruijn wrote: > On Sat, Dec 12, 2020 at 5:01 AM Vasily Averin wrote: >> >> On 12/11/20 6:37 PM, Vasily Averin wrote: >>> It seems for me the similar problem can happen in __skb_trim_rcsum(). >>> Also I doubt that that skb_che

Re: [PATCH] net: check skb partial checksum offset after trim

2020-12-12 Thread Vasily Averin
On 12/11/20 6:37 PM, Vasily Averin wrote: > It seems for me the similar problem can happen in __skb_trim_rcsum(). > Also I doubt that that skb_checksum_start_offset(skb) checks in > __skb_postpull_rcsum() and skb_csum_unnecessary() are correct, > becasue they do not guarantee t

Re: [PATCH] net: check skb partial checksum offset after trim

2020-12-11 Thread Vasily Averin
that that skb_checksum_start_offset(skb) checks in __skb_postpull_rcsum() and skb_csum_unnecessary() are correct, becasue they do not guarantee that skb have correct CHECKSUM_PARTIAL. Could somebody confirm it? Thank you, Vasily Averin On 12/11/20 6:00 PM, Vasily Averin wrote: > syzkaller reprodu

[PATCH] net: check skb partial checksum offset after trim

2020-12-11 Thread Vasily Averin
5e5...@syzkaller.appspotmail.com Signed-off-by: Vasily Averin --- include/linux/skbuff.h | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a828cf9..0a9545d 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -3419,9 +3419

Re: [PATCH -next] neigh: remove the extra slash

2020-10-23 Thread Vasily Averin
On 10/23/20 1:01 PM, Zhang Qilong wrote: > The normal path has only one slash. it is not normal path this string is used to calculate number of symbols in "net/%s/neigh/%s" used below > Signed-off-by: Zhang Qilong > --- > net/core/neighbour.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH net v2] net: fix pos incrementment in ipv6_route_seq_next

2020-10-13 Thread Vasily Averin
lo > 4+1 records in > 4+1 records out > 600 bytes copied, 0.00127758 s, 470 kB/s > > To fix the problem, create a fake pos pointer so seq_ops->start() > won't actually increase seq_file pos. With this fix, the > above `dd` command with `bs=128` will show correct r

Re: [PATCH net] net: fix pos incrementment in ipv6_route_seq_next

2020-10-12 Thread Vasily Averin
q_next(seq, NULL, pos); + return ipv6_route_seq_next(seq, NULL, &p); } else { return NULL; } In this case patch subject should be changed accordingly. Thank you, Vasily Averin On 10/13/20 3:09 AM, Yonghong Song wrote: > Commit

[PATCH] ethtool: remove extra checks

2020-06-06 Thread Vasily Averin
fo' is always provided by caller. Signed-off-by: Vasily Averin --- net/ethtool/linkinfo.c | 3 +-- net/ethtool/linkmodes.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/net/ethtool/linkinfo.c b/net/ethtool/linkinfo.c index 677068d..5eaf173 100644 --- a/net/ethtoo

[PATCH] net_failover: fixed rollback in net_failover_open()

2020-06-02 Thread Vasily Averin
found by smatch: drivers/net/net_failover.c:65 net_failover_open() error: we previously assumed 'primary_dev' could be null (see line 43) cc: sta...@vger.kernel.org Fixes: cfc80d9a1163 ("net: Introduce net_failover driver") Signed-off-by: Vasily Averin --- drivers/net/net_f

[PATCH] tcp: detecting the misuse of .sendpage for Slab objects

2019-03-06 Thread Vasily Averin
sendpage was not designed for processing of the Slab pages, in some situations it can trigger BUG_ON on receiving side. Signed-off-by: Vasily Averin --- net/ipv4/tcp.c | 4 1 file changed, 4 insertions(+) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index ad07dd71063d..dbb08140cdc9 100644

Re: [PATCH] tcp: detect use sendpage for slab-based objects

2019-03-05 Thread Vasily Averin
On 3/5/19 7:44 PM, Eric Dumazet wrote: > On Tue, Mar 5, 2019 at 7:11 AM Eric Dumazet wrote: >>> My original suggestion was to use VM_WARN_ONCE() so that the debug checks >>> would >>> be compiled out by the compiler, unless you compile a debug kernel. >>> >>> Something like : >>> >>> diff --gi

Re: [PATCH] tcp: detect use sendpage for slab-based objects

2019-03-05 Thread Vasily Averin
On 3/4/19 6:51 PM, Eric Dumazet wrote: > On 03/04/2019 04:58 AM, Vasily Averin wrote: >> Eric, what do you think about following patch? >> I validate its backported version on RHEL7 based OpenVZ kernel before >> sending to mainline. >> >> diff --git a/net/ipv

Re: [PATCH] tcp: detect use sendpage for slab-based objects

2019-03-04 Thread Vasily Averin
On 2/21/19 7:00 PM, Eric Dumazet wrote: > On Thu, Feb 21, 2019 at 7:30 AM Vasily Averin wrote: >> >> There was few incidents when XFS over network block device generates >> IO requests with slab-based metadata. If these requests are processed >> via sendpag

Re: [PATCH] tcp: detect use sendpage for slab-based objects

2019-02-25 Thread Vasily Averin
On 2/25/19 12:15 PM, Vasily Averin wrote: > On 2/22/19 7:39 PM, Eric Dumazet wrote: >> On Fri, Feb 22, 2019 at 6:02 AM Vasily Averin wrote: > >>> Eric, could you please elaborate once again why tcp_sendpage() should not >>> handle slab objects? >> >&

Re: [PATCH] tcp: detect use sendpage for slab-based objects

2019-02-25 Thread Vasily Averin
On 2/22/19 7:39 PM, Eric Dumazet wrote: > On Fri, Feb 22, 2019 at 6:02 AM Vasily Averin wrote: >> Eric, could you please elaborate once again why tcp_sendpage() should not >> handle slab objects? > > Simply because SLAB has its own way to manage objects from a page, and &g

Re: [PATCH] tcp: detect use sendpage for slab-based objects

2019-02-22 Thread Vasily Averin
On 2/21/19 7:00 PM, Eric Dumazet wrote: > On Thu, Feb 21, 2019 at 7:30 AM Vasily Averin wrote: >> index 2079145a3b7c..cf9572f4fc0f 100644 >> --- a/net/ipv4/tcp.c >> +++ b/net/ipv4/tcp.c >> @@ -996,6 +996,7 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct

[PATCH] tcp: detect use sendpage for slab-based objects

2019-02-21 Thread Vasily Averin
host tcp_recvmsg() can trigger following BUG_ON usercopy: kernel memory exposure attempt detected from XX (kmalloc-512) (1024 bytes) This patch helps to detect the reason of similar incidents on sending side. Signed-off-by: Vasily Averin --- net/ipv4/tcp.c | 1 + 1 file changed

Re: skb_can_coalesce() merges tcp frags with XFS-related slab objects

2019-02-20 Thread Vasily Averin
On 2/20/19 6:53 PM, Eric Dumazet wrote: > On 02/20/2019 05:34 AM, Vasily Averin wrote: >> Dear David, >> >> currently do_tcp_sendpages() calls skb_can_coalesce() to merge proper tcp >> fragments. >> If these fragments are slab objects and the data is not tran

skb_can_coalesce() merges tcp frags with XFS-related slab objects

2019-02-20 Thread Vasily Averin
there are chances that the problem will be reproduced again with some other filesystems or with some other kind of network blockdevice. David, what do you think, is it probably better to add PageSlab() check directly into skb_can_coalesce()? (see [1] below) Thank you, Vasily Averin [1]

Re: [PATCH] netfilter: fix clusterip_net_exit build regression

2017-12-07 Thread Vasily Averin
thank you, it was mu fault. Reviewed-by: Vasily Averin On 2017-12-07 16:26, Arnd Bergmann wrote: > The added check produces a build error when CONFIG_PROC_FS is > disabled: > > net/ipv4/netfilter/ipt_CLUSTERIP.c: In function 'clusterip_net_exit': > net/ipv4/netfilt

Re: [PATCH v5 00/13] exit_net checks for objects initialized in net_init hook

2017-11-14 Thread Vasily Averin
On 2017-11-14 09:47, David Miller wrote: > From: Vasily Averin > Date: Sun, 12 Nov 2017 22:26:44 +0300 > >> OpenVz kernel team have a long history of fighting against namespace-related >> bugs, >> some of them could be prevented by using simple checks described

[PATCH v5 13/13] xfrm6_tunnel: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that spi_byaddr and spi_byspi arrays initialized in net_init hook were return to initial state Signed-off-by: Vasily Averin --- net/ipv6/xfrm6_tunnel.c | 8 1 file changed, 8 insertions(+) diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index 4e438bc..f85f0d7

[PATCH v5 12/13] ppp: exit_net cleanup checks added

2017-11-12 Thread Vasily Averin
Be sure that lists initialized in net_init hook were return to initial state. Signed-off-by: Vasily Averin --- drivers/net/ppp/ppp_generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index e365866..30744ce 100644 --- a

[PATCH v5 11/13] phonet: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that pndevs.list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/phonet/pn_dev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 2cb4c5d..7778751 100644 --- a/net/phonet/pn_dev.c +++ b

[PATCH v5 10/13] sunrpc: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that all_clients list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/sunrpc/sunrpc_syms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index c73de18..56f9eff 100644 --- a/net

[PATCH v5 09/13] nfs client: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that nfs_client_list and nfs_volume_list lists initialized in net_init hook were return to initial state in net_exit hook. Signed-off-by: Vasily Averin --- fs/nfs/inode.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 134d9f5..4ef515f

[PATCH v5 07/13] fib_rules: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that rules_ops list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/core/fib_rules.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 9a6d97c..c029192 100644 --- a/net/core

[PATCH v5 08/13] l2tp: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that l2tp_session_hlist array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/l2tp/l2tp_core.c | 4 1 file changed, 4 insertions(+) diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 02d6110..fabc404 100644 --- a/net/l2tp

[PATCH v5 06/13] fib_notifier: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that fib_notifier_ops list initilized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/core/fib_notifier.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c index 4fc202d..6b8cd49 100644 --- a

[PATCH v5 05/13] netdev: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that dev_base_head list initialized in net_init hook was return to initial state Signed-off-by: Vasily Averin --- net/core/dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c index 588b473..56fece7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c

[PATCH v5 04/13] vxlan: exit_net cleanup checks added

2017-11-12 Thread Vasily Averin
Be sure that sock_list array initialized in net_init hook was return to initial state Signed-off-by: Vasily Averin --- drivers/net/vxlan.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index d7c49cf..c02d856 100644 --- a/drivers/net/vxlan.c

[PATCH v5 03/13] packet: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that packet.sklist initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/packet/af_packet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index bec01a3..4b58c4a 100644 --- a/net/packet

[PATCH v5 02/13] geneve: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that sock_list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- drivers/net/geneve.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index f640407..6bc5721 100644 --- a/drivers/net/geneve.c +++ b

[PATCH v5 01/13] af_key: replace BUG_ON on WARN_ON in net_exit hook

2017-11-12 Thread Vasily Averin
Signed-off-by: Vasily Averin --- net/key/af_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/key/af_key.c b/net/key/af_key.c index a00d607..3dffb89 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -3845,7 +3845,7 @@ static void __net_exit pfkey_net_exit(struct

[PATCH v5 00/13] exit_net checks for objects initialized in net_init hook

2017-11-12 Thread Vasily Averin
t, they handle tables list in exit_net hook. - added patches for grace and lockd v2: - net pointer removed from output - fixed compilation for phonet driver Vasily Averin (13): af_key: replace BUG_ON on WARN_ON in net_exit hook geneve: exit_net cleanup check added packet: exit_net cleanup c

Re: [PATCH v4 00/18] exit_net checks for objects initialized in net_init hook

2017-11-12 Thread Vasily Averin
On 2017-11-12 11:39, Vasily Averin wrote: > clusterip: exit_net cleanup check added > nf_tables: exit_net cleanup check added > nfnetlink_log: exit_net cleanup check added > nfnetlink_gueue: exit_net cleanup check added > x_tables: exit_net cleanup check added netfilter-

Re: [PATCH v3 20/21] phonet: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
network namespace code knows nothing about specific of each individual driver/subsystem. I do not understand how it's possible to do it in common netns code. Thank you, Vasily Averin

Re: [PATCH v4 12/18] nfnetlink_gueue: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
On 2017-11-12 11:52, Florian Westphal wrote: > Vasily Averin wrote: >> Be sure that instance_table array initialized in net_init hook >> was return to initial state. > >> +for (i = 0; i < INSTANCE_BUCKETS; i++) >> +if (WARN_ON_ONCE(

[PATCH v4 18/18] xfrm6_tunnel: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that spi_byaddr and spi_byspi arrays initialized in net_init hook were return to initial state Signed-off-by: Vasily Averin --- net/ipv6/xfrm6_tunnel.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index 4e438bc

[PATCH v4 17/18] ppp: exit_net cleanup checks added

2017-11-12 Thread Vasily Averin
Be sure that lists initialized in net_init hook were return to initial state. Signed-off-by: Vasily Averin --- drivers/net/ppp/ppp_generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index e365866..30744ce 100644 --- a

[PATCH v4 16/18] phonet: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that pndevs.list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/phonet/pn_dev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 2cb4c5d..7778751 100644 --- a/net/phonet/pn_dev.c +++ b

[PATCH v4 15/18] sunrpc: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that all_clients list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/sunrpc/sunrpc_syms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index c73de18..56f9eff 100644 --- a/net

[PATCH v4 14/18] nfs client: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that nfs_client_list and nfs_volume_list lists initialized in net_init hook were return to initial state in net_exit hook. Signed-off-by: Vasily Averin --- fs/nfs/inode.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 134d9f5..4ef515f

[PATCH v4 13/18] x_tables: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that xt.tables array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/x_tables.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index d8571f4..119b670 100644

[PATCH v4 12/18] nfnetlink_gueue: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that instance_table array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/nfnetlink_queue.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index c979662

[PATCH v4 11/18] nfnetlink_log: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that instance_table array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/nfnetlink_log.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index cad6498

[PATCH v4 10/18] nf_tables: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that lists initialized in net_init hook were return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/nf_tables_api.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 64e1ee0..f432b53 100644

[PATCH v4 09/18] clusterip: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that configs list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/ipv4/netfilter/ipt_CLUSTERIP.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 17b4ca5

[PATCH v4 07/18] fib_rules: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that rules_ops list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/core/fib_rules.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 9a6d97c..c029192 100644 --- a/net/core

[PATCH v4 08/18] l2tp: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that l2tp_session_hlist array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/l2tp/l2tp_core.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 02d6110..eed1e21 100644 --- a/net/l2tp

[PATCH v4 06/18] fib_notifier: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that fib_notifier_ops list initilized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/core/fib_notifier.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c index 4fc202d..6b8cd49 100644 --- a

[PATCH v4 05/18] netdev: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that dev_base_head list initialized in net_init hook was return to initial state Signed-off-by: Vasily Averin --- net/core/dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c index 588b473..56fece7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c

[PATCH v4 04/18] vxlan: exit_net cleanup checks added

2017-11-12 Thread Vasily Averin
Be sure that sock_list array initialized in net_init hook was return to initial state Signed-off-by: Vasily Averin --- drivers/net/vxlan.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index d7c49cf..766a41b 100644 --- a/drivers/net/vxlan.c

[PATCH v4 03/18] packet: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that packet.sklist initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/packet/af_packet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index bec01a3..4b58c4a 100644 --- a/net/packet

[PATCH v4 01/18] af_key: replace BUG_ON on WARN_ON in net_exit hook

2017-11-12 Thread Vasily Averin
Signed-off-by: Vasily Averin --- net/key/af_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/key/af_key.c b/net/key/af_key.c index a00d607..3dffb89 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -3845,7 +3845,7 @@ static void __net_exit pfkey_net_exit(struct

[PATCH v4 02/18] geneve: exit_net cleanup check added

2017-11-12 Thread Vasily Averin
Be sure that sock_list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- drivers/net/geneve.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index f640407..6bc5721 100644 --- a/drivers/net/geneve.c +++ b

[PATCH v4 00/18] exit_net checks for objects initialized in net_init hook

2017-11-12 Thread Vasily Averin
etic changes in some patches v3: - use net->ns.inum as net Id - removed patches for hashlimit and recent, they handle tables list in exit_net hook. - added patches for grace and lockd v2: - net pointer removed from output - fixed compilation for phonet driver Vasily Averin (18): af_key:

Re: [PATCH 21/21] sunrpc: exit_net cleanup check added

2017-11-07 Thread Vasily Averin
On 2017-11-08 04:22, Stephen Hemminger wrote: > On Sun, 5 Nov 2017 13:02:44 +0300 > Vasily Averin wrote: >> +WARN(!list_empty(&sn->all_clients), >> + "net %p exit: sunrpc all_clients list is not empty\n", net); > > Don't print a kernel

[PATCH v3 20/21] phonet: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that pndevs.list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/phonet/pn_dev.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 2cb4c5d..f0ab85d 100644 --- a/net/phonet/pn_dev.c

[PATCH v3 21/21] sunrpc: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that all_clients list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/sunrpc/sunrpc_syms.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index c73de18..3ee6d8e 100644 --- a/net

[PATCH v3 17/21] nfnetlink_gueue: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that instance_table array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/nfnetlink_queue.c | 8 1 file changed, 8 insertions(+) diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index

[PATCH v3 19/21] packet: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that packet.sklist initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/packet/af_packet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index bec01a3..cdd4ce6 100644 --- a/net/packet

[PATCH v3 18/21] x_tables: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that xt.tables array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/x_tables.c | 12 1 file changed, 12 insertions(+) diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index d8571f4..dcdaf96 100644

[PATCH v3 16/21] nfnetlink_log: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that instance_table array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/nfnetlink_log.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index cad6498

[PATCH v3 15/21] nf_tables: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that lists initialized in net_init hook were return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/nf_tables_api.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 64e1ee0..3b7f518

[PATCH v3 13/21] af_key: replace BUG_ON on WARN_ONCE in net_exit hook

2017-11-06 Thread Vasily Averin
Signed-off-by: Vasily Averin --- net/key/af_key.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/key/af_key.c b/net/key/af_key.c index a00d607..61d1b58 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -3845,7 +3845,9 @@ static void __net_exit pfkey_net_exit

[PATCH v3 11/21] clusterip: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that configs list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/ipv4/netfilter/ipt_CLUSTERIP.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 17b4ca5

[PATCH v3 12/21] xfrm6_tunnel: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that spi_byaddr and spi_byspi arrays initialized in net_init hook were return to initial state Signed-off-by: Vasily Averin --- net/ipv6/xfrm6_tunnel.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index 4e438bc

[PATCH v3 14/21] l2tp: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that l2tp_session_hlist array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/l2tp/l2tp_core.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 02d6110..249a2ed 100644 --- a/net

[PATCH v3 10/21] fib_rules: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that rules_ops list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/core/fib_rules.c | 8 1 file changed, 8 insertions(+) diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 9a6d97c..0049272 100644 --- a/net/core

[PATCH v3 07/21] nfs4blocklayout: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that bl_wq wait queue initialized in net_init hook is not used anymore. Signed-off-by: Vasily Averin --- fs/nfs/blocklayout/rpc_pipefs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nfs/blocklayout/rpc_pipefs.c b/fs/nfs/blocklayout/rpc_pipefs.c index 9fb067a6..8c3941b

[PATCH v3 09/21] fib_notifier: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that fib_notifier_ops list initilized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/core/fib_notifier.c | 8 1 file changed, 8 insertions(+) diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c index 4fc202d..57aec96 100644 --- a

[PATCH v3 08/21] nfs client: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that nfs_client_list and nfs_volume_list lists initialized in net_init hook were return to initial state in net_exit hook. Signed-off-by: Vasily Averin --- fs/nfs/client.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 22880ef..3966c98

[PATCH v3 06/21] netdev: exit_net cleanup check added

2017-11-06 Thread Vasily Averin
Be sure that dev_base_head list initialized in net_init hook was return to initial state Signed-off-by: Vasily Averin --- net/core/dev.c | 4 1 file changed, 4 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c index 588b473..34f88fc 100644 --- a/net/core/dev.c +++ b/net/core

[PATCH v3 05/21] vxlan: exit_net cleanup checks added

2017-11-06 Thread Vasily Averin
Be sure that sock_list array initialized in net_init hook was return to initial state Signed-off-by: Vasily Averin --- drivers/net/vxlan.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index d7c49cf..acf5763 100644 --- a/drivers/net/vxlan.c

[PATCH v3 04/21] ppp: exit_net cleanup checks added

2017-11-06 Thread Vasily Averin
Be sure that lists initialized in net_init hook were return to initial state. Signed-off-by: Vasily Averin --- drivers/net/ppp/ppp_generic.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index e365866..c0861d1 100644

[PATCH v3 03/21] exit_net cleanup: geneve sock_list check

2017-11-06 Thread Vasily Averin
Be sure that sock_list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- drivers/net/geneve.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index f640407..4e3a344 100644 --- a/drivers/net/geneve.c

[PATCH v3 02/21] lockd: added cleanup checks in exit_net hook

2017-11-06 Thread Vasily Averin
Signed-off-by: Vasily Averin --- fs/lockd/svc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 809cbcc..2a48558 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -690,6 +690,17 @@ static int lockd_init_net(struct net *net) static void

[PATCH v3 01/21] grace: replace BUG_ON by WARN_ONCE in exit_net hook

2017-11-06 Thread Vasily Averin
Signed-off-by: Vasily Averin --- fs/nfs_common/grace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs_common/grace.c b/fs/nfs_common/grace.c index 420d3a0..1bd6599 100644 --- a/fs/nfs_common/grace.c +++ b/fs/nfs_common/grace.c @@ -104,7 +104,9 @@ grace_exit_net

[PATCH v3 00/21] exit_net checks for objects initialized in net_init hook

2017-11-06 Thread Vasily Averin
removed from output - fixed compilation for phonet driver Vasily Averin (21): grace: replace BUG_ON by WARN_ONCE in exit_net hook lockd: added cleanup checks in exit_net hook exit_net cleanup: geneve sock_list check ppp: exit_net cleanup checks added vxlan: exit_net cleanup checks a

How to identify net namespace in kernel messages?

2017-11-05 Thread Vasily Averin
On 2017-11-05 15:48, David Miller wrote: > From: Vasily Averin >> I doubt that pointer to freed net have value for someone except >> developers, on the other hand it helps to speed up the problem >> investigation. > > Any kernel pointer printed has value to attacker

[PATCH v2 21/21] sunrpc: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that all_clients list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/sunrpc/sunrpc_syms.c | 4 1 file changed, 4 insertions(+) diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index c73de18..4a25658 100644 --- a/net

[PATCH v2 19/21] packet: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that packet.sklist initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/packet/af_packet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index bec01a3..7ceb97c 100644 --- a/net/packet

[PATCH v2 18/21] recent: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that tables list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/xt_recent.c | 4 1 file changed, 4 insertions(+) diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c index 245fa35..230d00f 100644 --- a/net

[PATCH v2 20/21] phonet: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that pndevs.list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/phonet/pn_dev.c | 4 1 file changed, 4 insertions(+) diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 2cb4c5d..81b4eb0 100644 --- a/net/phonet/pn_dev.c +++ b

[PATCH v2 17/21] hashlimit: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that htables array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/xt_hashlimit.c | 4 1 file changed, 4 insertions(+) diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 5da8746..abef6b4 100644

[PATCH v2 16/21] x_tables: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that xt.tables array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/x_tables.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index d8571f4..8125363 100644

[PATCH v2 14/21] nfnetlink_log: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that instance_table array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/nfnetlink_log.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index cad6498

[PATCH v2 13/21] nf_tables: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that lists initialized in net_init hook were return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/nf_tables_api.c | 9 + 1 file changed, 9 insertions(+) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 64e1ee0..8219b2f 100644

[PATCH v2 15/21] nfnetlink_gueue: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that instance_table array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/netfilter/nfnetlink_queue.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index c979662

[PATCH v2 09/21] clusterip: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that configs list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/ipv4/netfilter/ipt_CLUSTERIP.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 17b4ca5

[PATCH v2 11/21] af_key: replace BUG_ON on WARN_ON in net_exit hook

2017-11-05 Thread Vasily Averin
Signed-off-by: Vasily Averin --- net/key/af_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/key/af_key.c b/net/key/af_key.c index a00d607..3dffb89 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -3845,7 +3845,7 @@ static void __net_exit pfkey_net_exit(struct

[PATCH v2 12/21] l2tp: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that l2tp_session_hlist array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/l2tp/l2tp_core.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 02d6110..1136341 100644 --- a/net

[PATCH v2 10/21] xfrm6_tunnel: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that spi_byaddr and spi_byspi arrays initialized in net_init hook were return to initial state Signed-off-by: Vasily Averin --- net/ipv6/xfrm6_tunnel.c | 12 1 file changed, 12 insertions(+) diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index 4e438bc

[PATCH v2 08/21] fib_rules: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that rules_ops list initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/core/fib_rules.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 9a6d97c..5ab4fac 100644 --- a/net/core

[PATCH v2 07/21] fib_notifier: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that fib_notifier_ops list initilized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/core/fib_notifier.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c index 4fc202d..1f57ec0 100644 --- a

[PATCH v2 06/21] nfs client: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that nfs_client_list and nfs_volume_list lists initialized in net_init hook were return to initial state in net_exit hook. Signed-off-by: Vasily Averin --- fs/nfs/client.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 22880ef..e099a01

[PATCH v2 05/21] nfs4blocklayout: exit_net cleanup check added

2017-11-05 Thread Vasily Averin
Be sure that bl_wq wait queue initialized in net_init hook is not used anymore. Signed-off-by: Vasily Averin --- fs/nfs/blocklayout/rpc_pipefs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/blocklayout/rpc_pipefs.c b/fs/nfs/blocklayout/rpc_pipefs.c index 9fb067a6..faae48f 100644

  1   2   >