linux-kernelorg-stable/drivers/net/ethernet/airoha
Alok Tiwari 3cd582e7d0 net: airoha: fix potential use-after-free in airoha_npu_get()
np->name was being used after calling of_node_put(np), which
releases the node and can lead to a use-after-free bug.
Previously, of_node_put(np) was called unconditionally after
of_find_device_by_node(np), which could result in a use-after-free if
pdev is NULL.

This patch moves of_node_put(np) after the error check to ensure
the node is only released after both the error and success cases
are handled appropriately, preventing potential resource issues.

Fixes: 23290c7bc1 ("net: airoha: Introduce Airoha NPU support")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250715143102.3458286-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-16 16:15:09 -07:00
..
Kconfig net: airoha: Add FLOW_CLS_STATS callback support 2025-05-20 20:00:51 -07:00
Makefile net: airoha: Introduce PPE debugfs support 2025-03-04 13:22:10 +01:00
airoha_eth.c net: airoha: Fix an error handling path in airoha_probe() 2025-07-08 08:59:24 -07:00
airoha_eth.h net: airoha: Initialize PPE UPDMEM source-mac table 2025-06-03 12:55:29 +02:00
airoha_npu.c net: airoha: fix potential use-after-free in airoha_npu_get() 2025-07-16 16:15:09 -07:00
airoha_npu.h net: airoha: Add FLOW_CLS_STATS callback support 2025-05-20 20:00:51 -07:00
airoha_ppe.c net: airoha: Always check return value from airoha_ppe_foe_get_entry() 2025-06-19 08:34:13 -07:00
airoha_ppe_debugfs.c net: airoha: Add FLOW_CLS_STATS callback support 2025-05-20 20:00:51 -07:00
airoha_regs.h net: airoha: Enable RX queues 16-31 2025-06-10 17:58:26 -07:00