linux/drivers/net/ethernet/amd/pds_core
Shannon Nelson dfd76010f8 pds_core: remove write-after-free of client_id
A use-after-free error popped up in stress testing:

[Mon Apr 21 21:21:33 2025] BUG: KFENCE: use-after-free write in pdsc_auxbus_dev_del+0xef/0x160 [pds_core]
[Mon Apr 21 21:21:33 2025] Use-after-free write at 0x000000007013ecd1 (in kfence-#47):
[Mon Apr 21 21:21:33 2025]  pdsc_auxbus_dev_del+0xef/0x160 [pds_core]
[Mon Apr 21 21:21:33 2025]  pdsc_remove+0xc0/0x1b0 [pds_core]
[Mon Apr 21 21:21:33 2025]  pci_device_remove+0x24/0x70
[Mon Apr 21 21:21:33 2025]  device_release_driver_internal+0x11f/0x180
[Mon Apr 21 21:21:33 2025]  driver_detach+0x45/0x80
[Mon Apr 21 21:21:33 2025]  bus_remove_driver+0x83/0xe0
[Mon Apr 21 21:21:33 2025]  pci_unregister_driver+0x1a/0x80

The actual device uninit usually happens on a separate thread
scheduled after this code runs, but there is no guarantee of order
of thread execution, so this could be a problem.  There's no
actual need to clear the client_id at this point, so simply
remove the offending code.

Fixes: 10659034c6 ("pds_core: add the aux client API")
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250425203857.71547-1-shannon.nelson@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-28 15:54:30 -07:00
..
Makefile pds_core: remove CONFIG_DEBUG_FS from makefile 2023-05-03 09:15:50 +01:00
adminq.c pds_core: make wait_context part of q_info 2025-04-23 18:50:17 -07:00
auxbus.c pds_core: remove write-after-free of client_id 2025-04-28 15:54:30 -07:00
core.c pds_core: make wait_context part of q_info 2025-04-23 18:50:17 -07:00
core.h pds_core: make wait_context part of q_info 2025-04-23 18:50:17 -07:00
debugfs.c pds_core: fix memory leak in pdsc_debugfs_add_qcq() 2025-04-11 18:33:22 -07:00
dev.c pds_core: Fix pdsc_check_pci_health function to use work thread 2024-04-10 08:30:10 +01:00
devlink.c pds_core: handle unsupported PDS_CORE_CMD_FW_CONTROL result 2025-04-23 18:50:17 -07:00
fw.c pds_core: Clear BARs on reset 2024-01-31 18:26:59 -08:00
main.c pds_core: add new fwctl auxiliary_device 2025-03-20 20:03:29 -03:00