From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796422073; b=mPJWTwDV8U7I0I9/xgH6ZvkkusDWpnYN225C5vrmFThVDeR6qcICfZeFhO9bMvktxR9c eA2lZbaw2ziKxJN57XH3ScMHWaZuUPJ2YgZwZckpYVtNZM+s7vBOh0Tx87SjfKejgRo9S 0pyxnnVyWtucGvfDSFFNdCmkHJWVd2wJdLrpCKBfWLk+fxXYVerzSfXNDxgV/GxS9g0eF YvKj47QNUhY5sjfMVskxxMTWJkKsAffJV79yxX6tAT9naOD8iIA+zyKSS+FBMtVP1iK63 781Wjq12q3eNFGCOTAAxrynsmBt6KML7T91kxeiJYTfvStQ7w2YsWiZ9qUAd5QwTq4g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796422073; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=14LM5dfJndv8W5khK+h8ZAuQVui9nA6EfTGz3dQMuow=; b=xjWhUZezxvHN/jdX0GhuMRrCFTjvHFYxrJLQeim5lqJ88lR6QkulQDN3F9CcqSjWcmmM hXvyEv76+tFErVEevpqkeAPwGWDQpVWxJAMcREJU8tmA5ifEdTvw0Z2eVkLX4r/lGbWr5 X3Ia/GNk6T754hKchzGZLOVvQ1Uf001MDCMPrJ0Y0NjIX0qxcVtccc0USaVNWtpfsY2o3 GzuD7elL6acFSjU5unw2lhhei6hOtVc5A06X/LwPDZBHFOmTxvREUZvgeTVRNgwGW9dP6 S/ZL9rOzK1D9MA9NMQdU47SQtFEUg9iFM7DL5ZC+1itZWNi2ezR5SXLO+SCpv31Ne6g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WJ1oKYq5; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5625606A32F; Fri, 4 Dec 2026 22:07:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WJ1oKYq5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B66861F00A10; Fri, 4 Dec 2026 22:07:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796422073; bh=14LM5dfJndv8W5khK+h8ZAuQVui9nA6EfTGz3dQMuow=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=WJ1oKYq5yHAAzwnzeGXMJF1mVVpQ4/l5pWdKveJPyNWrpNe4LfPmEPDPDgP3/Yqeq ZvQY7tFNpZ0pKKe69m4VQ/nfPEuqAb8IhRshkanScZ+9Q6yKHLxLlCmfGnpWSULURD OOihkF27vozTkMRMELy/UYiQN1QBavUE+VsILufMxC7AQKi+HgG8fBaxb6JvZOLlI8 586EyKL/WCbvrkdDX7AysQ+WMqbChD73tbQHZ8C3cm7agyJp0R0e4qXl5UEQ+SNHpZ icSwaWKdw6Rzm3yziOI1dRDh4BW6lC/MSqYQzWxDPUavz3EcBZvZXR+2kxrsTBsDSQ KlgGDuXSQysPg== Subject: Re: [PATCH net 04/10] net: skbuff, skmsg, strparser: reject unreadable frags From: netdev-bot+sashiko@kernel.org To: tavip@google.com Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, andrew+netdev@lunn.ch, ncardwell@google.com, kuniyu@google.com, dsahern@kernel.org, idosch@nvidia.com, john.fastabend@gmail.com, jakub@cloudflare.com, jiayuan.chen@linux.dev, sd@queasysnail.net, shuah@kernel.org, almasrymina@google.com, sdf@fomichev.me, kaiyuanz@google.com, ilias.apalodimas@linaro.org, hawk@kernel.org, mcroce@microsoft.com, herbert@gondor.apana.org.au, ecree.xilinx@gmail.com, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Date: Fri, 04 Dec 2026 22:07:51 +0000 Message-ID: <179642207129.3146.8928415353994266777@kernel.org> In-Reply-To: <45de3e0b30489d345270cdc5c582218dc119cc31.1796329894.git.tavip@google.com> References: <45de3e0b30489d345270cdc5c582218dc119cc31.1796329894.git.tavip@google.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] Concern: the commit message says the issue was "reproduced and verified with the accompanying net_test KUnit tests", but this commit… - [Low] The commit uses the trailer "Assisted-by: LLM". - [Low] The patch adds a new error class to skb_to_sgvec() but leaves its documentation and the related comments unchanged. -- net: skbuff, skmsg, strparser: reject unreadable frags This patch makes scatterlist conversion, __skb_send_sock(), sockmap verdict processing and strparser return -EFAULT when they see skbs with unreadable net_iov frags, rather than dereferencing NULL page pointers. sk_psock_skb_ingress_enqueue() now passes errors other than -EMSGSIZE back to the caller instead of retrying skb_linearize(). The verdict path also clears SK_PSOCK_TX_ENABLED on the faulted psock. > This issue was found by code inspection while developing per-socket > devmem RX and reproduced and verified with the accompanying net_test > KUnit tests. [Severity: Low] This is probably fine, but the KUnit tests mentioned here are not in this commit. They seem to come later in the series, in "net: kunit: test unreadable net_iov defrag and skb helpers". There, netmem_unreadable_test_sg_and_strp() checks that skb_to_sgvec() returns -EFAULT, and also exercises skb_send_sock_locked() and strp_data_ready(). Would it be worth naming that patch here? > Fixes: 65249feb6b3d ("net: add support for skbs with unreadable frags") > Assisted-by: LLM > Signed-off-by: Octavian Purdila [Severity: Low] This isn't a bug, but Assisted-by is not one of the tags in $signature_tags in scripts/checkpatch.pl. Checkpatch will give a non-standard signature (BAD_SIGN_OFF) warning for this line. "LLM" also doesn't name the tool. Documentation/process/generated-content.rst asks "What tools were used?". Documentation/process/maintainer-netdev.rst asks that bug fixes describe how the issue was found and validated "in plain English, not with special tags or annotations". Could the tool use go in the commit message body instead? The same trailer is on the other patches in the series. > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > index 8ac7ad1378a12..d20d08682a132 100644 > --- a/net/core/skbuff.c > +++ b/net/core/skbuff.c [ ... ] > @@ -5391,6 +5396,9 @@ __skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len, > offset += copy; > } > > + if (unlikely(!skb_frags_readable(skb)) && skb_shinfo(skb)->nr_frags) > + return -EFAULT; > + > for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { > int end; > > diff --git a/net/core/skmsg.c b/net/core/skmsg.c > index 8a3b8536c0c21..f56393b43a462 100644 > --- a/net/core/skmsg.c > +++ b/net/core/skmsg.c > @@ -560,6 +560,9 @@ static int sk_psock_skb_ingress_enqueue(struct sk_buff *skb, > */ > num_sge = skb_to_sgvec(skb, msg->sg.data, off, len); > if (num_sge < 0) { > + if (num_sge != -EMSGSIZE) > + return num_sge; > + > /* skb linearize may fail with ENOMEM, but lets simply try again > * later if this happens. Under memory pressure we don't want to > * drop the skb. We need to linearize the skb so that the mapping [Severity: Low] Should the documentation and comments be updated now that skb_to_sgvec() can return -EFAULT? The skb_to_sgvec() kernel-doc in net/core/skbuff.c still lists only one error: * region of the buffer space attached to a socket buffer. Returns either * the number of scatterlist items used, or -EMSGSIZE if the contents * could not fit. This caller now handles -EMSGSIZE differently from other errors. The comments around it still say skb_to_sgvec() fails only when MAX_MSG_FRAGS is exceeded, and that after linearizing "the mapping in skb_to_sgvec can not error". The comment in sk_psock_verdict_apply() also looks out of date: * queue work otherwise we may get OOO data. Otherwise, * if sk_psock_skb_ingress errors will be handled by * retrying later from workqueue. When the error is not -EAGAIN, sk_psock_backlog() does not retry. It treats the error as a hard error: /* Hard errors break pipe and stop xmit. */ sk_psock_report_error(psock, ret ? -ret : EPIPE); sk_psock_clear_state(psock, SK_PSOCK_TX_ENABLED); -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1796329894.git.tavip%40google.com