]> Cypherpunks repositories - gostls13.git/commit
syscall: add all ambient capabilities into permitted and inheritable sets
authorAndrei Vagin <avagin@google.com>
Mon, 7 Jan 2019 18:18:42 +0000 (10:18 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 8 Mar 2019 20:53:16 +0000 (20:53 +0000)
commit5930c7de933c4d826926396f715bae63333143a2
tree160dffcb059f1641072790eff0c2097fa4702854
parentf1d5ce0185fe184c016016d55f1718778b799f6d
syscall: add all ambient capabilities into permitted and inheritable sets

According to the prctl man page, each capability from the ambient set
must already be present in both  the  permitted  and  the  inheritable
sets  of the process.

exec_linux_test suggests configuring the capabilities in the parent
process. This doesn't look nice, because:
* Capabilities are a per-thread attribute, so we need to use
LockOSThread.
* Need to restore capabilities after creating a process.
* Doesn't work with user namespaces, because a process gets capabilities
when a namespace is created.

Fixes #23152

Change-Id: Iba23e530fc7b9f5182d602fe855f82218f354219
Reviewed-on: https://go-review.googlesource.com/c/go/+/156577
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/syscall/exec_linux.go
src/syscall/exec_linux_test.go