Skip to content

net/tcp: Add TCP-AO support

Dmitry Safonov linux-doc lkml llvm netdev oe-kbuild-all 19 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v16 Latest23 patches 5 repliesApplied 23/23
  2. v1523 patches 0 repliesSuperseded
  3. v1423 patches 9 repliesSuperseded
Earlier versions · 16
VersionPostedPatchesRepliesStatus
v1323 patches2 repliesSuperseded
v1223 patches5 repliesSuperseded
v1123 patches4 repliesSuperseded
v1023 patches6 repliesSuperseded
v923 patches7 repliesSuperseded
v823 patches2 repliesSuperseded
v722 patches7 repliesSuperseded
v621 patches3 repliesSuperseded
v521 patches0 repliesSuperseded
v4 posting 2/221 patches4 repliesSuperseded
v4 posting 1/24 patches6 repliesSuperseded
v3 posting 2/24 patches2 repliesSuperseded
v2 posting 2/25 patches9 repliesSuperseded
v3 posting 1/236 patches2 repliesSuperseded
v2 posting 1/235 patches2 repliesSuperseded
v131 patches22 repliesSuperseded

Changes in v16 from the cover letter

- Fix build warning on RST patch in tcp_ao_prepare_reset(), now 'else' is dropped. Added back by later patch that wires up reqsk. (kernel test robot <[email protected]>)

Patches in v16 All 23 applied

#Subject and filesSizeRepliesApplied
1/23net/tcp: Prepare tcp_md5sig_pool for TCP-AOinclude/net/tcp.h net/ipv4/Kconfig net/ipv4/Makefile +5 more+525 -2112 repliesApplied
2/23net/tcp: Add TCP-AO config and structuresinclude/linux/tcp.h include/net/tcp.h include/net/tcp_ao.h +2 more+114 -80 repliesApplied
3/23net/tcp: Introduce TCP_AO setsockopt()sinclude/linux/sockptr.h include/net/tcp.h include/net/tcp_ao.h +8 more+952 -180 repliesApplied
4/23net/tcp: Prevent TCP-MD5 with TCP-AO being setinclude/net/tcp.h include/net/tcp_ao.h net/ipv4/tcp_ao.c +4 more+198 -90 repliesApplied
5/23net/tcp: Calculate TCP-AO traffic keysinclude/net/tcp.h include/net/tcp_ao.h net/ipv4/tcp_ao.c +5 more+314 -20 repliesApplied
6/23net/tcp: Add TCP-AO sign to outgoing packetsinclude/net/tcp.h include/net/tcp_ao.h net/ipv4/tcp_ao.c +4 more+391 -380 repliesApplied
7/23net/tcp: Add tcp_parse_auth_options()include/net/dropreason-core.h include/net/tcp.h include/net/tcp_ao.h +4 more+93 -220 repliesApplied
8/23net/tcp: Add AO sign to RST packetsinclude/net/tcp.h include/net/tcp_ao.h net/ipv4/tcp_ao.c +2 more+245 -430 repliesApplied
9/23net/tcp: Add TCP-AO sign to twskinclude/linux/tcp.h include/net/tcp_ao.h net/ipv4/tcp_ao.c +4 more+183 -500 repliesApplied
10/23net/tcp: Wire TCP-AO to request socketsinclude/linux/tcp.h include/net/tcp.h include/net/tcp_ao.h +9 more+505 -500 repliesApplied
11/23net/tcp: Sign SYN-ACK segments with TCP-AOinclude/net/tcp.h include/net/tcp_ao.h net/ipv4/tcp_ao.c +4 more+111 -160 repliesApplied
12/23net/tcp: Verify inbound TCP-AO signed segmentsinclude/net/dropreason-core.h include/net/tcp.h include/net/tcp_ao.h +5 more+248 -470 repliesApplied
13/23net/tcp: Add TCP-AO segments countersinclude/net/dropreason-core.h include/net/tcp.h include/net/tcp_ao.h +6 more+77 -150 repliesApplied
14/23net/tcp: Add TCP-AO SNE supportinclude/net/tcp_ao.h net/ipv4/tcp_ao.c net/ipv4/tcp_input.c +3 more+104 -130 repliesApplied
15/23net/tcp: Add tcp_hash_fail() ratelimited logsinclude/net/tcp.h include/net/tcp_ao.h net/ipv4/tcp.c +1 more+61 -121 replyApplied
16/23net/tcp: Ignore specific ICMPs for TCP-AO connectionsinclude/net/tcp_ao.h include/uapi/linux/snmp.h include/uapi/linux/tcp.h +4 more+87 -20 repliesApplied
17/23net/tcp: Add option for TCP-AO to (not) hash headerinclude/uapi/linux/tcp.h net/ipv4/tcp_ao.c+10 -30 repliesApplied
18/23net/tcp: Add TCP-AO getsockopt()sinclude/net/tcp_ao.h include/uapi/linux/tcp.h net/ipv4/tcp.c +1 more+369 -140 repliesApplied
19/23net/tcp: Allow asynchronous delete for TCP-AO keys (MKTs)include/uapi/linux/tcp.h net/ipv4/tcp_ao.c+20 -40 repliesApplied
20/23net/tcp: Add static_key for TCP-AOinclude/net/tcp.h include/net/tcp_ao.h net/ipv4/tcp_ao.c +3 more+98 -460 repliesApplied
21/23net/tcp: Wire up l3index to TCP-AOinclude/net/tcp.h include/net/tcp_ao.h net/ipv4/syncookies.c +5 more+177 -790 repliesApplied
22/23net/tcp: Add TCP_AO_REPAIRinclude/net/tcp_ao.h include/uapi/linux/tcp.h net/ipv4/tcp.c +1 more+125 -110 repliesApplied
23/23Documentation/tcp: Add TCP-AO documentationDocumentation/networking/index.rst Documentation/networking/tcp_ao.rst+445 -02 repliesApplied

Reviews trailers per patch

All 23 patches have a Reviewed-by or Acked-by.

PatchSteen HegelundDavid Ahern
1/23R-b A-b
2/23A-b
3/23A-b
4/23A-b
5/23A-b
6/23A-b
7/23A-b
8/23A-b
9/23A-b
10/23A-b
11/23A-b
12/23A-b
13/23A-b
14/23A-b
15/23A-b
16/23A-b
17/23A-b
18/23A-b
19/23A-b
20/23A-b
21/23A-b
22/23A-b
23/23A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v16 thread

Cover letter [PATCH v16 net-next 00/23] net/tcp: Add TCP-AO support

Hi,

This is version 16 of TCP-AO support. It addresses the build warning in the middle of patch set, reported by kernel test robot.

There's one Sparse warning introduced by tcp_sigpool_start():
__cond_acquires() seems to currently being broken. I've described the reasoning for it on v9 cover letter. Also, checkpatch.pl warnings were addressed, but yet I've left the ones that are more personal preferences (i.e. 80 columns limit). Please, ping me if you have a strong feeling about one of them.

The following changes since commit d6e48462e88fe7efc78b455ecde5b0ca43ec50b7:

net: mdio: xgene: Fix unused xgene_mdio_of_match warning for !CONFIG_OF (2023-10-23 10:16:47 -0700)

are available in the Git repository at:

[email protected]:0x7f454c46/linux.git tcp-ao-v16

for you to fetch changes up to 4d4eb816c47537ba31912dd5c8d7a68a69694fc6:

Documentation/tcp: Add TCP-AO documentation (2023-10-23 18:49:17 +0100)

----------------------------------------------------------------

And another branch with selftests, that will be sent later separately:

[email protected]:0x7f454c46/linux.git tcp-ao-v16-with-selftests

Thanks for your time and reviews,
Dmitry

--- Changelog ---

Changes from v15:
- Fix build warning on RST patch in tcp_ao_prepare_reset(), now 'else' is dropped. Added back by later patch that wires up reqsk. (kernel test robot <[email protected]>)

Version 15: https://lore.kernel.org/all/[email protected]/

Changes from v14:
- selftests: Refactored (enum test_fault) into tcp_ao selftest's lib/
- selftests: Refactored should_skip_test(), TEST_NEEDS_MD5, TEST_NEEDS_VRF, check_*_support() into lib/kconfig.c
- selftests: checked that tests are properly SKIPed when kernel config doesn't have required options enabled: net_ns, veth, tcp_ao and optionally tcp_md5, net_vrf
- Corrected Simon's email as his corigine address bounces back
- Fix missed ifdeffery for rcu_read_lock() in tcp_v6_send_reset() (kernel test robot <[email protected]>)
- Move tcp_key::sne after tcp_key::traffic_key to avoid a hole (Eric)
- In patch that wires up RST packets move TCPF_TIME_WAIT sk_state check to (TCPF_LISTEN | TCPF_NEW_SYN_RECV) checks in tcp_ao_prepare_reset(). (Eric)
- Converted tcp_ao_info::refcnt from atomic_t to refcount_t (Eric)
- Removed TODO comment in tcp_ao_connect_init(): can't happen because of the checks in tcp_connect(). Added WARN_ON_ONCE() if anything gets broken.

Version 14: https://lore.kernel.org/all/[email protected]/T/#u

Changes from v13:
- Converted Documentation/ page from human unreadable list-table::
to grid-table(s) (Jonathan)

Version 13: https://lore.kernel.org/all/[email protected]/T/#u

Changes from v12:
- Separate TCP-AO sign from __tcp_transmit_skb() into a separate function for code locality and readability (Paolo)
- Add TCP-AO self-connect selftest, which by its nature is a selftest for TCP simultaneous open, use different keyids and check tcp repair
- Fix simultaneous open: take correct ISNs for verification, pre-calculate sending traffic key on SYN-ACK, calculate receiving traffic key before going into TCP_ESTABLISHED
- Use kfree_sensitive() for hardening purposes
- Use READ_ONCE() on sk->sk_family when not under socket lock to prevent any possible race with IPV6_ADDRFORM

Version 12: https://lore.kernel.org/all/[email protected]/T/#u

Changes from v11:
- Define (struct tcp_key) for tcp-fast path and detect by type what key was used. This also benefits from TCP-MD5/TCP-AO static branches (Eric)
- Remove sk_gso_disable() from TCP-AO fast-path in __tcp_transmit_skb() (Eric)
- Don't leak skb on failed kmalloc() in __tcp_transmit_skb() (Eric)
- skb_dst_drop() is not necessary as kfree_skb() calls it (Eric)
- Don't dereference tcp_ao_key in net_warn_ratelimited(), outside of rcu_read_lock() (Eric)

Version 11: https://lore.kernel.org/all/[email protected]/T/#u

Changes from v10:
- Make seq (u32) in tcp_ao_prepare_reset() and declare the argument in "net/tcp: Add TCP-AO SNE support", where it gets used (Simon)
- Fix rebase artifact in tcp_v6_reqsk_send_ack(), which adds compile-error on a patch in the middle of series (Simon)
- Another rebase artifact in tcp_v6_reqsk_send_ack() that makes keyid, requested by peer on ipv6 reqsk ACKs not respected (Simon)

Version 10: https://lore.kernel.org/all/[email protected]/T/#u

The pre-v10 changelog is on version 10 cover-letter.

Cc Andy Lutomirski <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Bob Gilligan <[email protected]>
Cc Dan Carpenter <[email protected]>
Cc David Ahern <[email protected]>
Cc David Laight <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Dmitry Safonov <[email protected]>
Cc Donald Cassidy <[email protected]>
Cc Eric Biggers <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc "Eric W. Biederman" <[email protected]>
Cc Francesco Ruggeri <[email protected]>
Cc Gaillardetz, Dominik <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Hideaki YOSHIFUJI <[email protected]>
Cc Ivan Delalande <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Leonard Crestez <[email protected]>
Cc Nassiri, Mohammad <[email protected]>
Cc Paolo Abeni <[email protected]>
Cc Salam Noureddine <[email protected]>
Cc Simon Horman <[email protected]>
Cc Tetreault, Francois <[email protected]>

Dmitry Safonov (23):
net/tcp: Prepare tcp_md5sig_pool for TCP-AO net/tcp: Add TCP-AO config and structures net/tcp: Introduce TCP_AO setsockopt()s
net/tcp: Prevent TCP-MD5 with TCP-AO being set net/tcp: Calculate TCP-AO traffic keys
net/tcp: Add TCP-AO sign to outgoing packets net/tcp: Add tcp_parse_auth_options()
net/tcp: Add AO sign to RST packets
net/tcp: Add TCP-AO sign to twsk
net/tcp: Wire TCP-AO to request sockets
net/tcp: Sign SYN-ACK segments with TCP-AO net/tcp: Verify inbound TCP-AO signed segments net/tcp: Add TCP-AO segments counters
net/tcp: Add TCP-AO SNE support
net/tcp: Add tcp_hash_fail() ratelimited logs net/tcp: Ignore specific ICMPs for TCP-AO connections net/tcp: Add option for TCP-AO to (not) hash header net/tcp: Add TCP-AO getsockopt()s
net/tcp: Allow asynchronous delete for TCP-AO keys (MKTs) net/tcp: Add static_key for TCP-AO
net/tcp: Wire up l3index to TCP-AO
net/tcp: Add TCP_AO_REPAIR
Documentation/tcp: Add TCP-AO documentation

 Documentation/networking/index.rst  |    1 +
 Documentation/networking/tcp_ao.rst |  444 +++++
 include/linux/sockptr.h             |   23 +
 include/linux/tcp.h                 |   30 +-
 include/net/dropreason-core.h       |   30 +
 include/net/tcp.h                   |  288 +++-
 include/net/tcp_ao.h                |  362 ++++
 include/uapi/linux/snmp.h           |    5 +
 include/uapi/linux/tcp.h            |  105 ++
 net/ipv4/Kconfig                    |   17 +
 net/ipv4/Makefile                   |    2 +
 net/ipv4/proc.c                     |    5 +
 net/ipv4/syncookies.c               |    4 +
 net/ipv4/tcp.c                      |  246 +--
 net/ipv4/tcp_ao.c                   | 2392 +++++++++++++++++++++++++++
 net/ipv4/tcp_input.c                |   98 +-
 net/ipv4/tcp_ipv4.c                 |  363 +++-
 net/ipv4/tcp_minisocks.c            |   50 +-
 net/ipv4/tcp_output.c               |  236 ++-
 net/ipv4/tcp_sigpool.c              |  358 ++++
 net/ipv6/Makefile                   |    1 +
 net/ipv6/syncookies.c               |    5 +
 net/ipv6/tcp_ao.c                   |  168 ++
 net/ipv6/tcp_ipv6.c                 |  376 +++--
 24 files changed, 5174 insertions(+), 435 deletions(-)
 create mode 100644 Documentation/networking/tcp_ao.rst
 create mode 100644 include/net/tcp_ao.h
 create mode 100644 net/ipv4/tcp_ao.c
 create mode 100644 net/ipv4/tcp_sigpool.c
 create mode 100644 net/ipv6/tcp_ao.c

base-commit: d6e48462e88fe7efc78b455ecde5b0ca43ec50b7

Signature · 1 line
2.42.0