Skip to content

Commit

Permalink
amd64: fix get_user() on bitwise
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jul 26, 2007
1 parent c47ffe3 commit fdd3396
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-x86_64/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
})

Expand Down Expand Up @@ -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; \
})

Expand Down

0 comments on commit fdd3396

Please sign in to comment.