aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2011-04-01 17:08:34 -0400
committerJames Morris <jmorris@namei.org>2011-04-03 20:31:09 -0400
commitffa8e59df047d57e812a04f7d6baf6a25c652c0c (patch)
tree099fc879024f151ff5bc400763477f1bb0ffa254 /include/linux
parent4bf2ea77dba76a22f49db3c10773896aaeeb8f66 (diff)
capabilities: do not drop CAP_SETPCAP from the initial task
In olden' days of yore CAP_SETPCAP had special meaning for the init task. We actually have code to make sure that CAP_SETPCAP wasn't in pE of things using the init_cred. But CAP_SETPCAP isn't so special any more and we don't have a reason to special case dropping it for init or kthreads.... Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Andrew G. Morgan <morgan@kernel.org> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/capability.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 16ee8b49a200..11d562863e49 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -412,7 +412,6 @@ extern const kernel_cap_t __cap_init_eff_set;
412 412
413# define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }}) 413# define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }})
414# define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }}) 414# define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }})
415# define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }})
416# define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ 415# define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \
417 | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \ 416 | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \
418 CAP_FS_MASK_B1 } }) 417 CAP_FS_MASK_B1 } })
@@ -423,10 +422,10 @@ extern const kernel_cap_t __cap_init_eff_set;
423#endif /* _KERNEL_CAPABILITY_U32S != 2 */ 422#endif /* _KERNEL_CAPABILITY_U32S != 2 */
424 423
425#define CAP_INIT_INH_SET CAP_EMPTY_SET 424#define CAP_INIT_INH_SET CAP_EMPTY_SET
425#define CAP_INIT_EFF_SET CAP_FULL_SET
426 426
427# define cap_clear(c) do { (c) = __cap_empty_set; } while (0) 427# define cap_clear(c) do { (c) = __cap_empty_set; } while (0)
428# define cap_set_full(c) do { (c) = __cap_full_set; } while (0) 428# define cap_set_full(c) do { (c) = __cap_full_set; } while (0)
429# define cap_set_init_eff(c) do { (c) = __cap_init_eff_set; } while (0)
430 429
431#define cap_raise(c, flag) ((c).cap[CAP_TO_INDEX(flag)] |= CAP_TO_MASK(flag)) 430#define cap_raise(c, flag) ((c).cap[CAP_TO_INDEX(flag)] |= CAP_TO_MASK(flag))
432#define cap_lower(c, flag) ((c).cap[CAP_TO_INDEX(flag)] &= ~CAP_TO_MASK(flag)) 431#define cap_lower(c, flag) ((c).cap[CAP_TO_INDEX(flag)] &= ~CAP_TO_MASK(flag))
@@ -547,6 +546,9 @@ extern bool capable(int cap);
547extern bool ns_capable(struct user_namespace *ns, int cap); 546extern bool ns_capable(struct user_namespace *ns, int cap);
548extern bool task_ns_capable(struct task_struct *t, int cap); 547extern bool task_ns_capable(struct task_struct *t, int cap);
549 548
549extern const kernel_cap_t __cap_empty_set;
550extern const kernel_cap_t __cap_full_set;
551
550/** 552/**
551 * nsown_capable - Check superior capability to one's own user_ns 553 * nsown_capable - Check superior capability to one's own user_ns
552 * @cap: The capability in question 554 * @cap: The capability in question