]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp: fix more NULL deref after prequeue changes
authorEric Dumazet <edumazet@google.com>
Tue, 9 Dec 2014 17:56:08 +0000 (09:56 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Dec 2014 17:39:05 +0000 (09:39 -0800)
commit7efe8f1bb70588036edacab8b6c7f899092781f2
tree3e85de224b64f76bf3b6c5cba399b83cea2b9670
parentab12ec41d8d8fe5bb286daee450f64cf845c4a09
tcp: fix more NULL deref after prequeue changes

[ Upstream commit 0f85feae6b710ced3abad5b2b47d31dfcb956b62 ]

When I cooked commit c3658e8d0f1 ("tcp: fix possible NULL dereference in
tcp_vX_send_reset()") I missed other spots we could deref a NULL
skb_dst(skb)

Again, if a socket is provided, we do not need skb_dst() to get a
pointer to network namespace : sock_net(sk) is good enough.

Reported-by: Dann Frazier <dann.frazier@canonical.com>
Bisected-by: Dann Frazier <dann.frazier@canonical.com>
Tested-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: ca777eff51f7 ("tcp: remove dst refcount false sharing for prequeue mode")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c