All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Jonathan Marek <jonathan@marek.ca>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH v2] arm64: warn on incorrect placement of the kernel by the bootloader
Date: Sat, 13 Jun 2020 10:45:10 +0200	[thread overview]
Message-ID: <CAMj1kXENVduZAWOqkSE3ZvW=u=vyVjXBCe-1+i3h1oi1RjW_JA@mail.gmail.com> (raw)
In-Reply-To: <159188119408.197277.6500663041357704124.b4-ty@kernel.org>

On Thu, 11 Jun 2020 at 15:23, Will Deacon <will@kernel.org> wrote:
>
> On Thu, 11 Jun 2020 14:43:30 +0200, Ard Biesheuvel wrote:
> > Commit cfa7ede20f133c ("arm64: set TEXT_OFFSET to 0x0 in preparation for
> > removing it entirely") results in boot failures when booting kernels that
> > are built without KASLR support on broken bootloaders that ignore the
> > TEXT_OFFSET value passed via the header, and use the default of 0x80000
> > instead.
> >
> > To work around this, turn CONFIG_RELOCATABLE on by default, even if KASLR
> > itself (CONFIG_RANDOMIZE_BASE) is turned off, and require CONFIG_EXPERT
> > to be enabled to deviate from this. Then, emit a warning into the kernel
> > log if we are not booting via the EFI stub (which is permitted to deviate
> > from the placement restrictions) and the kernel base address is not placed
> > according to the rules as laid out in Documentation/arm64/booting.rst.
>
> Applied to arm64 (for-next/core), thanks!
>
> [1/1] arm64: warn on incorrect placement of the kernel by the bootloader
>       https://git.kernel.org/arm64/c/dd4bc6076587
>

This test

((u64)_text % MIN_KIMG_ALIGN) != 0

should have been written as

((u64)_text % MIN_KIMG_ALIGN) != TEXT_OFFSET

because now, we are throwing the warning when
CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is enabled :-(

I was reluctant to add another Makefile rule to add a
-DTEXT_OFFSET=... GCC option when compiling this source file, but it
appears we need it after all.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-06-13  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 12:43 [PATCH v2] arm64: warn on incorrect placement of the kernel by the bootloader Ard Biesheuvel
2020-06-11 13:23 ` Will Deacon
2020-06-13  8:45   ` Ard Biesheuvel [this message]
2020-06-15  9:51     ` Will Deacon
2020-06-15  9:53       ` 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='CAMj1kXENVduZAWOqkSE3ZvW=u=vyVjXBCe-1+i3h1oi1RjW_JA@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=jonathan@marek.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=will@kernel.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 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.