Re: [PATCH] ip6_gre: fix null-ptr-deref in ip6gre_init_net()

2020-07-13 Thread David Miller
From: Wei Yongjun Date: Mon, 13 Jul 2020 23:59:50 +0800 > KASAN report null-ptr-deref error when register_netdev() failed: ... > ip6gre_tunnel_uninit() has set 'ign->fb_tunnel_dev' to NULL, later > access to ign->fb_tunnel_dev cause null-ptr-deref. Fix it by saving > 'ign->fb_tunnel_dev' to loca

Re: [PATCH] ip6_gre: fix null-ptr-deref in ip6gre_init_net()

2020-07-13 Thread Eric Dumazet
On 7/13/20 8:59 AM, Wei Yongjun wrote: > KASAN report null-ptr-deref error when register_netdev() failed: > > > > ip6gre_tunnel_uninit() has set 'ign->fb_tunnel_dev' to NULL, later > access to ign->fb_tunnel_dev cause null-ptr-deref. Fix it by saving > 'ign->fb_tunnel_dev' to local variable nd

[PATCH] ip6_gre: fix null-ptr-deref in ip6gre_init_net()

2020-07-13 Thread Wei Yongjun
KASAN report null-ptr-deref error when register_netdev() failed: KASAN: null-ptr-deref in range [0x03c0-0x03c7] CPU: 2 PID: 422 Comm: ip Not tainted 5.8.0-rc4+ #12 Call Trace: ip6gre_init_net+0x4ab/0x580 ? ip6gre_tunnel_uninit+0x3f0/0x3f0 ops_init+0xa8/0x3c0 setup_net+0