lkml.org 
[lkml]   [2022]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] usercopy: Check valid lifetime via stack depth
On Fri, 25 Feb 2022 17:35:49 -0800 Kees Cook <keescook@chromium.org> wrote:

> On Fri, Feb 25, 2022 at 04:01:57PM -0800, Andrew Morton wrote:
> > On Fri, 25 Feb 2022 09:33:45 -0800 Kees Cook <keescook@chromium.org> wrote:
> >
> > > Under CONFIG_HARDENED_USERCOPY=y, when exact stack frame boundary checking
> > > is not available (i.e. everything except x86 with FRAME_POINTER), check
> > > a stack object as being at least "current depth valid", in the sense
> > > that any object within the stack region but not between start-of-stack
> > > and current_stack_pointer should be considered unavailable (i.e. its
> > > lifetime is from a call no longer present on the stack).
> > >
> > > Introduce ARCH_HAS_CURRENT_STACK_POINTER to track which architectures
> > > have actually implemented the common global register alias.
> > >
> > > Additionally report usercopy bounds checking failures with an offset
> > > from current_stack_pointer, which may assist with diagnosing failures.
> > >
> > > The LKDTM USERCOPY_STACK_FRAME_TO and USERCOPY_STACK_FRAME_FROM tests
> > > (once slightly adjusted in a separate patch) will pass again with
> > > this fixed.
> >
> > Again, what does this actually do?
>
> [answers]
>

OK, thanks. I think a new changelog is warranted?

What's your preferred path for upstreaming this change?


\
 
 \ /
  Last update: 2022-02-26 02:48    [W:0.046 / U:1.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site