aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/syscall.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-18 11:46:02 +0900
committerOphestra <cat@gensokyo.uk>2025-08-18 11:46:02 +0900
commit69a4ab81053ef31d745ac0d92531cefb7d3a3e44 (patch)
tree1997f2e46dedfb9ef406516a7972c21d0cb88f90 /container/syscall.go
parent22d577ab49c31b0c391dba37e01926e293b0a303 (diff)
container: move PR_SET_NO_NEW_PRIVS to parent
This allows some LSM setup in the parent. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/syscall.go')
-rw-r--r--container/syscall.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/container/syscall.go b/container/syscall.go
index 075da89a..62b85c55 100644
--- a/container/syscall.go
+++ b/container/syscall.go
@@ -18,6 +18,14 @@ func SetDumpable(dumpable uintptr) error {
return nil
}
+func SetNoNewPrivs() error {
+ _, _, errno := syscall.Syscall(syscall.SYS_PRCTL, PR_SET_NO_NEW_PRIVS, 1, 0)
+ if errno == 0 {
+ return nil
+ }
+ return errno
+}
+
// IgnoringEINTR makes a function call and repeats it if it returns an
// EINTR error. This appears to be required even though we install all
// signal handlers with SA_RESTART: see #22838, #38033, #38836, #40846.