lkml.org 
[lkml]   [2016]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: + proc-fix-null-dereference-when-reading-proc-pid-auxv.patch added to -mm tree
On Fri, Oct 21, 2016 at 6:13 AM,  <akpm@linux-foundation.org> wrote:

> Reading auxv of any kernel thread results in NULL pointer dereferencing in
> auxv_read() where mm can be NULL. Fix that by checking for NULL mm and
> bailing out early. This is also the original behavior changed by recent
> commit c5317167854e ("proc: switch auxv to use of __mem_open()").

> --- a/fs/proc/base.c~proc-fix-null-dereference-when-reading-proc-pid-auxv
> +++ a/fs/proc/base.c
> @@ -1014,6 +1014,9 @@ static ssize_t auxv_read(struct file *fi
> {
> struct mm_struct *mm = file->private_data;
> unsigned int nwords = 0;
> +
> + if (!mm)
> + return 0;

Rhetorical question: who wrote such clever __mem_open() ?

\
 
 \ /
  Last update: 2016-10-21 15:44    [W:0.277 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site