[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1472827555.5439.22.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Fri, 02 Sep 2016 07:45:55 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Ahern <dsa@...ulusnetworks.com>
Cc: Mahesh Bandewar <mahesh@...dewar.net>,
Jay Vosburgh <j.vosburgh@...il.com>,
Andy Gospodarek <gospo@...ulusnetworks.com>,
Veaceslav Falico <vfalico@...il.com>,
David Miller <davem@...emloft.net>,
Mahesh Bandewar <maheshb@...gle.com>,
Eric Dumazet <edumazet@...gle.com>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net] bonding: Fix bonding crash
On Fri, 2016-09-02 at 08:30 -0600, David Ahern wrote:
> This check duplicates what netdev_rx_handler_register does. Why not
> move the call to netdev_rx_handler_register here and then call
> unregister on failure paths?
As soon as you call netdev_rx_handler_register(), incoming packets will
hit your driver and we'll likely crash since the enslaving is not done
yet.
Really think about RCU, we do rcu_assign_pointer() because we want all
prior changes being committed to memory before 'enabling' readers to see
the updated rcu protected pointer.
There are 9 call sites where netdev_rx_handler_register() is used.
We can get rid of the extra check in netdev_rx_handler_register() once
all of them are using netdev_is_rx_handler_busy()
Since this patch takes care of bonding only, we need to keep the
existing check in netdev_rx_handler_register()
Anyway, we are speaking of control function, an extra check is simply
safer, like all the ASSERT_RTNL() we do have...
Powered by blists - more mailing lists