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>
This commit is contained in:
Bin Lu
2020-05-13 04:40:28 -04:00
parent 305f786e51
commit 5fa480a877
+6
View File
@@ -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 {