Skip to content

Commit a3232d2

Browse files
eparisxjamesmorris
authored andcommitted
capabilities: delete all CAP_INIT macros
The CAP_INIT macros of INH, BSET, and EFF made sense at one point in time, but now days they aren't helping. Just open code the logic in the init_cred. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
1 parent 5163b58 commit a3232d2

3 files changed

Lines changed: 3 additions & 13 deletions

File tree

‎include/linux/capability.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,6 @@ extern const kernel_cap_t __cap_init_eff_set;
421421

422422
#endif /* _KERNEL_CAPABILITY_U32S != 2 */
423423

424-
#define CAP_INIT_INH_SET CAP_EMPTY_SET
425-
#define CAP_INIT_EFF_SET CAP_FULL_SET
426-
427424
# define cap_clear(c) do { (c) = __cap_empty_set; } while (0)
428425

429426
#define cap_raise(c, flag) ((c).cap[CAP_TO_INDEX(flag)] |= CAP_TO_MASK(flag))

‎include/linux/init_task.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ extern struct group_info init_groups;
8383
#define INIT_IDS
8484
#endif
8585

86-
/*
87-
* Because of the reduced scope of CAP_SETPCAP when filesystem
88-
* capabilities are in effect, it is safe to allow CAP_SETPCAP to
89-
* be available in the default configuration.
90-
*/
91-
# define CAP_INIT_BSET CAP_FULL_SET
92-
9386
#ifdef CONFIG_RCU_BOOST
9487
#define INIT_TASK_RCU_BOOST() \
9588
.rcu_boost_mutex = NULL,

‎kernel/cred.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ struct cred init_cred = {
4949
.magic = CRED_MAGIC,
5050
#endif
5151
.securebits = SECUREBITS_DEFAULT,
52-
.cap_inheritable = CAP_INIT_INH_SET,
52+
.cap_inheritable = CAP_EMPTY_SET,
5353
.cap_permitted = CAP_FULL_SET,
54-
.cap_effective = CAP_INIT_EFF_SET,
55-
.cap_bset = CAP_INIT_BSET,
54+
.cap_effective = CAP_FULL_SET,
55+
.cap_bset = CAP_FULL_SET,
5656
.user = INIT_USER,
5757
.group_info = &init_groups,
5858
#ifdef CONFIG_KEYS

0 commit comments

Comments
 (0)