mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Fix sums test under MSAN by allowing Scudo to add MAP_NORESERVE
in mmap()
Note: This change allows `MAP_NORESERVE` generally, not just for MSAN. This follows what we do for `AllowTcMalloc()/AllowSystemMalloc()` PiperOrigin-RevId: 402231980 Change-Id: Ifa1c6b9f61f636dd6db231dde3765c3b4a40911b
This commit is contained in:
parent
221e929018
commit
df1c31188d
|
@ -131,7 +131,7 @@ class Sandbox {
|
|||
// - absolute: will be used as is.
|
||||
virtual std::string GetLibPath() const { return ""; }
|
||||
|
||||
// Gets the environment varialbes passed to the sandboxee.
|
||||
// Gets the environment variables passed to the sandboxee.
|
||||
virtual void GetEnvs(std::vector<std::string>* envs) const {}
|
||||
|
||||
// Modifies the Executor object if needed.
|
||||
|
|
|
@ -113,7 +113,8 @@ PolicyBuilder& PolicyBuilder::AllowScudoMalloc() {
|
|||
|
||||
// PROT_READ | PROT_WRITE
|
||||
ARG_32(3), // flags
|
||||
JEQ32(MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, ALLOW),
|
||||
BPF_STMT(BPF_ALU | BPF_AND | BPF_K,
|
||||
~uint32_t{MAP_FIXED | MAP_NORESERVE}),
|
||||
JEQ32(MAP_PRIVATE | MAP_ANONYMOUS, ALLOW),
|
||||
JUMP(&labels, mmap_end),
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user