]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGuangyu Sun <guangyu.sun@oracle.com>
Wed, 17 Oct 2012 18:24:26 +0000 (11:24 -0700)
commit88e728d4f51c5a19af4fec3c58da091e135cee1a
tree5b6171cf2820edefe0afed60958850d83b1dc38d
parent52ad9285a5fb243f9c2b7aff3035705c9bdcef6c
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: Guangyu Sun <guangyu.sun@oracle.com>
net/core/sock.c