]> git.itanic.dy.fi Git - linux-stable/commit
net: Fix sock_wfree() race
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 24 Sep 2009 10:49:24 +0000 (10:49 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 12 Oct 2009 19:40:27 +0000 (12:40 -0700)
commit657453424a3c382035983f9a47306fafea730f6d
tree559423ec2c3f5860cd08a414549a7d1e0d8fa337
parente3d38b579fe7fc60974e45e43034eab774c5a592
net: Fix sock_wfree() race

[ Upstream commit d99927f4d93f36553699573b279e0ff98ad7dea6 ]

Commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
(net: No more expensive sock_hold()/sock_put() on each tx)
opens a window in sock_wfree() where another cpu
might free the socket we are working on.

A fix is to call sk->sk_write_space(sk) while still
holding a reference on sk.

Reported-by: Jike Song <albcamus@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/core/sock.c