devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: Marek Bykowski <marek.bykowski@gmail.com>
Cc: Frank Rowand <frowand.list@gmail.com>,
	devicetree@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] of/fdt: Don't calculate initrd_start from the DT if 'linux,initrd-end' is 0
Date: Sun, 28 Aug 2022 20:12:41 -0500	[thread overview]
Message-ID: <CAL_JsqKGgZOSdWQ2ithipvrRAYwt-vOL1z9-RM++-_h6pA=C_Q@mail.gmail.com> (raw)
In-Reply-To: <20220826220017.188066-1-marek.bykowski@gmail.com>

On Fri, Aug 26, 2022 at 5:00 PM Marek Bykowski <marek.bykowski@gmail.com> wrote:
>
> If the 'linux,initrd-end' property is 0 and 'linux,initrd-start' property
> is other than 0, then phys_initrd_size calculated from 'linux,initrd-end'
> - 'linux,initrd-start' is negative, that subsequently gets converted to
> a high positive value as being u64.
>
> For example if 'linux,initrd-start' is 8800_0000, 'linux,initrd-end' is 0,
> then the phys_initrd_size calculated is ffff_ffff_7800_0000 (= 0 -
> 8800_0000 = -8800_0000 + ULLONG_MAX + 1). On my system, FVP ARM64,
> the intird memory region with the (wrong) size is added to the bootmem and
> then attempted to being paged in paging_init() that results in the kernel
> oops as shown below.

Shouldn't we just check that start < end?

Can we check this somewhere not DT specific (and also not arch
specific)? Then we don't have to worry if any other method of setting
initrd could have the same error.

Rob

  reply	other threads:[~2022-08-29  1:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 22:00 [PATCH] of/fdt: Don't calculate initrd_start from the DT if 'linux,initrd-end' is 0 Marek Bykowski
2022-08-29  1:12 ` Rob Herring [this message]
2022-08-30 15:35   ` Marek Bykowski
2022-09-06 10:07     ` Marek Bykowski
2022-09-06 14:39     ` Rob Herring

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='CAL_JsqKGgZOSdWQ2ithipvrRAYwt-vOL1z9-RM++-_h6pA=C_Q@mail.gmail.com' \
    --to=robh+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.bykowski@gmail.com \
    /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).