]> Cypherpunks repositories - gostls13.git/commit
syscall: add GidMappingsEnableSetgroups to Linux SysProcAttr
authorAlexander Morozov <lk4d4math@gmail.com>
Wed, 3 Jun 2015 17:50:39 +0000 (10:50 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 12 Jun 2015 23:38:59 +0000 (23:38 +0000)
commitf5c60ff2da4851f9056120a423ce6b48624fb97e
tree1ad6d39cccc3faae5e9e87df8e8847efbb3f4866
parent368f0ee6c4dc60b314dffbb63f5eab0ad62185d2
syscall: add GidMappingsEnableSetgroups to Linux SysProcAttr

Linux 3.19 made a change in the handling of setgroups and the 'gid_map' file to
address a security issue.
The upshot of the 3.19 changes is that in order to update the 'gid_maps' file,
use of the setgroups() system call in this user namespace must first be disabled
by writing "deny" to one of the /proc/PID/setgroups files for this namespace.

Also added tests for remapping uid_map and gid_map inside new user
namespace.

Fixes #10626

Change-Id: I4d2539acbab741a37092d277e10f31fc39a8feb7
Reviewed-on: https://go-review.googlesource.com/10670
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/syscall/exec_linux.go
src/syscall/exec_linux_test.go [new file with mode: 0644]