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: <20130329.233002.1109620073576548375.davem@davemloft.net>
Date:	Fri, 29 Mar 2013 23:30:02 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	tj@...nel.org
Cc:	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org, mingo@...hat.com, x86@...nel.org,
	rth@...ddle.net, linux@....linux.org.uk, msalter@...hat.com,
	starvik@...s.com, dhowells@...hat.com, tony.luck@...el.com,
	benh@...nel.crashing.org, takata@...ux-m32r.org,
	geert@...ux-m68k.org, james.hogan@...tec.com, monstr@...str.eu,
	ralf@...ux-mips.org, jonas@...thpole.se, rkuo@...eaurora.org,
	schwidefsky@...ibm.com, liqin.chen@...plusct.com,
	lethal@...ux-sh.org, vgupta@...opsys.com, chris@...kel.net,
	cmetcalf@...era.com, ysato@...rs.sourceforge.jp,
	gxt@...c.pku.edu.cn, jdike@...toit.com, heiko.carstens@...ibm.com,
	linux-s390@...r.kernel.org, vapier@...too.org,
	uclinux-dist-devel@...ckfin.uclinux.org
Subject: Re: [PATCH 3/5] dump_stack: consolidate dump_stack()
 implementations and unify their behaviors

From: Tejun Heo <tj@...nel.org>
Date: Fri, 29 Mar 2013 19:27:06 -0700

> Both dump_stack() and show_stack() are currently implemented by each
> architecture.  show_stack(NULL, NULL) dumps the backtrace for the
> current task as does dump_stack().  On some archs, dump_stack() prints
> extra information - pid, utsname and so on - in addition to the
> backtrace while the two are identical on other archs.
> 
> The usages in arch-independent code of the two functions indicate
> show_stack(NULL, NULL) should print out bare backtrace while
> dump_stack() is used for debugging purposes when something went wrong,
> so it does make sense to print additional information on the task
> which triggered dump_stack().
> 
> There's no reason to require archs to implement two separate but
> mostly identical functions.  It leads to unnecessary subtle
> differences among archs and makes it very tedius to add generic debug
> information.
> 
> This patch expands the dummy fallback dump_stack() implementation in
> lib/dump_stack.c such that it prints out debug information (taken from
> x86) and invokes show_stack(NULL, NULL) and drops arch-specific
> dump_stack() implementations in all archs except blackfin and s390.
> Blackfin's dump_stack() does something wonky that I don't understand
> and s390 prints its own debug information which includes fields which
> aren't accessible from arch-indepdent code.
> 
> Debug information can be printed separately by calling
> dump_stack_print_info() so that arch-specific dump_stack()
> implementation can still emit the same debug information.  This is
> used in blackfin.
> 
> This patch brings the following behavior changes.
> 
> * On some archs, an extra level in backtrace for show_stack() could be
>   printed.  This is because the top frame was determined in
>   dump_stack() on those archs while generic dump_stack() can't do that
>   reliably.  It can be compensated by inlining dump_stack() but not
>   sure whether that'd be necessary.
> 
> * Most archs didn't use to print debug info on dump_stack().  They do
>   now.
> 
> An example WARN dump follows.
> 
>  WARNING: at /work/os/work/kernel/workqueue.c:4840 init_workqueues+0x35/0x505()
>  Hardware name: empty
>  Modules linked in:
>  Pid: 1, comm: swapper/0 Not tainted 3.9.0-rc1-work+ #17
>   0000000000000009 ffff88007c861e08 ffffffff81c61545 ffff88007c861e48
>   ffffffff8108f50f ffffffff82228240 0000000000000040 ffffffff8234a03c
>   0000000000000000 0000000000000000 0000000000000000 ffff88007c861e58
>  Call Trace:
>   [<ffffffff81c61545>] dump_stack+0x19/0x1b
>   [<ffffffff8108f50f>] warn_slowpath_common+0x7f/0xc0
>   [<ffffffff8108f56a>] warn_slowpath_null+0x1a/0x20
>   [<ffffffff8234a071>] init_workqueues+0x35/0x505
>   ...
> 
> Signed-off-by: Tejun Heo <tj@...nel.org>

For sparc bits:

Acked-by: David S. Miller <davem@...emloft.net>
--
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