
From: Gaosheng Cui <cuigaosheng1@huawei.com> ohos inclusion category: bugfix issue: #I3ZXZF CVE: NA ------------------------------------------------------------------------ Fix vector fiq offset when enabled kaslr, we need to get the real symbol address according to __kaslr_offset, otherwise the fiq interrupt will fail to register. Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Signed-off-by: Chen Jun <chenjun102@huawei.com> Signed-off-by: Yu Changchun <yuchangchun1@huawei.com> --- arch/arm/kernel/fiq.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index 98ca3e3fa847..91e37dfe0396 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c @@ -48,10 +48,17 @@ #include <asm/irq.h> #include <asm/traps.h> +#ifdef CONFIG_RANDOMIZE_BASE +#define FIQ_OFFSET ({ \ + extern void *vector_fiq_offset; \ + (unsigned)&vector_fiq_offset - kaslr_offset(); \ + }) +#else #define FIQ_OFFSET ({ \ extern void *vector_fiq_offset; \ (unsigned)&vector_fiq_offset; \ }) +#endif static unsigned long dfl_fiq_insn; static struct pt_regs dfl_fiq_regs; -- 2.22.0