Amit Shah
e74d098c66
hvc_console: Fix race between hvc_close and hvc_remove
...
Alan pointed out a race in the code where hvc_remove is invoked. The
recent virtio_console work is the first user of hvc_remove().
Alan describes it thus:
The hvc_console assumes that a close and remove call can't occur at the
same time.
In addition tty_hangup(tty) is problematic as tty_hangup is asynchronous
itself....
So this can happen
hvc_close hvc_remove
hung up ? - no
lock
tty = hp->tty
unlock
lock
hp->tty = NULL
unlock
notify del
kref_put the hvc struct
close completes
tty is destroyed
tty_hangup dead tty
tty->ops will be NULL
NULL->...
This patch adds some tty krefs and also converts to using tty_vhangup().
Reported-by: Alan Cox <alan@lxorguk.ukuu.org.uk >
Signed-off-by: Amit Shah <amit.shah@redhat.com >
CC: Alan Cox <alan@lxorguk.ukuu.org.uk >
CC: linuxppc-dev@ozlabs.org
CC: Rusty Russell <rusty@rustcorp.com.au >
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de >
2010-03-19 07:17:54 -07:00
..
2010-03-13 14:45:49 -08:00
2010-03-08 16:55:37 +01:00
2010-03-08 16:55:37 +01:00
2010-03-12 15:52:40 -08:00
2009-09-24 07:21:03 -07:00
2010-02-17 17:37:33 +01:00
2009-12-04 15:39:55 +01:00
2010-02-11 13:59:42 -08:00
2009-10-01 16:11:11 -07:00
2009-07-12 12:22:34 -07:00
2009-10-01 16:11:11 -07:00
2010-02-09 11:13:56 +01:00
2009-12-11 15:18:03 -08:00
2009-10-01 16:11:11 -07:00
2009-06-26 14:37:26 +10:00
2009-01-06 15:59:30 -08:00
2009-10-14 17:36:48 +02:00
2010-03-02 14:43:15 -08:00
2009-10-04 15:05:10 -07:00
2009-12-16 07:19:59 -08:00
2009-12-11 15:18:03 -08:00
2009-10-14 17:36:49 +02:00
2009-10-11 11:20:58 -07:00
2009-10-13 10:20:16 -07:00
2009-11-18 08:37:40 -08:00
2010-02-25 15:38:37 -08:00
2010-03-19 07:17:54 -07:00
2010-02-24 14:22:32 +10:30
2009-01-13 14:48:01 +11:00
2010-03-08 16:55:37 +01:00
2010-03-08 12:25:29 +01:00
2010-02-24 14:22:32 +10:30
2010-02-24 14:22:32 +10:30
2010-02-24 14:22:32 +10:30
2010-02-24 14:22:32 +10:30
2009-06-18 11:16:55 +10:00
2009-08-20 10:29:28 +10:00
2010-03-02 14:43:15 -08:00
2009-12-11 15:18:06 -08:00
2010-02-24 14:22:53 +10:30
2010-02-04 00:25:19 -08:00
2009-12-10 22:55:36 +01:00
2009-12-11 15:18:03 -08:00
2009-09-15 08:42:00 -07:00
2010-03-12 15:52:35 -08:00
2009-12-15 08:53:27 -08:00
2010-03-12 15:52:43 -08:00
2010-03-02 14:43:15 -08:00
2009-12-04 15:39:55 +01:00
2010-03-02 14:43:12 -08:00
2009-07-12 12:22:34 -07:00
2009-12-04 15:39:55 +01:00
2010-03-12 15:52:43 -08:00
2010-03-02 14:43:22 -08:00
2010-03-01 08:51:52 -08:00
2009-12-19 23:36:00 +00:00
2009-10-14 17:36:52 +02:00
2009-06-18 13:03:54 -07:00
2009-06-15 16:47:27 +10:00
2010-02-09 11:13:56 +01:00
2010-02-04 11:55:45 +01:00
2009-09-19 12:50:38 -07:00
2009-12-11 15:18:06 -08:00
2009-07-12 12:22:34 -07:00
2009-11-18 08:37:40 -08:00
2009-02-22 09:23:02 -08:00
2009-10-14 17:36:53 +02:00
2009-06-11 08:51:01 -07:00
2009-10-11 11:20:58 -07:00
2010-03-08 16:55:37 +01:00
2010-01-04 12:31:20 -08:00
2010-03-02 14:43:22 -08:00
2009-12-11 15:18:06 -08:00
2009-07-12 12:22:34 -07:00
2010-03-02 14:43:08 -08:00
2010-03-02 14:43:16 -08:00
2009-09-01 01:13:31 -07:00
2009-12-16 07:19:57 -08:00
2009-10-14 17:36:53 +02:00
2009-10-11 11:20:58 -07:00
2010-01-04 12:31:21 -08:00
2010-03-12 15:52:39 -08:00
2010-03-03 08:48:58 -08:00
2010-03-08 16:55:37 +01:00
2009-11-09 09:40:54 +01:00
2010-03-02 14:43:22 -08:00
2009-12-11 15:18:07 -08:00
2010-01-27 11:33:53 +01:00
2009-07-20 16:38:43 -07:00
2009-06-02 10:32:34 +10:00
2010-03-04 13:40:39 +05:30
2010-02-27 18:27:14 +01:00
2010-03-19 07:17:52 -07:00
2010-02-09 11:13:56 +01:00