Re: [PATCH v2 1/3] init/main.c: Give init_task a canary

2014-09-11 Thread Aaron Tomlin
On Thu, Sep 11, 2014 at 07:23:45AM -0500, Chuck Ebbert wrote: > On Wed, 10 Sep 2014 14:29:33 +0100 > Aaron Tomlin wrote: > > > On Wed, Sep 10, 2014 at 02:26:54AM -0500, Chuck Ebbert wrote: > > > And has this been tested on parisc and metag, which use STACK_GROWSUP ? > > > I can't see how end_of_s

Re: [PATCH v2 1/3] init/main.c: Give init_task a canary

2014-09-11 Thread Chuck Ebbert
On Wed, 10 Sep 2014 14:29:33 +0100 Aaron Tomlin wrote: > On Wed, Sep 10, 2014 at 02:26:54AM -0500, Chuck Ebbert wrote: > > And has this been tested on parisc and metag, which use STACK_GROWSUP ? > > I can't see how end_of_stack() as it's defined now could work on those > > archs. > > AFAIU, dup

Re: [PATCH v2 1/3] init/main.c: Give init_task a canary

2014-09-10 Thread Aaron Tomlin
On Wed, Sep 10, 2014 at 02:26:54AM -0500, Chuck Ebbert wrote: > On Tue, 9 Sep 2014 10:42:27 +0100 > Aaron Tomlin wrote: > > > +void task_stack_end_magic(struct task_struct *tsk) > > +{ > > + unsigned long *stackend; > > + > > + stackend = end_of_stack(tsk); > > + *stackend = STACK_END_MAGI

Re: [PATCH v2 1/3] init/main.c: Give init_task a canary

2014-09-10 Thread Chuck Ebbert
On Tue, 9 Sep 2014 10:42:27 +0100 Aaron Tomlin wrote: > +void task_stack_end_magic(struct task_struct *tsk) > +{ > + unsigned long *stackend; > + > + stackend = end_of_stack(tsk); > + *stackend = STACK_END_MAGIC;/* for overflow detection */ > +} > + For clarity this should proba

[PATCH v2 1/3] init/main.c: Give init_task a canary

2014-09-09 Thread Aaron Tomlin
Tasks get their end of stack set to STACK_END_MAGIC with the aim to catch stack overruns. Currently this feature does not apply to init_task. This patch removes this restriction. Note that a similar patch was posted by Prarit Bhargava [1] some time ago but was never merged. [1]: http://marc.info/