lkml.org 
[lkml]   [2011]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] asm-generic headers: add arch-specific __strnlen_user calling in uaccess.h
Date
On Tuesday 11 January 2011, Guan Xuetao wrote:
> diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
> index b218b85..ac68c99 100644
> --- a/include/asm-generic/uaccess.h
> +++ b/include/asm-generic/uaccess.h
> @@ -288,14 +288,16 @@ strncpy_from_user(char *dst, const char __user *src, long count)
> *
> * Return 0 on exception, a value greater than N if too long
> */
> -#ifndef strnlen_user
> +#ifndef __strnlen_user
> +#define __strnlen_user strnlen
> +#endif
> +
> static inline long strnlen_user(const char __user *src, long n)
> {
> if (!access_ok(VERIFY_READ, src, 1))
> return 0;
> - return strlen((void * __force)src) + 1;
> + return __strnlen_user(src, n);
> }
> -#endif
>
> static inline long strlen_user(const char __user *src)

Yes, looks good. I believe no architecture currently uses the generic
uaccess.h file directly, so it's not surprising that you find problems
like this in it.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>


\
 
 \ /
  Last update: 2011-01-11 16:51    [W:0.024 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site