Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2024-36899— gpiolib: cdev: Fix use after free in lineinfo_changed_notify

AI Predicted 4.4 Difficulty: Hard EPSS 0.18% · P8

Possible ATT&CK Techniques 1AI

T1203 · Exploitation for Client Execution

Affected Version Matrix 14

VendorProductVersion RangeStatus
LinuxLinux51c1064e82e77b39a49889287ca50709303e2f26< 2dfbb920a89bdc58087672ad5325dc6c588b6860affected
51c1064e82e77b39a49889287ca50709303e2f26< 2d008d4961b039d2edce8976289773961b7e5fb5affected
51c1064e82e77b39a49889287ca50709303e2f26< d38c49f7bdf14381270736299e2ff68ec248a017affected
51c1064e82e77b39a49889287ca50709303e2f26< 95ca7c90eaf5ea8a8460536535101e3e81160e2aaffected
51c1064e82e77b39a49889287ca50709303e2f26< ca710b5f40b8b16fdcad50bebd47f50e4c62d239affected
51c1064e82e77b39a49889287ca50709303e2f26< 02f6b0e1ec7e0e7d059dddc893645816552039daaffected
5.7affected
< 5.7unaffected
… +6 more rows
Get alerts for future matching vulnerabilitiesLog in to subscribe

I. Basic Information for CVE-2024-36899

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
gpiolib: cdev: Fix use after free in lineinfo_changed_notify
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于 gpiolib:cdev 模块 lineinfo_changed_notify 中的释放后使用。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

VendorProductAffected VersionsCPESubscribe
LinuxLinux 51c1064e82e77b39a49889287ca50709303e2f26 ~ 2dfbb920a89bdc58087672ad5325dc6c588b6860 -
LinuxLinux 5.7 -

II. Public POCs for CVE-2024-36899

#POC DescriptionSource LinkShenlong Link
AI-Generated POCPremium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2024-36899

登录查看更多情报信息。

Patches & Fixes for CVE-2024-36899 (3)

Other References for CVE-2024-36899 (3)

Same Patch Batch · Linux · 2024-05-30 · 93 CVEs total

CVE-2024-36927ipv4: Fix uninit-value access in __ip_make_skb()
CVE-2024-36922wifi: iwlwifi: read txq->read_ptr under lock
CVE-2024-36920scsi: mpi3mr: Avoid memcpy field-spanning write WARNING
CVE-2024-36916blk-iocost: avoid out of bounds shift
CVE-2024-36917block: fix overflow in blk_ioctl_discard()
CVE-2024-36914drm/amd/display: Skip on writeback when it's not applicable
CVE-2024-36915nfc: llcp: fix nfc_llcp_setsockopt() unsafe copies
CVE-2024-36913Drivers: hv: vmbus: Leak pages if set_memory_encrypted() fails
CVE-2024-36919scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload
CVE-2024-36925swiotlb: initialise restricted pool list_head when SWIOTLB_DYNAMIC=y
CVE-2024-36924scsi: lpfc: Release hbalock before calling lpfc_worker_wake_up()
CVE-2024-36926powerpc/pseries/iommu: LPAR panics during boot up with a frozen PE
CVE-2024-36928s390/qeth: Fix kernel panic after setting hsuid
CVE-2024-36929net: core: reject skb_copy(_expand) for fraglist GSO skbs
CVE-2024-36930spi: fix null pointer dereference within spi_sync
CVE-2024-36932thermal/debugfs: Prevent use-after-free from occurring after cdev removal
CVE-2024-36931s390/cio: Ensure the copied buf is NUL terminated
CVE-2024-36933nsh: Restore skb->{protocol,data,mac_header} for outer header in nsh_gso_segment().
CVE-2024-36934bna: ensure the copied buf is NUL terminated
CVE-2024-36935ice: ensure the copied buf is NUL terminated

Showing top 20 of 93 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2024-36899

No comments yet


Leave a comment