lkml.org 
[lkml]   [2016]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] proc: prevent accessing /proc/<PID>/environ until it's ready
On Thu, 28 Apr 2016 21:04:18 +0200 Mathias Krause <minipli@googlemail.com> wrote:

> If /proc/<PID>/environ gets read before the envp[] array is fully set
> up in create_{aout,elf,elf_fdpic,flat}_tables(), we might end up trying
> to read more bytes than are actually written, as env_start will already
> be set but env_end will still be zero, making the range calculation
> underflow, allowing to read beyond the end of what has been written.
>
> Fix this as it is done for /proc/<PID>/cmdline by testing env_end for
> zero. It is, apparently, intentionally set last in create_*_tables().
>
> This bug was found by the PaX size_overflow plugin that detected the
> arithmetic underflow of 'this_len = env_end - (env_start + src)' when
> env_end is still zero.

So what are the implications of this? From my reading, a craftily
constructed application could occasionally read arbitrarily large
amounts of kernel memory?

\
 
 \ /
  Last update: 2016-04-28 23:41    [W:0.110 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site