Netdev List
 help / color / mirror / Atom feed
* [PATCH net v1 1/3] net: core: propagate unreadable flag in skb_zerocopy
@ 2026-08-01 12:52 Mina Almasry
  2026-08-01 12:52 ` [PATCH net v1 2/3] net: devmem: return EMSGSIZE on type mismatch Mina Almasry
  2026-08-01 12:52 ` [PATCH net v1 3/3] net: tcp: block standard payload injection into devmem skbs Mina Almasry
  0 siblings, 2 replies; 3+ messages in thread
From: Mina Almasry @ 2026-08-01 12:52 UTC (permalink / raw)
  Cc: Mina Almasry, Pavel Begunkov, Stanislav Fomichev, Bobby Eshleman,
	Florian Westphal, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Jason Xing, Kuniyuki Iwashima,
	Björn Töpel, Jiayuan Chen, Willem de Bruijn,
	Kaiyuan Zhang, open list:NETWORKING [GENERAL], open list

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.

Fixes: 65249feb6b3d ("net: add support for skbs with unreadable frags")
Cc: Pavel Begunkov <asml.silence@gmail.com>
Cc: Stanislav Fomichev <sdf@fomichev.me>
Cc: Bobby Eshleman <bobbyeshleman@gmail.com>
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: Mina Almasry <almasrymina@google.com>
---
 net/core/skbuff.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index ba3dbac80fb49..aebe8ea74776a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3928,6 +3928,9 @@ skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len, int hlen)
 	}
 	skb_shinfo(to)->nr_frags = j;
 
+	if (i > 0 && from->unreadable)
+		to->unreadable = 1;
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(skb_zerocopy);
-- 
2.55.0.571.g244d577d93-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-01 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-01 12:52 ` [PATCH net v1 3/3] net: tcp: block standard payload injection into devmem skbs Mina Almasry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox