CVE-2024-36899
Severity CVSS v4.0:
Pending analysis
Type:
CWE-362
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Publication date:
30/05/2024
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
gpiolib: cdev: Fix use after free in lineinfo_changed_notify<br />
<br />
The use-after-free issue occurs as follows: when the GPIO chip device file<br />
is being closed by invoking gpio_chrdev_release(), watched_lines is freed<br />
by bitmap_free(), but the unregistration of lineinfo_changed_nb notifier<br />
chain failed due to waiting write rwsem. Additionally, one of the GPIO<br />
chip&#39;s lines is also in the release process and holds the notifier chain&#39;s<br />
read rwsem. Consequently, a race condition leads to the use-after-free of<br />
watched_lines.<br />
<br />
Here is the typical stack when issue happened:<br />
<br />
[free]<br />
gpio_chrdev_release()<br />
--> bitmap_free(cdev->watched_lines) blocking_notifier_chain_unregister()<br />
--> down_write(&nh->rwsem) __down_write_common()<br />
--> rwsem_down_write_slowpath()<br />
--> schedule_preempt_disabled()<br />
--> schedule()<br />
<br />
[use]<br />
st54spi_gpio_dev_release()<br />
--> gpio_free()<br />
--> gpiod_free()<br />
--> gpiod_free_commit()<br />
--> gpiod_line_state_notify()<br />
--> blocking_notifier_call_chain()<br />
--> down_read(&nh->rwsem); notifier_call_chain()<br />
--> lineinfo_changed_notify()<br />
--> test_bit(xxxx, cdev->watched_lines)
Impact
Base Score 3.x
7.00
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.7 (including) | 6.6.31 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.8.10 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.9:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc6:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc7:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/02f6b0e1ec7e0e7d059dddc893645816552039da
- https://git.kernel.org/stable/c/2d008d4961b039d2edce8976289773961b7e5fb5
- https://git.kernel.org/stable/c/2dfbb920a89bdc58087672ad5325dc6c588b6860
- https://git.kernel.org/stable/c/95ca7c90eaf5ea8a8460536535101e3e81160e2a
- https://git.kernel.org/stable/c/ca710b5f40b8b16fdcad50bebd47f50e4c62d239
- https://git.kernel.org/stable/c/d38c49f7bdf14381270736299e2ff68ec248a017
- https://git.kernel.org/stable/c/02f6b0e1ec7e0e7d059dddc893645816552039da
- https://git.kernel.org/stable/c/95ca7c90eaf5ea8a8460536535101e3e81160e2a
- https://git.kernel.org/stable/c/ca710b5f40b8b16fdcad50bebd47f50e4c62d239
- https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html
- https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html



