linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] add __user markup in copy_user_handle_tail()
Date: Sat, 14 Aug 2010 01:06:44 +0900	[thread overview]
Message-ID: <1281715604-5174-1-git-send-email-namhyung@gmail.com> (raw)

__get/put_user_nocheck() requires 2nd arg should be a user pointer but was missing
__user markup. Add it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 arch/x86/lib/usercopy_64.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
index b7c2849..84b0c1b 100644
--- a/arch/x86/lib/usercopy_64.c
+++ b/arch/x86/lib/usercopy_64.c
@@ -170,14 +170,17 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest)
 	unsigned zero_len;
 
 	for (; len; --len) {
-		if (__get_user_nocheck(c, from++, sizeof(char)))
+		if (__get_user_nocheck(c, (u8 __user __force *) from++,
+				       sizeof(char)))
 			break;
-		if (__put_user_nocheck(c, to++, sizeof(char)))
+		if (__put_user_nocheck(c, (u8 __user __force *) to++,
+				       sizeof(char)))
 			break;
 	}
 
 	for (c = 0, zero_len = len; zerorest && zero_len; --zero_len)
-		if (__put_user_nocheck(c, to++, sizeof(char)))
+		if (__put_user_nocheck(c, (u8 __user __force *) to++,
+				       sizeof(char)))
 			break;
 	return len;
 }
-- 
1.7.0.4


                 reply	other threads:[~2010-08-13 16:06 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=1281715604-5174-1-git-send-email-namhyung@gmail.com \
    --to=namhyung@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).