Commit 02f14c79 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

ia64: Pin controlling tty for unaligned fault message

Prevent destruction of the controlling tty before tty_write_message()
can determine if the tty is safe to use.
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7f71b2c1
...@@ -1336,8 +1336,11 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) ...@@ -1336,8 +1336,11 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
* Don't call tty_write_message() if we're in the kernel; we might * Don't call tty_write_message() if we're in the kernel; we might
* be holding locks... * be holding locks...
*/ */
if (user_mode(regs)) if (user_mode(regs)) {
tty_write_message(current->signal->tty, buf); struct tty_struct *tty = get_current_tty();
tty_write_message(tty, buf);
tty_kref_put(tty);
}
buf[len-1] = '\0'; /* drop '\r' */ buf[len-1] = '\0'; /* drop '\r' */
/* watch for command names containing %s */ /* watch for command names containing %s */
printk(KERN_WARNING "%s", buf); printk(KERN_WARNING "%s", buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment