[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1801112346370.2091@nanos>
Date: Thu, 11 Jan 2018 23:47:23 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Steven Sistare <steven.sistare@...cle.com>
cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Pavel Tatashin <pasha.tatashin@...cle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andy Lutomirski <luto@...nel.org>,
Hugh Dickins <hughd@...gle.com>, Thomas Voegtle <tv@...96.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Guenter Roeck <linux@...ck-us.net>,
Shuah Khan <shuahkh@....samsung.com>, patches@...nelci.org,
Ben Hutchings <ben.hutchings@...ethink.co.uk>,
lkft-triage@...ts.linaro.org, stable <stable@...r.kernel.org>,
Matt Fleming <matt@...eblueprint.co.uk>,
Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH 4.4 00/37] 4.4.110-stable review
On Thu, 11 Jan 2018, Steven Sistare wrote:
> On 1/11/2018 5:30 PM, Thomas Gleixner wrote:
> > On Thu, 11 Jan 2018, Thomas Gleixner wrote:
> >> On Thu, 11 Jan 2018, Linus Torvalds wrote:
> >>
> >>> On Thu, Jan 11, 2018 at 12:37 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
> >>>>
> >>>> 67a9108ed431 ("x86/efi: Build our own page table structures")
> >>>>
> >>>> got rid of EFI depending on real_mode_header->trampoline_pgd
> >>>
> >>> So I think it only got rid of by default - the codepath is still
> >>> there, the allocation is still there, it's just that it's not actually
> >>> used unless somebody does that "efi=old_mmap" thing.
> >>
> >> Yes, the trampoline_pgd is still around, but I can't figure out how it
> >> would be used after boot. Confused, digging more.
> >
> > So coming back to the same commit. From the changelog:
> >
> > This is caused by mapping EFI regions with RWX permissions.
> > There isn't much we can do to restrict the permissions for these
> > regions due to the way the firmware toolchains mix code and
> > data, but we can at least isolate these mappings so that they do
> > not appear in the regular kernel page tables.
> >
> > In commit d2f7cbe7b26a ("x86/efi: Runtime services virtual
> > mapping") we started using 'trampoline_pgd' to map the EFI
> > regions because there was an existing identity mapping there
> > which we use during the SetVirtualAddressMap() call and for
> > broken firmware that accesses those addresses.
> >
> > So this very commit gets rid of the (ab)use of trampoline_pgd and allocates
> > efi_pgd, which we made use the proper size.
> >
> > trampoline_pgd is since then only used to get into long mode in
> > realmode/rm/trampoline_64.S and for reboot in machine_real_restart().
> >
> > The runtime services stuff does not use it in kernel versions >= 4.6
> >
> > Thanks,
> >
> > tglx
>
> Yes, and addressing Linus' concern about EFI_OLD_MEMMAP, those paths are
> independent of it. When EFI_OLD_MMAP is enabled, the efi pgd is not
> used, and the bug will not bite.
We have a fix queued in tip/x86/pti which addresses a missing NX clear, but
that's a different story.
Thanks,
tglx
Powered by blists - more mailing lists