Skip to content

Commit f9ae848

Browse files
0x7f454c46kuba-moo
authored andcommitted
net/tcp_ao: Don't leak ao_info on error-path
It seems I introduced it together with TCP_AO_CMDF_AO_REQUIRED, on version 5 [1] of TCP-AO patches. Quite frustrative that having all these selftests that I've written, running kmemtest & kcov was always in todo. [1]: https://lore.kernel.org/netdev/[email protected]/ Reported-by: Jakub Kicinski <[email protected]> Closes: https://lore.kernel.org/netdev/[email protected]/ Fixes: 0aadc73 ("net/tcp: Prevent TCP-MD5 with TCP-AO being set") Cc: [email protected] Signed-off-by: Dmitry Safonov <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 74382ae commit f9ae848

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/ipv4/tcp_ao.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,8 +1968,10 @@ static int tcp_ao_info_cmd(struct sock *sk, unsigned short int family,
19681968
first = true;
19691969
}
19701970

1971-
if (cmd.ao_required && tcp_ao_required_verify(sk))
1972-
return -EKEYREJECTED;
1971+
if (cmd.ao_required && tcp_ao_required_verify(sk)) {
1972+
err = -EKEYREJECTED;
1973+
goto out;
1974+
}
19731975

19741976
/* For sockets in TCP_CLOSED it's possible set keys that aren't
19751977
* matching the future peer (address/port/VRF/etc),

0 commit comments

Comments
 (0)