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 <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Cc: Kuniyuki Iwashima <[email protected]> Acked-by: Paul Moore <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7632fed commit 3cae906

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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)