diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-05-21 19:08:42 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-05-21 19:09:57 +0200 |
commit | a7cc722fff0b32bcd28bf4722dff816b0b695f7d (patch) | |
tree | 0ccfdbc0af990caf6282b7d2d222baf6fe01aa2b | |
parent | Linux 4.12-rc1 (diff) | |
download | linux-a7cc722fff0b32bcd28bf4722dff816b0b695f7d.tar.xz linux-a7cc722fff0b32bcd28bf4722dff816b0b695f7d.zip |
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>
-rw-r--r-- | arch/x86/include/asm/uaccess.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index 68766b276d9e..d9668c3beb5b 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -703,7 +703,7 @@ extern struct movsl_mask { #define unsafe_put_user(x, ptr, err_label) \ do { \ int __pu_err; \ - __put_user_size((x), (ptr), sizeof(*(ptr)), __pu_err, -EFAULT); \ + __put_user_size((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)), __pu_err, -EFAULT); \ if (unlikely(__pu_err)) goto err_label; \ } while (0) |