• Florian Westphal's avatar
    net: rtnetlink: use rcu to free rtnl message handlers · addf9b90
    Florian Westphal authored
    rtnetlink is littered with READ_ONCE() because we can have read accesses
    while another cpu can write to the structure we're reading by
    (un)registering doit or dumpit handlers.
    
    This patch changes this so that (un)registering cpu allocates a new
    structure and then publishes it via rcu_assign_pointer, i.e. once
    another cpu can see such pointer no modifications will occur anymore.
    
    based on initial patch from Peter Zijlstra.
    
    Cc: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    addf9b90
rtnetlink.c 109 KB