Skip to contentSkip to conversation

eth: fbnic: unlink NAPIs from queues on error to open

PATCH Applied Jakub Kicinski 3 participants 3 messages Jul 28, 2025 – Aug 5, 2025

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 eth: fbnic: unlink NAPIs from queues on error to open

CI hit a UaF in fbnic in the AF_XDP portion of the queues.py test. The UaF is in the __sk_mark_napi_id_once() call in xsk_bind(), NAPI has been freed. Looks like the device failed to open earlier, and we lack clearing the NAPI pointer from the queue.

Fixes 557d02238e05 ("eth: fbnic: centralize the queue count and NAPI<>queue setting")

---
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 drivers/net/ethernet/meta/fbnic/fbnic_netdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c +3 -1
index 7bd7812d9c06..04bb6e7147a2 100644
@@ -33,7 +33,7 @@ int __fbnic_open(struct fbnic_net *fbn)
 		dev_warn(fbd->dev,
 			 "Error %d sending host ownership message to the firmware\n",
 			 err);
-		goto free_resources;
+		goto err_reset_queues;
 	}
 
 	err = fbnic_time_start(fbn);
@@ -57,6 +57,8 @@ int __fbnic_open(struct fbnic_net *fbn)
 	fbnic_time_stop(fbn);
 release_ownership:
 	fbnic_fw_xmit_ownership_msg(fbn->fbd, false);
+err_reset_queues:
+	fbnic_reset_netif_queues(fbn);
 free_resources:
 	fbnic_free_resources(fbn);
 free_napi_vectors:
Signature · 1 line
2.50.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jakub Kicinski

CI hit a UaF in fbnic in the AF_XDP portion of the queues.py test. The UaF is in the __sk_mark_napi_id_once() call in xsk_bind(), NAPI has been freed. Looks like the device failed to open earlier, and we lack clearing the NAPI pointer from the queue.

Fixes 557d02238e05 ("eth: fbnic: centralize the queue count and NAPI<>queue setting")

Thanks,

I agree that the cited commit should have updated the unwind path as per this patch.

#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Mon, 28 Jul 2025 09:31:29 -0700 you wrote:

CI hit a UaF in fbnic in the AF_XDP portion of the queues.py test. The UaF is in the __sk_mark_napi_id_once() call in xsk_bind(), NAPI has been freed. Looks like the device failed to open earlier, and we lack clearing the NAPI pointer from the queue.

Fixes 557d02238e05 ("eth: fbnic: centralize the queue count and NAPI<>queue setting")

[...]

Here is the summary with links:
- [net] eth: fbnic: unlink NAPIs from queues on error to open

    https://git.kernel.org/netdev/net/c/4b31bcb025cb

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html