lkml.org 
[lkml]   [2016]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ks390/keyboard: use memdup_user().
On Fri, May 20, 2016 at 03:03:25PM +0200, Heiko Carstens wrote:
> On Fri, May 20, 2016 at 05:52:16PM +0530, Muhammad Falak R Wani wrote:
> > Use memdup_user to duplicate a memory region from user-space to
> > kernel-space, instead of open coding using kmalloc & copy_from_user.
> >
> > Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
> > + p = memdup_user(u_kbs->kb_string, len);
> > + if (IS_ERR(p))
> > + return PTR_ERR(p);
> > /*
> > * Make sure the string is terminated by 0. User could have
> > * modified it between us running strnlen_user() and copying it.
>
> Hi Muhammad, thanks for this patch. However could you change this to use
> memdup_user_nul() instead, so we can get rid of even more code?
>
Should I send V2 with the suggested changes ?

\
 
 \ /
  Last update: 2016-05-20 15:21    [W:0.064 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site