Messages in this thread | | | Date | Fri, 4 Jul 2014 12:11:51 +0400 | From | Cyrill Gorcunov <> | 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
| |