[lkml]   [2012]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH 1/2] prctl: Add PR_SET_MM option description
    On Sun, Apr 15, 2012 at 6:54 PM, Cyrill Gorcunov <> wrote:
    > On Sun, Apr 15, 2012 at 03:48:18PM +1200, Michael Kerrisk (man-pages) wrote:
    >> Cyrill,
    >> While reviewing your patch to the prctl() manual page, I noticed the
    >> following code inkernel/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.
    > Hi Michael, yup, -EINVAL escaped (I think EFAULT or ENOMEM is not really
    > good here). I'll fix and send update. Thanks!

    For what it's worth (I am no expert), it looks to me as though EFAULT
    or ENOMEM is more usual after a failed find_vma(). Furthermore, EINVAL
    is already heavily used, so not very informative as an error.



    Michael Kerrisk
    Linux man-pages maintainer;
    Author of "The Linux Programming Interface";
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2012-04-15 12:17    [W:0.020 / U:11.516 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site