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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190216072127.GA1945@tigerII.localdomain>
Date:   Sat, 16 Feb 2019 16:21:27 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To:     Yao HongBo <yaohongbo@...wei.com>
Cc:     sergey.senozhatsky@...il.com, linuxarm@...wei.com,
        linux-kernel@...r.kernel.org
Subject: Re: possible deadlock in console_unlock

On (02/16/19 14:36), Yao HongBo wrote:
> hi, sergey:
> 
> As shown in that link, https://lkml.org/lkml/2018/6/6/397
> 
> On the linux kernel 5.0-rc6, Syzkaller also hit 'possible deadlock in console_unlock'
> bug for several times in my environment.
> 
> This solution fixes things for me. Do you have a plan to submit patches to
> solve this problem.
> 
> diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
> 	__printk_safe_enter();
> 	kmalloc(sizeof(struct tty_buffer) + 2 * size, GFP_ATOMIC);
> 	__printk_safe_exit();

I would probably try the following:

---

diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index ec145a59f199..058d004dcbaa 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -172,7 +172,8 @@ static struct tty_buffer *tty_buffer_alloc(struct tty_port *port, size_t size)
 	   have queued and recycle that ? */
 	if (atomic_read(&port->buf.mem_used) > port->buf.mem_limit)
 		return NULL;
-	p = kmalloc(sizeof(struct tty_buffer) + 2 * size, GFP_ATOMIC);
+	p = kmalloc(sizeof(struct tty_buffer) + 2 * size,
+		    GFP_ATOMIC | __GFP_NOWARN);
 	if (p == NULL)
 		return NULL;
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ