]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.14] runtime: ensure allocToCache updates searchAddr in a valid way
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 22 Apr 2020 21:36:11 +0000 (21:36 +0000)
committerIan Lance Taylor <iant@golang.org>
Fri, 1 May 2020 17:37:02 +0000 (17:37 +0000)
commit1b41fcbce503fd9f383ae15bfdd24720fde4a188
treed7baa9cb0d58070479ce30112b8b6cf15d05834b
parentc4b92691b021dbed5ab243ced91c030286dcb922
[release-branch.go1.14] runtime: ensure allocToCache updates searchAddr in a valid way

Currently allocToCache assumes it can move the search address past the
block it allocated the cache from, which violates the property that
searchAddr should always point to mapped memory (i.e. memory represented
by pageAlloc.inUse).

This bug was already fixed once for pageAlloc.alloc in the Go 1.14
release via CL 216697, but that changed failed to take into account
allocToCache.

For #38605.
Fixes #38606.

Change-Id: Id08180aa10d19dc0f9f551a1d9e327a295560dff
Reviewed-on: https://go-review.googlesource.com/c/go/+/229577
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit 287d1ec96c1271de532c6b1160cd9cbbe717ee34)
Reviewed-on: https://go-review.googlesource.com/c/go/+/230377
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/mpagecache.go
src/runtime/mpagecache_test.go