media: venus: fix use after free bug in venus_remove due to race condition
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ af2c3834c8ca7cc65d15592ac671933df8848115 · < b0686aedc5f1343442d044bd64eeac7e7a391f4e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
media: venus: fix use after free bug in venus_remove due to race condition
in venus_probe, core->work is bound with venus_sys_error_handler, which is used to handle error. The code use core->sys_err_done to make sync work. The core->work is started in venus_event_notify.
If we call venus_remove, there might be an unfished work. The possible sequence is as follows:
CPU0 CPU1
|venus_sys_error_handler venus_remove | hfi_destroy | venus_hfi_destroy | kfree(hdev); | |hfi_reinit |venus_hfi_queues_reinit |//use hdev
Fix it by canceling the work in venus_remove.
From the CVE record · Linux
A race in the Linux kernel’s Venus media driver can cause a use-after-free when the driver is removed while error-handling work is still pending. The input does not specify how an attacker could trigger the race or whether local access, authentication, or user interaction is required.
Engineers running Linux kernels with the Venus media driver should check whether their kernel includes the fix; affected versions are not specified.