diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/prctl.h | 15 | ||||
-rw-r--r-- | include/linux/sched.h | 2 | ||||
-rw-r--r-- | include/linux/security.h | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index e0cfec2490aa..78b76e24cc7e 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
@@ -124,4 +124,19 @@ | |||
124 | #define PR_SET_CHILD_SUBREAPER 36 | 124 | #define PR_SET_CHILD_SUBREAPER 36 |
125 | #define PR_GET_CHILD_SUBREAPER 37 | 125 | #define PR_GET_CHILD_SUBREAPER 37 |
126 | 126 | ||
127 | /* | ||
128 | * If no_new_privs is set, then operations that grant new privileges (i.e. | ||
129 | * execve) will either fail or not grant them. This affects suid/sgid, | ||
130 | * file capabilities, and LSMs. | ||
131 | * | ||
132 | * Operations that merely manipulate or drop existing privileges (setresuid, | ||
133 | * capset, etc.) will still work. Drop those privileges if you want them gone. | ||
134 | * | ||
135 | * Changing LSM security domain is considered a new privilege. So, for example, | ||
136 | * asking selinux for a specific new context (e.g. with runcon) will result | ||
137 | * in execve returning -EPERM. | ||
138 | */ | ||
139 | #define PR_SET_NO_NEW_PRIVS 38 | ||
140 | #define PR_GET_NO_NEW_PRIVS 39 | ||
141 | |||
127 | #endif /* _LINUX_PRCTL_H */ | 142 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 81a173c0897d..ba60897bb447 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1341,6 +1341,8 @@ struct task_struct { | |||
1341 | * execve */ | 1341 | * execve */ |
1342 | unsigned in_iowait:1; | 1342 | unsigned in_iowait:1; |
1343 | 1343 | ||
1344 | /* task may not gain privileges */ | ||
1345 | unsigned no_new_privs:1; | ||
1344 | 1346 | ||
1345 | /* Revert to default priority/policy when forking */ | 1347 | /* Revert to default priority/policy when forking */ |
1346 | unsigned sched_reset_on_fork:1; | 1348 | unsigned sched_reset_on_fork:1; |
diff --git a/include/linux/security.h b/include/linux/security.h index 673afbb8238a..6e1dea93907a 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -144,6 +144,7 @@ struct request_sock; | |||
144 | #define LSM_UNSAFE_SHARE 1 | 144 | #define LSM_UNSAFE_SHARE 1 |
145 | #define LSM_UNSAFE_PTRACE 2 | 145 | #define LSM_UNSAFE_PTRACE 2 |
146 | #define LSM_UNSAFE_PTRACE_CAP 4 | 146 | #define LSM_UNSAFE_PTRACE_CAP 4 |
147 | #define LSM_UNSAFE_NO_NEW_PRIVS 8 | ||
147 | 148 | ||
148 | #ifdef CONFIG_MMU | 149 | #ifdef CONFIG_MMU |
149 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, | 150 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, |