Skip to content

Commit 3cae906

Browse files
edumazetkuba-moo
authored andcommitted
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: 6e9f2df ("calipso: Don't call calipso functions for AF_INET sk.") Reported-by: syzbot <syzkaller@googlegroups.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Kuniyuki Iwashima <kuniyu@amazon.com> Acked-by: Paul Moore <paul@paul-moore.com> Link: https://patch.msgid.link/20250604133826.1667664-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 7632fed commit 3cae906

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

net/netlabel/netlabel_kapi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,10 @@ int netlbl_conn_setattr(struct sock *sk,
11651165
break;
11661166
#if IS_ENABLED(CONFIG_IPV6)
11671167
case AF_INET6:
1168-
if (sk->sk_family != AF_INET6)
1169-
return -EAFNOSUPPORT;
1168+
if (sk->sk_family != AF_INET6) {
1169+
ret_val = -EAFNOSUPPORT;
1170+
goto conn_setattr_return;
1171+
}
11701172

11711173
addr6 = (struct sockaddr_in6 *)addr;
11721174
entry = netlbl_domhsh_getentry_af6(secattr->domain,

0 commit comments

Comments
 (0)