tty: fix race in tty_fasync
commit179b7e53797c61a7652075eb48c6008dbd2b88d5
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Dec 2009 15:07:19 +0000 (17 07:07 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 25 Jan 2010 18:49:15 +0000 (25 10:49 -0800)
tree6ff5e48f7a9c9d881763d143b9a896a4a96ed1e8
parentb70922a1819f26c3962a184070d9370dfae634a9
tty: fix race in tty_fasync

commit 703625118069f9f8960d356676662d3db5a9d116 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/tty_io.c