Skip to content

Commit 656ab59

Browse files
author
Ard Biesheuvel
committed
arm64: vmlinux.lds: make __rela_offset and __dynsym_offset ABSOLUTE
Due to the untyped KIMAGE_VADDR constant, the linker may not notice that the __rela_offset and __dynsym_offset expressions are absolute values (i.e., are not subject to relocation). This does not matter for KASLR, but it does confuse kallsyms in relative mode, since it uses the lowest non-absolute symbol address as the anchor point, and expects all other symbol addresses to be within 4 GB of it. Fix this by qualifying these expressions as ABSOLUTE() explicitly. Fixes: 0cd3defe0af4 ("arm64: kernel: perform relocation processing from ID map") Cc: <stable@vger.kernel.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com> (cherry picked from commit d6732fc402c2665f61e72faf206a0268e65236e9) Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
1 parent 5808d4c commit 656ab59

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/arm64/kernel/vmlinux.lds.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ SECTIONS
168168
*(.hash)
169169
}
170170

171-
__rela_offset = ADDR(.rela) - KIMAGE_VADDR;
171+
__rela_offset = ABSOLUTE(ADDR(.rela) - KIMAGE_VADDR);
172172
__rela_size = SIZEOF(.rela);
173-
__dynsym_offset = ADDR(.dynsym) - KIMAGE_VADDR;
173+
__dynsym_offset = ABSOLUTE(ADDR(.dynsym) - KIMAGE_VADDR);
174174

175175
. = ALIGN(SEGMENT_ALIGN);
176176
__init_end = .;

0 commit comments

Comments
 (0)