Commit a52c7156 authored by rsesek's avatar rsesek Committed by Commit bot

[Android] Allow __NR_rt_tgsigqueueinfo under seccomp.

BUG=644759

Review-Url: https://codereview.chromium.org/2313393003
Cr-Commit-Position: refs/heads/master@{#417419}
parent a7fbfd26
......@@ -50,7 +50,8 @@ BoolExpr RestrictSocketArguments(const Arg<int>& domain,
} // namespace
SandboxBPFBasePolicyAndroid::SandboxBPFBasePolicyAndroid()
: SandboxBPFBasePolicy() {}
: SandboxBPFBasePolicy(),
pid_(getpid()) {}
SandboxBPFBasePolicyAndroid::~SandboxBPFBasePolicyAndroid() {}
......@@ -122,6 +123,13 @@ ResultExpr SandboxBPFBasePolicyAndroid::EvaluateSyscall(int sysno) const {
break;
}
// https://crbug.com/644759
if (sysno == __NR_rt_tgsigqueueinfo) {
const Arg<pid_t> tgid(0);
return If(tgid == pid_, Allow())
.Else(Error(EPERM));
}
#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
defined(__mips__)
if (sysno == __NR_socket) {
......
......@@ -5,6 +5,8 @@
#ifndef CONTENT_COMMON_SANDBOX_LINUX_ANDROID_SANDBOX_BPF_BASE_POLICY_ANDROID_H_
#define CONTENT_COMMON_SANDBOX_LINUX_ANDROID_SANDBOX_BPF_BASE_POLICY_ANDROID_H_
#include <sys/types.h>
#include "base/macros.h"
#include "content/common/sandbox_linux/sandbox_bpf_base_policy_linux.h"
......@@ -23,6 +25,8 @@ class SandboxBPFBasePolicyAndroid : public SandboxBPFBasePolicy {
int system_call_number) const override;
private:
const pid_t pid_;
DISALLOW_COPY_AND_ASSIGN(SandboxBPFBasePolicyAndroid);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment