From 3ec074897f9d0aba21bc9f41be18f52bfbeb599e Mon Sep 17 00:00:00 2001 From: ShiruRen Date: Mon, 6 Aug 2018 10:10:25 -0700 Subject: Fix a bug in PCIDs.Assign Store the new assigned pcid in p.cache[pt]. Signed-off-by: ShiruRen Change-Id: I4aee4e06559e429fb5e90cb9fe28b36139e3b4b6 PiperOrigin-RevId: 207563833 --- pkg/sentry/platform/ring0/pagetables/pcids_x86.go | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg/sentry/platform') diff --git a/pkg/sentry/platform/ring0/pagetables/pcids_x86.go b/pkg/sentry/platform/ring0/pagetables/pcids_x86.go index 4296371e8..227cf7aad 100644 --- a/pkg/sentry/platform/ring0/pagetables/pcids_x86.go +++ b/pkg/sentry/platform/ring0/pagetables/pcids_x86.go @@ -64,6 +64,7 @@ func (p *PCIDs) Assign(pt *PageTables) (uint16, bool) { if len(p.avail) > 0 { pcid := p.avail[len(p.avail)-1] p.avail = p.avail[:len(p.avail)-1] + p.cache[pt] = pcid // We need to flush because while this is in the available // pool, it may have been used previously. -- cgit v1.2.3