linux/arch/arm64/kernel/pi
Wentao Guan 4023b7424e arm64/scs: Fix potential sign extension issue of advance_loc4
The expression (*opcode++ << 24) and exp * code_alignment_factor
may overflow signed int and becomes negative.

Fix this by casting each byte to u64 before shifting. Also fix
the misaligned break statement while we are here.

Example of the result can be seen here:
Link: https://godbolt.org/z/zhY8d3595

It maybe not a real problem, but could be a issue in future.

Fixes: d499e9627d ("arm64/scs: Fix handling of advance_loc4")
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2026-04-27 12:16:26 +01:00
..
.gitignore arm64: gitignore: ignore relacheck 2024-02-22 21:57:52 +00:00
idreg-override.c arm64: Add override for MPAM 2025-06-02 13:49:09 +01:00
kaslr_early.c arm64/mm: Remove randomization of the linear map 2025-04-29 13:21:49 +01:00
Makefile arm64 updates for 6.17: 2025-07-29 20:21:54 -07:00
map_kernel.c arm64 updates for 6.19: 2025-12-02 17:03:55 -08:00
map_range.c arm64: mm: Represent physical memory with phys_addr_t and resource_size_t 2025-09-16 20:39:49 +01:00
patch-scs.c arm64/scs: Fix potential sign extension issue of advance_loc4 2026-04-27 12:16:26 +01:00
pi.h arm64: Fail module loading if dynamic SCS patching fails 2025-11-07 15:00:09 +00:00
relacheck.c arm64: kernel: Manage absolute relocations in code built under pi/ 2024-02-16 12:42:28 +00:00
relocate.c arm64: head: Move early kernel mapping routines into C code 2024-02-16 12:42:33 +00:00