All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <amc96@srcf.net>
To: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 1/8] x86/boot: Drop incorrect mapping at l2_xenmap[0]
Date: Tue, 30 Nov 2021 12:39:46 +0000	[thread overview]
Message-ID: <c86cf903-7627-0f8f-78ba-de97fa05c5d4@srcf.net> (raw)
In-Reply-To: <0b38fd69-c484-fdd4-9816-5d2a00b0a7b8@suse.com>

On 30/11/2021 11:22, Jan Beulich wrote:
> On 30.11.2021 12:14, Andrew Cooper wrote:
>> On 30/11/2021 10:33, Jan Beulich wrote:
>>> On 30.11.2021 11:04, Andrew Cooper wrote:
>>>> It has been 4 years since the default load address changed from 1M to 2M, and
>>>> _stext ceased residing in l2_xenmap[0].  We should not be inserting an unused
>>>> mapping.
>>>>
>>>> To ensure we don't create mappings accidentally, loop from 0 and obey
>>>> _PAGE_PRESENT on all entries.
>>>>
>>>> Fixes: 7ed93f3a0dff ("x86: change default load address from 1 MiB to 2 MiB")
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>>
>>> I guess this may be worth backporting despite not having any immediate
>>> adverse effect.
>> I'd say so, yes.  I too can't see an adverse effect right now, but I'm
>> definitely wary of stray executable mappings lying around.
>>
>>
>> In principle, it would be nice to reclaim the 2M of space (which only
>> exists for the MB1 path IIRC), but then we're getting into a position
>> where xen_phys_start isn't really that any more.
> Well, xen_phys_base might be slightly more accurate, but apart from that
> I do think that we reclaim that space (as much as we did reclaim the 1Mb
> before the change of the default load address):
>
>     if ( efi_boot_mem_unused(&eb_start, &eb_end) )
>     {
>         reserve_e820_ram(&boot_e820, __pa(_stext), __pa(eb_start));
>         reserve_e820_ram(&boot_e820, __pa(eb_end), __pa(__2M_rwdata_end));
>     }
>     else
>         reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));

That means there are zero safety barriers between a bad function pointer
and executing arbitrary guest memory, doesn't it...

My "adverse effect" comment was under the impression that we just left
the range unused.

~Andrew


  reply	other threads:[~2021-11-30 12:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 10:04 [PATCH 0/8] x86: Support for __ro_after_init Andrew Cooper
2021-11-30 10:04 ` [PATCH 1/8] x86/boot: Drop incorrect mapping at l2_xenmap[0] Andrew Cooper
2021-11-30 10:33   ` Jan Beulich
2021-11-30 11:14     ` Andrew Cooper
2021-11-30 11:22       ` Jan Beulich
2021-11-30 12:39         ` Andrew Cooper [this message]
2021-11-30 10:04 ` [PATCH 2/8] x86/boot: Better describe the pagetable relocation loops Andrew Cooper
2021-12-02 11:43   ` Jan Beulich
2021-11-30 10:04 ` [PATCH 3/8] x86/boot: Fix data placement around __high_start() Andrew Cooper
2021-12-02 11:49   ` Jan Beulich
2021-12-02 14:06     ` Andrew Cooper
2021-11-30 10:04 ` [PATCH 4/8] x86/mm: Drop bogus cacheability logic in update_xen_mappings() Andrew Cooper
2021-11-30 13:11   ` Andrew Cooper
2021-11-30 14:56     ` Andrew Cooper
2021-11-30 10:04 ` [PATCH 5/8] x86/boot: Drop xen_virt_end Andrew Cooper
2021-12-02 11:56   ` Jan Beulich
2021-12-02 14:07     ` Andrew Cooper
2021-11-30 10:04 ` [PATCH 6/8] x86/boot: Adjust .text/.rodata/etc permissions in one place Andrew Cooper
2021-12-02 12:15   ` Jan Beulich
2021-11-30 10:04 ` [PATCH 7/8] x86/boot: Support __ro_after_init Andrew Cooper
2021-12-02 13:10   ` Jan Beulich
2021-11-30 10:04 ` [PATCH RFC 8/8] x86/boot: Check that permission restrictions have taken effect Andrew Cooper
2021-12-02 13:33   ` Jan Beulich
2021-12-06 18:12     ` Andrew Cooper

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=c86cf903-7627-0f8f-78ba-de97fa05c5d4@srcf.net \
    --to=amc96@srcf.net \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.