* [Intel-wired-lan] [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock @ 2015-07-07 15:53 ` Vasily Averin 0 siblings, 0 replies; 12+ messages in thread From: Vasily Averin @ 2015-07-07 15:53 UTC (permalink / raw) To: intel-wired-lan ipmr_free_table() calls unregister_netdevice_many() inside and changes net_todo_list protected by rtnl_lock Signed-off-by: Vasily Averin <vvs@virtuozzo.com> --- net/ipv6/ip6mr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 74ceb73..9108636 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -250,7 +250,9 @@ static int __net_init ip6mr_rules_init(struct net *net) return 0; err2: + rtnl_lock(); ip6mr_free_table(mrt); + rtnl_unlock(); err1: fib_rules_unregister(ops); return err; -- 1.9.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock @ 2015-07-07 15:53 ` Vasily Averin 0 siblings, 0 replies; 12+ messages in thread From: Vasily Averin @ 2015-07-07 15:53 UTC (permalink / raw) To: David S. Miller, netdev Cc: intel-wired-lan, Jeff Kirsher, Hannes Frederic Sowa, Cong Wang ipmr_free_table() calls unregister_netdevice_many() inside and changes net_todo_list protected by rtnl_lock Signed-off-by: Vasily Averin <vvs@virtuozzo.com> --- net/ipv6/ip6mr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 74ceb73..9108636 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -250,7 +250,9 @@ static int __net_init ip6mr_rules_init(struct net *net) return 0; err2: + rtnl_lock(); ip6mr_free_table(mrt); + rtnl_unlock(); err1: fib_rules_unregister(ops); return err; -- 1.9.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Intel-wired-lan] [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock 2015-07-07 15:53 ` Vasily Averin @ 2015-07-07 17:13 ` Cong Wang -1 siblings, 0 replies; 12+ messages in thread From: Cong Wang @ 2015-07-07 17:13 UTC (permalink / raw) To: intel-wired-lan On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: > ipmr_free_table() calls unregister_netdevice_many() inside > and changes net_todo_list protected by rtnl_lock > Did you see any real bug? ipmr_free_table() is called in failure path, in this case there is no device registered yet, so unregister should be just a nop? ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock @ 2015-07-07 17:13 ` Cong Wang 0 siblings, 0 replies; 12+ messages in thread From: Cong Wang @ 2015-07-07 17:13 UTC (permalink / raw) To: Vasily Averin Cc: David S. Miller, Linux Kernel Network Developers, intel-wired-lan, Jeff Kirsher, Hannes Frederic Sowa On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: > ipmr_free_table() calls unregister_netdevice_many() inside > and changes net_todo_list protected by rtnl_lock > Did you see any real bug? ipmr_free_table() is called in failure path, in this case there is no device registered yet, so unregister should be just a nop? ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Intel-wired-lan] [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock 2015-07-07 17:13 ` Cong Wang @ 2015-07-07 17:25 ` Vasily Averin -1 siblings, 0 replies; 12+ messages in thread From: Vasily Averin @ 2015-07-07 17:25 UTC (permalink / raw) To: intel-wired-lan On 07.07.2015 20:13, Cong Wang wrote: > On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >> ipmr_free_table() calls unregister_netdevice_many() inside >> and changes net_todo_list protected by rtnl_lock > > Did you see any real bug? No, it was result of manual code review. > ipmr_free_table() is called in failure path, in this case there is no > device registered yet, so unregister should be just a nop? However may be it's better to mark this place for future anyway? ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock @ 2015-07-07 17:25 ` Vasily Averin 0 siblings, 0 replies; 12+ messages in thread From: Vasily Averin @ 2015-07-07 17:25 UTC (permalink / raw) To: Cong Wang Cc: David S. Miller, Linux Kernel Network Developers, intel-wired-lan, Jeff Kirsher, Hannes Frederic Sowa On 07.07.2015 20:13, Cong Wang wrote: > On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >> ipmr_free_table() calls unregister_netdevice_many() inside >> and changes net_todo_list protected by rtnl_lock > > Did you see any real bug? No, it was result of manual code review. > ipmr_free_table() is called in failure path, in this case there is no > device registered yet, so unregister should be just a nop? However may be it's better to mark this place for future anyway? ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Intel-wired-lan] [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock 2015-07-07 17:25 ` Vasily Averin @ 2015-07-07 17:30 ` Cong Wang -1 siblings, 0 replies; 12+ messages in thread From: Cong Wang @ 2015-07-07 17:30 UTC (permalink / raw) To: intel-wired-lan On Tue, Jul 7, 2015 at 10:25 AM, Vasily Averin <vvs@virtuozzo.com> wrote: > On 07.07.2015 20:13, Cong Wang wrote: >> On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >>> ipmr_free_table() calls unregister_netdevice_many() inside >>> and changes net_todo_list protected by rtnl_lock >> >> Did you see any real bug? > > No, it was result of manual code review. > >> ipmr_free_table() is called in failure path, in this case there is no >> device registered yet, so unregister should be just a nop? > > However may be it's better to mark this place for future anyway? Then add a comment there. ;) ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock @ 2015-07-07 17:30 ` Cong Wang 0 siblings, 0 replies; 12+ messages in thread From: Cong Wang @ 2015-07-07 17:30 UTC (permalink / raw) To: Vasily Averin Cc: David S. Miller, Linux Kernel Network Developers, intel-wired-lan, Jeff Kirsher, Hannes Frederic Sowa On Tue, Jul 7, 2015 at 10:25 AM, Vasily Averin <vvs@virtuozzo.com> wrote: > On 07.07.2015 20:13, Cong Wang wrote: >> On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >>> ipmr_free_table() calls unregister_netdevice_many() inside >>> and changes net_todo_list protected by rtnl_lock >> >> Did you see any real bug? > > No, it was result of manual code review. > >> ipmr_free_table() is called in failure path, in this case there is no >> device registered yet, so unregister should be just a nop? > > However may be it's better to mark this place for future anyway? Then add a comment there. ;) ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Intel-wired-lan] [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock 2015-07-07 17:30 ` Cong Wang @ 2015-07-07 17:53 ` Vasily Averin -1 siblings, 0 replies; 12+ messages in thread From: Vasily Averin @ 2015-07-07 17:53 UTC (permalink / raw) To: intel-wired-lan On 07.07.2015 20:30, Cong Wang wrote: > On Tue, Jul 7, 2015 at 10:25 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >> On 07.07.2015 20:13, Cong Wang wrote: >>> On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >>>> ipmr_free_table() calls unregister_netdevice_many() inside >>>> and changes net_todo_list protected by rtnl_lock >>> >>> Did you see any real bug? >> >> No, it was result of manual code review. >> >>> ipmr_free_table() is called in failure path, in this case there is no >>> device registered yet, so unregister should be just a nop? >> >> However may be it's better to mark this place for future anyway? > > Then add a comment there. ;) As you can see I'm not familiar with this code, so I would like to ask you to do it. :) ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock @ 2015-07-07 17:53 ` Vasily Averin 0 siblings, 0 replies; 12+ messages in thread From: Vasily Averin @ 2015-07-07 17:53 UTC (permalink / raw) To: Cong Wang Cc: David S. Miller, Linux Kernel Network Developers, intel-wired-lan, Jeff Kirsher, Hannes Frederic Sowa On 07.07.2015 20:30, Cong Wang wrote: > On Tue, Jul 7, 2015 at 10:25 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >> On 07.07.2015 20:13, Cong Wang wrote: >>> On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >>>> ipmr_free_table() calls unregister_netdevice_many() inside >>>> and changes net_todo_list protected by rtnl_lock >>> >>> Did you see any real bug? >> >> No, it was result of manual code review. >> >>> ipmr_free_table() is called in failure path, in this case there is no >>> device registered yet, so unregister should be just a nop? >> >> However may be it's better to mark this place for future anyway? > > Then add a comment there. ;) As you can see I'm not familiar with this code, so I would like to ask you to do it. :) ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock 2015-07-07 17:53 ` Vasily Averin (?) @ 2015-07-08 10:29 ` Vasily Averin 2015-07-08 11:46 ` Vasily Averin -1 siblings, 1 reply; 12+ messages in thread From: Vasily Averin @ 2015-07-08 10:29 UTC (permalink / raw) To: Cong Wang Cc: David S. Miller, Linux Kernel Network Developers, Hannes Frederic Sowa On 07.07.2015 20:53, Vasily Averin wrote: > On 07.07.2015 20:30, Cong Wang wrote: >> On Tue, Jul 7, 2015 at 10:25 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >>> On 07.07.2015 20:13, Cong Wang wrote: >>>> On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >>>>> ipmr_free_table() calls unregister_netdevice_many() inside >>>>> and changes net_todo_list protected by rtnl_lock >>>> >>>> Did you see any real bug? >>> >>> No, it was result of manual code review. >>> >>>> ipmr_free_table() is called in failure path, in this case there is no >>>> device registered yet, so unregister should be just a nop? >>> >>> However may be it's better to mark this place for future anyway? >> >> Then add a comment there. ;) > > As you can see I'm not familiar with this code, > so I would like to ask you to do it. :) Seems I've found a better idea: to add ASSERT_RTNL() into unregister_netdevice_many() ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock 2015-07-08 10:29 ` Vasily Averin @ 2015-07-08 11:46 ` Vasily Averin 0 siblings, 0 replies; 12+ messages in thread From: Vasily Averin @ 2015-07-08 11:46 UTC (permalink / raw) To: Cong Wang Cc: David S. Miller, Linux Kernel Network Developers, Hannes Frederic Sowa On 08.07.2015 13:29, Vasily Averin wrote: > On 07.07.2015 20:53, Vasily Averin wrote: >> On 07.07.2015 20:30, Cong Wang wrote: >>> On Tue, Jul 7, 2015 at 10:25 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >>>> On 07.07.2015 20:13, Cong Wang wrote: >>>>> On Tue, Jul 7, 2015 at 8:53 AM, Vasily Averin <vvs@virtuozzo.com> wrote: >>>>>> ipmr_free_table() calls unregister_netdevice_many() inside >>>>>> and changes net_todo_list protected by rtnl_lock >>>>> >>>>> Did you see any real bug? >>>> >>>> No, it was result of manual code review. >>>> >>>>> ipmr_free_table() is called in failure path, in this case there is no >>>>> device registered yet, so unregister should be just a nop? >>>> >>>> However may be it's better to mark this place for future anyway? >>> >>> Then add a comment there. ;) >> >> As you can see I'm not familiar with this code, >> so I would like to ask you to do it. :) > > Seems I've found a better idea: > to add ASSERT_RTNL() into unregister_netdevice_many() It was done already, there is ASSERT_RTNL() in rollback_registered_many() called from unregister_netdevice_many(). Please drop this patch, seems it isn't required. ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-07-08 11:47 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-07-07 15:53 [Intel-wired-lan] [PATCH 3/3] ipmr_free_table() should be called under taken rtnl_lock Vasily Averin 2015-07-07 15:53 ` Vasily Averin 2015-07-07 17:13 ` [Intel-wired-lan] " Cong Wang 2015-07-07 17:13 ` Cong Wang 2015-07-07 17:25 ` [Intel-wired-lan] " Vasily Averin 2015-07-07 17:25 ` Vasily Averin 2015-07-07 17:30 ` [Intel-wired-lan] " Cong Wang 2015-07-07 17:30 ` Cong Wang 2015-07-07 17:53 ` [Intel-wired-lan] " Vasily Averin 2015-07-07 17:53 ` Vasily Averin 2015-07-08 10:29 ` Vasily Averin 2015-07-08 11:46 ` Vasily Averin
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.