lkml.org 
[lkml]   [2022]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vmlinux.lds.h: CFI: Reduce alignment of jump-table to function alignment
On Thu, Sep 22, 2022 at 10:57:15PM +0100, Will Deacon wrote:
> Due to undocumented, hysterical raisins on x86, the CFI jump-table
> sections in .text are needlessly aligned to PMD_SIZE in the vmlinux
> linker script. When compiling a CFI-enabled arm64 kernel with a 64KiB
> page-size, a PMD maps 512MiB of virtual memory and so the .text section
> increases to a whopping 940MiB and blows the final Image up to 960MiB.
> Others report a link failure.

Heh. "That's not an image ... THIS is an image."[1]

> Since the CFI jump-table requires only instruction alignment, reduce the
> alignment directives to function alignment for parity with other parts
> of the .text section. This reduces the size of the .text section for the
> aforementioned 64KiB page size arm64 kernel to 19MiB for a much more
> reasonable total Image size of 39MiB.

❤️

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

[1] https://www.youtube.com/watch?v=rne8pOxGuwM#t=27

--
Kees Cook

\
 
 \ /
  Last update: 2022-09-23 00:19    [W:0.091 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site