Skip to content
Snippets Groups Projects
Select Git revision
  • 3307c4d31b5f7389948dc186a88748dfc7acf292
  • openEuler-1.0-LTS default protected
  • openEuler-22.09
  • OLK-5.10
  • openEuler-22.03-LTS
  • openEuler-22.03-LTS-Ascend
  • master
  • openEuler-22.03-LTS-LoongArch-NW
  • openEuler-22.09-HCK
  • openEuler-20.03-LTS-SP3
  • openEuler-21.09
  • openEuler-21.03
  • openEuler-20.09
  • 4.19.90-2210.5.0
  • 5.10.0-123.0.0
  • 5.10.0-60.63.0
  • 5.10.0-60.62.0
  • 4.19.90-2210.4.0
  • 5.10.0-121.0.0
  • 5.10.0-60.61.0
  • 4.19.90-2210.3.0
  • 5.10.0-60.60.0
  • 5.10.0-120.0.0
  • 5.10.0-60.59.0
  • 5.10.0-119.0.0
  • 4.19.90-2210.2.0
  • 4.19.90-2210.1.0
  • 5.10.0-118.0.0
  • 5.10.0-106.19.0
  • 5.10.0-60.58.0
  • 4.19.90-2209.6.0
  • 5.10.0-106.18.0
  • 5.10.0-106.17.0
33 results

arch

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Kirill A. Shutemov authored and Xie XiuQi committed
    [ Upstream commit 81c7ed29 ]
    
    A kernel which boots in 5-level paging mode crashes in a small percentage
    of cases if KASLR is enabled.
    
    This issue was tracked down to the case when the kernel image unpacks in a
    way that it crosses an 1G boundary. The crash is caused by an overrun of
    the PMD page table in __startup_64() and corruption of P4D page table
    allocated next to it. This particular issue is not visible with 4-level
    paging as P4D page tables are not used.
    
    But the P4D and the PUD calculation have similar problems.
    
    The PMD index calculation is wrong due to operator precedence, which fails
    to confine the PMDs in the PMD array on wrap around.
    
    The P4D calculation for 5-level paging and the PUD calculation calculate
    the first index correctly, but then blindly increment it which causes the
    same issue when a kernel image is located across a 512G and for 5-level
    paging across a 46T boundary.
    
    This wrap around mishandling was introduced when these parts moved from
    assembly to C.
    
    Restore it to the correct behaviour.
    
    Fixes: c88d7150 ("x86/boot/64: Rewrite startup_64() in C")
    Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20190620112345.28833-1-kirill.shutemov@linux.intel.com
    
    
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
    3307c4d3
    History
    Name Last commit Last update
    ..