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=1796332163; b=gsuFdlmfG/mwpC8U8ed01V8d9+xkWCB260/dKkRlfEB5PLdJvPJe8nhq+oM7PBuVa0QN ytFfsFsocbkyhnXZ4kB7cYjKpAMmEfqAdPslYDXYHM2aUQxkHywiNu1Gd8wM7iOAWYK7X P1zCTP6mwNYrBsnsXeWFArfbm5YsODCgkevQLvAV+lh69KNLc8PgaZRG6wMTFOFKvXgq/ 701wi5yZk9JO71Y96MEY3tDYxtgoibunCFgQTwwLYyt2kxaNbJ+IHMgreoGCmvbQ2cKnK f4gE0NiQXF7clZD4d9BOl6PUBBfWq5La+9bWJO9zGk3CgdzOTs1Hpbr8W6F4Jd4uicw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796332163; 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=v8CEMaiPgwVVruM15hJdWv4TlrNO3bkI9q8qH06mMaC78Y7Vz/VbiNff+Y1M1G8iD3+B AnwT1b1Uilu5U+14CArUU6mRaCMYfc/gFuRuRAC7AOkJrZU2wd4i1i/X1HLxCMehsHoBl cHr5fuWKi6bCsfuGLFa99CaxsJWTf7jht6AP6pOeFsLTCIhnv6p7iuD6/ieILejn6lFnv m2LGdFhD2hTxzr+ZE4KSdhq9ffEDCffROiAsni+PGNmarZG5ckNZ4qQiza3YIUhJmqnFS 0NpDSM7dn2Gvqn+uwYsol60nHtJBSmb+h8Xjcb08Og5yhS0xuan2YBRH7XlUnxOB25A== 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 473D5606A33B for ; Thu, 3 Dec 2026 21:09:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 473D5606A33B 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-8b847ab3fd3so271857b3a.2 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=bgh396YnBoeCZs6fRRrwDZm70kDc3TNPlcZxfUxpkuC+vrL04Dua9TdsjaSGiOfBVL ZXX2Wwn05KmzUSiC5UJDSrdwhJ085fzEUn0pkJQqwn3Nh2aLQtV7wmFpIA3ZzIvKmtcN hY0SmCSydMTCwnXYYW9B9JoeX89GgtpbOB70R/7bq3GxTrHvFg2Ht+q4almGryfotWY4 Ey2L9iTFRTyZoDiUrybUVn9EpYnCjw2OH4SBygG0uBTR8TYCUsHhSoT/Ho7SqyLq6AVx 5puOPQBFQkURAHTLkVfR4W1pWo57i5IEpc0w+kyTD6XuSUJCmoflFlcbVfP4oBCTE5Kz MgWA== X-Forwarded-Encrypted: i=1; AL+hErHVIMWYbfoX1fwgPDvGq2hOxy84qOv2ClliXYDmGsMhzbOkL9zY01u37PJO2TUkSTDqD8hkU/6HAWPLOEgLOPk=@vger.kernel.org X-Gm-Message-State: APuU4Z8/GBQdpljzg0/1KAjxQ+O7yi3AnzL+NrbNBZdXraBcU8PWUDjz q9qeR5JSDD4kK6uApo2He9T8q2j3AtLIHBm/FAiSBA5o6Gqe0PaHsHT7p/mNc1YAo0iZ++NtGv+ Q8g== 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: linux-kselftest@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