summaryrefslogtreecommitdiff
path: root/arch/ia64
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-11 07:36:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-29 01:13:44 +0300
commit02f14c79abe26a2045669e34baf2c8902d13ae54 (patch)
tree3802df787e3d3e01ee19a4b177954f8ba4db4f38 /arch/ia64
parent7f71b2c1441877141651d96c9a380bfb32e2ff78 (diff)
downloadlinux-02f14c79abe26a2045669e34baf2c8902d13ae54.tar.xz
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: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kernel/unaligned.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c
index 622772b7fb6c..e7ae6088350a 100644
--- a/arch/ia64/kernel/unaligned.c
+++ b/arch/ia64/kernel/unaligned.c
@@ -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
* be holding locks...
*/
- if (user_mode(regs))
- tty_write_message(current->signal->tty, buf);
+ if (user_mode(regs)) {
+ struct tty_struct *tty = get_current_tty();
+ tty_write_message(tty, buf);
+ tty_kref_put(tty);
+ }
buf[len-1] = '\0'; /* drop '\r' */
/* watch for command names containing %s */
printk(KERN_WARNING "%s", buf);