From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1] arm64: setup: Check for overlapping dtb and Image load addresses
Date: Mon, 29 Jan 2018 15:48:12 +0000	[thread overview]
Message-ID: <20180129154812.GA25061@arm.com> (raw)
In-Reply-To: <20180124092345.5072-1-clingutla@codeaurora.org>
On Wed, Jan 24, 2018 at 02:53:45PM +0530, Lingutla Chandrasekhar wrote:
> Sometime kernel image and dtb load offsets can overlap due to
> dynamically increased Image or dtb size if both load addresses
> are near to each other, which leads to bootup failures.
> 
> So validate dtb load address and kernel image, if they overlap
> do not proceed to boot.
> 
> Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
> ---
> 
> Changes since v0:
> - Print overlap bytes.
> - Simplify ovelap checks.
This all feels a bit fragile to me, since we're relying on some portion of
the Image and .dtb working in order to run this code successfully.  I'd
rather not pretend to detect this exact scenario, particularly as I can't
see it being useful for anybody other than firmware developers (who are in a
better position to check whether or not this is happening).
More generally, is there not some .dtb checksum failure that detects
corruption there? Perhaps we could do something like that for the Image
too?
Will
next prev parent reply	other threads:[~2018-01-29 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  9:23 [PATCH v1] arm64: setup: Check for overlapping dtb and Image load addresses Lingutla Chandrasekhar
2018-01-29 15:48 ` Will Deacon [this message]
2018-02-05  8:06   ` Chandra Sekhar Lingutla
2018-02-05 11:13     ` Mark Rutland
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=20180129154812.GA25061@arm.com \
    --to=will.deacon@arm.com \
    --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).