• K
    x86/kexec: Add the EFI system tables and ACPI tables to the ident map · 12391a94
    Kairui Song 提交于
    mainline inclusion
    from mainline-6bbeb276b71f undefined
    commit 6bbeb276b71f
    category: bugfix
    bugzilla: 17339
    CVE: NA
    
    -------------------------------------------------
    
    Currently, only the whole physical memory is identity-mapped for the
    kexec kernel and the regions reserved by firmware are ignored.
    
    However, the recent addition of RSDP parsing in the decompression stage
    and especially:
    
      33f0df8d843d ("x86/boot: Search for RSDP in the EFI tables")
    
    which tries to access EFI system tables and to dig out the RDSP address
    from there, becomes a problem because in certain configurations, they
    might not be mapped in the kexec'ed kernel's address space.
    
    What is more, this problem doesn't appear on all systems because the
    kexec kernel uses gigabyte pages to build the identity mapping. And
    the EFI system tables and ACPI tables can, depending on the system
    configuration, end up being mapped as part of all physical memory, if
    they share the same 1 GB area with the physical memory.
    
    Therefore, make sure they're always mapped.
    
     [ bp: productize half-baked patch:
       - rewrite commit message.
       - correct the map_acpi_tables() function name in the !ACPI case. ]
    Signed-off-by: NKairui Song <kasong@redhat.com>
    Signed-off-by: NBaoquan He <bhe@redhat.com>
    Signed-off-by: NBorislav Petkov <bp@suse.de>
    Tested-by: NDirk van der Merwe <dirk.vandermerwe@netronome.com>
    Cc: dyoung@redhat.com
    Cc: fanc.fnst@cn.fujitsu.com
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: j-nomura@ce.jp.nec.com
    Cc: kexec@lists.infradead.org
    Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    Cc: Lianbo Jiang <lijiang@redhat.com>
    Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: x86-ml <x86@kernel.org>
    Link: https://lkml.kernel.org/r/20190429002318.GA25400@MiWiFi-R3L-srvSigned-off-by: NChen Zhou <chenzhou10@huawei.com>
    Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    12391a94
machine_kexec_64.c 15.9 KB