Skip to content

Commit f1191b5

Browse files
author
Al Viro
committed
check_unsafe_exec() doesn't care about signal handlers sharing
... since we'll unshare sighand anyway Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 498052b commit f1191b5

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎fs/exec.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,23 +1060,20 @@ int check_unsafe_exec(struct linux_binprm *bprm)
10601060
{
10611061
struct task_struct *p = current, *t;
10621062
unsigned long flags;
1063-
unsigned n_fs, n_sighand;
1063+
unsigned n_fs;
10641064
int res = 0;
10651065

10661066
bprm->unsafe = tracehook_unsafe_exec(p);
10671067

10681068
n_fs = 1;
1069-
n_sighand = 1;
10701069
write_lock(&p->fs->lock);
10711070
lock_task_sighand(p, &flags);
10721071
for (t = next_thread(p); t != p; t = next_thread(t)) {
10731072
if (t->fs == p->fs)
10741073
n_fs++;
1075-
n_sighand++;
10761074
}
10771075

1078-
if (p->fs->users > n_fs ||
1079-
atomic_read(&p->sighand->count) > n_sighand) {
1076+
if (p->fs->users > n_fs) {
10801077
bprm->unsafe |= LSM_UNSAFE_SHARE;
10811078
} else {
10821079
if (p->fs->in_exec)

0 commit comments

Comments
 (0)