Skip to content

Commit 1380f68

Browse files
edumazetgregkh
authored andcommitted
calipso: unlock rcu before returning -EAFNOSUPPORT
commit 3cae906 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2cfcbe1 commit 1380f68

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
@@ -1140,8 +1140,10 @@ int netlbl_conn_setattr(struct sock *sk,
11401140
break;
11411141
#if IS_ENABLED(CONFIG_IPV6)
11421142
case AF_INET6:
1143-
if (sk->sk_family != AF_INET6)
1144-
return -EAFNOSUPPORT;
1143+
if (sk->sk_family != AF_INET6) {
1144+
ret_val = -EAFNOSUPPORT;
1145+
goto conn_setattr_return;
1146+
}
11451147

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

0 commit comments

Comments
 (0)