From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] filldir write data missing size
Date: Tue, 22 Jul 2008 06:31:12 +0900 [thread overview]
Message-ID: <878wvu9b6n.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <87abgbgrvt.wl%ysato@users.sourceforge.jp> (Yoshinori Sato's message of "Mon, 21 Jul 2008 11:48:38 -0400")
Yoshinori Sato <ysato@users.sourceforge.jp> writes:
> This problem is sh-linux-gcc v4.1.2 and target sh2(a)-bigendian.
>
> "__put_user(s64, u32_ptr)" compiled.
>
> Correct code.
> *u32_ptr = s64 & 0xffffffff;
>
> Bad code.
> *u32_ptr = s64 >> 32;
>
> I'm add cast put_user 4byte case.
I see. How about the following patch? I guess the problems of this type
should be fixed.
diff -puN include/asm-sh/uaccess_32.h~sh-fix include/asm-sh/uaccess_32.h
--- linux-2.6/include/asm-sh/uaccess_32.h~sh-fix 2008-07-22 06:20:15.000000000 +0900
+++ linux-2.6-hirofumi/include/asm-sh/uaccess_32.h 2008-07-22 06:25:26.000000000 +0900
@@ -211,8 +211,9 @@ do { \
({ \
long __pu_err; \
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \
+ __typeof__(*(ptr)) __pu_val = x; \
__chk_user_ptr(ptr); \
- __put_user_size((x), __pu_addr, (size), __pu_err); \
+ __put_user_size(__pu_val, __pu_addr, (size), __pu_err); \
__pu_err; \
})
@@ -220,8 +221,9 @@ do { \
({ \
long __pu_err = -EFAULT; \
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \
+ __typeof__(*(ptr)) __pu_val = x; \
if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) \
- __put_user_size((x), __pu_addr, (size), \
+ __put_user_size(__pu_val, __pu_addr, (size), \
__pu_err); \
__pu_err; \
})
_
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2008-07-21 21:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-19 3:18 Yoshinori Sato
2008-07-19 17:24 ` OGAWA Hirofumi
2008-07-19 18:28 ` Yoshinori Sato
2008-07-19 20:11 ` OGAWA Hirofumi
2008-07-21 15:48 ` Yoshinori Sato
2008-07-21 21:31 ` OGAWA Hirofumi [this message]
2008-07-28 18:58 ` Yoshinori Sato
2008-07-28 19:07 ` Paul Mundt
2008-07-28 20:14 ` OGAWA Hirofumi
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=878wvu9b6n.fsf@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ysato@users.sourceforge.jp \
/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
Powered by JetHome