跳转到帖子

Amazon Linux AMI 2: CVE-2024-36899: Security patch for kernel-livepatch-5.10.227-219.884, kernel-livepatch-5.10.228-219.884, kernel-livepatch-5.10.230-223.885, kernel-livepatch-5.10.233-223.887 (Multiple Advisories)

recommended_posts

发布于
  • Members

Amazon Linux AMI 2: CVE-2024-36899: Security patch for kernel-livepatch-5.10.227-219.884, kernel-livepatch-5.10.228-219.884, kernel-livepatch-5.10.230-223.885, kernel-livepatch-5.10.233-223.887 (Multiple Advisories)

Severity
4
CVSS
(AV:L/AC:M/Au:N/C:P/I:P/A:P)
Published
05/30/2024
Created
02/05/2025
Added
02/04/2025
Modified
02/04/2025

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.

Solution(s)

  • amazon-linux-ami-2-upgrade-kernel-livepatch-5-10-227-219-884
  • amazon-linux-ami-2-upgrade-kernel-livepatch-5-10-228-219-884
  • amazon-linux-ami-2-upgrade-kernel-livepatch-5-10-230-223-885
  • amazon-linux-ami-2-upgrade-kernel-livepatch-5-10-233-223-887

References

  • https://attackerkb.com/topics/cve-2024-36899
  • AL2/ALASLIVEPATCH-2025-195
  • AL2/ALASLIVEPATCH-2025-196
  • AL2/ALASLIVEPATCH-2025-197
  • AL2/ALASLIVEPATCH-2025-198
  • CVE - 2024-36899
  • 查看数 700
  • 已创建
  • 最后回复

参与讨论

你可立刻发布并稍后注册。 如果你有帐户,立刻登录发布帖子。

游客
回帖…