lkml.org 
[lkml]   [2016]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature
On Mon, Sep 05, 2016 at 10:47:22AM +0200, Jiri Olsa wrote:
> On Fri, Sep 02, 2016 at 08:17:13AM -0700, Andi Kleen wrote:
> > On Fri, Sep 02, 2016 at 02:25:45PM +0200, Jiri Olsa wrote:
> > > One of the bullets for hardened usercopy feature is:
> > > - object must not overlap with kernel text
> > >
> > > which is what we expose via /proc/kcore. We can hit
> > > this check and crash the system very easily just by
> > > reading the text area in kcore file:
> > >
> > > usercopy: kernel memory exposure attempt detected from ffffffff8179a01f (<kernel text>) (4065 bytes)
> > > kernel BUG at mm/usercopy.c:75!
> > >
> > > Omitting kernel text area from kcore when there's
> > > hardened usercopy feature is enabled.
> >
> > That will completely break PT decoding, which relies on looking
> > at the kernel text in /proc/kcore.
> >
> > Need a different fix here, perhaps some special copy function
> > that is not hardened.
>
> how about something like this

Looks good to me, but you would need the *_nocheck variant for non x86
architectures too of course.

-Andi

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.111 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site