mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user