From: Arnd Bergmann <arnd@arndb.de>
To: "Guan Xuetao" <guanxuetao@mprc.pku.edu.cn>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] asm-generic headers: add arch-specific __strnlen_user calling in uaccess.h
Date: Tue, 11 Jan 2011 16:49:14 +0100 [thread overview]
Message-ID: <201101111649.14711.arnd@arndb.de> (raw)
In-Reply-To: <008801cbb166$96cd0430$c4670c90$@mprc.pku.edu.cn>
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>
prev parent reply other threads:[~2011-01-11 15:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-11 8:07 [PATCH] asm-generic headers: add arch-specific __strnlen_user calling in uaccess.h Guan Xuetao
2011-01-11 15:49 ` Arnd Bergmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201101111649.14711.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=guanxuetao@mprc.pku.edu.cn \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox