Index: sandbox/linux/seccomp/maps.cc |
=================================================================== |
--- sandbox/linux/seccomp/maps.cc (revision 45661) |
+++ sandbox/linux/seccomp/maps.cc (working copy) |
@@ -221,7 +221,10 @@ |
static_cast<unsigned long>(addr) - kMaxDistance < gap_start) { |
position = gap_start; |
} else { |
- position = addr - kMaxDistance; |
+ position = (addr - kMaxDistance) & ~4095; |
+ if (position < gap_start) { |
+ position = gap_start; |
+ } |
} |
} else { |
// Otherwise, take the end of the region. |