Skip to content

Commit 01ce16f

Browse files
mrutland-armgregkh
authored andcommitted
arm64: armv8_deprecated: ensure extension of addr
commit 55de49f9aa17b0b2b144dd2af587177b9aadf429 upstream. Our compat swp emulation holds the compat user address in an unsigned int, which it passes to __user_swpX_asm(). When a 32-bit value is passed in a register, the upper 32 bits of the register are unknown, and we must extend the value to 64 bits before we can use it as a base address. This patch casts the address to unsigned long to ensure it has been suitably extended, avoiding the potential issue, and silencing a related warning from clang. Fixes: bd35a4a ("arm64: Port SWP/SWPB emulation support from arm") Cc: <stable@vger.kernel.org> # 3.19.x- Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 51ff10e commit 01ce16f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/arm64/kernel/armv8_deprecated.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ static void register_insn_emulation_sysctl(struct ctl_table *table)
305305
ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN, \
306306
CONFIG_ARM64_PAN) \
307307
: "=&r" (res), "+r" (data), "=&r" (temp) \
308-
: "r" (addr), "i" (-EAGAIN), "i" (-EFAULT) \
308+
: "r" ((unsigned long)addr), "i" (-EAGAIN), \
309+
"i" (-EFAULT) \
309310
: "memory")
310311

311312
#define __user_swp_asm(data, addr, res, temp) \

0 commit comments

Comments
 (0)