Skip to contentSkip to conversation

kcm: Call strp_stop before strp_done in kcm_attach

PATCH Applied Tom Herbert 3 participants 3 messages Feb 14, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 [email protected]
Fixes e5571240236c5652f ("kcm: Check if sk_user_data already set in kcm_attach"
---
 net/kcm/kcmsock.c | 1 +
 1 file changed, 1 insertion(+)
net/kcm/kcmsock.c +1 -0
index f297d53a11aa..435594648dac 100644
@@ -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;
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw

From: Tom Herbert <[email protected]>
Date: Wed, 14 Feb 2018 09:22:42 -0800

Quoted 8 lines

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 [email protected]
Fixes e5571240236c5652f ("kcm: Check if sk_user_data already set in kcm_attach"

Applied, thanks Tom.

#2 lore raw
Quoted 8 lines · David Miller

From: Tom Herbert <[email protected]>
Date: Wed, 14 Feb 2018 09:22:42 -0800

Quoted 5 lines

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.

Quoted 5 lines
Quoted 3 lines
Reported-by [email protected]
Fixes e5571240236c5652f ("kcm: Check if sk_user_data already set in kcm_attach"

Applied, thanks Tom.

If bug was add added in e5571240236c5652f then this patch should have targeted net tree.