]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] UML: tty locking
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Tue, 26 Sep 2006 06:33:08 +0000 (23:33 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 26 Sep 2006 15:49:09 +0000 (08:49 -0700)
Ensure current->signal->tty doesn't get freed during log_exec().

Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/kernel/exec.c

index fc38a6d5906d4251599a95753f229486eae2cb4e..0561c43b4685c7935f4fb33600229a7c15793bf1 100644 (file)
@@ -41,9 +41,11 @@ static long execve1(char *file, char __user * __user *argv,
         long error;
 
 #ifdef CONFIG_TTY_LOG
-       task_lock(current);
+       mutex_lock(&tty_mutex);
+       task_lock(current);     /* FIXME:  is this needed ? */
        log_exec(argv, current->signal->tty);
        task_unlock(current);
+       mutex_unlock(&tty_mutex);
 #endif
         error = do_execve(file, argv, env, &current->thread.regs);
         if (error == 0){