Skip to content

Commit 4b74726

Browse files
q2venPaolo Abeni
authored and
Paolo Abeni
committed
tcp: Don't flag tcp_sk(sk)->rx_opt.saw_unknown for TCP AO.
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]>
1 parent aa09b7e commit 4b74726

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/ipv4/tcp_input.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4223,6 +4223,13 @@ void tcp_parse_options(const struct net *net,
42234223
* checked (see tcp_v{4,6}_rcv()).
42244224
*/
42254225
break;
4226+
#endif
4227+
#ifdef CONFIG_TCP_AO
4228+
case TCPOPT_AO:
4229+
/* TCP AO has already been checked
4230+
* (see tcp_inbound_ao_hash()).
4231+
*/
4232+
break;
42264233
#endif
42274234
case TCPOPT_FASTOPEN:
42284235
tcp_parse_fastopen_option(

0 commit comments

Comments
 (0)