public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] amd64: fix get_user() on bitwise
@ 2007-07-26 16:35 Al Viro
  0 siblings, 0 replies; only message in thread
From: Al Viro @ 2007-07-26 16:35 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, ak


We really need force-cast when converting to final result type;
unsigned long can be silently converted to integer types and
to pointers, but not to bitwise.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 include/asm-x86_64/uaccess.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index 9df30b9..f4ce876 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -100,7 +100,7 @@ struct exception_table_entry
 	case 8:  __get_user_x(8,__ret_gu,__val_gu,ptr); break;		\
 	default: __get_user_bad(); break;				\
 	}								\
-	(x) = (typeof(*(ptr)))__val_gu;				\
+	(x) = (__force typeof(*(ptr)))__val_gu;				\
 	__ret_gu;							\
 })
 
@@ -192,7 +192,7 @@ struct __large_struct { unsigned long buf[100]; };
 	int __gu_err;						\
 	unsigned long __gu_val;					\
 	__get_user_size(__gu_val,(ptr),(size),__gu_err);	\
-	(x) = (typeof(*(ptr)))__gu_val;			\
+	(x) = (__force typeof(*(ptr)))__gu_val;			\
 	__gu_err;						\
 })
 
-- 
1.5.3.GIT



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-26 16:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-26 16:35 [PATCH] amd64: fix get_user() on bitwise Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox