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: <1343203348.3139.16.camel@dabdike>
Date:	Wed, 25 Jul 2012 12:02:28 +0400
From:	James Bottomley <James.Bottomley@...senPartnership.com>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Tony Luck <tony.luck@...el.com>, linux-kernel@...r.kernel.org,
	Ingo Molnar <mingo@...e.hu>, Helge Deller <deller@....de>,
	linux-parisc@...r.kernel.org, linux-ia64@...r.kernel.org,
	Fengguang Wu <fengguang.wu@...el.com>
Subject: Re: [PATCH] debug: Do not permit CONFIG_DEBUG_STACK_USAGE=y on IA64
 or PARISC

On Wed, 2012-07-25 at 09:45 +0200, Ingo Molnar wrote:
> * Tony Luck <tony.luck@...el.com> wrote:
> 
> > The stack_not_used() function in <linux/sched.h> assumes that stacks
> > grow downwards. This is not true on IA64 or PARISC, so this function
> > would walk off in the wrong direction and into the weeds.
> > 
> > Found on IA64 because of a compilation failure with recursive dependencies
> > on IA64_TASKSIZE and IA64_THREAD_INFO_SIZE.
> > 
> > Fixing the code is possible, but should be combined with other
> > infrastructure additions to set up the "canary" at the end of the stack.
> > 
> > Reported-by: Fengguang Wu <fengguang.wu@...el.com> (failed allmodconfig build)
> > Signed-off-by: Tony Luck <tony.luck@...el.com>
> > ---
> >  lib/Kconfig.debug | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index ff5bdee..4a18650 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -714,7 +714,7 @@ config STACKTRACE
> >  
> >  config DEBUG_STACK_USAGE
> >  	bool "Stack utilization instrumentation"
> > -	depends on DEBUG_KERNEL
> > +	depends on DEBUG_KERNEL && !IA64 && !PARISC
> 
> The modern way of doing this is by adding an ARCH_SUPPORTS_ 
> flag.

That's a bit daft, isn't it?  We'd have to add ARCH_SUPPORTS_ flags to
about 25 separate architectures just to get it not supported on these
two.

Since the problem is an invalid assumption about how the stack grows,
why not just condition it on that.  We actually have a config option for
this: CONFIG_STACK_GROWSUP.  But for some reason ia64 doesn't define
this, why not, Tony?  It looks deliberate because you have replaced a
lot of

#ifdef CONFIG_STACK_GROWSUP

with

#if defined(CONFIG_STACK_GROWSUP) || defined(CONFIG_IA64)

but not all of them.

James



--
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