aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/container.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/container.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/container.go')
-rw-r--r--container/container.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/container/container.go b/container/container.go
index 8f90235c..52691cea 100644
--- a/container/container.go
+++ b/container/container.go
@@ -179,6 +179,12 @@ func (p *Container) Start() error {
p.wait = make(chan struct{})
done <- func() error { // setup depending on per-thread state must happen here
+ // PR_SET_NO_NEW_PRIVS: depends on per-thread state but acts on all processes created from that thread
+ if err := SetNoNewPrivs(); err != nil {
+ return wrapErrSuffix(err,
+ "prctl(PR_SET_NO_NEW_PRIVS):")
+ }
+
msg.Verbose("starting container init")
if err := p.cmd.Start(); err != nil {
return msg.WrapErr(err, err.Error())