From: Namhyung Kim <namhyung@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] bitmap: fix address_space conversion on __bitmap_parse
Date: Fri, 13 Aug 2010 23:55:34 +0900 [thread overview]
Message-ID: <1281711334-28428-1-git-send-email-namhyung@gmail.com> (raw)
buf can be a user-space pointer in case of is_user, 3rd arg, is 1.
But casting to ubuf lacks required address_space notations. Add it.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
lib/bitmap.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/bitmap.c b/lib/bitmap.c
index ffb78c9..42205d8 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -422,7 +422,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
{
int c, old_c, totaldigits, ndigits, nchunks, nbits;
u32 chunk;
- const char __user *ubuf = buf;
+ const char __user *ubuf = (const char __user __force *) buf;
bitmap_zero(maskp, nmaskbits);
@@ -507,7 +507,8 @@ int bitmap_parse_user(const char __user *ubuf,
{
if (!access_ok(VERIFY_READ, ubuf, ulen))
return -EFAULT;
- return __bitmap_parse((const char *)ubuf, ulen, 1, maskp, nmaskbits);
+ return __bitmap_parse((const char __force *)ubuf, ulen, 1,
+ maskp, nmaskbits);
}
EXPORT_SYMBOL(bitmap_parse_user);
--
1.7.0.4
reply other threads:[~2010-08-13 14:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1281711334-28428-1-git-send-email-namhyung@gmail.com \
--to=namhyung@gmail.com \
--cc=akpm@linux-foundation.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
all inboxes | Powered by JetHome®