[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140704081151.GM12440@moon>
Date: Fri, 4 Jul 2014 12:11:51 +0400
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Andrew Vagin <avagin@...allels.com>
Cc: linux-kernel@...r.kernel.org, Kees Cook <keescook@...omium.org>,
Tejun Heo <tj@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrew Vagin <avagin@...nvz.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Serge Hallyn <serge.hallyn@...onical.com>,
Pavel Emelyanov <xemul@...allels.com>,
Vasiliy Kulikov <segoon@...nwall.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Michael Kerrisk <mtk.manpages@...il.com>
Subject: Re: [RFC 2/2] prctl: PR_SET_MM -- Introduce PR_SET_MM_MAP operation
On Fri, Jul 04, 2014 at 11:52:56AM +0400, Andrew Vagin wrote:
> > +
> > +struct prctl_mm_map {
> > + unsigned long start_code;
>
> "unsigned long" has different sizes on x86_64 and x86, so a compat
> is required for x32 processes on x64 kernel.
Yes, good point. I think we can use u64/32 types instead to make
a code shared. I'll update once I collect all comments about
aproach.
> > +
> > + /*
> > + * Stack, brk, command line arguments and environment must exist.
> > + */
> > + stack_vma = find_vma(mm, prctl_map->start_stack);
>
> Why do we not use __prctl_check_vma here?
Well __prctl_check_vma does return error or zero while I need this
vma reference for stack rlim check which is done below in code.
>
> > + if (!stack_vma) {
> > + error = -EINVAL;
> > + goto out;
> > + }
> > +#define __prctl_check_vma(mm, addr) find_vma(mm, addr) ? 0 : -EINVAL
> > + error |= __prctl_check_vma(mm, prctl_map->start_brk);
> > + error |= __prctl_check_vma(mm, prctl_map->brk);
Cyrill
--
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