From a20596752cbd4088d87c8651850de9286a8e9d72 Mon Sep 17 00:00:00 2001 From: Ray Essick Date: Sun, 12 Jul 2020 20:28:07 -0700 Subject: [PATCH] extend syscall minijail for clang code coverage cutover to clang-based code coverage uses extra system call (ftruncate) when writing coverage data. exposed while generating coverage for media.extractor. Bug: 160917521 Test: build, boot, kill -37 extractors for {arm,x86}x{32,64} Change-Id: I555b168c7aab43caa590df951861b92e8fa14bc3 --- code_coverage/seccomp_policy/code_coverage.arm.policy | 1 + code_coverage/seccomp_policy/code_coverage.arm64.policy | 1 + code_coverage/seccomp_policy/code_coverage.policy.def | 2 ++ code_coverage/seccomp_policy/code_coverage.x86.policy | 1 + code_coverage/seccomp_policy/code_coverage.x86_64.policy | 1 + 5 files changed, 6 insertions(+) diff --git a/code_coverage/seccomp_policy/code_coverage.arm.policy b/code_coverage/seccomp_policy/code_coverage.arm.policy index d6784e371..b80910f19 100644 --- a/code_coverage/seccomp_policy/code_coverage.arm.policy +++ b/code_coverage/seccomp_policy/code_coverage.arm.policy @@ -6,6 +6,7 @@ openat: 1 write: 1 fcntl64: 1 fstat64: 1 +ftruncate64: 1 geteuid32: 1 _llseek: 1 mmap2: 1 diff --git a/code_coverage/seccomp_policy/code_coverage.arm64.policy b/code_coverage/seccomp_policy/code_coverage.arm64.policy index 4c3dd2664..7040ea258 100644 --- a/code_coverage/seccomp_policy/code_coverage.arm64.policy +++ b/code_coverage/seccomp_policy/code_coverage.arm64.policy @@ -6,6 +6,7 @@ openat: 1 write: 1 fcntl: 1 fstat: 1 +ftruncate: 1 geteuid: 1 lseek: 1 mmap: 1 diff --git a/code_coverage/seccomp_policy/code_coverage.policy.def b/code_coverage/seccomp_policy/code_coverage.policy.def index f136084bc..599c4a458 100644 --- a/code_coverage/seccomp_policy/code_coverage.policy.def +++ b/code_coverage/seccomp_policy/code_coverage.policy.def @@ -22,6 +22,7 @@ write: 1 #if defined(__LP64__) fcntl: 1 fstat: 1 +ftruncate: 1 geteuid: 1 lseek: 1 mmap: 1 @@ -29,6 +30,7 @@ rt_sigreturn: 1 #else fcntl64: 1 fstat64: 1 +ftruncate64: 1 geteuid32: 1 _llseek: 1 mmap2: 1 diff --git a/code_coverage/seccomp_policy/code_coverage.x86.policy b/code_coverage/seccomp_policy/code_coverage.x86.policy index 24ff8b9c0..f8e0cc0f4 100644 --- a/code_coverage/seccomp_policy/code_coverage.x86.policy +++ b/code_coverage/seccomp_policy/code_coverage.x86.policy @@ -6,6 +6,7 @@ openat: 1 write: 1 fcntl64: 1 fstat64: 1 +ftruncate64: 1 geteuid32: 1 _llseek: 1 mmap2: 1 diff --git a/code_coverage/seccomp_policy/code_coverage.x86_64.policy b/code_coverage/seccomp_policy/code_coverage.x86_64.policy index 308103654..dcf2f9a11 100644 --- a/code_coverage/seccomp_policy/code_coverage.x86_64.policy +++ b/code_coverage/seccomp_policy/code_coverage.x86_64.policy @@ -6,6 +6,7 @@ openat: 1 write: 1 fcntl: 1 fstat: 1 +ftruncate: 1 geteuid: 1 lseek: 1 mmap: 1