cbcvebase.
CVE-2023-52587
published 2024-03-06

CVE-2023-52587: In the Linux kernel, the following vulnerability has been resolved: IB/ipoib: Fix mcast list locking Releasing the `priv->lock` while iterating the…

PriorityP420medium5.5CVSS 3.1
AVLACLPRLUINSUCNINAH
EPSS
0.31%
23.3th percentile
In the Linux kernel, the following vulnerability has been resolved: IB/ipoib: Fix mcast list locking Releasing the `priv->lock` while iterating the `priv->multicast_list` in `ipoib_mcast_join_task()` opens a window for `ipoib_mcast_dev_flush()` to remove the items while in the middle of iteration. If the mcast is removed while the lock was dropped, the for loop spins forever resulting in a hard lockup (as was reported on RHEL 4.18.0-372.75.1.el8_6 kernel): Task A (kworker/u72:2 below) | Task B (kworker/u72:0 below) -----------------------------------+----------------------------------- ipoib_mcast_join_task(work) | ipoib_ib_dev_flush_light(work) spin_lock_irq(&priv->lock) | __ipoib_ib_dev_flush(priv, ...) list_for_each_entry(mcast, | ipoib_mcast_dev_flush(dev = priv->dev) &priv->multicast_list, list) | ipoib_mcast_join(dev, mcast) | spin_unlock_irq(&priv->lock) | | spin_lock_irqsave(&priv->lock, flags) | list_for_each_entry_safe(mcast, tmcast, | &priv->multicast_list, list) | list_del(&mcast->list); | list_add_tail(&mcast->list, &remove_list) | spin_unlock_irqrestore(&priv->lock, flags) spin_lock_irq(&priv->lock) | | ipoib_mcast_remove_list(&remove_list) (Here, `mcast` is no longer on the | list_for_each_entry_safe(mcast, tmcast, `priv->multicast_list` and we keep | remove_list, list) spinning on the `remove_list` of | >>> wait_for_completion(&mcast->done) the other thread which is blocked | and the list is still valid on | it's stack.) Fix this by keeping the lock held and changing to GFP_ATOMIC to prevent eventual sleeps. Unfortunately we could not reproduce the lockup and confirm this fix but based on the code review I think this fix should address such lockups. crash> bc 31 PID: 747 TASK: ff1c6a1a007e8000 CPU: 31 COMMAND: "kworker/u72:2" -- [exception RIP: ipoib_mcast_join_task+0x1b1] RIP: ffffffffc0944ac1 RSP: ff646f199a8c7e00 RFLAGS: 00000002 RAX: 0000000000000000 RBX: ff1c6a1a04dc82f8 RCX: 0000000000000000 work (&priv->mcast_task{,.work}) RDX: ff1c6a192d

Affected

23 ranges
VendorProductVersion rangeFixed in
debianlinux< linux 6.1.82-1 (bookworm)linux 6.1.82-1 (bookworm)
linuxlinux
linuxlinux>= d2fe937ce6ce23daf5fb214e45432dbb631581b7 < 4c8922ae8eb8dcc1e4b7d1059d97a8334288d8254c8922ae8eb8dcc1e4b7d1059d97a8334288d825
linuxlinux>= d2fe937ce6ce23daf5fb214e45432dbb631581b7 < 615e3adc2042b7be4ad122a043fc9135e6342c90615e3adc2042b7be4ad122a043fc9135e6342c90
linuxlinux>= d2fe937ce6ce23daf5fb214e45432dbb631581b7 < ac2630fd3c90ffec34a0bfc4d413668538b0e8f2ac2630fd3c90ffec34a0bfc4d413668538b0e8f2
linuxlinux>= d2fe937ce6ce23daf5fb214e45432dbb631581b7 < ed790bd0903ed3352ebf7f650d910f49b7319b34ed790bd0903ed3352ebf7f650d910f49b7319b34
linuxlinux>= d2fe937ce6ce23daf5fb214e45432dbb631581b7 < 5108a2dc2db5630fb6cd58b8be80a0c134bc310a5108a2dc2db5630fb6cd58b8be80a0c134bc310a
linuxlinux>= d2fe937ce6ce23daf5fb214e45432dbb631581b7 < 342258fb46d66c1b4c7e2c3717ac01e10c03cf18342258fb46d66c1b4c7e2c3717ac01e10c03cf18
linuxlinux>= d2fe937ce6ce23daf5fb214e45432dbb631581b7 < 7c7bd4d561e9dc6f5b7df9e184974915f6701a897c7bd4d561e9dc6f5b7df9e184974915f6701a89
linuxlinux>= d2fe937ce6ce23daf5fb214e45432dbb631581b7 < 4f973e211b3b1c6d36f7c6a19239d258856749f94f973e211b3b1c6d36f7c6a19239d258856749f9
linuxlinux_kernel< 4.19.3074.19.307
linuxlinux_kernel>= 0 < 5.10.216-15.10.216-1
linuxlinux_kernel>= 0 < 6.1.82-16.1.82-1
linuxlinux_kernel>= 0 < 6.7.7-16.7.7-1
linuxlinux_kernel>= 0 < 6.7.7-16.7.7-1
linuxlinux_kernel>= 0 < 5.4.0-181.2015.4.0-181.201
linuxlinux_kernel>= 0 < 5.15.0-106.1165.15.0-106.116
linuxlinux_kernel>= 4.20 < 5.4.2695.4.269
linuxlinux_kernel>= 5.11 < 5.15.1495.15.149
linuxlinux_kernel>= 5.16 < 6.1.776.1.77
linuxlinux_kernel>= 5.5 < 5.10.2105.10.210
linuxlinux_kernel>= 6.2 < 6.6.166.6.16
linuxlinux_kernel>= 6.7 < 6.7.46.7.4

CVSS provenance

nvdv3.15.5MEDIUMCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
osv7.5HIGH
vendor_ubuntu7.5HIGH
vendor_debian5.5MEDIUM
vendor_redhat5.5MEDIUM
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.