7.8high
ASoC: rt5645: Fix errorenous cleanup order
- Severity
- 7.8high CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.27% (higher than 20% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from a6ff8ddcf3f38ec84337e5e7eb3e0e9a73754cf5 before 236d29c5857f02e0a53fdf15d3dce1536c4322ce, from a6ff8ddcf3f38ec84337e5e7eb3e0e9a73754cf5 before 0941150100173d4eaf3fe08ff4b16740e7c3026f, from a6ff8ddcf3f38ec84337e5e7eb3e0e9a73754cf5 before abe7554da62cb489712a54de69ef5665c250e564, from a6ff8ddcf3f38ec84337e5e7eb3e0e9a73754cf5 before 1a5a3dfd9f172dcb115072f0aea5e27d3083c20e, from a6ff8ddcf3f38ec84337e5e7eb3e0e9a73754cf5 before 061a6159cea583f1155f67d1915917a6b9282662, from a6ff8ddcf3f38ec84337e5e7eb3e0e9a73754cf5 before 88c09e4812d72c3153afc8e5a45ecac2d0eae3ff, from a6ff8ddcf3f38ec84337e5e7eb3e0e9a73754cf5 before 453f0920ffc1a28e28ddb9c3cd5562472b2895b0, from a6ff8ddcf3f38ec84337e5e7eb3e0e9a73754cf5 before 2def44d3aec59e38d2701c568d65540783f90f2f and 1 more Not affected: before 4.13, from 4.14.283 up to 4.14.*, from 4.19.247 up to 4.19.*, from 5.4.198 up to 5.4.*, from 5.10.121 up to 5.10.*, from 5.15.46 up to 5.15.* | CVE List |
| linux linux_kernel | before 4.9.318, from 4.10 before 4.14.283, from 4.15 before 4.19.247, from 4.20 before 5.4.198, from 5.5 before 5.10.121, from 5.11 before 5.15.46, from 5.16 before 5.17.14, from 5.18 before 5.18.3 | NVD |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ASoC: rt5645: Se corrige el orden de depuración erróneo Hay un error lógico al eliminar el dispositivo rt5645, ya que la función rt5645_i2c_remove() primero cancela &rt5645->jack_detect_work y elimina &rt5645->btn_check_timer después. Sin embargo, dado que el controlador del temporizador rt5645_btn_check_callback() volverá a poner en cola jack_detect_work, este orden de limpieza tiene errores. Es decir, una vez que del_timer_sync en rt5645_i2c_remove se ejecuta simultáneamente con rt5645_btn_check_callback, el jack_detect_work cancelado se reprogramará nuevamente, lo que provocará un posible use-after-free. Este parche soluciona el problema colocando la función del_timer_sync antes de cancel_delayed_work_sync.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-49493 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2022-49493 changed 2026-06-17 | Public domain |