lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180829003539.668e514c@roar.ozlabs.ibm.com>
Date:   Wed, 29 Aug 2018 00:35:39 +1000
From:   Nicholas Piggin <npiggin@...il.com>
To:     Matteo Croce <mcroce@...hat.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jslaby@...e.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        linux-kernel@...r.kernel.org
Subject: Re: VirtIO console hangs

On Tue, 28 Aug 2018 12:54:08 +0000
Matteo Croce <mcroce@...hat.com> wrote:

> With kernel 4.19.0-rc1 virtio_console hangs very often.
> I can always trigger the bug by pasting some characters in the
> terminal window, the console will stop receiving keypresses, but I can
> still see output from the console.
> Stangely, logging in the VM via SSH and sending lot of data to hvc0,
> like 'dmesg >/dev/hvc0' will fix the issue until the next paste.
> 
> I did a git bisect and I've found that this is the offending commit,
> reverting it fixes it.
> 
> Cheers,
> 
> commit ec97eaad1383ab2500fcf9a07ade6044fbcc67f5
> Author: Nicholas Piggin <npiggin@...il.com>
> Date:   Tue May 1 00:55:54 2018 +1000
> 
>     tty: hvc: hvc_poll() break hv read loop

Thanks for the report. I can't immediately see what the problem
is. Can you try get a stack trace of where it is stuck?

Perhaps try this patch if you have time (it's a bit of a shot
in the dark).

Thanks,
Nick

diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index 5414c4a87bea..ac45235832f1 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -635,6 +635,7 @@ static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)
 	int read_total = 0;
 	int written_total = 0;
 
+again:
 	spin_lock_irqsave(&hp->lock, flags);
 
 	/* Push pending writes */
@@ -721,6 +722,10 @@ static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)
 		poll_mask |= HVC_POLL_READ;
 	read_total = n;
 
+	spin_unlock_irqrestore(&hp->lock, flags);
+	cond_resched();
+	goto again;
+
  out:
 	/* Wakeup write queue if necessary */
 	if (hp->do_wakeup) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ