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] [thread-next>] [day] [month] [year] [list]
Message-ID: <878wvu9b6n.fsf@devron.myhome.or.jp>
Date:	Tue, 22 Jul 2008 06:31:12 +0900
From:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:	Yoshinori Sato <ysato@...rs.sourceforge.jp>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] filldir write data missing size

Yoshinori Sato <ysato@...rs.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@...l.parknet.co.jp>
--
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