netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: restore napi_consume_skb()'s NULL-handling
@ 2025-11-27  1:43 Jakub Kicinski
  2025-11-27 16:10 ` Eric Dumazet
  2025-11-28  2:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2025-11-27  1:43 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, andrew+netdev, horms, Jakub Kicinski

Commit e20dfbad8aab ("net: fix napi_consume_skb() with alien skbs")
added a skb->cpu check to napi_consume_skb(), before the point where
napi_consume_skb() validated skb is not NULL.

Add an explicit check to the early exit condition.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
AI code review reported this on my bnxt patch..
---
 net/core/skbuff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 5a1d123e7ef7..a00808f7be6a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1490,7 +1490,7 @@ void napi_skb_free_stolen_head(struct sk_buff *skb)
 void napi_consume_skb(struct sk_buff *skb, int budget)
 {
 	/* Zero budget indicate non-NAPI context called us, like netpoll */
-	if (unlikely(!budget)) {
+	if (unlikely(!budget || !skb)) {
 		dev_consume_skb_any(skb);
 		return;
 	}
-- 
2.51.1


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

* Re: [PATCH net-next] net: restore napi_consume_skb()'s NULL-handling
  2025-11-27  1:43 [PATCH net-next] net: restore napi_consume_skb()'s NULL-handling Jakub Kicinski
@ 2025-11-27 16:10 ` Eric Dumazet
  2025-11-28  2:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2025-11-27 16:10 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, pabeni, andrew+netdev, horms

On Wed, Nov 26, 2025 at 5:43 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> Commit e20dfbad8aab ("net: fix napi_consume_skb() with alien skbs")
> added a skb->cpu check to napi_consume_skb(), before the point where
> napi_consume_skb() validated skb is not NULL.
>
> Add an explicit check to the early exit condition.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Eric Dumazet <edumazet@google.com>

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

* Re: [PATCH net-next] net: restore napi_consume_skb()'s NULL-handling
  2025-11-27  1:43 [PATCH net-next] net: restore napi_consume_skb()'s NULL-handling Jakub Kicinski
  2025-11-27 16:10 ` Eric Dumazet
@ 2025-11-28  2:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-28  2:20 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms

Hello:

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

On Wed, 26 Nov 2025 17:43:11 -0800 you wrote:
> Commit e20dfbad8aab ("net: fix napi_consume_skb() with alien skbs")
> added a skb->cpu check to napi_consume_skb(), before the point where
> napi_consume_skb() validated skb is not NULL.
> 
> Add an explicit check to the early exit condition.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net-next] net: restore napi_consume_skb()'s NULL-handling
    https://git.kernel.org/netdev/net-next/c/4c03592689bc

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] 3+ messages in thread

end of thread, other threads:[~2025-11-28  2:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-27  1:43 [PATCH net-next] net: restore napi_consume_skb()'s NULL-handling Jakub Kicinski
2025-11-27 16:10 ` Eric Dumazet
2025-11-28  2:20 ` 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).