[PATCH] UML: tty locking

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>

authored by

Alan Cox and committed by
Linus Torvalds
b1fc0b1f 75e29b18

+3 -1
+3 -1
arch/um/kernel/exec.c
··· 41 long error; 42 43 #ifdef CONFIG_TTY_LOG 44 - task_lock(current); 45 log_exec(argv, current->signal->tty); 46 task_unlock(current); 47 #endif 48 error = do_execve(file, argv, env, &current->thread.regs); 49 if (error == 0){
··· 41 long error; 42 43 #ifdef CONFIG_TTY_LOG 44 + mutex_lock(&tty_mutex); 45 + task_lock(current); /* FIXME: is this needed ? */ 46 log_exec(argv, current->signal->tty); 47 task_unlock(current); 48 + mutex_unlock(&tty_mutex); 49 #endif 50 error = do_execve(file, argv, env, &current->thread.regs); 51 if (error == 0){