bytecodealliance / bytecodealliance/wasmtime
release-24.0.0: x64 fcopysign still sinks 128-bit load (CVE-2026-24116)
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
Looking at `cranelift/codegen/src/isa/x64/lower.isle:4093` on `release-24.0.0`, the `fcopysign` lowering rules for `$F32` and `$F64` haven't been updated yet:
```
(rule (lower (has_type $F32 (fcopysign a @ (value_type $F32) b)))
(let ((sign_bit Xmm (imm $F32 0x80000000)))
(x64_orps
(x64_andnps sign_bit a)
(x64_andps sign_bit b))))
(rule (lower (has_type $F64 (fcopysign a @ (value_type $F64) b)))
(let ((sign_bit Xmm (imm $F64 0x8000000000000000)))
(x64_orpd
(x64_andnpd sign_bit a)
(x64_andpd sign_bit b))))
```
Upstream commit [`728fa071`](https://github.com/bytecodealliance/wasmtime/commit/728fa07184f8da2a046f48ef9b61f869dce133a6) wraps `a` and `b` in `(let ((a Xmm a)) ...)` so a 128-bit load isn't sunk into the operand position — that sink is what causes the OOB read described in the 40.0.3 release notes. Without it, an `f64.load` feeding `f64.copysign` can read 16 bytes instead of 8 and segfault when signals-based traps are off.
Is there an intent to backport `728fa071` to `release-24.0.0`, or is this branch out of security support? Happy to file a PR if it's the former.
Best,
vulgraph
Contributor guide
Assessment
This issue has not been assessed yet.