From: Robert Love <rml@tech9.net>
To: marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] console close race fix
Date: 09 Dec 2001 18:15:26 -0500 [thread overview]
Message-ID: <1007939727.1237.5.camel@phantasy> (raw)
Marcelo,
The attached is a fix originally by Andrew Morton and discovered by the
preempt-kernel patch. It is in Alan's tree but was never merged into
Linus's.
There is a race between con_close and con_flush_chars.
n_tty_receive_buf writes to the tty queue and then flushes it via
con_flush_chars. If the console closes in between these operations,
con_flush_char barfs.
Please, for all that is righteous, apply.
Robert Love
diff -urN linux-2.4.17-pre7/drivers/char/console.c linux/drivers/char/console.c
--- linux-2.4.17-pre6/drivers/char/console.c Thu Dec 6 14:08:14 2001
+++ linux/drivers/char/console.c Thu Dec 6 14:09:06 2001
@@ -2356,8 +2356,14 @@
return;
pm_access(pm_con);
+
+ /*
+ * If we raced with con_close(), `vt' may be null.
+ * Hence this bandaid. - akpm
+ */
acquire_console_sem();
- set_cursor(vt->vc_num);
+ if (vt)
+ set_cursor(vt->vc_num);
release_console_sem();
}
reply other threads:[~2001-12-09 23:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1007939727.1237.5.camel@phantasy \
--to=rml@tech9.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox