]> Cypherpunks repositories - gostls13.git/commit
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)
committerGopher Robot <gobot@golang.org>
Wed, 12 Oct 2022 00:12:53 +0000 (00:12 +0000)
commit4bcf94b0232db65ed5df47e0127cdbc8866aec64
tree38fd232bf504d2891fe89fb3f9ffe05ed2c23dc0
parente9fd40a866e9e47ba65976d4cfeaeef7eaf76266
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 #56141

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>
src/cmd/compile/internal/typecheck/_builtin/runtime.go
src/cmd/compile/internal/typecheck/builtin.go
src/internal/fuzz/trace.go
src/runtime/libfuzzer.go
test/fixedbugs/issue56141.go [new file with mode: 0644]