diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-14 08:03:18 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-14 08:03:18 -0800 |
| commit | 9147191c813c705459d56b68523fe0d127594be5 (patch) | |
| tree | f512a4877da5272b237c25cb5a85336bc7a52cdb | |
| parent | b88182f4903e4745dc155be4874db8becf07d456 (diff) | |
| download | patches-9147191c813c705459d56b68523fe0d127594be5.tar.gz | |
tty bugfix
| -rw-r--r-- | series | 1 | ||||
| -rw-r--r-- | tty.current/tty-fix-race-in-tty_fasync.patch | 39 |
2 files changed, 40 insertions, 0 deletions
@@ -15,6 +15,7 @@ gregkh/gkh-version.patch ################################# tty.current/serial-imx-bit-confusion.patch tty.current/serial-core-resume-serial-hardware-with-no_console_suspend.patch +tty.current/tty-fix-race-in-tty_fasync.patch ################################# # USB patches for 2.6.33 diff --git a/tty.current/tty-fix-race-in-tty_fasync.patch b/tty.current/tty-fix-race-in-tty_fasync.patch new file mode 100644 index 00000000000000..3adb6479caaae7 --- /dev/null +++ b/tty.current/tty-fix-race-in-tty_fasync.patch @@ -0,0 +1,39 @@ +From foo@baz Thu Jan 14 08:00:21 PST 2010 +Date: Thu, 17 Dec 2009 07:07:19 -0800 +To: Greg KH <greg@kroah.com> +From: Greg Kroah-Hartman <gregkh@suse.de> +Subject: tty: fix race in tty_fasync + +We need to keep the lock held over the call to __f_setown() to +prevent a PID race. + +Thanks to Al Viro for pointing out the problem, and to Travis for +making us look here in the first place. + +Cc: Eric W. Biederman <ebiederm@xmission.com> +Cc: Al Viro <viro@ZenIV.linux.org.uk> +Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> +Cc: Linus Torvalds <torvalds@linux-foundation.org> +Cc: Tavis Ormandy <taviso@google.com> +Cc: Jeff Dike <jdike@addtoit.com> +Cc: Julien Tinnes <jln@google.com> +Cc: Matt Mackall <mpm@selenic.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/char/tty_io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/char/tty_io.c ++++ b/drivers/char/tty_io.c +@@ -1951,8 +1951,8 @@ static int tty_fasync(int fd, struct fil + pid = task_pid(current); + type = PIDTYPE_PID; + } +- spin_unlock_irqrestore(&tty->ctrl_lock, flags); + retval = __f_setown(filp, pid, type, 0); ++ spin_unlock_irqrestore(&tty->ctrl_lock, flags); + if (retval) + goto out; + } else { |
