* [PATCH -mm] c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found
@ 2012-04-24 20:08 Cyrill Gorcunov
2012-04-24 20:27 ` Kees Cook
2012-04-25 0:12 ` KAMEZAWA Hiroyuki
0 siblings, 2 replies; 5+ messages in thread
From: Cyrill Gorcunov @ 2012-04-24 20:08 UTC (permalink / raw)
To: Andrew Morton
Cc: LKML, Michael Kerrisk (man-pages),
KOSAKI Motohiro, Pavel Emelyanov, Tejun Heo, Kees Cook,
Serge Hallyn, MEZAWA Hiroyuki
In case if underlied VMA is not found prctl_set_mm will return -EINVAL,
but Michael proposed to return -EFAULT and Kosaki seconded.
Make it so.
Reported-by: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Pavel Emelyanov <xemul@parallels.com>,
Cc: Tejun Heo <tj@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
kernel/sys.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: linux-2.6.git/kernel/sys.c
===================================================================
--- linux-2.6.git.orig/kernel/sys.c
+++ linux-2.6.git/kernel/sys.c
@@ -1838,8 +1838,10 @@ static int prctl_set_mm(int opt, unsigne
case PR_SET_MM_ARG_END:
case PR_SET_MM_ENV_START:
case PR_SET_MM_ENV_END:
- if (!vma)
+ if (!vma) {
+ error = -EFAULT;
goto out;
+ }
#ifdef CONFIG_STACK_GROWSUP
if (vma_flags_mismatch(vma, VM_READ | VM_WRITE | VM_GROWSUP, 0))
#else
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -mm] c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found
2012-04-24 20:08 [PATCH -mm] c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found Cyrill Gorcunov
@ 2012-04-24 20:27 ` Kees Cook
2012-04-24 21:38 ` KOSAKI Motohiro
2012-04-25 0:12 ` KAMEZAWA Hiroyuki
1 sibling, 1 reply; 5+ messages in thread
From: Kees Cook @ 2012-04-24 20:27 UTC (permalink / raw)
To: Cyrill Gorcunov
Cc: Andrew Morton, LKML, Michael Kerrisk (man-pages),
KOSAKI Motohiro, Pavel Emelyanov, Tejun Heo, Serge Hallyn,
MEZAWA Hiroyuki
On Tue, Apr 24, 2012 at 1:08 PM, Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> In case if underlied VMA is not found prctl_set_mm will return -EINVAL,
> but Michael proposed to return -EFAULT and Kosaki seconded.
> Make it so.
>
> Reported-by: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Kees Cook <keescook@chromium.org>
-Kees
--
Kees Cook
Chrome OS Security
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -mm] c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found
2012-04-24 20:27 ` Kees Cook
@ 2012-04-24 21:38 ` KOSAKI Motohiro
2012-04-24 21:41 ` Michael Kerrisk (man-pages)
0 siblings, 1 reply; 5+ messages in thread
From: KOSAKI Motohiro @ 2012-04-24 21:38 UTC (permalink / raw)
To: Kees Cook
Cc: Cyrill Gorcunov, Andrew Morton, LKML, Michael Kerrisk (man-pages),
Pavel Emelyanov, Tejun Heo, Serge Hallyn, MEZAWA Hiroyuki
On Tue, Apr 24, 2012 at 4:27 PM, Kees Cook <keescook@chromium.org> wrote:
> On Tue, Apr 24, 2012 at 1:08 PM, Cyrill Gorcunov <gorcunov@openvz.org> wrote:
>> In case if underlied VMA is not found prctl_set_mm will return -EINVAL,
>> but Michael proposed to return -EFAULT and Kosaki seconded.
>> Make it so.
>>
>> Reported-by: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
>> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
>
> Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -mm] c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found
2012-04-24 21:38 ` KOSAKI Motohiro
@ 2012-04-24 21:41 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2012-04-24 21:41 UTC (permalink / raw)
To: KOSAKI Motohiro
Cc: Kees Cook, Cyrill Gorcunov, Andrew Morton, LKML, Pavel Emelyanov,
Tejun Heo, Serge Hallyn, MEZAWA Hiroyuki
On Wed, Apr 25, 2012 at 9:38 AM, KOSAKI Motohiro
<kosaki.motohiro@gmail.com> wrote:
> On Tue, Apr 24, 2012 at 4:27 PM, Kees Cook <keescook@chromium.org> wrote:
>> On Tue, Apr 24, 2012 at 1:08 PM, Cyrill Gorcunov <gorcunov@openvz.org> wrote:
>>> In case if underlied VMA is not found prctl_set_mm will return -EINVAL,
>>> but Michael proposed to return -EFAULT and Kosaki seconded.
>>> Make it so.
>>>
>>> Reported-by: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
>>> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
>>
>> Acked-by: Kees Cook <keescook@chromium.org>
>
> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -mm] c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found
2012-04-24 20:08 [PATCH -mm] c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found Cyrill Gorcunov
2012-04-24 20:27 ` Kees Cook
@ 2012-04-25 0:12 ` KAMEZAWA Hiroyuki
1 sibling, 0 replies; 5+ messages in thread
From: KAMEZAWA Hiroyuki @ 2012-04-25 0:12 UTC (permalink / raw)
To: Cyrill Gorcunov
Cc: Andrew Morton, LKML, Michael Kerrisk (man-pages),
KOSAKI Motohiro, Pavel Emelyanov, Tejun Heo, Kees Cook,
Serge Hallyn
(2012/04/25 5:08), Cyrill Gorcunov wrote:
> In case if underlied VMA is not found prctl_set_mm will return -EINVAL,
> but Michael proposed to return -EFAULT and Kosaki seconded.
> Make it so.
>
> Reported-by: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
> Cc: Pavel Emelyanov <xemul@parallels.com>,
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Serge Hallyn <serge.hallyn@canonical.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-04-25 0:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-24 20:08 [PATCH -mm] c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found Cyrill Gorcunov
2012-04-24 20:27 ` Kees Cook
2012-04-24 21:38 ` KOSAKI Motohiro
2012-04-24 21:41 ` Michael Kerrisk (man-pages)
2012-04-25 0:12 ` KAMEZAWA Hiroyuki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.