Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143830
b: refs/heads/master
c: 437f7fd
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Apr 24, 2009
1 parent 310b3a2 commit df5b512
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c652f96d3852b97a49c331cd0bb02d22f3cb31b
refs/heads/master: 437f7fdb607f32b737e4da9f14bebcfdac2c90c3
6 changes: 2 additions & 4 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,19 +1060,19 @@ EXPORT_SYMBOL(install_exec_creds);
int check_unsafe_exec(struct linux_binprm *bprm)
{
struct task_struct *p = current, *t;
unsigned long flags;
unsigned n_fs;
int res = 0;

bprm->unsafe = tracehook_unsafe_exec(p);

n_fs = 1;
write_lock(&p->fs->lock);
lock_task_sighand(p, &flags);
rcu_read_lock();
for (t = next_thread(p); t != p; t = next_thread(t)) {
if (t->fs == p->fs)
n_fs++;
}
rcu_read_unlock();

if (p->fs->users > n_fs) {
bprm->unsafe |= LSM_UNSAFE_SHARE;
Expand All @@ -1083,8 +1083,6 @@ int check_unsafe_exec(struct linux_binprm *bprm)
res = 1;
}
}

unlock_task_sighand(p, &flags);
write_unlock(&p->fs->lock);

return res;
Expand Down

0 comments on commit df5b512

Please sign in to comment.