mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Add a helper method to allow the eventfd* family of syscalls.
PiperOrigin-RevId: 518565738 Change-Id: I2a3efe069ab1da65dd5f7cdcd3762637b7274b49
This commit is contained in:
parent
b50bc23138
commit
18894d57f9
|
@ -844,6 +844,16 @@ PolicyBuilder& PolicyBuilder::AllowRename() {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PolicyBuilder& PolicyBuilder::AllowEventFd() {
|
||||||
|
AllowSyscalls({
|
||||||
|
#ifdef __NR_eventfd
|
||||||
|
__NR_eventfd,
|
||||||
|
#endif
|
||||||
|
__NR_eventfd2,
|
||||||
|
});
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
PolicyBuilder& PolicyBuilder::AllowPrctlSetName() {
|
PolicyBuilder& PolicyBuilder::AllowPrctlSetName() {
|
||||||
AddPolicyOnSyscall(__NR_prctl, {ARG_32(0), JEQ32(PR_SET_NAME, ALLOW)});
|
AddPolicyOnSyscall(__NR_prctl, {ARG_32(0), JEQ32(PR_SET_NAME, ALLOW)});
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -474,6 +474,12 @@ class PolicyBuilder final {
|
||||||
// - renameat2
|
// - renameat2
|
||||||
PolicyBuilder& AllowRename();
|
PolicyBuilder& AllowRename();
|
||||||
|
|
||||||
|
// Appends code to allow creating event notification file descriptors.
|
||||||
|
// Allows these syscalls:
|
||||||
|
// - eventfd (if available)
|
||||||
|
// - eventfd2
|
||||||
|
PolicyBuilder& AllowEventFd();
|
||||||
|
|
||||||
// Appends code to allow polling files.
|
// Appends code to allow polling files.
|
||||||
// Allows these syscalls:
|
// Allows these syscalls:
|
||||||
// - poll (if available)
|
// - poll (if available)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user