Description
In the Linux kernel, the following vulnerability has been resolved:

riscv: lib: Fix ZBB strnlen reading past count boundary

The ZBB-optimized strnlen loop loads one word ahead before checking the
aligned boundary:

REG_L t1, SZREG(t0) // load next word
addi t0, t0, SZREG // advance
orc.b t1, t1
bgeu t0, t4, 4f // boundary check AFTER load

where t4 = (s + count) & -SZREG. When s is aligned and count is a
multiple of SZREG, t4 equals s + count and the loop loads a full word
starting at exactly s + count. If s + count falls on a page boundary
with the next page unmapped, this faults.

Fix by computing the aligned boundary from the last valid byte
(s + count - 1) instead of s + count. This makes the loop stop at the
word containing the last valid byte rather than potentially loading the
word after it. The count == 0 case is already handled by the beqz
early exit.

Also add a pre-loop guard (bgeu t0, t4) for the case where all valid
bytes fit within the first word. With the adjusted boundary, t4 can
equal t0, and entering the loop with stale register state from the
first-word processing would produce incorrect results.

The final minu clamp ensures the result is still correct when the last
loaded word extends past s + count - 1 within the same aligned word.
Published: 2026-08-26
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a bug in the RISC‑V implementation of the kernel’s strnlen routine. The loop loads a word past the requested count before performing the aligned‑boundary check, which can cause the function to read a page that is unmapped. The fault results in a kernel exception that brings the system to a halt. Because the fault occurs in core kernel code, the impact is a local denial of service on any system that can invoke the code with an untrusted string or a suitably crafted count value.

Affected Systems

The affected product is the Linux kernel running on RISC‑V processors, specifically any build that contains the buggy strnlen loop before the patch. The fix is provided in the kernel source tree and is applied in later kernel releases; production images should be updated accordingly.

Risk and Exploitability

The bug has no remote exploitation surface or privilege escalation path. The primary risk is that an attacker could trigger the fault by feeding a crafted count value to strnlen, resulting in a crash. Because the vulnerability is confined to the kernel library and does not give code execution, the only realistic consequence is local denial of service. The EPSS score is not available, and the issue is not listed in the CISA KEV catalog, so the probability of exploit in the wild is presumed low but a local denial of service remains a critical risk for affected installations.

Generated by OpenCVE AI on August 26, 2026 at 15:21 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel on RISC‑V to the latest stable release that incorporates the commit(s) fixing the out‑of‑bounds read.
  • If an immediate kernel upgrade is not possible, apply the patch from the Linux kernel repository to your source tree and rebuild the kernel, ensuring the corrected strnlen implementation is in place.
  • Validate any input passed to strnlen by ensuring the count does not exceed the length of a mapped, contiguous buffer and that the buffer does not cross a page boundary.

Generated by OpenCVE AI on August 26, 2026 at 15:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 26 Aug 2026 15:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-129
CWE-20

Wed, 26 Aug 2026 14:45:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: riscv: lib: Fix ZBB strnlen reading past count boundary The ZBB-optimized strnlen loop loads one word ahead before checking the aligned boundary: REG_L t1, SZREG(t0) // load next word addi t0, t0, SZREG // advance orc.b t1, t1 bgeu t0, t4, 4f // boundary check AFTER load where t4 = (s + count) & -SZREG. When s is aligned and count is a multiple of SZREG, t4 equals s + count and the loop loads a full word starting at exactly s + count. If s + count falls on a page boundary with the next page unmapped, this faults. Fix by computing the aligned boundary from the last valid byte (s + count - 1) instead of s + count. This makes the loop stop at the word containing the last valid byte rather than potentially loading the word after it. The count == 0 case is already handled by the beqz early exit. Also add a pre-loop guard (bgeu t0, t4) for the case where all valid bytes fit within the first word. With the adjusted boundary, t4 can equal t0, and entering the loop with stale register state from the first-word processing would produce incorrect results. The final minu clamp ensures the result is still correct when the last loaded word extends past s + count - 1 within the same aligned word.
Title riscv: lib: Fix ZBB strnlen reading past count boundary
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-08-26T14:36:58.954Z

Reserved: 2026-08-15T05:44:03.931Z

Link: CVE-2026-74751

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-26T15:16:54.160

Modified: 2026-08-26T15:16:54.160

Link: CVE-2026-74751

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-26T16:15:07Z

Weaknesses
  • CWE-129

    Improper Validation of Array Index

  • CWE-20

    Improper Input Validation