From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796332162; b=a2bKtS8rtk3GRivHW/mM3MfHLBwvJWZ5BT8/ec21qbK0TSfJaS/3Wxg1XmzsxlI6DzcX jdZ49u6gWgH6V0ta2fI/CBx5bwxr5NZpbDutHYL6AmDumhNh5Si4HlcmbOCYgBV9kN79z /xEota+nwDkJII8bJ/2EeXCtrcD2+iy9geIfEjB3jmoEA5rm8UKll0oA/BWO1jE3N1FiG FmyRV3ToRr+gBO49u2TwdwbZjkuiuSfdGsb3kNXYnFHv6ZoymPHsWQKz3rUoN+hZZdFXz Re3+prVgYdBO1Pc0EvgP/ShCSRpY7xByd55kf1oyFfC75lSIky4fTVwPuWOHfy6Yazg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796332162; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:Mime-Version: X-Mailer:Message-ID:Subject:From:To:Cc:Content-Type; bh=9LKFGCjL8yNWkBHduGTS2sm41p6/HmCa6WJFSdnkPf4=; b=rWSXcmpqqiaAvyoymwZfmFH8lxE6ymLIhLFJ+0qqAHPLEWIjGVeC+ivUtdXvWqBracSe ThuYkhhP+w2VYVmAB/1rksiwtBg2UlifI5na+EoiEoof8z0laUJpVK38vPuWQ/WXHM67e lCUojHyRP3R9pjWIsjNXczbjJtVfugfOpKy7xp0c0U3P/j0WnGbMuoRXyeNVkEyxWoNrn tWigGatxY4c3jgg7k3AflopHhMsBhfeDZ2oSTDutcGk5OKaLl1D/IdojERdGApqAn5xGd qMxpL/8AcRzt3LyGcbzZ2vg/Cc9ZXoYZRi+/EgXqmGrqcBTq0pVU0VBZf6IFKnHoVMA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--tavip.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=d2UnoxU3; arc=none smtp.remote-ip=209.85.210.197 Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47404606A33C for ; Thu, 3 Dec 2026 21:09:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 47404606A33C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--tavip.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=d2UnoxU3 Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-8b5d8de9619so329093b3a.0 for ; Thu, 03 Dec 2026 13:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796332161; x=1796936961; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=9LKFGCjL8yNWkBHduGTS2sm41p6/HmCa6WJFSdnkPf4=; b=d2UnoxU3PVxv3T5DuzuWQ30oDXiS24Mw52tJ68JouR1Sx5k1GXSdl9UyuJmH0wUNeY S2TDgGDzg5jD7ffz9uXNXLsAKn/QaUAZjph4/6NbUPJ9BCMYWOgUbj5eLc50xQDdXYDq lo1K352yqimtFAVP/d0r1c31u/OY3zXRNlYG9CerecjJi486vmXSPNt5oEvq4AFRBZ/a 5irg014/FZEd/DXwE9X/6DJQnZUHAT2IC1CdtEjOvNI0zNLCdkjnYanos85py81i8TH6 i7oEoI4fRFzsTFUlLruo5mziTDA9WtMLhmf5fcH2VnWRrDilW609Qj6KArcJEZn3tmA5 OUXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796332161; x=1796936961; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9LKFGCjL8yNWkBHduGTS2sm41p6/HmCa6WJFSdnkPf4=; b=TvvLZSmheQeYvO3eLjY0HzSaD1vyIM6Ge2jDToVApjTPKphFNnPK39cFoEH6lm/opj YyFuc9YSTYPC4zpakH1MhsjR6TOwI5RQjnomRDd5+ZMfh4+yfUPdXjxwVgB/ynHMrJK1 Lz26ieroHCUC9BMfUp6ulqLfe1mt9kHvZCrRz9oFjaDQvOsSmnBhZNLTldvJW6JYJnnX HUpZwddFJ+oJ4e5HvKy10nfaONlX6gECde7iuEL788BNqEQsH1eqcelCik+NCAwfDynw UdOWHc73D7sPrh5fXOAh+gaKk3Qm2SyFJNX/cgGJ1osuEULH59P01yLgvJWYYC0qQ8vM 9DLQ== X-Forwarded-Encrypted: i=1; AL+hErFm5fEL7X0y4/WckayCEDlYb7iardKXJDLW8s82qJuV5QoI8FZELRwP8FhL6dvu/3QCvs4=@vger.kernel.org X-Gm-Message-State: APuU4Z9A7juLuXmjIe+dAJfAL2WfZQUcu1FMiDMqYy3ZvRLzgLE0cBko ujFVo8eiaQ0HU/LuLnQFqb4IMGcUe36Nbslm04zIhEdT0RWbzLg23zMfkIWyrr5unPXd+KQ+j0U hZg== X-Received: from pjl4.prod.google.com ([2002:a17:90b:2f84:b0:3b3:aa49:9102]) (user=tavip job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:390b:b0:3b3:fe22:2745 with SMTP id 98e67ed59e1d1-3b41c933edamr46224012a91.45.1796332161340; Thu, 03 Dec 2026 13:09:21 -0800 (PST) Date: Thu, 3 Dec 2026 21:09:10 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog Message-ID: Subject: [PATCH net 00/10] net: fix unreadable net_iov skb handling across networking paths From: Octavian Purdila To: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , Simon Horman Cc: Andrew Lunn , Neal Cardwell , Kuniyuki Iwashima , David Ahern , Ido Schimmel , John Fastabend , Jakub Sitnicki , Jiayuan Chen , Sabrina Dubroca , Shuah Khan , Mina Almasry , Stanislav Fomichev , Kaiyuan Zhang , Ilias Apalodimas , Jesper Dangaard Brouer , Matteo Croce , Herbert Xu , Edward Cree , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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 -- 2.56.1.915.g69d5ec7298-goog