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
Subject: Re: [PATCH net 04/10] net: skbuff, skmsg, strparser: reject unreadable frags
Date: Fri, 04 Dec 2026 22:07:51 +0000 [thread overview]
Message-ID: <179642207129.3146.8928415353994266777@kernel.org> (raw)
In-Reply-To: <45de3e0b30489d345270cdc5c582218dc119cc31.1796329894.git.tavip@google.com>
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 <tavip@google.com>
[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
next prev parent reply other threads:[~2026-12-04 22:07 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 21:09 [PATCH net 00/10] net: fix unreadable net_iov skb handling across networking paths Octavian Purdila
2026-12-03 21:09 ` [PATCH net 01/10] net: gro: free skb on napi_frags_skb() header pull failure Octavian Purdila
2026-12-04 18:31 ` Mina Almasry
2026-12-03 21:09 ` [PATCH net 02/10] net: gro: reset unreadable and pp_recycle in napi_reuse_skb Octavian Purdila
2026-12-04 18:32 ` Mina Almasry
2026-12-04 21:07 ` Octavian Purdila
2026-12-04 22:07 ` netdev-bot+sashiko
2026-12-03 21:09 ` [PATCH net 03/10] inet: frag: reject fragments with mixed readability in reassembly Octavian Purdila
2026-12-04 18:38 ` Mina Almasry
2026-12-04 21:09 ` Octavian Purdila
2026-12-04 22:07 ` netdev-bot+sashiko
2026-12-03 21:09 ` [PATCH net 04/10] net: skbuff, skmsg, strparser: reject unreadable frags Octavian Purdila
2026-12-04 18:58 ` Mina Almasry
2026-12-04 21:25 ` Octavian Purdila
2026-12-04 22:07 ` netdev-bot+sashiko [this message]
2026-12-03 21:09 ` [PATCH net 05/10] tls: reject unreadable skbs in tls_strp Octavian Purdila
2026-12-04 18:44 ` Mina Almasry
2026-12-04 22:24 ` Octavian Purdila
2026-12-04 22:07 ` netdev-bot+sashiko
2026-12-03 21:09 ` [PATCH net 06/10] tcp: reject unreadable skbs on TCP-MD5 and TCP-AO Octavian Purdila
2026-12-04 18:46 ` Mina Almasry
2026-12-04 22:26 ` Octavian Purdila
2026-12-04 22:07 ` netdev-bot+sashiko
2026-12-03 21:09 ` [PATCH net 07/10] net: kunit: test unreadable net_iov napi_gro_frags Octavian Purdila
2026-12-04 18:47 ` Mina Almasry
2026-12-04 22:07 ` netdev-bot+sashiko
2026-12-03 21:09 ` [PATCH net 08/10] net: kunit: test unreadable net_iov defrag and skb helpers Octavian Purdila
2026-12-04 22:07 ` netdev-bot+sashiko
2026-12-03 21:09 ` [PATCH net 09/10] selftests: drv-net: devmem: test unreadable kTLS RX Octavian Purdila
2026-12-04 18:48 ` Mina Almasry
2026-12-04 22:28 ` Octavian Purdila
2026-12-04 22:08 ` netdev-bot+sashiko
2026-12-03 21:09 ` [PATCH net 10/10] selftests: drv-net: devmem: test unreadable skbs on TCP-MD5 and TCP-AO Octavian Purdila
2026-12-04 22:08 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179642207129.3146.8928415353994266777@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@kernel.org \
--cc=hawk@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jakub@cloudflare.com \
--cc=jiayuan.chen@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=kaiyuanz@google.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=mcroce@microsoft.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=tavip@google.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox