CyberSecBulletin
CVE-2024-26885NVD status: Modified

Linux: Improper Restriction of Operations within the Bounds of a Memory Buffer

CVE-2024-26885 is a high-severity improper restriction of operations within the bounds of a memory buffer vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions 1f5e352b9088211fa5eb4e1639cd365f4f7d2f65, 4b81a9f92b3676cb74b907a7a209b3d15bd9a7f9, c826502bed93970f2fd488918a7b8d5f1d30e2e3 as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.25% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to 1f5e352b9088211fa5eb4e1639cd365f4f7d2f65 or 4b81a9f92b3676cb74b907a7a209b3d15bd9a7f9 or c826502bed93970f2fd488918a7b8d5f1d30e2e3 or edf7990baa48de5097daa9ac02e06cb4c798a737, whichever matches your release line, or a later version.
  2. Update SIMATIC S7-1500 TM MFP - GNU/Linux subsystem to V1.1.1 or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux6f9d451ab1a33728adb72d7ff66a7b374d665176 up to, but not including, 1f5e352b9088211fa5eb4e1639cd365f4f7d2f65; 6f9d451ab1a33728adb72d7ff66a7b374d665176 up to, but not including, 4b81a9f92b3676cb74b907a7a209b3d15bd9a7f9; 6f9d451ab1a33728adb72d7ff66a7b374d665176 up to, but not including, c826502bed93970f2fd488918a7b8d5f1d30e2e3; 6f9d451ab1a33728adb72d7ff66a7b374d665176 up to, but not including, edf7990baa48de5097daa9ac02e06cb4c798a737; 6f9d451ab1a33728adb72d7ff66a7b374d665176 up to, but not including, 250051acc21f9d4c5c595e4fcb55986ea08c4691; 6f9d451ab1a33728adb72d7ff66a7b374d665176 up to, but not including, 22079b3a423382335f47d9ed32114e6c9fe88d7c; 6f9d451ab1a33728adb72d7ff66a7b374d665176 up to, but not including, e89386f62ce9a9ab9a94835a9890883c23d9d52c; 6f9d451ab1a33728adb72d7ff66a7b374d665176 up to, but not including, 281d464a34f540de166cee74b723e97ac2515ec3; and 1 more ranges1f5e352b9088211fa5eb4e1639cd365f4f7d2f65, 4b81a9f92b3676cb74b907a7a209b3d15bd9a7f9, c826502bed93970f2fd488918a7b8d5f1d30e2e3, edf7990baa48de5097daa9ac02e06cb4c798a737, 250051acc21f9d4c5c595e4fcb55986ea08c4691, 22079b3a423382335f47d9ed32114e6c9fe88d7c
Linuxlinux_kernel5.4; 6f9d451ab1a3Not stated
SiemensSIMATIC S7-1500 TM MFP - GNU/Linux subsystembefore V1.1.1V1.1.1

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighCNA
CVSS 3.17.8HighNVD

Official description

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix DEVMAP_HASH overflow check on 32-bit arches The devmap code allocates a number hash buckets equal to the next power of two of the max_entries value provided when creating the map. When rounding up to the next power of two, the 32-bit variable storing the number of buckets can overflow, and the code checks for overflow by checking if the truncated 32-bit value is equal to 0. However, on 32-bit arches the rounding up itself can overflow mid-way through, because it ends up doing a left-shift of 32 bits on an unsigned long value. If the size of an unsigned long is four bytes, this is undefined behaviour, so there is no guarantee that we'll end up with a nice and tidy 0-value at the end. Syzbot managed to turn this into a crash on arm32 by creating a DEVMAP_HASH with max_entries > 0x80000000 and then trying to update it. Fix this by moving the overflow check to before the rounding up operation.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Improper Restriction of Operations within the Bounds of a Memory Buffer

The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary.

How developers prevent this class of flaw

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer. Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples include the Safe C String Library (SafeStr) by Messier and Viega, and the Strsafe.h library from Microsoft. These libraries provide safer versions of overflow-prone string-handling functions.
  • Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking. D3-SFCV (Stack Frame Canary Validation) from D3FEND discusses canary-based detection in detail.

More Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerabilities (CWE-119)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerabilities

Spotted an error? Tell us.