]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
udp: add a missing smp_wmb() in udp_lib_get_port()
authorEric Dumazet <dada1@cosmosbay.com>
Sun, 2 Nov 2008 04:19:18 +0000 (21:19 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Nov 2008 04:19:18 +0000 (21:19 -0700)
commitc37ccc0d4e2a4ee52f1a40cff1be0049f2104bba
tree8ed76232d7debc5f63f5b80dac7b8a9ba44eb4ce
parent7e3a42a12c4b9d99bfe81cb929cadf0e08a37c49
udp: add a missing smp_wmb() in udp_lib_get_port()

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: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c