All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] support for text-relative kallsyms table
@ 2016-01-20  9:05 Ard Biesheuvel
  2016-01-20  9:05 ` [PATCH 1/4] kallsyms: add support for relative offsets in kallsyms address table Ard Biesheuvel
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Ard Biesheuvel @ 2016-01-20  9:05 UTC (permalink / raw)
  To: linux-kernel, linux-s390, linuxppc-dev, x86, keescook, akpm,
	mingo, hpa, heiko.carstens, benh, mpe, mmarek, rusty
  Cc: Ard Biesheuvel

This implements text-relative kallsyms address tables. This was developed
as part of my series to implement KASLR/CONFIG_RELOCATABLE for arm64, but
I think it may be beneficial to other architectures as well, so I am
presenting it as a separate series.

The idea is that on 64-bit builds, it is rather wasteful to use absolute
addressing for kernel symbols since they are all within a couple of MBs
of each other. On top of that, the absolute addressing implies that, when
the kernel is relocated at runtime, each address in the table needs to be
fixed up individually.

Since all section-relative addresses are already emitted relative to _text,
it is quite straight-forward to record only the offset, and add the absolute
address of _text at runtime when referring to the address table.

The reduction ranges from around 250 KB uncompressed vmlinux size and 10 KB
compressed size (s390) to 3 MB/500 KB for ppc64 (although, in the latter case,
the reduction in uncompressed size is primarily __init data)

Kees Cook was so kind to test these against x86_64, and confirmed that KASLR
still operates as expected.

Ard Biesheuvel (4):
  kallsyms: add support for relative offsets in kallsyms address table
  powerpc: enable text relative kallsyms for ppc64
  s390: enable text relative kallsyms for 64-bit targets
  x86_64: enable text relative kallsyms for 64-bit targets

 arch/powerpc/Kconfig    |  1 +
 arch/s390/Kconfig       |  1 +
 arch/x86/Kconfig        |  1 +
 init/Kconfig            | 14 ++++++++
 kernel/kallsyms.c       | 35 +++++++++++++-----
 scripts/kallsyms.c      | 38 +++++++++++++++++---
 scripts/link-vmlinux.sh |  4 +++
 scripts/namespace.pl    |  1 +
 8 files changed, 82 insertions(+), 13 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-02-08 17:19 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-20  9:05 [PATCH 0/4] support for text-relative kallsyms table Ard Biesheuvel
2016-01-20  9:05 ` [PATCH 1/4] kallsyms: add support for relative offsets in kallsyms address table Ard Biesheuvel
2016-01-20 19:13   ` Kees Cook
2016-01-20  9:05 ` [PATCH 2/4] powerpc: enable text relative kallsyms for ppc64 Ard Biesheuvel
2016-01-21  4:01   ` Michael Ellerman
2016-01-21  4:01     ` Michael Ellerman
2016-01-20  9:05 ` [PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets Ard Biesheuvel
2016-01-20  9:43   ` Heiko Carstens
2016-01-20 10:04     ` Ard Biesheuvel
2016-01-20 10:17       ` Heiko Carstens
2016-01-20 10:18         ` Ard Biesheuvel
2016-01-20  9:05 ` [PATCH 4/4] x86_64: " Ard Biesheuvel
2016-01-20 19:12   ` Kees Cook
2016-01-20 10:33 ` [PATCH 0/4] support for text-relative kallsyms table Ingo Molnar
2016-01-20 11:50   ` Arnd Bergmann
2016-01-21  5:10 ` Rusty Russell
2016-01-21  5:10   ` Rusty Russell
2016-01-21  6:45   ` Ard Biesheuvel
2016-01-21  8:32     ` Ard Biesheuvel
2016-01-27  3:46       ` Rusty Russell
2016-01-27  3:46         ` Rusty Russell
2016-02-08 17:19   ` Ard Biesheuvel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.