# CVE-2024-35873: linux: In the Linux kernel, the following vulnerability has been resolved:  riscv: Fix vector state restore in rt_sigreturn(...

CVE-2024-35873 is fixed in linux on 1 platform, first by DEBIAN-CVE-2024-35873, released May 19, 2024. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2024-35873
- Priority: Routine
- CVSS: 5.5 (medium)
- EPSS: 0.0020
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: May 19, 2024

## Description

In the Linux kernel, the following vulnerability has been resolved:  riscv: Fix vector state restore in rt_sigreturn()  The RISC-V Vector specification states in "Appendix D: Calling Convention for Vector State" [1] that "Executing a system call causes all caller-saved vector registers (v0-v31, vl, vtype) and vstart to become unspecified.". In the RISC-V kernel this is called "discarding the vstate".  Returning from a signal handler via the rt_sigreturn() syscall, vector discard is also performed. However, this is not an issue since the vector state should be restored from the sigcontext, and therefore not care about the vector discard.  The "live state" is the actual vector register in the running context, and the "vstate" is the vector state of the task. A dirty live state, means that the vstate and live state are not in synch.  When vectorized user_from_copy() was introduced, an bug sneaked in at the restoration code, related to the discard of the live state.  An example when this go wrong:    1. A userland application is executing vector code   2. The application receives a signal, and the signal handler is      entered.   3. The application returns from the signal handler, using the      rt_sigreturn() syscall.   4. The live vector state is discarded upon entering the      rt_sigreturn(), and the live state is marked as "dirty", indicating      that the live state need to be synchronized with the current      vstate.   5. rt_sigreturn() restores the vstate, except the Vector registers,      from the sigcontext   6. rt_sigreturn() restores the Vector registers, from the sigcontext,      and now the vectorized user_from_copy() is used. The dirty live      state from the discard is saved to the vstate, making the vstate      corrupt.   7. rt_sigreturn() returns to the application, which crashes due to      corrupted vstate.  Note that the vectorized user_from_copy() is invoked depending on the value of CONFIG_RISCV_ISA_V_UCOPY_THRESHOLD. Default is 768, which means that vlen has to be larger than 128b for this bug to trigger.  The fix is simply to mark the live state as non-dirty/clean prior performing the vstate restore.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | linux Debian 13.5 (trixie) | 6.8.9-1 | [DEBIAN-CVE-2024-35873](https://patchblox.com/security/data/fix/linux/debian-cve-2024-35873.md) | May 19, 2024 |
| Linux | linux Debian 14 | 6.8.9-1 | [DEBIAN-CVE-2024-35873](https://patchblox.com/security/data/fix/linux/debian-cve-2024-35873.md) | May 19, 2024 |

---

Data as of 2026-11-08T13:06:02Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
