CVE-2022-49493

ASoC: rt5645: Fix errorenous cleanup order

High · published February 26, 2025

CVSS v3.1
7.8
EPSS
0%
Percentile
18.0
In the wild
Unconfirmed
What it is

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.

The record
Technical detail
CVSS v3.1
7.8 · HIGH
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00268 · 18.0th percentile
Published
2025-02-26T02:13Z
EPSS history
Timeline
  • 26 FEB 02:13Z
    ASoC: rt5645: Fix errorenous cleanup order
    cvelistv5