ASoC: rt5645: Fix errorenous cleanup order
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a6ff8ddcf3f38ec84337e5e7eb3e0e9a73754cf5 · < 88c09e4812d72c3153afc8e5a45ecac2d0eae3ff| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ASoC: rt5645: Fix errorenous cleanup order
There is a logic error when removing rt5645 device as the function rt5645_i2c_remove() first cancel the &rt5645->jack_detect_work and delete the &rt5645->btn_check_timer latter. However, since the timer handler rt5645_btn_check_callback() will re-queue the jack_detect_work, this cleanup order is buggy.
That is, once the del_timer_sync in rt5645_i2c_remove is concurrently run with the rt5645_btn_check_callback, the canceled jack_detect_work will be rescheduled again, leading to possible use-after-free.
This patch fix the issue by placing the del_timer_sync function before the cancel_delayed_work_sync.
From the CVE record · Linux
The Linux kernel's ASoC rt5645 driver cancels jack-detection work before deleting a timer that can schedule that work again. If the timer callback runs concurrently with device removal, the work can be rescheduled and cause a possible use-after-free. The input does not establish how an attacker could trigger this condition or whether authentication or user interaction is required.
Engineers running Linux kernels with the ASoC rt5645 driver should check their kernel versions; affected versions were not provided.