mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 12:32:55 +00:00
Bug 993145 - Skip attempting seccomp sandboxing if seccomp unavailable. r=kang
This commit is contained in:
parent
2074c7670e
commit
7f0d9d7eb4
@ -386,6 +386,14 @@ BroadcastSetThreadSandbox()
|
||||
SetThreadSandbox();
|
||||
}
|
||||
|
||||
// This function can overapproximate (i.e., return true even if
|
||||
// sandboxing isn't supported, but not the reverse). See bug 993145.
|
||||
static bool
|
||||
IsSandboxingSupported(void)
|
||||
{
|
||||
return prctl(PR_GET_SECCOMP) != -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the seccomp sandbox for this process and sets user/group-based privileges.
|
||||
* Should be called only once, and before any potentially harmful content is loaded.
|
||||
@ -408,7 +416,9 @@ SetCurrentProcessSandbox()
|
||||
}
|
||||
#endif
|
||||
|
||||
BroadcastSetThreadSandbox();
|
||||
if (IsSandboxingSupported()) {
|
||||
BroadcastSetThreadSandbox();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
Loading…
x
Reference in New Issue
Block a user