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:07:45 +0000 (11:07 +0100)
commit6c0b71202f83f7851f173caee9059f830e3b0dfd
tree33c33024a036c27a4d72aa7780f1e20e5f21187c
parent44890e9ff771ef11777b2d1ebf8589255eb12502
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