[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20201116160710.c088d1f6b4ab957d93f9aa13@kernel.org>
Date: Mon, 16 Nov 2020 16:07:10 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Chen Yu <yu.chen.surf@...il.com>
Subject: Re: [GIT PULL] bootconfig: Extend the magic check range to the
preceding 3 bytes
On Fri, 13 Nov 2020 13:03:05 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Fri, 13 Nov 2020 09:57:54 -0800
> Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>
> > On Fri, Nov 13, 2020 at 9:54 AM Steven Rostedt <rostedt@...dmis.org> wrote:
> > >
> > > The issue is that grub padded the end of the ramdisk after loading it
> > > into memory. I'm not sure how the bootconfig tool can fix this. Perhaps
> > > make sure the ram disk size is 4 bytes aligned?
> >
> > Exactly. Since - as far as I can tell - the _only_ thing that actually
> > generates that BOOTCONFIG_MAGIC marker is the bootconfig tool, you
> > control the vertical and the horizontal. No need for some "heuristic"
> > and searching for things.
> >
> > And then that thing needs to be documented, so that if somebody else
> > starts generating BOOTCONFIG_MAGIC markers, we have a hard rule in
> > place that "look, the bootconfig is always aligned".
> >
> > Might as well align it more than 4 bytes while at it and make it even stricter.
> >
>
> OK, yes I agree with this.
OK, but note that the initrd_end can be modified by the bootloader anyway.
The bootloader can pass any "size" bigger than actual initramfs size
because initramfs is a cpio file which has a "TRAILER!!!" magic as the
end of file. This means kernel can ignore or use (as the bootconfig does)
for a tailing data storage.
But I agree that we need to document it, so that anyone can refer the
data format.
> Masami, can you send a patch to fix the bootconfig tool to make sure
> that when it appends to the initrd that it makes sure the file size is
> aligned. Would 32 bytes be big enough for an alignment?
OK, it is easy to me to update bootconfig tool to align up the total size
to 32bytes, but I think 4 bytes align is OK if we document it. Without
documentation, no one in the bootloader decides what is the correct
format.
Thank you,
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists