lkml.org 
[lkml]   [2014]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2014-07-04 12:21    [W:0.091 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site