Skip to contentSkip to conversation

calipso: unlock rcu before returning -EAFNOSUPPORT

PATCH Applied Eric Dumazet 3 participants 3 messages Jun 4, 2025 – Jun 5, 2025

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

PATCH 1/1 calipso: unlock rcu before returning -EAFNOSUPPORT

syzbot reported that a recent patch forgot to unlock rcu in the error path.

Adopt the convention that netlbl_conn_setattr() is already using.

Fixes 6e9f2df1c550 ("calipso: Don't call calipso functions for AF_INET sk.")
Cc Kuniyuki Iwashima <[email protected]>
---
 net/netlabel/netlabel_kapi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/netlabel/netlabel_kapi.c +4 -2
index 6ea16138582c0b6ad39608f2c08bdfde7493a13e..33b77084a4e5f34770f960d7c82e481d9889753a 100644
@@ -1165,8 +1165,10 @@ int netlbl_conn_setattr(struct sock *sk,
 		break;
 #if IS_ENABLED(CONFIG_IPV6)
 	case AF_INET6:
-		if (sk->sk_family != AF_INET6)
-			return -EAFNOSUPPORT;
+		if (sk->sk_family != AF_INET6) {
+			ret_val = -EAFNOSUPPORT;
+			goto conn_setattr_return;
+		}
 
 		addr6 = (struct sockaddr_in6 *)addr;
 		entry = netlbl_domhsh_getentry_af6(secattr->domain,
Signature · 1 line
2.50.0.rc0.604.gd4ff7b7c86-goog
#1 lore raw

From: Eric Dumazet <[email protected]>
Date: Wed, 4 Jun 2025 13:38:26 +0000

Quoted 11 lines

syzbot reported that a recent patch forgot to unlock rcu in the error path.

Adopt the convention that netlbl_conn_setattr() is already using.

Fixes 6e9f2df1c550 ("calipso: Don't call calipso functions for AF_INET sk.")
Cc Kuniyuki Iwashima <[email protected]>

Thanks for cathcing this!

Reviewed-by Kuniyuki Iwashima <[email protected]>

#2 lore raw
In reply to Eric Dumazet
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 5 lines · On Wed, 4 Jun 2025 13:38:26 +0000 you wrote:

syzbot reported that a recent patch forgot to unlock rcu in the error path.

Adopt the convention that netlbl_conn_setattr() is already using.

Quoted 8 lines
Fixes 6e9f2df1c550 ("calipso: Don't call calipso functions for AF_INET sk.")
Cc Kuniyuki Iwashima <[email protected]>

[...]

Here is the summary with links:
- [net] calipso: unlock rcu before returning -EAFNOSUPPORT

    https://git.kernel.org/netdev/net/c/3cae906e1a61

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html