linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFT PATCH 0/2] ARM/arm64: module-plt: split core and init PLT sections
Date: Mon, 20 Feb 2017 22:00:39 +0000	[thread overview]
Message-ID: <1487628041-2147-1-git-send-email-ard.biesheuvel@linaro.org> (raw)

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.

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.

For now, these are build tested only. I was hoping Angus could check whether
1/2 makes his problems go away.

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   | 62 ++++++++++++++------
 arch/arm/kernel/module.lds      |  1 +
 arch/arm64/include/asm/module.h |  9 ++-
 arch/arm64/kernel/module-plts.c | 56 ++++++++++++------
 arch/arm64/kernel/module.c      |  2 +-
 arch/arm64/kernel/module.lds    |  1 +
 7 files changed, 99 insertions(+), 41 deletions(-)

-- 
2.7.4

             reply	other threads:[~2017-02-20 22:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 22:00 Ard Biesheuvel [this message]
2017-02-20 22:00 ` [RFT PATCH 1/2] ARM: module: split core and init PLT sections Ard Biesheuvel
2017-02-21 14:26   ` Angus Clark
2017-02-21 17:35     ` Ard Biesheuvel
2017-02-23 15:45   ` Ard Biesheuvel
2017-02-20 22:00 ` [RFT PATCH 2/2] arm64: " Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487628041-2147-1-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).