Commit 10467913 authored by Aurelien Jarno's avatar Aurelien Jarno Committed by Paul Walmsley
Browse files

riscv: uaccess: fix __put_user_nocheck for unaligned accesses



The type of the value to write should be determined by the size of the
destination, not by the value itself, which may be a constant. This
aligns the behavior with x86_64, where __typeof__(*(__gu_ptr)) is used
to infer the correct type.

This fixes an issue in put_cmsg, which was only writing 4 out of 8
bytes to the cmsg_len field, causing the glibc tst-socket-timestamp test
to fail.

Fixes: ca1a66cd ("riscv: uaccess: do not do misaligned accesses in get/put_user()")
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
Reviewed-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250724220853.1969954-1-aurelien@aurel32.net


Signed-off-by: default avatarPaul Walmsley <pjw@kernel.org>
parent e108c8a9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment