diff options
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1426,12 +1426,8 @@ static void check_unsafe_exec(struct linux_binprm *bprm) | |||
1426 | struct task_struct *p = current, *t; | 1426 | struct task_struct *p = current, *t; |
1427 | unsigned n_fs; | 1427 | unsigned n_fs; |
1428 | 1428 | ||
1429 | if (p->ptrace) { | 1429 | if (p->ptrace) |
1430 | if (ptracer_capable(p, current_user_ns())) | 1430 | bprm->unsafe |= LSM_UNSAFE_PTRACE; |
1431 | bprm->unsafe |= LSM_UNSAFE_PTRACE_CAP; | ||
1432 | else | ||
1433 | bprm->unsafe |= LSM_UNSAFE_PTRACE; | ||
1434 | } | ||
1435 | 1431 | ||
1436 | /* | 1432 | /* |
1437 | * This isn't strictly necessary, but it makes it harder for LSMs to | 1433 | * This isn't strictly necessary, but it makes it harder for LSMs to |
@@ -1479,7 +1475,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm) | |||
1479 | if (task_no_new_privs(current)) | 1475 | if (task_no_new_privs(current)) |
1480 | return; | 1476 | return; |
1481 | 1477 | ||
1482 | inode = file_inode(bprm->file); | 1478 | inode = bprm->file->f_path.dentry->d_inode; |
1483 | mode = READ_ONCE(inode->i_mode); | 1479 | mode = READ_ONCE(inode->i_mode); |
1484 | if (!(mode & (S_ISUID|S_ISGID))) | 1480 | if (!(mode & (S_ISUID|S_ISGID))) |
1485 | return; | 1481 | return; |