net: guard tcp_set_keepalive() to tcp sockets
authorEric Dumazet <edumazet@google.com>
Mon, 24 Sep 2012 07:00:11 +0000 (07:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Sep 2012 20:51:53 +0000 (16:51 -0400)
commit3e10986d1d698140747fcfc2761ec9cb64c1d582
treeee37bd030acf7dce85c0a1866bab6700bc71d8f0
parent69190e67d4fac49e2f6ea22f46780d0c712214b8
net: guard tcp_set_keepalive() to tcp sockets

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>
net/core/sock.c