CVE Catalog

CVE-2024-36899

High
Published: Translated: NVD NIST

Summary

A use-after-free vulnerability has been identified in the gpiolib module of the Linux kernel, occurring during the closure of the GPIO device file. This issue leads to a race condition that may result in unintended access to freed memory.

Risk Assessment

Organizations may be exposed to attacks that exploit this vulnerability for unauthorized memory access, potentially leading to system instability or exposure of sensitive data.

Recommendation

It is recommended to update the Linux kernel to the latest version where this vulnerability has been fixed to minimize the risk associated with its exploitation.

Related vulnerabilities

Original NVD description (English source)

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() -

Vulnerability data from NVD (NIST) · CISA KEV · EPSS