Skip to content

Commit 6c8616a

Browse files
committed
added a new CAP_SYMBI_ELEV capability
1 parent 8a18549 commit 6c8616a

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

include/uapi/linux/capability.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,11 @@ struct vfs_ns_cap_data {
418418

419419
#define CAP_CHECKPOINT_RESTORE 40
420420

421-
#define CAP_LAST_CAP CAP_CHECKPOINT_RESTORE
421+
/* Allow performing the elevate syscall and make use of symbiote functionality */
422+
423+
#define CAP_SYMBI_ELEV 41
424+
425+
#define CAP_LAST_CAP CAP_SYMBI_ELEV
422426

423427
#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
424428

kernel/sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ SYSCALL_DEFINE1(elevate, unsigned long, flags)
10951095
struct SymbiReg sreg;
10961096
sreg.raw = flags;
10971097

1098-
if (!capable(CAP_SYS_ADMIN))
1098+
if (!capable(CAP_SYMBI_ELEV))
10991099
return -EPERM;
11001100

11011101
// User's registers

security/selinux/include/classmap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
#define COMMON_CAP2_PERMS "mac_override", "mac_admin", "syslog", \
3030
"wake_alarm", "block_suspend", "audit_read", "perfmon", "bpf", \
31-
"checkpoint_restore"
31+
"checkpoint_restore", "symbi_elev"
3232

33-
#if CAP_LAST_CAP > CAP_CHECKPOINT_RESTORE
33+
#if CAP_LAST_CAP > CAP_SYMBI_ELEV
3434
#error New capability defined, please update COMMON_CAP2_PERMS.
3535
#endif
3636

0 commit comments

Comments
 (0)