Linux: Out-of-bounds Write
CVE-2024-38621 is a high-severity out-of-bounds write vulnerability in Linux, with a CVSS 3.1 base score of 7.1 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 f6a392266276730bea893b55d12940e32a25f56a, ecf4ddc3aee8ade504c4d36b7b4053ce6093e200, a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7 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.28% chance of exploitation within 30 days, which is low compared with other CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Linux to f6a392266276730bea893b55d12940e32a25f56a or ecf4ddc3aee8ade504c4d36b7b4053ce6093e200 or a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7 or 7532bcec0797adfa08791301c3bcae14141db3bd, whichever matches your release line, or a later version.
- Update SIMATIC S7-1500 CPU 1518-4 PN/DP MFP to V3.1.5 or a later version.
- Update SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP to V3.1.5 or a later version.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Linux | Linux | 9cb2173e6ea8f2948bd1367c93083a2500fcf08f up to, but not including, f6a392266276730bea893b55d12940e32a25f56a; 9cb2173e6ea8f2948bd1367c93083a2500fcf08f up to, but not including, ecf4ddc3aee8ade504c4d36b7b4053ce6093e200; 9cb2173e6ea8f2948bd1367c93083a2500fcf08f up to, but not including, a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7; 9cb2173e6ea8f2948bd1367c93083a2500fcf08f up to, but not including, 7532bcec0797adfa08791301c3bcae14141db3bd; 9cb2173e6ea8f2948bd1367c93083a2500fcf08f up to, but not including, b504518a397059e1d55c521ba0ea2b545a6c4b52; 9cb2173e6ea8f2948bd1367c93083a2500fcf08f up to, but not including, d410017a7181cb55e4a5c810b32b75e4416c6808; 9cb2173e6ea8f2948bd1367c93083a2500fcf08f up to, but not including, a08492832cc4cacc24e0612f483c86ca899b9261; 9cb2173e6ea8f2948bd1367c93083a2500fcf08f up to, but not including, faa4364bef2ec0060de381ff028d1d836600a381; and 1 more ranges | f6a392266276730bea893b55d12940e32a25f56a, ecf4ddc3aee8ade504c4d36b7b4053ce6093e200, a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7, 7532bcec0797adfa08791301c3bcae14141db3bd, b504518a397059e1d55c521ba0ea2b545a6c4b52, d410017a7181cb55e4a5c810b32b75e4416c6808 |
| Siemens | SIMATIC S7-1500 CPU 1518-4 PN/DP MFP | V3.1.0 up to, but not including, V3.1.5 | V3.1.5 |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP | V3.1.0 up to, but not including, V3.1.5 | V3.1.5 |
| Siemens | SIPLUS S7-1500 CPU 1518-4 PN/DP MFP | V3.1.0 up to, but not including, V3.1.5 | V3.1.5 |
| Linux | Linux Kernel | 3.7 up to, but not including, 4.19.316; 4.20 up to, but not including, 5.4.278; 5.5 up to, but not including, 5.10.219; 5.11 up to, but not including, 5.15.161; 5.16 up to, but not including, 6.1.93; 6.2 up to, but not including, 6.6.33; 6.7 up to, but not including, 6.9.4 | 4.19.316, 5.4.278, 5.10.219, 5.15.161, 6.1.93, 6.6.33 |
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
- NoneNothing can be modified.
- 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:N/A:H. Scored by NVD.
Official description
In the Linux kernel, the following vulnerability has been resolved: media: stk1160: fix bounds checking in stk1160_copy_video() The subtract in this condition is reversed. The ->length is the length of the buffer. The ->bytesused is how many bytes we have copied thus far. When the condition is reversed that means the result of the subtraction is always negative but since it's unsigned then the result is a very high positive value. That means the overflow check is never true. Additionally, the ->bytesused doesn't actually work for this purpose because we're not writing to "buf->mem + buf->bytesused". Instead, the math to calculate the destination where we are writing is a bit involved. You calculate the number of full lines already written, multiply by two, skip a line if necessary so that we start on an odd numbered line, and add the offset into the line. To fix this buffer overflow, just take the actual destination where we are writing, if the offset is already out of bounds print an error and return. Otherwise, write up to buf->length bytes.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
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.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- git.kernel.org/stable/c/7532bcec0797adfa08791301c3bcae14141db3bd
- git.kernel.org/stable/c/a08492832cc4cacc24e0612f483c86ca899b9261
- git.kernel.org/stable/c/a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7
- git.kernel.org/stable/c/b504518a397059e1d55c521ba0ea2b545a6c4b52
- git.kernel.org/stable/c/d410017a7181cb55e4a5c810b32b75e4416c6808
- git.kernel.org/stable/c/ecf4ddc3aee8ade504c4d36b7b4053ce6093e200
- git.kernel.org/stable/c/f6a392266276730bea893b55d12940e32a25f56a
- git.kernel.org/stable/c/faa4364bef2ec0060de381ff028d1d836600a381
Other references
Recent Out-of-bounds Write vulnerabilities
- 8.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.5 High severity
- 8.8 High severity
Spotted an error? Tell us.