Re: [PATCH v4.4 V2 11/43] arm64: uaccess: Mask __user pointers for __arch_{clear, copy_*}_user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31-07-19, 13:37, Mark Rutland wrote:
> On Fri, Jul 12, 2019 at 10:57:59AM +0530, Viresh Kumar wrote:
> > From: Will Deacon <will.deacon@xxxxxxx>
> > 
> > commit f71c2ffcb20dd8626880747557014bb9a61eb90e upstream.
> > 
> > Like we've done for get_user and put_user, ensure that user pointers
> > are masked before invoking the underlying __arch_{clear,copy_*}_user
> > operations.
> > 
> > Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
> > Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
> > [ v4.4: fixup for v4.4 style uaccess primitives ]
> > Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> 
> [...]
> 
> >  static inline unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n)
> >  {
> >  	kasan_check_write(to, n);
> > -	return  __arch_copy_from_user(to, from, n);
> > +	return __arch_copy_from_user(to, __uaccess_mask_ptr(from), n);
> > +
> >  }
> >  
> >  static inline unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n)
> >  {
> >  	kasan_check_read(from, n);
> > -	return  __arch_copy_to_user(to, from, n);
> > +	return __arch_copy_to_user(__uaccess_mask_ptr(to), from, n);
> > +
> >  }
> 
> Can we please drop the trailing whitespace from each of these? That
> wasn't in the upstreadm commit or v4.9.y.

That was a mistake on my end it seems. Fixed now. Thanks.

-- 
viresh



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux