diff options
| author | Donggeun Yoo <donggeunyoo.kernel@gmail.com> | 2026-10-03 19:22:21 +0900 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2026-10-05 18:20:14 -0500 |
| commit | 624ee129620a054466b6a29d98cd7a40ccc239cd (patch) | |
| tree | f6d0f59fbfa28f202637ee0edab3b990a4eb6110 /tools/perf/scripts/python/net_dropmonitor.py | |
| parent | cee9395acd8043be0644b25c34bfa86623f2b935 (diff) | |
PCI/DOE: Fix double free of a duplicate feature's sysfs name
When a DOE feature is reported twice, sysfs_add_file_to_group() fails
with -EEXIST for the second copy and pci_doe_sysfs_feature_populate()
frees that attribute's name, but leaves the pointer in place.
pci_doe_sysfs_feature_remove() frees every name again when the device
is removed, or when a later feature fails to register, so the name is
freed twice:
BUG: KASAN: double-free in pci_doe_sysfs_feature_remove+0x117/0x1b0
Call Trace:
kfree+0x11a/0x420
pci_doe_sysfs_feature_remove+0x117/0x1b0
pci_doe_sysfs_teardown+0x90/0xf0
pci_remove_bus_device+0x128/0x2e0
pci_stop_and_remove_bus_device_locked+0x1d/0x30
remove_store+0xd2/0xf0
Clear the pointer after freeing the name.
Fixes: 2311ab1820fe ("PCI/DOE: Expose DOE features via sysfs")
Suggested-by: Alistair Francis <alistair@alistair23.me>
Assisted-by: LLM
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261003102221.59894-1-donggeunyoo.kernel@gmail.com
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions
