summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBin Lu <bin.lu@arm.com>2020-05-13 04:39:25 -0400
committerBin Lu <bin.lu@arm.com>2020-05-13 04:40:28 -0400
commit5fa480a877b4aa4633797e2fd8cd0364eebc7366 (patch)
treed7939a77e21e0cae937e20bc4e502e9ae24f5e79
parent305f786e51ea2092c633d97b06818e59c5f40552 (diff)
PROT_NONE should be specially treated in the step of mapPhysical
It's a workaround to treat PROT_NONE as RDONLY temporarily. TODO(gvisor.dev/issue/2686): PROT_NONE should be specially treated. Signed-off-by: Bin Lu <bin.lu@arm.com>
-rw-r--r--pkg/sentry/platform/kvm/machine_arm64.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/platform/kvm/machine_arm64.go b/pkg/sentry/platform/kvm/machine_arm64.go
index e42505542..750751aa3 100644
--- a/pkg/sentry/platform/kvm/machine_arm64.go
+++ b/pkg/sentry/platform/kvm/machine_arm64.go
@@ -60,6 +60,12 @@ func rdonlyRegionsForSetMem() (phyRegions []physicalRegion) {
if !vr.accessType.Write && vr.accessType.Read {
rdonlyRegions = append(rdonlyRegions, vr.region)
}
+
+ // TODO(gvisor.dev/issue/2686): PROT_NONE should be specially treated.
+ // Workaround: treated as rdonly temporarily.
+ if !vr.accessType.Write && !vr.accessType.Read && !vr.accessType.Execute {
+ rdonlyRegions = append(rdonlyRegions, vr.region)
+ }
})
for _, r := range rdonlyRegions {