Re: [Patch net-next] audit: remove useless synchronize_net()
From: Cong Wang <hidden>
Date: 2016-11-30 17:20:25
From: Cong Wang <hidden>
Date: 2016-11-30 17:20:25
On Wed, Nov 30, 2016 at 1:16 AM, Richard Guy Briggs [off-list ref] wrote:
On 2016-11-29 09:14, Cong Wang wrote:quoted
netlink kernel socket is protected by refcount, not RCU. Its rcv path is neither protected by RCU. So the synchronize_net() is just pointless.If I understand correctly, xfrm_user_net_exit() usage of RCU_INIT_POINTER() and synchronize_net() is similarly pointless? Also net/phonet/socket.c? I probably modelled things based on the former...
Possibly, but xfrm case is slightly different, it has two copies of the pointer to the netlink socket, also it uses exit_batch(). I need to double check. Take a look at better examples, fib_front, genetlink, rtnetlink.