Re: [net,v2] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf

2017-06-20 Thread Cong Wang
On Mon, Jun 19, 2017 at 11:37 PM, jeffy wrote: > Hi Cong Wang, > > > On 06/20/2017 12:54 PM, Cong Wang wrote: >> >> Interesting, I didn't notice this corner-case, because normally >> we would hit the one in rollback_registered_many(). Probably >> we need to add a check

Re: [net,v2] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf

2017-06-20 Thread jeffy
Hi Cong Wang, On 06/20/2017 12:54 PM, Cong Wang wrote: Hello, On Mon, Jun 19, 2017 at 8:15 PM, jeffy wrote: but actually they are not guaranteed to be paired: the netdev_run_todo(see the first dump stack above) would call netdev_wait_allrefs to rebroadcast

Re: [net,v2] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf

2017-06-19 Thread Cong Wang
Hello, On Mon, Jun 19, 2017 at 8:15 PM, jeffy wrote: > but actually they are not guaranteed to be paired: > > the netdev_run_todo(see the first dump stack above) would call > netdev_wait_allrefs to rebroadcast unregister notification multiple times, > unless timed out

Re: [net,v2] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf

2017-06-19 Thread jeffy
Hi guys, i hit some warnings when testing this patch on my local 4.4 kernel(arm64 chromebook) with KASAN & SLUB_DEBUG: [9.919374] BUG: KASAN: use-after-free in ip6_route_dev_notify+0x194/0x2bc at addr ffc0c9d4e480 [9.928469] Read of size 4 by task kworker/u12:3/124 [

Re: [Patch net v2] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf

2017-05-08 Thread David Miller
From: David Ahern Date: Thu, 4 May 2017 13:41:15 -0600 > On 5/4/17 11:36 AM, Cong Wang wrote: >> For each netns (except init_net), we initialize its null entry >> in 3 places: >> >> 1) The template itself, as we use kmemdup() >> 2) Code around dst_init_metrics() in

Re: [Patch net v2] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf

2017-05-04 Thread David Ahern
On 5/4/17 11:36 AM, Cong Wang wrote: > For each netns (except init_net), we initialize its null entry > in 3 places: > > 1) The template itself, as we use kmemdup() > 2) Code around dst_init_metrics() in ip6_route_net_init() > 3) ip6_route_dev_notify(), which is supposed to initialize it after >

[Patch net v2] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf

2017-05-04 Thread Cong Wang
For each netns (except init_net), we initialize its null entry in 3 places: 1) The template itself, as we use kmemdup() 2) Code around dst_init_metrics() in ip6_route_net_init() 3) ip6_route_dev_notify(), which is supposed to initialize it after loopback registers Unfortunately the last one