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]
Date:	Tue, 02 Feb 2010 08:25:35 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	Li Zefan <lizf@...fujitsu.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing: fix circular dead lock

On Tue, 2010-02-02 at 15:32 +0800, Lai Jiangshan wrote:
> When we cat <debugfs>/tracing/stack_trace, we may cause circular lock:
> sys_read()
>   t_start()
>      arch_spin_lock(&max_stack_lock);
> 
>   t_show()
>      seq_printf(), vsnprintf() .... /* they are all trace-able,
>        when they are traced, max_stack_lock may be required again. */
> 
> 
> The following script can trigger this circular dead lock very easy:
> #!/bin/bash
> 
> echo 1 > /proc/sys/kernel/stack_tracer_enabled
> 
> mount -t debugfs xxx /mnt > /dev/null 2>&1

> (
> # make check_stack() zealous to require max_stack_lock
> for ((; ;))
> {
> 	echo 1 > /mnt/tracing/stack_max_size
> }
> ) &
> 
> for ((; ;))
> {
> 	cat /mnt/tracing/stack_trace > /dev/null
> }
> 
> 
> To fix this bug, we increase the percpu trace_active before
> require the lock.
> 
> Reported-by: Li Zefan <lizf@...fujitsu.com>
> Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>

Thanks Lai! I'll try to get this into 33.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ