Skip to content

Commit

Permalink
tcp: Don't flag tcp_sk(sk)->rx_opt.saw_unknown for TCP AO.
Browse files Browse the repository at this point in the history
When we process segments with TCP AO, we don't check it in
tcp_parse_options().  Thus, opt_rx->saw_unknown is set to 1,
which unconditionally triggers the BPF TCP option parser.

Let's avoid the unnecessary BPF invocation.

Fixes: 0a3a809 ("net/tcp: Verify inbound TCP-AO signed segments")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Acked-by: Dmitry Safonov <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
q2ven authored and Paolo Abeni committed Jul 4, 2024
1 parent aa09b7e commit 4b74726
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -4223,6 +4223,13 @@ void tcp_parse_options(const struct net *net,
* checked (see tcp_v{4,6}_rcv()).
*/
break;
#endif
#ifdef CONFIG_TCP_AO
case TCPOPT_AO:
/* TCP AO has already been checked
* (see tcp_inbound_ao_hash()).
*/
break;
#endif
case TCPOPT_FASTOPEN:
tcp_parse_fastopen_option(
Expand Down

0 comments on commit 4b74726

Please sign in to comment.