lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 11 Jan 2011 16:49:14 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	"Guan Xuetao" <guanxuetao@...c.pku.edu.cn>
Cc:	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] asm-generic headers: add arch-specific __strnlen_user calling in uaccess.h

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@...db.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ