Commit c5e42b7
committed
mei: bus: Check for still connected devices in mei_cl_bus_dev_release()
JIRA: https://issues.redhat.com/browse/RHEL-113185
commit 35e8a42
Author: Hans de Goede <hansg@kernel.org>
Date: Mon Jun 23 10:50:52 2025 +0200
mei: bus: Check for still connected devices in mei_cl_bus_dev_release()
mei_cl_bus_dev_release() also frees the mei-client (struct mei_cl)
belonging to the device being released.
If there are bugs like the just fixed bug in the ACE/CSI2 mei drivers,
the mei-client being freed might still be part of the mei_device's
file_list and iterating over this list after the freeing will then trigger
a use-afer-free bug.
Add a check to mei_cl_bus_dev_release() to make sure that the to-be-freed
mei-client is not on the mei_device's file_list.
Signed-off-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250623085052.12347-11-hansg@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steve Best <sbest@redhat.com>1 parent 241eeac commit c5e42b7
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1300 | 1300 | | |
1301 | 1301 | | |
1302 | 1302 | | |
| 1303 | + | |
| 1304 | + | |
1303 | 1305 | | |
1304 | 1306 | | |
1305 | 1307 | | |
1306 | 1308 | | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
1307 | 1313 | | |
1308 | 1314 | | |
1309 | 1315 | | |
| |||
0 commit comments