Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1305718 > unrolled thread

[PATCH 3/9] ia64: Pin controlling tty for unaligned fault message

Started byPeter Hurley <peter@hurleysoftware.com>
First post2016-01-10 23:50 +0100
Last post2016-01-10 23:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/9] ia64: Pin controlling tty for unaligned fault message Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 23:50 +0100

#1305718 — [PATCH 3/9] ia64: Pin controlling tty for unaligned fault message

FromPeter Hurley <peter@hurleysoftware.com>
Date2016-01-10 23:50 +0100
Subject[PATCH 3/9] ia64: Pin controlling tty for unaligned fault message
Message-ID<qPwY9-1VJ-13@gated-at.bofh.it>
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>
---
 arch/ia64/kernel/unaligned.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c
index 622772b..e7ae608 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);
-- 
2.7.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web