Эх сурвалжийг харах

[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>
Alan Cox 18 жил өмнө
parent
commit
b1fc0b1f21
1 өөрчлөгдсөн 3 нэмэгдсэн , 1 устгасан
  1. 3 1
      arch/um/kernel/exec.c

+ 3 - 1
arch/um/kernel/exec.c

@@ -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){