Junglewise Threat Intelligence

CVE-2024-58017: Linux Kernel signed integer overflow in printk log buffer

CVE-2024-58017 · Severity: medium · CVSS 5.5 · Published 2025-02-27

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability was identified in the Linux kernel's logging system (printk) where a mathematical error in defining the maximum log buffer size could lead to unpredictable system behavior. This issue primarily affects the stability of the operating system, potentially allowing a local user to cause a system crash or denial of service. The flaw has been addressed in recent kernel updates to ensure the buffer size is calculated safely.

Technical details

A signed integer overflow vulnerability existed in kernel/printk/printk.c due to the bitwise shift operation '1 << 31' on a 32-bit signed integer. In C, shifting a 1 into the sign bit of a signed 32-bit integer results in undefined behavior. This constant is used to define LOG_BUF_LEN_MAX. An attacker with local access could potentially leverage this undefined behavior to impact system availability. The fix involves casting the integer literal to an unsigned 32-bit integer (u32) before the shift operation to ensure well-defined behavior. Patches have been backported to multiple stable kernel branches including 6.1.y, 6.6.y, 6.12.y, and 6.13.y.

Affected products

  • Linux Linux Kernel versions before 6.1.129, 6.6.78, 6.12.14, 6.13.3

Timeline

  • 2024-09-28: disclosed: Initial patch submitted by Kuan-Wei Chiu
  • 2024-12-12: patched: Patch committed to main stable tree
  • 2025-02-27: advisory: CVE-2024-58017 published

References

Related threats