CWE
362
Advisory Published
CVE Published
Updated

CVE-2024-39501: drivers: core: synchronize really_probe() and dev_uevent()

First published: Fri Jul 12 2024(Updated: )

In the Linux kernel, the following vulnerability has been resolved: drivers: core: synchronize really_probe() and dev_uevent() Synchronize the dev-&gt;driver usage in really_probe() and dev_uevent(). These can run in different threads, what can result in the following race condition for dev-&gt;driver uninitialization: Thread #1: ========== really_probe() { ... probe_failed: ... device_unbind_cleanup(dev) { ... dev-&gt;driver = NULL; // &lt;= Failed probe sets dev-&gt;driver to NULL ... } ... } Thread #2: ========== dev_uevent() { ... if (dev-&gt;driver) // If dev-&gt;driver is NULLed from really_probe() from here on, // after above check, the system crashes add_uevent_var(env, "DRIVER=%s", dev-&gt;driver-&gt;name); ... } really_probe() holds the lock, already. So nothing needs to be done there. dev_uevent() is called with lock held, often, too. But not always. What implies that we can't add any locking in dev_uevent() itself. So fix this race by adding the lock to the non-protected path. This is the path where above race is observed: dev_uevent+0x235/0x380 uevent_show+0x10c/0x1f0 &lt;= Add lock here dev_attr_show+0x3a/0xa0 sysfs_kf_seq_show+0x17c/0x250 kernfs_seq_show+0x7c/0x90 seq_read_iter+0x2d7/0x940 kernfs_fop_read_iter+0xc6/0x310 vfs_read+0x5bc/0x6b0 ksys_read+0xeb/0x1b0 __x64_sys_read+0x42/0x50 x64_sys_call+0x27ad/0x2d30 do_syscall_64+0xcd/0x1d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f Similar cases are reported by syzkaller in <a href="https://syzkaller.appspot.com/bug?extid=ffa8143439596313a85a">https://syzkaller.appspot.com/bug?extid=ffa8143439596313a85a</a> But these are regarding the *initialization* of dev-&gt;driver dev-&gt;driver = drv; As this switches dev-&gt;driver to non-NULL these reports can be considered to be false-positives (which should be "fixed" by this commit, as well, though). The same issue was reported and tried to be fixed back in 2015 in <a href="https://lore.kernel.org/lkml/1421259054-2574-1-git-send-email-a.sangwan@samsung.com/">https://lore.kernel.org/lkml/1421259054-2574-1-git-send-email-a.sangwan@samsung.com/</a> already.

Credit: 416baaa9-dc9f-4396-8d5f-8c081fb06d67 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Affected SoftwareAffected VersionHow to fix
redhat/kernel<4.19.317
4.19.317
redhat/kernel<5.4.279
5.4.279
redhat/kernel<5.10.221
5.10.221
redhat/kernel<5.15.162
5.15.162
redhat/kernel<6.1.95
6.1.95
redhat/kernel<6.6.35
6.6.35
redhat/kernel<6.9.6
6.9.6
redhat/kernel<6.10
6.10
debian/linux
5.10.223-1
5.10.234-1
6.1.129-1
6.1.128-1
6.12.20-1
debian/linux-6.1
6.1.129-1~deb11u1
IBM Security Verify Governance - Identity Manager<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Software Stack<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Virtual Appliance<=ISVG 10.0.2
IBM Security Verify Governance Identity Manager Container<=ISVG 10.0.2

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Parent vulnerabilities

(Appears in the following advisories)

Frequently Asked Questions

  • What is the severity of CVE-2024-39501?

    CVE-2024-39501 is categorized as a race condition vulnerability in the Linux kernel.

  • How do I fix CVE-2024-39501?

    To mitigate CVE-2024-39501, upgrade your kernel to one of the fixed versions specified, such as 4.19.317 or 6.10.

  • Which versions of the Linux kernel are affected by CVE-2024-39501?

    CVE-2024-39501 affects several versions of the Linux kernel prior to the patched versions listed.

  • What is the nature of the vulnerability in CVE-2024-39501?

    CVE-2024-39501 involves a race condition between really_probe() and dev_uevent() functions.

  • Is CVE-2024-39501 specific to a certain Linux distribution?

    CVE-2024-39501 impacts multiple Linux distributions, particularly those using affected kernel versions.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203