* [PATCH net v2] gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO
@ 2025-06-02 10:34 Alok Tiwari
2025-06-03 8:25 ` Simon Horman
2025-06-04 11:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Alok Tiwari @ 2025-06-02 10:34 UTC (permalink / raw)
To: almasrymina, bcf, joshwash, willemb, pkaligineedi, pabeni, kuba,
jeroendb, hramamurthy, andrew+netdev, davem, edumazet, netdev
Cc: alok.a.tiwari, linux-kernel, darren.kenny
gve_alloc_pending_packet() can return NULL, but gve_tx_add_skb_dqo()
did not check for this case before dereferencing the returned pointer.
Add a missing NULL check to prevent a potential NULL pointer
dereference when allocation fails.
This improves robustness in low-memory scenarios.
Fixes: a57e5de476be ("gve: DQO: Add TX path")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Mina Almasry <almasrymina@google.com>
---
v1->v2
added Fixes tag and [PATCH net v2]
---
drivers/net/ethernet/google/gve/gve_tx_dqo.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/google/gve/gve_tx_dqo.c b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
index a27f1574a733..9d705d94b065 100644
--- a/drivers/net/ethernet/google/gve/gve_tx_dqo.c
+++ b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
@@ -764,6 +764,9 @@ static int gve_tx_add_skb_dqo(struct gve_tx_ring *tx,
s16 completion_tag;
pkt = gve_alloc_pending_packet(tx);
+ if (!pkt)
+ return -ENOMEM;
+
pkt->skb = skb;
completion_tag = pkt - tx->dqo.pending_packets;
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO
2025-06-02 10:34 [PATCH net v2] gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO Alok Tiwari
@ 2025-06-03 8:25 ` Simon Horman
2025-06-04 11:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-06-03 8:25 UTC (permalink / raw)
To: Alok Tiwari
Cc: almasrymina, bcf, joshwash, willemb, pkaligineedi, pabeni, kuba,
jeroendb, hramamurthy, andrew+netdev, davem, edumazet, netdev,
linux-kernel, darren.kenny
On Mon, Jun 02, 2025 at 03:34:29AM -0700, Alok Tiwari wrote:
> gve_alloc_pending_packet() can return NULL, but gve_tx_add_skb_dqo()
> did not check for this case before dereferencing the returned pointer.
>
> Add a missing NULL check to prevent a potential NULL pointer
> dereference when allocation fails.
>
> This improves robustness in low-memory scenarios.
>
> Fixes: a57e5de476be ("gve: DQO: Add TX path")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> Reviewed-by: Mina Almasry <almasrymina@google.com>
> ---
> v1->v2
> added Fixes tag and [PATCH net v2]
This patch is marked as Rejected in patchwork, but it's unclear to me why.
The patch does look good to me, there was positive review to v1 which
is addressed in v2, and i see no prior comment on v2. I'm updating it's
status accordingly. Apologies if I missed something.
Reviewed-by: Simon Horman <horms@kernel.org>
--
pw-bot: under-review
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO
2025-06-02 10:34 [PATCH net v2] gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO Alok Tiwari
2025-06-03 8:25 ` Simon Horman
@ 2025-06-04 11:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-04 11:40 UTC (permalink / raw)
To: ALOK TIWARI
Cc: almasrymina, bcf, joshwash, willemb, pkaligineedi, pabeni, kuba,
jeroendb, hramamurthy, andrew+netdev, davem, edumazet, netdev,
linux-kernel, darren.kenny
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Mon, 2 Jun 2025 03:34:29 -0700 you wrote:
> gve_alloc_pending_packet() can return NULL, but gve_tx_add_skb_dqo()
> did not check for this case before dereferencing the returned pointer.
>
> Add a missing NULL check to prevent a potential NULL pointer
> dereference when allocation fails.
>
> This improves robustness in low-memory scenarios.
>
> [...]
Here is the summary with links:
- [net,v2] gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO
https://git.kernel.org/netdev/net/c/12c331b29c73
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-06-04 11:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-02 10:34 [PATCH net v2] gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO Alok Tiwari
2025-06-03 8:25 ` Simon Horman
2025-06-04 11:40 ` 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).