Linux: Incorrect Calculation of Buffer Size
CVE-2024-43843 is a high-severity incorrect calculation of buffer size 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 3e6a1b1b179abb643ec3560c02bc3082bc92285f, 9f1e16fb1fc9826001c69e0551d51fbbcd2d74e9 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.2% 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 3e6a1b1b179abb643ec3560c02bc3082bc92285f or 9f1e16fb1fc9826001c69e0551d51fbbcd2d74e9, whichever matches your release line, or a later version.
- Update Linux Kernel to 6.10.3 or a later version.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Linux | Linux | 26ef208c209a0e6eed8942a5d191b39dccfa6e38 up to, but not including, 3e6a1b1b179abb643ec3560c02bc3082bc92285f; 26ef208c209a0e6eed8942a5d191b39dccfa6e38 up to, but not including, 9f1e16fb1fc9826001c69e0551d51fbbcd2d74e9; 6.8 | 3e6a1b1b179abb643ec3560c02bc3082bc92285f, 9f1e16fb1fc9826001c69e0551d51fbbcd2d74e9 |
| Linux | Linux Kernel | 6.8 up to, but not including, 6.10.3 | 6.10.3 |
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.
Official description
In the Linux kernel, the following vulnerability has been resolved: riscv, bpf: Fix out-of-bounds issue when preparing trampoline image We get the size of the trampoline image during the dry run phase and allocate memory based on that size. The allocated image will then be populated with instructions during the real patch phase. But after commit 26ef208c209a ("bpf: Use arch_bpf_trampoline_size"), the `im` argument is inconsistent in the dry run and real patch phase. This may cause emit_imm in RV64 to generate a different number of instructions when generating the 'im' address, potentially causing out-of-bounds issues. Let's emit the maximum number of instructions for the "im" address during dry run to fix this problem.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Incorrect Calculation of Buffer Size
The product does not correctly calculate the size to be used when allocating a buffer.
How developers prevent this class of flaw
- When allocating a buffer for the purpose of transforming, converting, or encoding an input, allocate enough memory to handle the largest possible encoding. For example, in a routine that converts & characters to & for HTML entity encoding, the output buffer needs to be at least 5 times as large as the input buffer.
- Understand the programming language's underlying representation and how it interacts with numeric calculation (CWE-681). Pay close attention to byte size discrepancies, precision, signed/unsigned distinctions, truncation, conversion and casting between types, not-a-number calculations, and how the language handles numbers that are too large or too small for its underlying representation. Also be careful to account for 32-bit, 64-bit, and other potential differences that may affect the numeric representation.
- Perform input validation on any numeric input by ensuring that it is within the expected range. Enforce that the input meets both the minimum and maximum requirements for the expected range.
More Incorrect Calculation of Buffer Size vulnerabilities (CWE-131)
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
Recent Incorrect Calculation of Buffer Size vulnerabilities
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 9.0 Critical severity
- 7.5 High severity
- 7.5 High severity
Spotted an error? Tell us.