mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-08 08:02:59 -04:00
net/tcp: Ignore specific ICMPs for TCP-AO connections
Similarly to IPsec, RFC5925 prescribes: ">> A TCP-AO implementation MUST default to ignore incoming ICMPv4 messages of Type 3 (destination unreachable), Codes 2-4 (protocol unreachable, port unreachable, and fragmentation needed -- ’hard errors’), and ICMPv6 Type 1 (destination unreachable), Code 1 (administratively prohibited) and Code 4 (port unreachable) intended for connections in synchronized states (ESTABLISHED, FIN-WAIT-1, FIN- WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT) that match MKTs." A selftest (later in patch series) verifies that this attack is not possible in this TCP-AO implementation. Co-developed-by: Francesco Ruggeri <fruggeri@arista.com> Signed-off-by: Francesco Ruggeri <fruggeri@arista.com> Co-developed-by: Salam Noureddine <noureddine@arista.com> Signed-off-by: Salam Noureddine <noureddine@arista.com> Signed-off-by: Dmitry Safonov <dima@arista.com> Acked-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
2717b5adea
commit
953af8e3ac
@@ -301,6 +301,7 @@ enum
|
||||
LINUX_MIB_TCPAOBAD, /* TCPAOBad */
|
||||
LINUX_MIB_TCPAOKEYNOTFOUND, /* TCPAOKeyNotFound */
|
||||
LINUX_MIB_TCPAOGOOD, /* TCPAOGood */
|
||||
LINUX_MIB_TCPAODROPPEDICMPS, /* TCPAODroppedIcmps */
|
||||
__LINUX_MIB_MAX
|
||||
};
|
||||
|
||||
|
||||
@@ -405,7 +405,8 @@ struct tcp_ao_info_opt { /* setsockopt(TCP_AO_INFO) */
|
||||
set_rnext :1, /* corresponding ::rnext */
|
||||
ao_required :1, /* don't accept non-AO connects */
|
||||
set_counters :1, /* set/clear ::pkt_* counters */
|
||||
reserved :28; /* must be 0 */
|
||||
accept_icmps :1, /* accept incoming ICMPs */
|
||||
reserved :27; /* must be 0 */
|
||||
__u16 reserved2; /* padding, must be 0 */
|
||||
__u8 current_key; /* KeyID to set as Current_key */
|
||||
__u8 rnext; /* KeyID to set as Rnext_key */
|
||||
@@ -413,6 +414,7 @@ struct tcp_ao_info_opt { /* setsockopt(TCP_AO_INFO) */
|
||||
__u64 pkt_bad; /* failed verification */
|
||||
__u64 pkt_key_not_found; /* could not find a key to verify */
|
||||
__u64 pkt_ao_required; /* segments missing TCP-AO sign */
|
||||
__u64 pkt_dropped_icmp; /* ICMPs that were ignored */
|
||||
} __attribute__((aligned(8)));
|
||||
|
||||
/* setsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE, ...) */
|
||||
|
||||
Reference in New Issue
Block a user