mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Don't call platform.AddressSpace.MapFile with no permissions.
PiperOrigin-RevId: 305598136
This commit is contained in:
@@ -201,8 +201,10 @@ func (mm *MemoryManager) mapASLocked(pseg pmaIterator, ar usermem.AddrRange, pre
|
||||
if pma.needCOW {
|
||||
perms.Write = false
|
||||
}
|
||||
if err := mm.as.MapFile(pmaMapAR.Start, pma.file, pseg.fileRangeOf(pmaMapAR), perms, precommit); err != nil {
|
||||
return err
|
||||
if perms.Any() { // MapFile precondition
|
||||
if err := mm.as.MapFile(pmaMapAR.Start, pma.file, pseg.fileRangeOf(pmaMapAR), perms, precommit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
pseg = pseg.NextSegment()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user