Skip to content

Commit a0127af

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security docs update from James Morris. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: security: Minor improvements to no_new_privs documentation
2 parents 332a2e1 + c540521 commit a0127af

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Documentation/prctl/no_new_privs.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ bits will no longer change the uid or gid; file capabilities will not
2525
add to the permitted set, and LSMs will not relax constraints after
2626
execve.
2727

28+
To set no_new_privs, use prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0).
29+
30+
Be careful, though: LSMs might also not tighten constraints on exec
31+
in no_new_privs mode. (This means that setting up a general-purpose
32+
service launcher to set no_new_privs before execing daemons may
33+
interfere with LSM-based sandboxing.)
34+
2835
Note that no_new_privs does not prevent privilege changes that do not
2936
involve execve. An appropriately privileged task can still call
3037
setuid(2) and receive SCM_RIGHTS datagrams.

include/linux/prctl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@
141141
* Changing LSM security domain is considered a new privilege. So, for example,
142142
* asking selinux for a specific new context (e.g. with runcon) will result
143143
* in execve returning -EPERM.
144+
*
145+
* See Documentation/prctl/no_new_privs.txt for more details.
144146
*/
145147
#define PR_SET_NO_NEW_PRIVS 38
146148
#define PR_GET_NO_NEW_PRIVS 39

0 commit comments

Comments
 (0)