lkml.org 
[lkml]   [2012]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Bad error return after find_vma() in PR_SET_MM code
On Tue, Apr 24, 2012 at 11:12:15AM -0400, KOSAKI Motohiro wrote:
> (4/15/12 12:00 AM), Michael Kerrisk (man-pages) wrote:
> >[Bother! Resending with corrected subject line (was "[PATCH 1/2]
> >prctl: Add PR_SET_MM option description")]
> >
> >Cyrill,
> >
> >While reviewing your patch to the prctl() manual page, I noticed the
> >following code in kernel/sys.c::prctl_set_mm():
> >
> > if (opt != PR_SET_MM_START_BRK&& opt != PR_SET_MM_BRK) {
> > /* It must be existing VMA */
> > if (!vma || vma->vm_start> addr)
> > goto out;
> > }
> >
> >At this point, the code causes an exit with error set to zero (i.e.,
> >success). This looks unintended to me. Is the code correct? I suspect
> >a return of -EFAULT or -ENOMEM is warranted.
>
> EFAULT please when detecting invalid vma.

Thanks for reminder, Kosaki! I'll cook a patch asap.

Cyrill


\
 
 \ /
  Last update: 2012-04-24 17:19    [from the cache]
©2003-2011 Jasper Spaans