ARM: entry: word-align the syscall table
Subsystems (2)
PATCH 1/1 ARM: entry: word-align the syscall table
On ARM, ENTRY is .align 0 and nothing else aligns the table. It is layout-dependent and left to chance that unrelated code (e.g. CONFIG_TRACE_IRQFLAGS fast path in entry-common.S) can shift the table on or off a word boundary since Thumb-2 has 2-byte instructions. The syscall dispatch loads the handler with
ldr pc, [tbl, scno, lsl #2]
which requires the table base to be word-aligned. Observed on our platform, the first syscall loads pc from an unaligned address and takes a fatal alignment exception:
Alignment trap: not handling instruction f858f02a at [<c0100208>]
Unhandled fault: alignment exception (0x001) at 0xc01002ba
Internal error: : 1 [#1] PREEMPT SMP THUMB2Align the table in syscall_table_start so it is always word-aligned regardless of THUMB2 layout.
Signed-off-by Yenchia Chen <[email protected]>
Signed-off-by Huang-Sen Lin <[email protected]>
--- arch/arm/kernel/entry-common.S | 1 + 1 file changed, 1 insertion(+)
arch/arm/kernel/entry-common.S +1 -0
@@ -321,6 +321,7 @@ __sys_trace_return: .macro syscall_table_start, sym .equ __sys_nr, 0 .type \sym, #object + .align 2 ENTRY(\sym) .endm
Signature · 1 line
2.45.2