summaryrefslogtreecommitdiffstats
path: root/net/kcm/kcmsock.c
diff options
context:
space:
mode:
authorTom Herbert <tom@quantonium.net>2018-02-14 18:22:42 +0100
committerDavid S. Miller <davem@davemloft.net>2018-02-14 21:38:39 +0100
commitdff8baa261174de689a44572d0ea182d7aa70598 (patch)
tree41bdf2216ed27acc86855b741ff8e08d1c822cc3 /net/kcm/kcmsock.c
parentnet: phy: dp83867: Add documentation for CLK_OUT pin muxing (diff)
downloadlinux-dff8baa261174de689a44572d0ea182d7aa70598.tar.xz
linux-dff8baa261174de689a44572d0ea182d7aa70598.zip
kcm: Call strp_stop before strp_done in kcm_attach
In kcm_attach strp_done is called when sk_user_data is already set to fail the attach. strp_done needs the strp to be stopped and warns if it isn't. Call strp_stop in this case to eliminate the warning message. Reported-by: syzbot+88dfb55e4c8b770d86e3@syzkaller.appspotmail.com Fixes: e5571240236c5652f ("kcm: Check if sk_user_data already set in kcm_attach" Signed-off-by: Tom Herbert <tom@quantonium.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/kcm/kcmsock.c')
-rw-r--r--net/kcm/kcmsock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index f297d53a11aa..435594648dac 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1417,6 +1417,7 @@ static int kcm_attach(struct socket *sock, struct socket *csock,
*/
if (csk->sk_user_data) {
write_unlock_bh(&csk->sk_callback_lock);
+ strp_stop(&psock->strp);
strp_done(&psock->strp);
kmem_cache_free(kcm_psockp, psock);
return -EALREADY;