kcm: Only allow TCP sockets to be attached to a KCM mux
authorTom Herbert <tom@quantonium.net>
Wed, 24 Jan 2018 20:35:40 +0000 (12:35 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:05:40 +0000 (11:05 +0100)
commit2bb174afca6cdb90499bcd2c46e5d966d9976834
tree088e66c4818f424c2b5e2c30c2262f5458afab92
parent085cbbda4b4cc7dd2ba63806346881c2c2e10107
kcm: Only allow TCP sockets to be attached to a KCM mux

commit 581e7226a5d43f629eb6399a121f85f6a15f81be upstream.

TCP sockets for IPv4 and IPv6 that are not listeners or in closed
stated are allowed to be attached to a KCM mux.

Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module")
Reported-by: syzbot+8865eaff7f9acd593945@syzkaller.appspotmail.com
Signed-off-by: Tom Herbert <tom@quantonium.net>
Reviewed-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/kcm/kcmsock.c