]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: guard tcp_set_keepalive() to tcp sockets
authorEric Dumazet <edumazet@google.com>
Mon, 24 Sep 2012 07:00:11 +0000 (07:00 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Jun 2013 09:43:30 +0000 (11:43 +0200)
commitf2e244fabae264798ac7980a3d3056ba1684a187
treebc0d1ff252cffdcbcb9b26fc256c6fedd8b401d8
parent81821315da86f301a126c3fdcdb542f77c3d7fe7
net: guard tcp_set_keepalive() to tcp sockets

[ Upstream commit 3e10986d1d698140747fcfc2761ec9cb64c1d582 ]

Its possible to use RAW sockets to get a crash in
tcp_set_keepalive() / sk_reset_timer()

Fix is to make sure socket is a SOCK_STREAM one.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/core/sock.c