]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
gve: Clear napi->skb before dev_kfree_skb_any()
authorZiwei Xiao <ziweixiao@google.com>
Wed, 12 Jun 2024 00:16:54 +0000 (00:16 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 13 Jun 2024 14:37:35 +0000 (07:37 -0700)
commit6f4d93b78ade0a4c2cafd587f7b429ce95abb02e
treeeaf1eeac3b91df556b34ae9d7b61dd8a538be187
parent79f18a41dd056115d685f3b0a419c7cd40055e13
gve: Clear napi->skb before dev_kfree_skb_any()

gve_rx_free_skb incorrectly leaves napi->skb referencing an skb after it
is freed with dev_kfree_skb_any(). This can result in a subsequent call
to napi_get_frags returning a dangling pointer.

Fix this by clearing napi->skb before the skb is freed.

Fixes: 9b8dd5e5ea48 ("gve: DQO: Add RX path")
Cc: stable@vger.kernel.org
Reported-by: Shailend Chand <shailend@google.com>
Signed-off-by: Ziwei Xiao <ziweixiao@google.com>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Reviewed-by: Shailend Chand <shailend@google.com>
Reviewed-by: Praveen Kaligineedi <pkaligineedi@google.com>
Link: https://lore.kernel.org/r/20240612001654.923887-1-ziweixiao@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/google/gve/gve_rx_dqo.c