]> git.karo-electronics.de Git - karo-tx-linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2012 20:28:07 +0000 (05:28 +0900)
commit1a6b2c9da08fe3dc1fa825dfefcc70010c088a35
treefea4bb6d8c7160eb646c3c93704b3674f1fbe7a5
parent74665a9b4fca3420c07f1e583242a477b2eb34b0
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>
net/core/sock.c