[lkml]   [2003]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] disassociate_ctty SMP fix

the following patch, against today's BK tree, fixes a small
SMP race in disassociate_ctty. This function gets called
from do_exit, without the BKL held.

However, it sets the *tty variable before grabbing the bkl,
then makes decisions on what the variable was set to before
the lock was grabbed, despite the fact that another process
could modify its ->tty pointer in this same function.

please apply

Bravely reimplemented by the knights who say "NIH".
Current spamtrap: <a href=mailto:""></a>

===== drivers/char/tty_io.c 1.50 vs edited =====
--- 1.50/drivers/char/tty_io.c Sat Dec 7 16:23:16 2002
+++ edited/drivers/char/tty_io.c Sat Jan 11 11:37:34 2003
@@ -577,7 +577,7 @@
void disassociate_ctty(int on_exit)
- struct tty_struct *tty = current->tty;
+ struct tty_struct *tty;
struct task_struct *p;
struct list_head *l;
struct pid *pid;
@@ -585,6 +585,7 @@


+ tty = current->tty;
if (tty) {
tty_pgrp = tty->pgrp;
if (on_exit && tty->driver.type != TTY_DRIVER_TYPE_PTY)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-03-22 13:32    [W:0.026 / U:3.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site