# CVE-2026-74751: riscv: lib: Fix ZBB strnlen reading past count boundary

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.4
- **CVSS:** 9.4 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: Low; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.46% (percentile 32, 2026-11-26)
- **Published:** 2026-08-26T14:36:58.954Z
- **Modified:** 2026-08-27T06:17:26.247Z

## Who should check

- Anyone running Linux \>= 5ba15d419fab848a3813eb56bbcad00e291fbc49, \< e697e30f3dd2da3a1df7dc0980546d5b53aea4b6; \>= 5ba15d419fab848a3813eb56bbcad00e291fbc49, \< 5d588c684833e678a0008eb69c33190f01a65f4b
- Anyone running Linux 7.1

## 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.

## Affected and fixed versions

- Linux: \>= 5ba15d419fab848a3813eb56bbcad00e291fbc49, \< e697e30f3dd2da3a1df7dc0980546d5b53aea4b6; \>= 5ba15d419fab848a3813eb56bbcad00e291fbc49, \< 5d588c684833e678a0008eb69c33190f01a65f4b (cvelist)
- Linux: 7.1 (cvelist)

## Mitigation

- Upgrade Linux to 5d588c684833e678a0008eb69c33190f01a65f4b or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-74751. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-74751.md
Affected: Linux >= 5ba15d419fab848a3813eb56bbcad00e291fbc49, < e697e30f3dd2da3a1df7dc0980546d5b53aea4b6; >= 5ba15d419fab848a3813eb56bbcad00e291fbc49, < 5d588c684833e678a0008eb69c33190f01a65f4b; Linux 7.1
Fixed in: Linux 5d588c684833e678a0008eb69c33190f01a65f4b

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-74751 being exploited?

There is no confirmed exploitation: CVE-2026-74751 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.46% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-74751?

Critical: CVSS 9.4 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-74751?

Linux \>= 5ba15d419fab848a3813eb56bbcad00e291fbc49, \< e697e30f3dd2da3a1df7dc0980546d5b53aea4b6; \>= 5ba15d419fab848a3813eb56bbcad00e291fbc49, \< 5d588c684833e678a0008eb69c33190f01a65f4b; Linux 7.1.

### Is there a fix for CVE-2026-74751?

Yes. Fixed in Linux 5d588c684833e678a0008eb69c33190f01a65f4b. Upgrade Linux to 5d588c684833e678a0008eb69c33190f01a65f4b or later.

### How do I check if I'm affected by CVE-2026-74751?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/e697e30f3dd2da3a1df7dc0980546d5b53aea4b6>
- other: <https://git.kernel.org/stable/c/5d588c684833e678a0008eb69c33190f01a65f4b>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-74751>

HTML: <https://flawdb.com/CVE-2026-74751> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-74751>
