1
0
Fork 0
alistair23-linux/include
Eric Dumazet 4dc6dc7162 net: sock_copy() fixes
Commit e912b1142b
(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>
2009-07-16 18:05:26 -07:00
..
acpi Merge branch 'bjorn-notify' into release 2009-06-24 01:22:20 -04:00
asm-generic Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic 2009-06-23 11:34:24 -07:00
crypto
drm drm: EDID endianness fixes. 2009-06-19 09:11:13 +10:00
keys
linux skbuff.h: Fix comment for NET_IP_ALIGN 2009-07-14 12:03:42 -07:00
math-emu
media V4L/DVB (11901): v4l2: Create helper function for bounding and aligning images 2009-06-23 03:21:18 -03:00
mtd Kill jffs2-user.h 2009-06-05 17:31:38 +01:00
net net: sock_copy() fixes 2009-07-16 18:05:26 -07:00
pcmcia
rdma
rxrpc
scsi sd, sr: fix Driver 'sd' needs updating message 2009-06-21 12:01:27 -05:00
sound Merge branch 'topic/pcm-jiffies-check' into for-linus 2009-06-10 07:26:41 +02:00
trace ext4: convert instrumentation from markers to tracepoints 2009-06-17 11:48:11 -04:00
video fbdev: s1d13xxxfb: add accelerated bitblt functions 2009-06-16 19:48:00 -07:00
xen
Kbuild [SCSI] FC Pass Thru support 2009-06-12 14:20:05 -05:00