kcm: lock lower socket in kcm_attach
authorTom Herbert <tom@quantonium.net>
Tue, 13 Mar 2018 19:01:43 +0000 (12:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Mar 2018 16:10:40 +0000 (18:10 +0200)
commit515bc34124f3aaf7ea2508fa2707906623eba748
treec4b84af438af3e9c6033e4b22e3872f5d9c45c4e
parent07cf9d303c7ce8620ea34e3407e08facf65c732d
kcm: lock lower socket in kcm_attach

[ Upstream commit 2cc683e88c0c993ac3721d9b702cb0630abe2879 ]

Need to lock lower socket in order to provide mutual exclusion
with kcm_unattach.

v2: Add Reported-by for syzbot

Fixes: ab7ac4eb9832e32a09f4e804 ("kcm: Kernel Connection Multiplexor module")
Reported-by: syzbot+ea75c0ffcd353d32515f064aaebefc5279e6161e@syzkaller.appspotmail.com
Signed-off-by: Tom Herbert <tom@quantonium.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/kcm/kcmsock.c