]> Git Repo - J-linux.git/commitdiff
tcp: Don't flag tcp_sk(sk)->rx_opt.saw_unknown for TCP AO.
authorKuniyuki Iwashima <[email protected]>
Wed, 3 Jul 2024 03:35:08 +0000 (20:35 -0700)
committerPaolo Abeni <[email protected]>
Thu, 4 Jul 2024 09:56:12 +0000 (11:56 +0200)
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: 0a3a809089eb ("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]>
net/ipv4/tcp_input.c

index e67cbeeeb95b4965e4acdade5ed625a42c946afd..77294fd5fd3ec5cde446d21236d2ff426b928a83 100644 (file)
@@ -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(
This page took 0.182828 seconds and 4 git commands to generate.