]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.19] all: prevent fakePC overflow on 386 in libfuzzer mode
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 11 Oct 2022 04:56:51 +0000 (11:56 +0700)
committerHeschi Kreinick <heschi@google.com>
Mon, 24 Oct 2022 17:29:11 +0000 (17:29 +0000)
commite73130cf45dbc8cf6e3074b4cda9674b18d82feb
tree47f825739d5d2694630a5803ec2c4d19dba5f36a
parent0cc20ecc28d803776bdfd6ffba267b87b93b73bb
[release-branch.go1.19] all: prevent fakePC overflow on 386 in libfuzzer mode

fakePC uses hash.Sum32, which returns an uint32. However, libfuzzer
trace/hook functions declare fakePC argument as int, causing overflow on
386 archs.

Fixing this by changing fakePC argument to uint to prevent the overflow.

Fixes #56168

Change-Id: I3994c461319983ab70065f90bf61539a363e0a2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/441996
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/442435
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/typecheck/builtin.go
src/cmd/compile/internal/typecheck/builtin/runtime.go
src/internal/fuzz/trace.go
src/runtime/libfuzzer.go
test/fixedbugs/issue56141.go [new file with mode: 0644]