Bug 1227885 (CVE-2024-40965)

Summary: VUL-0: CVE-2024-40965: kernel: i2c: lpi2c: Avoid calling clk_get_rate during transfer
Product: [Novell Products] SUSE Security Incidents Reporter: SMASH SMASH <smash_bz>
Component: IncidentsAssignee: Kernel Bugs <kernel-bugs>
Status: NEW --- QA Contact: Security Team bot <security-team>
Severity: Normal    
Priority: P3 - Medium CC: andrea.mattiazzo
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://smash.suse.de/issue/413892/
Whiteboard: CVSSv3.1:SUSE:CVE-2024-40965:4.7:(AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H)
Found By: Security Response Team Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description SMASH SMASH 2024-07-16 07:49:37 UTC
In the Linux kernel, the following vulnerability has been resolved:

i2c: lpi2c: Avoid calling clk_get_rate during transfer

Instead of repeatedly calling clk_get_rate for each transfer, lock
the clock rate and cache the value.
A deadlock has been observed while adding tlv320aic32x4 audio codec to
the system. When this clock provider adds its clock, the clk mutex is
locked already, it needs to access i2c, which in return needs the mutex
for clk_get_rate as well.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2024-40965
https://www.cve.org/CVERecord?id=CVE-2024-40965
https://git.kernel.org/stable/c/2b42e9587a7a9c7b824e0feb92958f258263963e
https://git.kernel.org/stable/c/4268254a39484fc11ba991ae148bacbe75d9cc0a
https://git.kernel.org/pub/scm/linux/security/vulns.git/plain/cve/published/2024/CVE-2024-40965.mbox