{"id":"DEBIAN-CVE-2024-36899","details":"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()   --\u003e bitmap_free(cdev-\u003ewatched_lines)                  \u003c-- freed   --\u003e blocking_notifier_chain_unregister()     --\u003e down_write(&nh-\u003erwsem)                          \u003c-- waiting rwsem           --\u003e __down_write_common()             --\u003e rwsem_down_write_slowpath()                   --\u003e schedule_preempt_disabled()                     --\u003e schedule()  [use] st54spi_gpio_dev_release()   --\u003e gpio_free()     --\u003e gpiod_free()       --\u003e gpiod_free_commit()         --\u003e gpiod_line_state_notify()           --\u003e blocking_notifier_call_chain()             --\u003e down_read(&nh-\u003erwsem);                  \u003c-- held rwsem             --\u003e notifier_call_chain()               --\u003e lineinfo_changed_notify()                 --\u003e test_bit(xxxx, cdev-\u003ewatched_lines) \u003c-- 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.","modified":"2026-09-15T09:03:14.197931655Z","published":"2024-05-30T16:15:13.510Z","upstream":["CVE-2024-36899"],"references":[{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2024-36899"}],"affected":[{"package":{"name":"linux","ecosystem":"Debian:12","purl":"pkg:deb/debian/linux?arch=source&distro=bookworm"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.1.128-1"}]}],"versions":["6.1.106-1","6.1.106-2","6.1.106-3","6.1.112-1","6.1.115-1","6.1.119-1","6.1.123-1","6.1.124-1","6.1.27-1","6.1.37-1","6.1.38-1","6.1.38-2","6.1.38-2~bpo11+1","6.1.38-3","6.1.38-4","6.1.38-4~bpo11+1","6.1.52-1","6.1.55-1","6.1.55-1~bpo11+1","6.1.64-1","6.1.66-1","6.1.67-1","6.1.69-1","6.1.69-1~bpo11+1","6.1.76-1","6.1.76-1~bpo11+1","6.1.82-1","6.1.85-1","6.1.90-1","6.1.90-1~bpo11+1","6.1.94-1","6.1.94-1~bpo11+1","6.1.98-1","6.1.99-1"],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2024-36899.json"}},{"package":{"name":"linux","ecosystem":"Debian:13","purl":"pkg:deb/debian/linux?arch=source&distro=trixie"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.8.11-1"}]}],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2024-36899.json"}},{"package":{"name":"linux","ecosystem":"Debian:14","purl":"pkg:deb/debian/linux?arch=source&distro=forky"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.8.11-1"}]}],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2024-36899.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}