net: fix unreadable net_iov skb handling across networking paths
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest10 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | net: gro: free skb on napi_frags_skb() header pull failurenet/ | +4 | 1 reply | |
| 2/10 | net: gro: reset unreadable and pp_recycle in napi_reuse_skbnet/ | +2 | 1 reply | |
| 3/10 | inet: frag: reject fragments with mixed readability in reassemblyinclude/ net/ | +11 | 1 reply | |
| 4/10 | net: skbuff, skmsg, strparser: reject unreadable fragsnet/ net/ net/ | +23 | 0 replies | |
| 5/10 | tls: reject unreadable skbs in tls_strpnet/ | +22 | 1 reply | |
| 6/10 | tcp: reject unreadable skbs on TCP-MD5 and TCP-AOinclude/ net/ net/ +3 more | +92 | 0 replies | |
| 7/10 | net: kunit: test unreadable net_iov napi_gro_fragsnet/ | +245 | 0 replies | |
| 8/10 | net: kunit: test unreadable net_iov defrag and skb helpersnet/ | +382 | 0 replies | |
| 9/10 | selftests: drv-net: devmem: test unreadable kTLS RXtools/ tools/ tools/ | +221 | 0 replies | |
| 10/10 | selftests: drv-net: devmem: test unreadable skbs on TCP-MD5 and TCP-AOtools/ tools/ tools/ | +252 | 0 replies |
Reviews trailers per patch
2 of 10 patches have a Reviewed-by or Acked-by.
| Patch | Mina Almasry |
|---|---|
| 1/10 | R-b |
| 2/10 | R-b |
| 3/10 | |
| 4/10 | |
| 5/10 | |
| 6/10 | |
| 7/10 | |
| 8/10 | |
| 9/10 | |
| 10/10 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net 00/10] net: fix unreadable net_iov skb handling across networking paths
Device-memory TCP and io_uring zcrx bind RX queues to page_pool memory providers whose net_iov fragments cannot be mapped or read by the CPU. While standard TCP devmem traffic uses flow steering onto isolated RX queues, several networking paths either propagate stale skb metadata, mix readable and unreadable fragments across frag_list, or attempt to map or copy payload fragments on the CPU when unexpected protocol traffic or socket options interact with unreadable skbs:
1. GRO fragment reuse and pull failure (patches 1-2): napi_frags_skb() calls napi_reuse_skb() while fragments remain attached on Ethernet header pull failure and napi_gro_frags() dereferences the resulting NULL skb; napi_reuse_skb() leaves stale skb->unreadable and skb->pp_recycle state on cached napi->skb heads.
2. IP fragment reassembly and generic skb helpers (patches 3-4): IP fragment reassembly permits mixing readable and unreadable fragments in the same queue and does not propagate head->unreadable to the frag_list wrapper skb, and skb_to_sgvec(), skb_send_sock_locked(), sockmap verdict processing, and strparser assume CPU-readable fragments.
3. kTLS RX and TCP-MD5 / TCP-AO (patches 5-6): kTLS tls_strp decryption and software TCP-MD5 / TCP-AO payload hashing attempt to access unreadable net_iov fragments on the CPU.
Patches 1-6 fix these paths by freeing failed napi_frags_skb() skbs, resetting cached GRO skb state, rejecting mixed-readability IP fragments, and rejecting unreadable fragments cleanly before CPU page mapping occurs.
Patches 7-8 add KUnit regression tests in net_test covering the napi_gro_frags, IP defrag, scatterlist, skmsg, and strparser paths and verifying page_pool and dmabuf binding reference counts remain balanced. Patches 9-10 extend devmem.py with end-to-end protocol regression tests for kTLS RX and TCP-MD5 / TCP-AO RX and TX rejection.
Verified with net_core KUnit tests in QEMU and end-to-end devmem.py runs over ConnectX-7 (mlx5_core) 400GbE hardware.
Octavian Purdila (10):
net: gro: free skb on napi_frags_skb() header pull failure
net: gro: reset unreadable and pp_recycle in napi_reuse_skb
inet: frag: reject fragments with mixed readability in reassembly
net: skbuff, skmsg, strparser: reject unreadable frags
tls: reject unreadable skbs in tls_strp
tcp: reject unreadable skbs on TCP-MD5 and TCP-AO
net: kunit: test unreadable net_iov napi_gro_frags
net: kunit: test unreadable net_iov defrag and skb helpers
selftests: drv-net: devmem: test unreadable kTLS RX
selftests: drv-net: devmem: test unreadable skbs on TCP-MD5 and TCP-AO
include/net/inet_frag.h | 1 + include/net/tcp.h | 33 +- net/core/gro.c | 7 +- net/core/net_test.c | 628 +++++++++++++++++- net/core/skbuff.c | 8 + net/core/skmsg.c | 10 + net/ipv4/inet_fragment.c | 13 +- net/ipv4/tcp.c | 32 +- net/ipv4/tcp_ao.c | 29 +- net/ipv4/tcp_ipv4.c | 13 +- net/ipv4/tcp_output.c | 9 +- net/ipv6/tcp_ipv6.c | 10 +- net/strparser/strparser.c | 5 + net/tls/tls_strp.c | 24 +- tools/testing/selftests/drivers/net/hw/config | 2 + .../selftests/drivers/net/hw/devmem.py | 17 +- .../selftests/drivers/net/hw/devmem_lib.py | 445 ++++++++++++- .../drivers/net/hw/lib/py/__init__.py | 11 +- 18 files changed, 1247 insertions(+), 50 deletions(-)
base-commit: 90ae4042bd9f35a9098d14b1a12a43df9b326e2b
Signature · 1 line
2.56.1.915.g69d5ec7298-goog