🔍 CVE-2022-50144

5.5
CVSS Score
MEDIUM
2025-06-18
2026-11-05 20:17
✅ 완료

🇰🇷 한글 설명

리눅스 커널의 SoundWire 드라이버에서 바인드/언바인드 처리와 콜백 호출 방식이 잘못 설계되어 있었다. 코덱 드라이버를 제거한 뒤에도 콜백이 호출되어 NULL 포인터 역참조나 페이지 폴트로 커널 오ops가 발생할 수 있었다. 이를 해결하기 위해 sdw_dev_lock 뮤텍스를 도입하고 probe 완료 기반 로직을 제거했다.

💡 쉬운 설명

오디오 장치의 드라이버를 제거했다가 다시 붙이는 과정에서 커널이 이미 지워진 정보를 참조해 시스템이 멈추거나 비정상 종료될 수 있는 문제입니다. 제거된 드라이버의 콜백이 실행되지 않도록 동기화가 추가되었습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: soundwire: revisit driver bind/unbind and callbacks In the SoundWire probe, we store a pointer from the driver ops into the 'slave' structure. This can lead to kernel oopses when unbinding codec drivers, e.g. with the following sequence to remove machine driver and codec driver. /sbin/modprobe -r snd_soc_sof_sdw /sbin/modprobe -r snd_soc_rt711 The full details can be found in the BugLink below, for reference the two following examples show different cases of driver ops/callbacks being invoked after the driver .remove(). kernel: BUG: kernel NULL pointer dereference, address: 0000000000000150 kernel: Workqueue: events cdns_update_slave_status_work [soundwire_cadence] kernel: RIP: 0010:mutex_lock+0x19/0x30 kernel: Call Trace: kernel: ? sdw_handle_slave_status+0x426/0xe00 [soundwire_bus 94ff184bf398570c3f8ff7efe9e32529f532e4ae] kernel: ? newidle_balance+0x26a/0x400 kernel: ? cdns_update_slave_status_work+0x1e9/0x200 [soundwire_cadence 1bcf98eebe5ba9833cd433323769ac923c9c6f82] kernel: BUG: unable to handle page fault for address: ffffffffc07654c8 kernel: Workqueue: pm pm_runtime_work kernel: RIP: 0010:sdw_bus_prep_clk_stop+0x6f/0x160 [soundwire_bus] kernel: Call Trace: kernel: <TASK> kernel: sdw_cdns_clock_stop+0xb5/0x1b0 [soundwire_cadence 1bcf98eebe5ba9833cd433323769ac923c9c6f82] kernel: intel_suspend_runtime+0x5f/0x120 [soundwire_intel aca858f7c87048d3152a4a41bb68abb9b663a1dd] kernel: ? dpm_sysfs_remove+0x60/0x60 This was not detected earlier in Intel tests since the tests first remove the parent PCI device and shut down the bus. The sequence above is a corner case which keeps the bus operational but without a driver bound. While trying to solve this kernel oopses, it became clear that the existing SoundWire bus does not deal well with the unbind case. Commit 528be501b7d4a ("soundwire: sdw_slave: add probe_complete structure and new fields") added a 'probed' status variable and a 'probe_complete' struct completion. This status is however not reset on remove and likewise the 'probe complete' is not re-initialized, so the bind/unbind/bind test cases would fail. The timeout used before the 'update_status' callback was also a bad idea in hindsight, there should really be no timing assumption as to if and when a driver is bound to a device. An initial draft was based on device_lock() and device_unlock() was tested. This proved too complicated, with deadlocks created during the suspend-resume sequences, which also use the same device_lock/unlock() as the bind/unbind sequences. On a CometLake device, a bad DSDT/BIOS caused spurious resumes and the use of device_lock() caused hangs during suspend. After multiple weeks or testing and painful reverse-engineering of deadlocks on different devices, we looked for alternatives that did not interfere with the device core. A bus notifier was used successfully to keep track of DRIVER_BOUND and DRIVER_UNBIND events. This solved the bind-unbind-bind case in tests, but it can still be defeated with a theoretical corner case where the memory is freed by a .remove while the callback is in use. The notifier only helps make sure the driver callbacks are valid, but not that the memory allocated in probe remains valid while the callbacks are invoked. This patch suggests the introduction of a new 'sdw_dev_lock' mutex protecting probe/remove and all driver callbacks. Since this mutex is 'local' to SoundWire only, it does not interfere with existing locks and does not create deadlocks. In addition, this patch removes the 'probe_complete' completion, instead we directly invoke the 'update_status' from the probe routine. That removes any sort of timing dependency and a much better support for the device/driver model, the driver could be bound before the bus started, or eons after the bus started and the hardware would be properly initialized in all cases. BugLink: https://github.com/thesofproject/linux/is ---truncated---

📍 영향받는 시스템

SoundWire 버스 드라이버를 사용하는 수정 이전의 Linux 커널 버전 (Intel SoundWire 기반 오디오 시스템)

⚔️ 공격 벡터

로컬 권한이 있는 사용자가 드라이버 모듈을 제거·재로딩하는 과정에서 발생하는 경쟁 상태 및 커널 오류를 유발하는 방식으로, 주로 서비스 거부(시스템 중단)에 해당합니다.

🛡️ 대응 방법

커널을 CVE-2022-50144 수정이 포함된 최신 안정 버전으로 업데이트하고 재부팅합니다.

🔧 검증 코드

출력된 커널 버전이 배포판의 CVE-2022-50144 수정 패치 포함 버전(벤더 보안 공지 기준)보다 새로우면 패치된 것이고, 이전 버전이면 업데이트가 필요합니다.

Shell / Script
uname -r && (dpkg -l linux-image-$(uname -r) 2>/dev/null || rpm -q kernel 2>/dev/null)

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

💻 영향받는 소프트웨어

Linux Kernel