Skip to content

Commit cb839a5

Browse files
committed
Update sandboxed-api dependency and import internal changes
- cl/806270901 - cl/764006885 - cl/767014600 Bug: b/445259151
1 parent 7597120 commit cb839a5

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

base/cvd/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ git_override(
6767

6868
git_override(
6969
module_name = "sandboxed_api",
70-
commit = "75b6c16e8e95314456795b34af06571879b18e1f",
70+
commit = "c520612b14a472e0b4784e9f9e41f9e822264cc3",
7171
remote = "https://github.com/google/sandboxed-api.git",
7272
patch_strip = 1,
7373
patches = [

base/cvd/cuttlefish/host/commands/process_sandboxer/policies/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ cf_cc_library(
5454
deps = [
5555
"//cuttlefish/host/commands/process_sandboxer:policies_header",
5656
"@sandboxed_api//sandboxed_api/sandbox2",
57+
"@sandboxed_api//sandboxed_api/sandbox2/allowlists:map_exec",
5758
"@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
5859
"@sandboxed_api//sandboxed_api/util:file_base",
5960
],

base/cvd/cuttlefish/host/commands/process_sandboxer/policies/baseline.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <string_view>
2323
#include <vector>
2424

25+
#include "sandboxed_api/sandbox2/allowlists/map_exec.h"
2526
#include "sandboxed_api/sandbox2/policybuilder.h"
2627
#include "sandboxed_api/sandbox2/util/bpf_helper.h"
2728
#include "sandboxed_api/util/path.h"
@@ -35,11 +36,12 @@ sandbox2::PolicyBuilder BaselinePolicy(const HostInfo& host,
3536
return sandbox2::PolicyBuilder()
3637
.AddLibrariesForBinary(exe, JoinPath(host.host_artifacts_path, "lib64"))
3738
// For dynamic linking and memory allocation
38-
.AllowDynamicStartup()
39+
.AllowDynamicStartup(sandbox2::MapExec())
3940
.AllowExit()
4041
.AllowGetPIDs()
4142
.AllowGetRandom()
4243
// Observed by `strace` on `socket_vsock_proxy` with x86_64 AOSP `glibc`.
44+
.Allow(sandbox2::MapExec())
4345
.AddPolicyOnMmap([](bpf_labels& labels) -> std::vector<sock_filter> {
4446
return {
4547
ARG_32(2), // prot

base/cvd/cuttlefish/host/commands/process_sandboxer/policies/run_cvd.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ sandbox2::PolicyBuilder RunCvdPolicy(const HostInfo& host) {
125125
.AllowEventFd()
126126
.AllowFork() // Multithreading, sandboxer_proxy, process monitor
127127
.AllowGetIDs()
128-
.AllowInotifyInit()
128+
.AllowInotify()
129129
.AllowMkdir()
130130
.AllowPipe()
131131
.AllowSafeFcntl()
@@ -135,8 +135,6 @@ sandbox2::PolicyBuilder RunCvdPolicy(const HostInfo& host) {
135135
.AllowSyscall(__NR_connect)
136136
.AllowSyscall(__NR_execve) // sandboxer_proxy
137137
.AllowSyscall(__NR_getsid)
138-
.AllowSyscall(__NR_inotify_add_watch)
139-
.AllowSyscall(__NR_inotify_rm_watch)
140138
.AllowSyscall(__NR_listen)
141139
.AllowSyscall(__NR_msgget) // Metrics SysV RPC
142140
.AllowSyscall(__NR_msgsnd) // Metrics SysV RPC

0 commit comments

Comments
 (0)