CVE-2024-36899
Last modified
CVE-2024-36899 is a high-severity vulnerability rated 7/10 on the CVSS scale. In the Linux kernel, the following vulnerability has been resolved: gpiolib: cdev: Fix use after free in lineinfo_changed_notify The use-after-free issue occurs as follows: when the GPIO chip device file is being closed by invoking gpio_chrdev_release(), watched_lines is freed by bitmap_free(), but the unregistration of lineinfo_changed_nb notifier chain failed due to waiting write rwsem. Additionally, one of the GPIO chip's lines is also in the release process and holds the notifier chain's read rwsem. EPSS estimates a 0.18% chance of exploitation in the next 30 days.
Description
In the Linux kernel, the following vulnerability has been resolved: gpiolib: cdev: Fix use after free in lineinfo_changed_notify The use-after-free issue occurs as follows: when the GPIO chip device file is being closed by invoking gpio_chrdev_release(), watched_lines is freed by bitmap_free(), but the unregistration of lineinfo_changed_nb notifier chain failed due to waiting write rwsem. Additionally, one of the GPIO chip's lines is also in the release process and holds the notifier chain's read rwsem. Consequently, a race condition leads to the use-after-free of watched_lines. Here is the typical stack when issue happened: [free] gpio_chrdev_release() --> bitmap_free(cdev->watched_lines) <-- freed --> blocking_notifier_chain_unregister() --> down_write(&nh->rwsem) <-- waiting rwsem --> __down_write_common() --> rwsem_down_write_slowpath() --> schedule_preempt_disabled() --> schedule() [use] st54spi_gpio_dev_release() --> gpio_free() --> gpiod_free() --> gpiod_free_commit() --> gpiod_line_state_notify() --> blocking_notifier_call_chain() --> down_read(&nh->rwsem); <-- held rwsem --> notifier_call_chain() --> lineinfo_changed_notify() --> test_bit(xxxx, cdev->watched_lines) <-- use after free The side effect of the use-after-free issue is that a GPIO line event is being generated for userspace where it shouldn't. However, since the chrdev is being closed, userspace won't have the chance to read that event anyway. To fix the issue, call the bitmap_free() function after the unregistration of lineinfo_changed_nb notifier chain.
Metrics
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness Enumeration
Affected Software
| Vendor | Product | Versions | Update |
|---|---|---|---|
| Linux | Linux Kernel | >= 5.7, < 6.6.31 | — |
| Linux | Linux Kernel | >= 6.7, < 6.8.10 | — |
| Linux | Linux Kernel | 6.9 | Rc1 |
References
Timeline
- Published
- Last Modified
- Status
- Modified
Frequently Asked Questions
What is CVE-2024-36899?
How severe is CVE-2024-36899?
How do I fix CVE-2024-36899?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2024
- CVE-2024-36893In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-36894In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2024-36895In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2024-36896In the Linux kernel, the following vulnerability has been re…9.1
- CVE-2024-36897In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-36898In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2024-3690A vulnerability classified as critical was found in PHPGuruk…8.8
- CVE-2024-36900In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-36901In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-36902In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-36903In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-36904In the Linux kernel, the following vulnerability has been re…7.8
Are you affected by CVE-2024-36899?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
