зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1788596 - Merge UtilityAudioDecoderSandboxPolicy into UtilitySandboxPolicy r=jld
Differential Revision: https://phabricator.services.mozilla.com/D156284
This commit is contained in:
Родитель
bb54ba5873
Коммит
301e159051
|
@ -751,11 +751,8 @@ void SetUtilitySandbox(int aBroker, ipc::SandboxingKind aKind) {
|
|||
UniquePtr<sandbox::bpf_dsl::Policy> policy;
|
||||
switch (aKind) {
|
||||
case ipc::SandboxingKind::GENERIC_UTILITY:
|
||||
policy = GetUtilitySandboxPolicy(sBroker);
|
||||
break;
|
||||
|
||||
case ipc::SandboxingKind::UTILITY_AUDIO_DECODING_GENERIC:
|
||||
policy = GetUtilityAudioDecoderSandboxPolicy(sBroker);
|
||||
policy = GetUtilitySandboxPolicy(sBroker);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -2090,26 +2090,6 @@ class UtilitySandboxPolicy : public SandboxPolicyCommon {
|
|||
case __NR_getrusage:
|
||||
return Allow();
|
||||
|
||||
// Pass through the common policy.
|
||||
default:
|
||||
return SandboxPolicyCommon::EvaluateSyscall(sysno);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
UniquePtr<sandbox::bpf_dsl::Policy> GetUtilitySandboxPolicy(
|
||||
SandboxBrokerClient* aMaybeBroker) {
|
||||
return UniquePtr<sandbox::bpf_dsl::Policy>(
|
||||
new UtilitySandboxPolicy(aMaybeBroker));
|
||||
}
|
||||
|
||||
class UtilityAudioDecoderSandboxPolicy final : public UtilitySandboxPolicy {
|
||||
public:
|
||||
explicit UtilityAudioDecoderSandboxPolicy(SandboxBrokerClient* aBroker)
|
||||
: UtilitySandboxPolicy(aBroker) {}
|
||||
|
||||
ResultExpr EvaluateSyscall(int sysno) const override {
|
||||
switch (sysno) {
|
||||
// Required by FFmpeg
|
||||
case __NR_get_mempolicy:
|
||||
return Allow();
|
||||
|
@ -2126,15 +2106,15 @@ class UtilityAudioDecoderSandboxPolicy final : public UtilitySandboxPolicy {
|
|||
|
||||
// Pass through the common policy.
|
||||
default:
|
||||
return UtilitySandboxPolicy::EvaluateSyscall(sysno);
|
||||
return SandboxPolicyCommon::EvaluateSyscall(sysno);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
UniquePtr<sandbox::bpf_dsl::Policy> GetUtilityAudioDecoderSandboxPolicy(
|
||||
UniquePtr<sandbox::bpf_dsl::Policy> GetUtilitySandboxPolicy(
|
||||
SandboxBrokerClient* aMaybeBroker) {
|
||||
return UniquePtr<sandbox::bpf_dsl::Policy>(
|
||||
new UtilityAudioDecoderSandboxPolicy(aMaybeBroker));
|
||||
new UtilitySandboxPolicy(aMaybeBroker));
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -41,9 +41,6 @@ UniquePtr<sandbox::bpf_dsl::Policy> GetSocketProcessSandboxPolicy(
|
|||
UniquePtr<sandbox::bpf_dsl::Policy> GetUtilitySandboxPolicy(
|
||||
SandboxBrokerClient* aMaybeBroker);
|
||||
|
||||
UniquePtr<sandbox::bpf_dsl::Policy> GetUtilityAudioDecoderSandboxPolicy(
|
||||
SandboxBrokerClient* aMaybeBroker);
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче