netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] netmem: fix skb_frag_address_safe with unreadable skbs
@ 2025-06-19 17:52 Mina Almasry
  2025-06-21 15:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Mina Almasry @ 2025-06-19 17:52 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: Mina Almasry, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, ap420073, Stanislav Fomichev

skb_frag_address_safe() needs a check that the
skb_frag_page exists check similar to skb_frag_address().

Cc: ap420073@gmail.com

Signed-off-by: Mina Almasry <almasrymina@google.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>

---

v2: https://lore.kernel.org/netdev/20250617210950.1338107-1-almasrymina@google.com/

- Move to net-next
- save return value of skb_frag_page
---
 include/linux/skbuff.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 9508968cb300..4f6dcb37bae8 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3665,7 +3665,13 @@ static inline void *skb_frag_address(const skb_frag_t *frag)
  */
 static inline void *skb_frag_address_safe(const skb_frag_t *frag)
 {
-	void *ptr = page_address(skb_frag_page(frag));
+	struct page *page = skb_frag_page(frag);
+	void *ptr;
+
+	if (!page)
+		return NULL;
+
+	ptr = page_address(page);
 	if (unlikely(!ptr))
 		return NULL;
 

base-commit: afc783fa0aab9cc093fbb04871bfda406480cf8d
-- 
2.50.0.rc2.701.gf1e915cc24-goog


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

* Re: [PATCH net-next v2] netmem: fix skb_frag_address_safe with unreadable skbs
  2025-06-19 17:52 [PATCH net-next v2] netmem: fix skb_frag_address_safe with unreadable skbs Mina Almasry
@ 2025-06-21 15:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-21 15:00 UTC (permalink / raw)
  To: Mina Almasry
  Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni, horms,
	ap420073, sdf

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 19 Jun 2025 17:52:38 +0000 you wrote:
> skb_frag_address_safe() needs a check that the
> skb_frag_page exists check similar to skb_frag_address().
> 
> Cc: ap420073@gmail.com
> 
> Signed-off-by: Mina Almasry <almasrymina@google.com>
> Acked-by: Stanislav Fomichev <sdf@fomichev.me>
> 
> [...]

Here is the summary with links:
  - [net-next,v2] netmem: fix skb_frag_address_safe with unreadable skbs
    https://git.kernel.org/netdev/net-next/c/4672aec56d2e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-06-21 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19 17:52 [PATCH net-next v2] netmem: fix skb_frag_address_safe with unreadable skbs Mina Almasry
2025-06-21 15:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).