• Eric Dumazet's avatar
    udp: add a missing smp_wmb() in udp_lib_get_port() · c37ccc0d
    Eric Dumazet authored
    Corey Minyard spotted a missing memory barrier in udp_lib_get_port()
    
    We need to make sure a reader cannot read the new 'sk->sk_next' value
    and previous value of 'sk->sk_hash'. Or else, an item could be deleted
    from a chain, and inserted into another chain. If new chain was empty
    before the move, 'next' pointer is NULL, and lockless reader can
    not detect it missed following items in original chain.
    
    This patch is temporary, since we expect an upcoming patch
    to introduce another way of handling the problem.
    Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c37ccc0d
udp.c 44.6 KB