File tree Expand file tree Collapse file tree 6 files changed +7
-13
lines changed Expand file tree Collapse file tree 6 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -1426,12 +1426,8 @@ static void check_unsafe_exec(struct linux_binprm *bprm)
1426
1426
struct task_struct * p = current , * t ;
1427
1427
unsigned n_fs ;
1428
1428
1429
- if (p -> ptrace ) {
1430
- if (ptracer_capable (p , current_user_ns ()))
1431
- bprm -> unsafe |= LSM_UNSAFE_PTRACE_CAP ;
1432
- else
1433
- bprm -> unsafe |= LSM_UNSAFE_PTRACE ;
1434
- }
1429
+ if (p -> ptrace )
1430
+ bprm -> unsafe |= LSM_UNSAFE_PTRACE ;
1435
1431
1436
1432
/*
1437
1433
* This isn't strictly necessary, but it makes it harder for LSMs to
Original file line number Diff line number Diff line change @@ -140,8 +140,7 @@ struct request_sock;
140
140
/* bprm->unsafe reasons */
141
141
#define LSM_UNSAFE_SHARE 1
142
142
#define LSM_UNSAFE_PTRACE 2
143
- #define LSM_UNSAFE_PTRACE_CAP 4
144
- #define LSM_UNSAFE_NO_NEW_PRIVS 8
143
+ #define LSM_UNSAFE_NO_NEW_PRIVS 4
145
144
146
145
#ifdef CONFIG_MMU
147
146
extern int mmap_min_addr_handler (struct ctl_table * table , int write ,
Original file line number Diff line number Diff line change @@ -469,7 +469,7 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm)
469
469
;
470
470
}
471
471
472
- if (bprm -> unsafe & ( LSM_UNSAFE_PTRACE | LSM_UNSAFE_PTRACE_CAP ) ) {
472
+ if (bprm -> unsafe & LSM_UNSAFE_PTRACE ) {
473
473
error = may_change_ptraced_domain (new_profile );
474
474
if (error )
475
475
goto audit ;
Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
548
548
549
549
if ((is_setid ||
550
550
!cap_issubset (new -> cap_permitted , old -> cap_permitted )) &&
551
- ((bprm -> unsafe & ~( LSM_UNSAFE_PTRACE | LSM_UNSAFE_PTRACE_CAP ) ) ||
551
+ ((bprm -> unsafe & ~LSM_UNSAFE_PTRACE ) ||
552
552
!ptracer_capable (current , new -> user_ns ))) {
553
553
/* downgrade; they get no more than they had, and maybe less */
554
554
if (!ns_capable (new -> user_ns , CAP_SETUID ) ||
Original file line number Diff line number Diff line change @@ -2404,8 +2404,7 @@ static int selinux_bprm_set_creds(struct linux_binprm *bprm)
2404
2404
2405
2405
/* Make sure that anyone attempting to ptrace over a task that
2406
2406
* changes its SID has the appropriate permit */
2407
- if (bprm -> unsafe &
2408
- (LSM_UNSAFE_PTRACE | LSM_UNSAFE_PTRACE_CAP )) {
2407
+ if (bprm -> unsafe & LSM_UNSAFE_PTRACE ) {
2409
2408
u32 ptsid = ptrace_parent_sid (current );
2410
2409
if (ptsid != 0 ) {
2411
2410
rc = avc_has_perm (ptsid , new_tsec -> sid ,
Original file line number Diff line number Diff line change @@ -934,7 +934,7 @@ static int smack_bprm_set_creds(struct linux_binprm *bprm)
934
934
isp -> smk_task != sbsp -> smk_root )
935
935
return 0 ;
936
936
937
- if (bprm -> unsafe & ( LSM_UNSAFE_PTRACE | LSM_UNSAFE_PTRACE_CAP ) ) {
937
+ if (bprm -> unsafe & LSM_UNSAFE_PTRACE ) {
938
938
struct task_struct * tracer ;
939
939
rc = 0 ;
940
940
You can’t perform that action at this time.
0 commit comments