]> git.baikalelectronics.ru Git - kernel.git/commit
net: Fix sock_wfree() race
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 24 Sep 2009 10:49:24 +0000 (10:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Sep 2009 23:20:38 +0000 (16:20 -0700)
commit18f95f6ba728049a49e1395d2a46c7322a8b48b7
tree28481ae5aebac58c5fe29e0f08eddff4e80289f6
parent667806178d8e01e765cb17d70c976bff2e04f353
net: Fix sock_wfree() race

Commit 8514b872147d26cd511dd91bc60a80259f008c50
(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>
net/core/sock.c