Re: [PATCH net v1 1/3] net: core: propagate unreadable flag in skb_zerocopy

From: Pavel Begunkov

Date: Sun Aug 02 2026 - 08:44:33 EST


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