Messages in this thread Patch in this message | | | Date | Fri, 22 Nov 2013 18:54:39 +0100 | From | Oleg Nesterov <> | Subject | [PATCH 1/4] check_unsafe_exec: use while_each_thread() rather than next_thread() |
| |
next_thread() should be avoided, change check_unsafe_exec() to use while_each_thread(). This also saves 32 bytes.
Signed-off-by: Oleg Nesterov <oleg@redhat.com> --- fs/exec.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fs/exec.c b/fs/exec.c index 1dee8ef..0cd9c25 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1245,10 +1245,11 @@ static int check_unsafe_exec(struct linux_binprm *bprm) if (current->no_new_privs) bprm->unsafe |= LSM_UNSAFE_NO_NEW_PRIVS; + t = p; n_fs = 1; spin_lock(&p->fs->lock); rcu_read_lock(); - for (t = next_thread(p); t != p; t = next_thread(t)) { + while_each_thread(p, t) { if (t->fs == p->fs) n_fs++; } -- 1.5.5.1
| |