Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tom Herbert and committed by
David S. Miller
dff8baa2 0e47079b

+1
+1
net/kcm/kcmsock.c
··· 1417 1417 */ 1418 1418 if (csk->sk_user_data) { 1419 1419 write_unlock_bh(&csk->sk_callback_lock); 1420 + strp_stop(&psock->strp); 1420 1421 strp_done(&psock->strp); 1421 1422 kmem_cache_free(kcm_psockp, psock); 1422 1423 return -EALREADY;