]> Cypherpunks repositories - gostls13.git/commit
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)
committerMichael Knyszek <mknyszek@google.com>
Mon, 27 Apr 2020 21:37:31 +0000 (21:37 +0000)
commit287d1ec96c1271de532c6b1160cd9cbbe717ee34
tree63c19da7e5e16975f951b27de9f06f9df7762c11
parent9a3f22be7a3a28bd8f33a86925e2b05f2314ead2
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.

Fixes #38605.

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>
src/runtime/mpagecache.go
src/runtime/mpagecache_test.go