All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <dkiper@net-space.pl>
To: Alexander Boettcher <alexander.boettcher@genode-labs.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>,
	Daniel Kiper <dkiper@net-space.pl>
Subject: Re: [PATCH] mbi: use per segment a separate relocator chunk
Date: Wed, 16 May 2018 12:22:38 +0200	[thread overview]
Message-ID: <20180516102238.GC24959@router-fw-old.local.net-space.pl> (raw)
In-Reply-To: <a5ab4886-41ec-7bf6-faa7-271e22289a83@genode-labs.com>

On Tue, May 15, 2018 at 09:18:18PM +0200, Alexander Boettcher wrote:
> On 15.05.2018 21:10, Alexander Boettcher wrote:
> >>I assume that a given ELF PHDR address/size does not cover VGA memory or
> >>anything like that,
> >
> >No.
> >
> >>so, I am not sure what exactly overwrites this region.
> >>grub_memset() in current line 161 at some point?
> >
> >No. During grub_relocator_prepare_reloc the overwrite happens, if i'm
> >not wrong.
> >
> >An (artificial) example, imagine two ELF PHDRs, e.g.
> >
> > ??[0x8000-0x9000) and
> > ??[0x2000000-0x2100000).
> >
> >Without this patch grub calculates one relocator chunk of size 0x20f8000
> >(0x2100000 - 0x8000) and places it at some higher memory, e.g.
> >[0x3000000 - 0x30f8000). During the invocation of
>
> Must be [0x3000000-0x50f8000)
>
> >grub_relocator_prepare_reloc the memory gets copied from
> >
> >[0x3000000-0x30f8000) to [0x8000-0x2100000)
>
> Must be [0x3000000-0x50f8000) to [0x8000-0x2100000)

It seems to me that it happens a bit later. AIUI grub_relocator_prepare_reloc()
prepare movers which are executed when main GRUB code is left,
e.g relst() call from grub_relocator32_boot(). And the movers
do bad job. Well, they were told to do so... Anyway, I think
that the comment should be a bit more clear about it.

Daniel


  reply	other threads:[~2018-05-16 10:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 19:02 [PATCH] mbi: use per segment a separate relocator chunk Alexander Boettcher
2018-05-15 13:42 ` Daniel Kiper
2018-05-15 19:10   ` Alexander Boettcher
2018-05-15 19:18     ` Alexander Boettcher
2018-05-16 10:22       ` Daniel Kiper [this message]
2018-06-05 19:59   ` Alexander Boettcher

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=20180516102238.GC24959@router-fw-old.local.net-space.pl \
    --to=dkiper@net-space.pl \
    --cc=alexander.boettcher@genode-labs.com \
    --cc=grub-devel@gnu.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.