From: Tom Herbert Date: Wed, 14 Feb 2018 17:22:42 +0000 (-0800) Subject: kcm: Call strp_stop before strp_done in kcm_attach X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=19042316b9e12c93bf334a04d4dd7a4e846c7311;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git kcm: Call strp_stop before strp_done in kcm_attach commit dff8baa261174de689a44572d0ea182d7aa70598 upstream. 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c index 9db49805b7be..01a4ff3df60b 100644 --- a/net/kcm/kcmsock.c +++ b/net/kcm/kcmsock.c @@ -1425,6 +1425,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); err = -EALREADY;