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: <20140904155200.GC1436@atomlin.usersys.redhat.com>
Date:	Thu, 4 Sep 2014 16:52:00 +0100
From:	Aaron Tomlin <atomlin@...hat.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	peterz@...radead.org, mingo@...hat.com, dzickus@...hat.com,
	bmr@...hat.com, jcastillo@...hat.com, pzijlstr@...hat.com,
	riel@...hat.com, linux-kernel@...r.kernel.org, tglx@...utronix.de,
	x86@...nel.org, rostedt@...dmis.org, hannes@...xchg.org,
	aneesh.kumar@...ux.vnet.ibm.com, akpm@...ux-foundation.org,
	linuxppc-dev@...ts.ozlabs.org, minchan@...nel.org
Subject: Re: [PATCH 1/2] sched: Add helper for task stack page overrun
 checking

On Thu, Sep 04, 2014 at 05:02:34PM +0200, Oleg Nesterov wrote:
> On 09/04, Aaron Tomlin wrote:
> >
> > +#define task_stack_end_corrupted(task) \
> > +		(*(end_of_stack(task)) != STACK_END_MAGIC)
> 
> and it is always used along with "tsk != init_task".
> 
> But why we exclude swapper/0? Can't we add
> 
> 	end_of_stack(current) = STACK_END_MAGIC;
> 
> somewhere at the start of start_kernel() ?

Good point. I can look into it.

> If not, perhaps this new helper should check "task != &init_task"
> itself so that we can simplify its users?
> 
> Oleg.
> 
> >  
> >  static inline int object_is_on_stack(void *obj)
> >  {
> > diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
> > index 8a4e5cb..06c7390 100644
> > --- a/kernel/trace/trace_stack.c
> > +++ b/kernel/trace/trace_stack.c
> > @@ -13,7 +13,6 @@
> >  #include <linux/sysctl.h>
> >  #include <linux/init.h>
> >  #include <linux/fs.h>
> > -#include <linux/magic.h>
> >  
> >  #include <asm/setup.h>
> >  
> > @@ -171,8 +170,8 @@ check_stack(unsigned long ip, unsigned long *stack)
> >  			i++;
> >  	}
> >  
> > -	if ((current != &init_task &&
> > -		*(end_of_stack(current)) != STACK_END_MAGIC)) {
> > +	if (current != &init_task &&
> > +		task_stack_end_corrupted(current)) {
> >  		print_max_stack();
> >  		BUG();
> >  	}
> > -- 
> > 1.9.3
> > 
> 

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