[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKgNAkjWdy_SYaJsNXUOv7cNL2xwZNW7FCdRsT6wiRFb0dmetw@mail.gmail.com>
Date: Sun, 15 Apr 2012 16:00:17 +1200
From: "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
To: Cyrill Gorcunov <gorcunov@...nvz.org>
Cc: Pavel Emelyanov <xemul@...allels.com>, linux-man@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>, Tejun Heo <tj@...nel.org>,
Andrew Morton <akpm@...l.org>,
Michael Kerrisk <mtk.manpages@...il.com>
Subject: Bad error return after find_vma() in PR_SET_MM code
[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.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists