From: Peter Hurley <peter@hurleysoftware.com>
To: Tony Luck <tony.luck@intel.com>, Fenghua Yu <fenghua.yu@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ia64: Pin controlling tty for unaligned fault message
Date: Thu, 16 Oct 2014 19:12:47 +0000 [thread overview]
Message-ID: <544018AF.5090507@hurleysoftware.com> (raw)
In-Reply-To: <1413486653-26010-1-git-send-email-peter@hurleysoftware.com>
On 10/16/2014 03:10 PM, Peter Hurley wrote:
> Prevent destruction of the controlling tty before tty_write_message()
> can determine if the tty is safe to use.
This does not make tty_write_message() bulletproof from concurrent
teardown, but that's on my todo list.
> 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);
>
WARNING: multiple messages have this Message-ID (diff)
From: Peter Hurley <peter@hurleysoftware.com>
To: Tony Luck <tony.luck@intel.com>, Fenghua Yu <fenghua.yu@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ia64: Pin controlling tty for unaligned fault message
Date: Thu, 16 Oct 2014 15:12:47 -0400 [thread overview]
Message-ID: <544018AF.5090507@hurleysoftware.com> (raw)
In-Reply-To: <1413486653-26010-1-git-send-email-peter@hurleysoftware.com>
On 10/16/2014 03:10 PM, Peter Hurley wrote:
> Prevent destruction of the controlling tty before tty_write_message()
> can determine if the tty is safe to use.
This does not make tty_write_message() bulletproof from concurrent
teardown, but that's on my todo list.
> 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);
>
next prev parent reply other threads:[~2014-10-16 19:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 19:10 [PATCH] ia64: Pin controlling tty for unaligned fault message Peter Hurley
2014-10-16 19:10 ` Peter Hurley
2014-10-16 19:12 ` Peter Hurley [this message]
2014-10-16 19:12 ` Peter Hurley
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=544018AF.5090507@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=fenghua.yu@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.