All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ARM/arm64: module-plt: split core and init PLT sections
@ 2017-02-21 22:12 Ard Biesheuvel
  2017-02-21 22:12 ` [PATCH v2 1/2] ARM: module: " Ard Biesheuvel
  2017-02-21 22:12 ` [PATCH v2 2/2] arm64: " Ard Biesheuvel
  0 siblings, 2 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2017-02-21 22:12 UTC (permalink / raw)
  To: linux-arm-kernel

This fixes a thinko on my part in both the ARM and the arm64 implementations
of module PLTs. What I failed to realise is that the core module sections and
the init sections are allocated independently, which means they could end up
further away from each other than the range of a branch instruction. This
implies that they cannot share a single array of PLT entries, and so this
series splits them into core and init PLT sections. To complicate matters
further, this also means that .init.text code may require PLT entries to branch
into the .text section of the same module.

For ARM, this is actually a revert of commit 35fa91eed817 ("ARM: kernel:
merge core and init PLTs") [although the patch in this series is not a
straight revert.] This means that the issue is a regression, and the patch
should probably go to -stable.

For arm64, the likelihood of this issue ever occurring is very small, due
to the 128 MB range of its branch instructions. Also, the arm64 version of
the code was never correct, so it is not a regression. But for correctness,
it is fixed in the same way as for ARM.

Build tested on ARM+arm64, and runtime tested on arm64.

v2: deal with init PLT entries referring to .text symbols of the same module
    fix warning in ARM code

Ard Biesheuvel (2):
  ARM: module: split core and init PLT sections
  arm64: module: split core and init PLT sections

 arch/arm/include/asm/module.h   |   9 +-
 arch/arm/kernel/module-plts.c   |  87 +++++++++++-----
 arch/arm/kernel/module.lds      |   1 +
 arch/arm64/include/asm/module.h |   9 +-
 arch/arm64/kernel/module-plts.c | 108 ++++++++++++--------
 arch/arm64/kernel/module.c      |   2 +-
 arch/arm64/kernel/module.lds    |   1 +
 7 files changed, 140 insertions(+), 77 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2017-04-26 11:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21 22:12 [PATCH v2 0/2] ARM/arm64: module-plt: split core and init PLT sections Ard Biesheuvel
2017-02-21 22:12 ` [PATCH v2 1/2] ARM: module: " Ard Biesheuvel
2017-02-22 11:29   ` Angus Clark
2017-02-22 11:30     ` Ard Biesheuvel
2017-04-25 22:30   ` [v2,1/2] " Florian Fainelli
2017-04-25 22:48     ` Ard Biesheuvel
2017-02-21 22:12 ` [PATCH v2 2/2] arm64: " Ard Biesheuvel
2017-04-26 11:32   ` Catalin Marinas

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.