]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
kcm: Call strp_stop before strp_done in kcm_attach
authorTom Herbert <tom@quantonium.net>
Wed, 14 Feb 2018 17:22:42 +0000 (09:22 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Feb 2018 20:38:39 +0000 (15:38 -0500)
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>
net/kcm/kcmsock.c

index f297d53a11aa0be823d4235449c9a6474f39469f..435594648dac03dcc29ba47ca1da29e4a5684142 100644 (file)
@@ -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;