Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 11 Feb 2019 12:47:21 +0000
From: "Reshetova, Elena" <elena.reshetova@...el.com>
To: Kees Cook <keescook@...omium.org>
CC: Kernel Hardening <kernel-hardening@...ts.openwall.com>, Andy Lutomirski
	<luto@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar
	<mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, Peter Zijlstra
	<peterz@...radead.org>
Subject: RE: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon
 system call


> On Fri, Feb 8, 2019 at 4:16 AM Elena Reshetova
> <elena.reshetova@...el.com> wrote:
> > --- a/mm/usercopy.c
> > +++ b/mm/usercopy.c
> > @@ -37,7 +37,7 @@
> >  static noinline int check_stack_object(const void *obj, unsigned long len)
> >  {
> >         const void * const stack = task_stack_page(current);
> > -       const void * const stackend = stack + THREAD_SIZE;
> > +       const void * const stackend = (void *)task_top_of_stack(current);
> >         int ret;
> >
> >         /* Object is not on the stack at all. */
> 
> It seems like having task_top_of_stack() would be a nice refactoring
> to have regardless of this feature (and splitting out would make this
> patch a bit easier to read too).

Yes, if my refactoring in these places looks correct, I can create a separate
patch to just use task_top_of_stack() instead of hard coding some math like
above. Does it sound correct to people? I could not find a reason why these
places do not use task_top_of_stack() to begin with... 

Best Regards,
Elena.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.