From: Fushuai Wang <hidden> Date: 2025-06-24 14:43:14
When xdp_rxq_info_reg_mem_model() fails after a successful
xdp_rxq_info_reg(), the kernel may leaks the registered RXQ
info structure. Fix this by calling xdp_rxq_info_unreg() in
the error path, ensuring proper cleanup when memory model
registration fails.
Fixes: d678be1dc1ec ("dpaa2-eth: add XDP_REDIRECT support")
Signed-off-by: Fushuai Wang <redacted>
---
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 1 +
1 file changed, 1 insertion(+)
From: Simon Horman <horms@kernel.org> Date: 2025-06-25 10:43:43
On Tue, Jun 24, 2025 at 10:42:35PM +0800, Fushuai Wang wrote:
When xdp_rxq_info_reg_mem_model() fails after a successful
xdp_rxq_info_reg(), the kernel may leaks the registered RXQ
info structure. Fix this by calling xdp_rxq_info_unreg() in
the error path, ensuring proper cleanup when memory model
registration fails.
Fixes: d678be1dc1ec ("dpaa2-eth: add XDP_REDIRECT support")
Signed-off-by: Fushuai Wang <redacted>
Thanks, I agree this is needed.
Reviewed-by: Simon Horman <horms@kernel.org>
But I wonder how these resources are released in the following cases:
* Error in dpaa2_eth_bind_dpni() after at least one
successful call to dpaa2_eth_setup_rx_flow()
* Error in dpaa2_eth_probe() after a successful call to
dpaa2_eth_bind_dpni()
* Driver removal (dpaa2_eth_remove())
From: Fushuai Wang <hidden> Date: 2025-06-25 12:56:28
quoted
When xdp_rxq_info_reg_mem_model() fails after a successful
xdp_rxq_info_reg(), the kernel may leaks the registered RXQ
info structure. Fix this by calling xdp_rxq_info_unreg() in
the error path, ensuring proper cleanup when memory model
registration fails.
Fixes: d678be1dc1ec ("dpaa2-eth: add XDP_REDIRECT support")
Signed-off-by: Fushuai Wang <redacted>
Thanks, I agree this is needed.
Reviewed-by: Simon Horman <horms@kernel.org>
But I wonder how these resources are released in the following cases:
* Error in dpaa2_eth_bind_dpni() after at least one
successful call to dpaa2_eth_setup_rx_flow()
* Error in dpaa2_eth_probe() after a successful call to
dpaa2_eth_bind_dpni()
* Driver removal (dpaa2_eth_remove())
Hi, Simon
I think these paths also leak xdp_rxq_info.
I'll add cleanup for them and send v2 shortly.
--
Regards,
Wang
From: Simon Horman <horms@kernel.org> Date: 2025-06-25 17:00:05
On Wed, Jun 25, 2025 at 08:55:47PM +0800, Fushuai Wang wrote:
quoted
quoted
When xdp_rxq_info_reg_mem_model() fails after a successful
xdp_rxq_info_reg(), the kernel may leaks the registered RXQ
info structure. Fix this by calling xdp_rxq_info_unreg() in
the error path, ensuring proper cleanup when memory model
registration fails.
Fixes: d678be1dc1ec ("dpaa2-eth: add XDP_REDIRECT support")
Signed-off-by: Fushuai Wang <redacted>
Thanks, I agree this is needed.
Reviewed-by: Simon Horman <horms@kernel.org>
But I wonder how these resources are released in the following cases:
* Error in dpaa2_eth_bind_dpni() after at least one
successful call to dpaa2_eth_setup_rx_flow()
* Error in dpaa2_eth_probe() after a successful call to
dpaa2_eth_bind_dpni()
* Driver removal (dpaa2_eth_remove())
Hi, Simon
I think these paths also leak xdp_rxq_info.
I'll add cleanup for them and send v2 shortly.