1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
cmd/compile: truncate uint64 indices for imm8 jump tables
Variable uint64 arguments lowered through immJumpTable were converted
directly to uintptr. Since the generated table has 256 entries, values
above 255 could dispatch outside the table and corrupt control flow. With
-spectre=ret, the binary-search fallback instead selected case 255,
differing from constant lowering.
Convert uint64 indices to uint8 before either dispatch path, matching
imm8 constant encoding. Extend the ShiftAllRightConcatMod32 tests through
the first out-of-range value.
Tests:
- GOEXPERIMENT=simd ./bin/go test simd/...
- GOEXPERIMENT=simd ./bin/go test -short cmd/compile/...
- GOEXPERIMENT=simd ./bin/go vet cmd/compile/internal/ssagen simd/...
- linux/amd64 PoC, ordinary and -spectre=ret dispatch
Fixes #80522.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[release-branch.go1.27] cmd/compile: truncate uint64 indices for imm8 jump tables
Variable uint64 arguments lowered through immJumpTable were converted
directly to uintptr. Since the generated table has 256 entries, values
above 255 could dispatch outside the table and corrupt control flow. With
-spectre=ret, the binary-search fallback instead selected case 255,
differing from constant lowering.
Convert uint64 indices to uint8 before either dispatch path, matching
imm8 constant encoding. Extend the ShiftAllRightConcatMod32 tests through
the first out-of-range value.
Tests:
- GOEXPERIMENT=simd ./bin/go test simd/...
- GOEXPERIMENT=simd ./bin/go test -short cmd/compile/...
- GOEXPERIMENT=simd ./bin/go vet cmd/compile/internal/ssagen simd/...
- linux/amd64 PoC, ordinary and -spectre=ret dispatch
Updates #80522.
Change-Id: I4a663f91c561e8212509b155e10acfc7245a59a1
GitHub-Last-Rev: 18cbbde1817affdce75d96be0a10ec908e0a785a
GitHub-Pull-Request: golang/go#80526
Reviewed-on: https://go-review.googlesource.com/c/go/+/803273
Reviewed-by: Carlos Amedee <car...@golang.org>
Reviewed-by: David Chase <drc...@google.com>
LUCI-TryBot-Result: golang...@luci-project-accounts.iam.gserviceaccount.com <golang...@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit b590fd1075ed62322d7866cf2c7e4498a8b5061c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/804581
Reviewed-by: Keith Randall <k...@google.com>
Reviewed-by: Keith Randall <k...@golang.org>
Auto-Submit: David Chase <drc...@google.com>
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |