[PATCH net] eth: fbnic: Fix payload page pool error cleanup

Björn Töpel posted 1 patch 1 week, 2 days ago
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH net] eth: fbnic: Fix payload page pool error cleanup
Posted by Björn Töpel 1 week, 2 days ago
The payload page pool pointer contains an error pointer when its
allocation fails. The cleanup path passes that error pointer to
page_pool_destroy() instead of destroying the header page pool. This
can dereference the error pointer and leave the header page pool
allocated.

Destroy the header page pool instead.

Fixes: 8a11010fdd96 ("eth: fbnic: allocate unreadable page pool for the payloads")
Reported-by: Sashiko <netdev-bot+sashiko@kernel.org>
Link: https://lore.kernel.org/netdev/178915061000.219967.7726187707862333281@kernel.org/
Signed-off-by: Björn Töpel <bjorn@kernel.org>
---
 drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
index 401f8b8ae1ca..528d72071aff 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
@@ -1599,7 +1599,7 @@ fbnic_alloc_qt_page_pools(struct fbnic_net *fbn, struct fbnic_q_triad *qt,
 	return 0;
 
 err_destroy_sub0:
-	page_pool_destroy(pp);
+	page_pool_destroy(qt->sub0.page_pool);
 	return PTR_ERR(pp);
 }
 

base-commit: 18a6fe05fb6e18de29fa90d388bb34044114b3d8
-- 
2.55.0

Re: [PATCH net] eth: fbnic: Fix payload page pool error cleanup
Posted by Simon Horman 1 week, 1 day ago
On Tue, Sep 15, 2026 at 12:49:15PM +0200, Björn Töpel wrote:
> The payload page pool pointer contains an error pointer when its
> allocation fails. The cleanup path passes that error pointer to
> page_pool_destroy() instead of destroying the header page pool. This
> can dereference the error pointer and leave the header page pool
> allocated.
> 
> Destroy the header page pool instead.
> 
> Fixes: 8a11010fdd96 ("eth: fbnic: allocate unreadable page pool for the payloads")
> Reported-by: Sashiko <netdev-bot+sashiko@kernel.org>
> Link: https://lore.kernel.org/netdev/178915061000.219967.7726187707862333281@kernel.org/
> Signed-off-by: Björn Töpel <bjorn@kernel.org>

Reviewed-by: Simon Horman <horms@kernel.org>