CVE-2024-36003

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-36003
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-36003.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-36003
Downstream
Related
Published
2024-05-20T09:48:04Z
Modified
2025-10-17T06:10:01.451801Z
Summary
ice: fix LAG and VF lock dependency in ice_reset_vf()
Details

In the Linux kernel, the following vulnerability has been resolved:

ice: fix LAG and VF lock dependency in iceresetvf()

9f74a3dfcf83 ("ice: Fix VF Reset paths when interface in a failed over aggregate"), the ice driver has acquired the LAG mutex in iceresetvf(). The commit placed this lock acquisition just prior to the acquisition of the VF configuration lock.

If iceresetvf() acquires the configuration lock via the ICEVFRESETLOCK flag, this could deadlock with icevccfgqs_msg() because it always acquires the locks in the order of the VF configuration lock and then the LAG mutex.

Lockdep reports this violation almost immediately on creating and then removing 2 VF:

====================================================== WARNING: possible circular locking dependency detected

6.8.0-rc6 #54 Tainted: G W O

kworker/60:3/6771 is trying to acquire lock: ff40d43e099380a0 (&vf->cfglock){+.+.}-{3:3}, at: icereset_vf+0x22f/0x4d0 [ice]

but task is already holding lock: ff40d43ea1961210 (&pf->lagmutex){+.+.}-{3:3}, at: icereset_vf+0xb7/0x4d0 [ice]

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #1 (&pf->lagmutex){+.+.}-{3:3}: _lockacquire+0x4f8/0xb40 lockacquire+0xd4/0x2d0 _mutexlock+0x9b/0xbf0 icevccfgqsmsg+0x45/0x690 [ice] icevcprocessvfmsg+0x4f5/0x870 [ice] _icecleanctrlq+0x2b5/0x600 [ice] iceservicetask+0x2c9/0x480 [ice] processonework+0x1e9/0x4d0 workerthread+0x1e1/0x3d0 kthread+0x104/0x140 retfromfork+0x31/0x50 retfromfork_asm+0x1b/0x30

-> #0 (&vf->cfglock){+.+.}-{3:3}: checkprevadd+0xe2/0xc50 validatechain+0x558/0x800 _lockacquire+0x4f8/0xb40 lockacquire+0xd4/0x2d0 _mutexlock+0x9b/0xbf0 iceresetvf+0x22f/0x4d0 [ice] iceprocessvflrevent+0x98/0xd0 [ice] iceservicetask+0x1cc/0x480 [ice] processonework+0x1e9/0x4d0 workerthread+0x1e1/0x3d0 kthread+0x104/0x140 retfromfork+0x31/0x50 retfromforkasm+0x1b/0x30

other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&pf->lagmutex); lock(&vf->cfglock); lock(&pf->lagmutex); lock(&vf->cfglock);

* DEADLOCK * 4 locks held by kworker/60:3/6771: #0: ff40d43e05428b38 ((wqcompletion)ice){+.+.}-{0:0}, at: processonework+0x176/0x4d0 #1: ff50d06e05197e58 ((workcompletion)(&pf->servtask)){+.+.}-{0:0}, at: processonework+0x176/0x4d0 #2: ff40d43ea1960e50 (&pf->vfs.tablelock){+.+.}-{3:3}, at: iceprocessvflrevent+0x48/0xd0 [ice] #3: ff40d43ea1961210 (&pf->lagmutex){+.+.}-{3:3}, at: iceresetvf+0xb7/0x4d0 [ice]

stack backtrace: CPU: 60 PID: 6771 Comm: kworker/60:3 Tainted: G W O 6.8.0-rc6 #54 Hardware name: Workqueue: ice iceservicetask [ice] Call Trace: <TASK> dumpstacklvl+0x4a/0x80 checknoncircular+0x12d/0x150 checkprevadd+0xe2/0xc50 ? savetrace+0x59/0x230 ? addchaincache+0x109/0x450 validatechain+0x558/0x800 _lockacquire+0x4f8/0xb40 ? lockdephardirqson+0x7d/0x100 lockacquire+0xd4/0x2d0 ? iceresetvf+0x22f/0x4d0 [ice] ? lockisheldtype+0xc7/0x120 _mutexlock+0x9b/0xbf0 ? iceresetvf+0x22f/0x4d0 [ice] ? iceresetvf+0x22f/0x4d0 [ice] ? rcuiswatching+0x11/0x50 ? iceresetvf+0x22f/0x4d0 [ice] iceresetvf+0x22f/0x4d0 [ice] ? processonework+0x176/0x4d0 iceprocessvflrevent+0x98/0xd0 [ice] iceservicetask+0x1cc/0x480 [ice] processonework+0x1e9/0x4d0 workerthread+0x1e1/0x3d0 ? _pfxworkerthread+0x10/0x10 kthread+0x104/0x140 ? _pfxkthread+0x10/0x10 retfromfork+0x31/0x50 ? _pfxkthread+0x10/0x10 retfromfork_asm+0x1b/0x30 </TASK>

To avoid deadlock, we must acquire the LAG ---truncated---

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fd7f7a8ad3363fd94fc3868616cc70a1d8dfc01b
Fixed
740717774dc37338404d10726967d582414f638c
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9f74a3dfcf83e11aedcb98250b8040dbc6d9659a
Fixed
de8631d8c9df08440268630200e64b623a5f69e6
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9f74a3dfcf83e11aedcb98250b8040dbc6d9659a
Fixed
96fdd1f6b4ed72a741fb0eb705c0e13049b8721f

Affected versions

v6.*

v6.6.10
v6.6.11
v6.6.12
v6.6.13
v6.6.14
v6.6.15
v6.6.16
v6.6.17
v6.6.18
v6.6.19
v6.6.20
v6.6.21
v6.6.22
v6.6.23
v6.6.24
v6.6.25
v6.6.26
v6.6.27
v6.6.28
v6.6.29
v6.6.5
v6.6.6
v6.6.7
v6.6.8
v6.6.9
v6.7
v6.7-rc3
v6.7-rc4
v6.7-rc5
v6.7-rc6
v6.7-rc7
v6.7-rc8
v6.8
v6.8-rc1
v6.8-rc2
v6.8-rc3
v6.8-rc4
v6.8-rc5
v6.8-rc6
v6.8-rc7
v6.8.1
v6.8.2
v6.8.3
v6.8.4
v6.8.5
v6.8.6
v6.8.7
v6.8.8
v6.9-rc1
v6.9-rc2
v6.9-rc3
v6.9-rc4

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.6.30
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.8.9