Skip to content

Commit a7cc722

Browse files
author
Al Viro
committed
fix unsafe_put_user()
__put_user_size() relies upon its first argument having the same type as what the second one points to; the only other user makes sure of that and unsafe_put_user() should do the same. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 2ea659a commit a7cc722

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/include/asm/uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ extern struct movsl_mask {
703703
#define unsafe_put_user(x, ptr, err_label) \
704704
do { \
705705
int __pu_err; \
706-
__put_user_size((x), (ptr), sizeof(*(ptr)), __pu_err, -EFAULT); \
706+
__put_user_size((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)), __pu_err, -EFAULT); \
707707
if (unlikely(__pu_err)) goto err_label; \
708708
} while (0)
709709

0 commit comments

Comments
 (0)