All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Mina Almasry <almasrymina@google.com>
Cc: "Stanislav Fomichev" <sdf@fomichev.me>,
	"Bobby Eshleman" <bobbyeshleman@gmail.com>,
	"Florian Westphal" <fw@strlen.de>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>,
	"Jason Xing" <kerneljasonxing@gmail.com>,
	"Kuniyuki Iwashima" <kuniyu@google.com>,
	"Björn Töpel" <bjorn@kernel.org>,
	"Jiayuan Chen" <jiayuan.chen@linux.dev>,
	"Willem de Bruijn" <willemb@google.com>,
	"Kaiyuan Zhang" <kaiyuanz@google.com>,
	"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net v1 1/3] net: core: propagate unreadable flag in skb_zerocopy
Date: Sun, 2 Aug 2026 13:44:11 +0100	[thread overview]
Message-ID: <81e18535-e66a-498f-b293-3cb1c090fb9f@gmail.com> (raw)
In-Reply-To: <11a640b6-46b1-44d6-aee6-872107f7f570@gmail.com>

On 8/2/26 13:33, Pavel Begunkov wrote:
> On 8/1/26 13:52, Mina Almasry wrote:
>> When skb_zerocopy() copies devmem payload fragments, it fails to update
>> the target skb's unreadable flag. This causes the target to appear as
>> readable memory.
>>
>> Propagate the unreadable flag if any devmem fragments were copied from
>> the source.
> 
>  From a quick look, it doesn't seem like the function would work reliably
> with netmems even with this patch, but that's a different kind of issue
> we can return to later. Curious, did you hit this in prod?

  	skb_shinfo(to)->nr_frags = j;
  
+	if (i > 0 && from->unreadable)
+		to->unreadable = 1;

Taking another look, if j != i, it'd also have the mixing problem,
and that can happen if it hits that head-to-frag copy.

if (!skb_frags_readable(from) && j > 0 && len)
	// goto fault;

Maybe add sth like this before the frag assignment loop?

-- 
Pavel Begunkov


  reply	other threads:[~2026-08-02 12:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-01 12:52 [PATCH net v1 1/3] net: core: propagate unreadable flag in skb_zerocopy Mina Almasry
2026-08-01 12:52 ` [PATCH net v1 2/3] net: devmem: return EMSGSIZE on type mismatch Mina Almasry
2026-08-02 12:26   ` Pavel Begunkov
2026-08-01 12:52 ` [PATCH net v1 3/3] net: tcp: block standard payload injection into devmem skbs Mina Almasry
2026-08-02 12:25   ` Pavel Begunkov
2026-08-02 12:33 ` [PATCH net v1 1/3] net: core: propagate unreadable flag in skb_zerocopy Pavel Begunkov
2026-08-02 12:44   ` Pavel Begunkov [this message]
2026-08-03 15:49   ` Mina Almasry

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=81e18535-e66a-498f-b293-3cb1c090fb9f@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=almasrymina@google.com \
    --cc=bjorn@kernel.org \
    --cc=bobbyeshleman@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=horms@kernel.org \
    --cc=jiayuan.chen@linux.dev \
    --cc=kaiyuanz@google.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.