diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-07-16 03:13:10 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-17 05:05:26 +0400 |
commit | 4dc6dc7162c08b9965163c9ab3f9375d4adff2c7 (patch) | |
tree | f4b9959e9ca5e5b8bdb6301663a15e0f67d4c68c /net/econet/af_econet.c | |
parent | 303d67c288319768b19ed8dbed429fef7eb7c275 (diff) | |
download | linux-4dc6dc7162c08b9965163c9ab3f9375d4adff2c7.tar.xz |
net: sock_copy() fixes
Commit e912b1142be8f1e2c71c71001dc992c6e5eb2ec1
(net: sk_prot_alloc() should not blindly overwrite memory)
took care of not zeroing whole new socket at allocation time.
sock_copy() is another spot where we should be very careful.
We should not set refcnt to a non null value, until
we are sure other fields are correctly setup, or
a lockless reader could catch this socket by mistake,
while not fully (re)initialized.
This patch puts sk_node & sk_refcnt to the very beginning
of struct sock to ease sock_copy() & sk_prot_alloc() job.
We add appropriate smp_wmb() before sk_refcnt initializations
to match our RCU requirements (changes to sock keys should
be committed to memory before sk_refcnt setting)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/econet/af_econet.c')
0 files changed, 0 insertions, 0 deletions