diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-07 20:21:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-07 20:21:59 -0400 |
commit | a0127afbed65b7b9f8a486c557017eafb4d4c0fc (patch) | |
tree | 13cc11b0eb15128270e323c4053922d39a7343c7 | |
parent | 332a2e1244bd08b9e3ecd378028513396a004a24 (diff) | |
parent | c540521bba5d2f24bd2c0417157bfaf8b85e2eee (diff) |
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
-rw-r--r-- | Documentation/prctl/no_new_privs.txt | 7 | ||||
-rw-r--r-- | include/linux/prctl.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/prctl/no_new_privs.txt b/Documentation/prctl/no_new_privs.txt index cb705ec69abe..f7be84fba910 100644 --- a/Documentation/prctl/no_new_privs.txt +++ b/Documentation/prctl/no_new_privs.txt | |||
@@ -25,6 +25,13 @@ bits will no longer change the uid or gid; file capabilities will not | |||
25 | add to the permitted set, and LSMs will not relax constraints after | 25 | add to the permitted set, and LSMs will not relax constraints after |
26 | execve. | 26 | execve. |
27 | 27 | ||
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 | |||
28 | Note that no_new_privs does not prevent privilege changes that do not | 35 | Note that no_new_privs does not prevent privilege changes that do not |
29 | involve execve. An appropriately privileged task can still call | 36 | involve execve. An appropriately privileged task can still call |
30 | setuid(2) and receive SCM_RIGHTS datagrams. | 37 | setuid(2) and receive SCM_RIGHTS datagrams. |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index 3988012255dc..289760f424aa 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
@@ -141,6 +141,8 @@ | |||
141 | * Changing LSM security domain is considered a new privilege. So, for example, | 141 | * Changing LSM security domain is considered a new privilege. So, for example, |
142 | * asking selinux for a specific new context (e.g. with runcon) will result | 142 | * asking selinux for a specific new context (e.g. with runcon) will result |
143 | * in execve returning -EPERM. | 143 | * in execve returning -EPERM. |
144 | * | ||
145 | * See Documentation/prctl/no_new_privs.txt for more details. | ||
144 | */ | 146 | */ |
145 | #define PR_SET_NO_NEW_PRIVS 38 | 147 | #define PR_SET_NO_NEW_PRIVS 38 |
146 | #define PR_GET_NO_NEW_PRIVS 39 | 148 | #define PR_GET_NO_NEW_PRIVS 39 |