Bug 8148 (CVE-2024-23196) - sound/hda的snd_hdac_regmap_sync函数存在竞争条件
Summary: sound/hda的snd_hdac_regmap_sync函数存在竞争条件
Status: NEW
Alias: CVE-2024-23196
Product: ANCK 5.10 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: 5.10.y-16
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: GuixinLiu
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-01 17:08 UTC by Shiloong
Modified: 2024-03-06 09:49 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shiloong admin 2024-02-01 17:08:00 UTC
上报人信息:
  - 白家驹 <baijiaju@buaa.edu.cn>
  - 北京航空航天大学网络空间安全学院

	
成因:
在snd_hdac_regmap_sync函数中,检查codec->regmap指针非空后在regcache_sync中进行了解引用,但检查codec->regmap指针非空并没有包含在解引用的mutex lock临界区内,codec->regmap在检查后仍有可能被其他线程的snd_hdac_regmap_exit等函数置空,从而触发空指针解引用,此bug是一个典型的原子性违反。

	
危害:
该模块被编译进内核里,发生空指针解引用会导致kernel panic并挂起系统,可以用于拒绝服务攻击。


修复缓解:
   -  将snd_hdac_regmap_sync函数的临界区扩大到判断指针非空外,防止codec->regmap在检查非空后被赋空。

补丁已提交给Linux Kernel并被接收,补丁链接:https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=1f4a08fed450db87fbb5ff5105354158bdbe1a22