1. 24 4月, 2021 1 次提交
  2. 23 4月, 2021 2 次提交
  3. 22 4月, 2021 4 次提交
  4. 21 4月, 2021 3 次提交
  5. 20 4月, 2021 3 次提交
    • M
      x86/crash: Fix crash_setup_memmap_entries() out-of-bounds access · 5849cdf8
      Mike Galbraith 提交于
      Commit in Fixes: added support for kexec-ing a kernel on panic using a
      new system call. As part of it, it does prepare a memory map for the new
      kernel.
      
      However, while doing so, it wrongly accesses memory it has not
      allocated: it accesses the first element of the cmem->ranges[] array in
      memmap_exclude_ranges() but it has not allocated the memory for it in
      crash_setup_memmap_entries(). As KASAN reports:
      
        BUG: KASAN: vmalloc-out-of-bounds in crash_setup_memmap_entries+0x17e/0x3a0
        Write of size 8 at addr ffffc90000426008 by task kexec/1187
      
        (gdb) list *crash_setup_memmap_entries+0x17e
        0xffffffff8107cafe is in crash_setup_memmap_entries (arch/x86/kernel/crash.c:322).
        317                                      unsigned long long mend)
        318     {
        319             unsigned long start, end;
        320
        321             cmem->ranges[0].start = mstart;
        322             cmem->ranges[0].end = mend;
        323             cmem->nr_ranges = 1;
        324
        325             /* Exclude elf header region */
        326             start = image->arch.elf_load_addr;
        (gdb)
      
      Make sure the ranges array becomes a single element allocated.
      
       [ bp: Write a proper commit message. ]
      
      Fixes: dd5f7260 ("kexec: support for kexec on panic using new system call")
      Signed-off-by: NMike Galbraith <efault@gmx.de>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NDave Young <dyoung@redhat.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lkml.kernel.org/r/725fa3dc1da2737f0f6188a1a9701bead257ea9d.camel@gmx.de
      5849cdf8
    • I
      x86/platform/uv: Remove dead !CONFIG_KEXEC_CORE code · 27743f01
      Ingo Molnar 提交于
      The !CONFIG_KEXEC_CORE code in arch/x86/platform/uv/uv_nmi.c was unused, untested
      and didn't even build for 7 years. Since we fixed this by requiring X86_UV to
      depend on CONFIG_KEXEC_CORE, remove the (now) dead code.
      
      Also move the uv_nmi_kexec_failed definition back up to where the other file-scope
      global variables are defined.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Mike Travis <travis@sgi.com>
      Cc: linux-kernel@vger.kernel.org
      27743f01
    • I
      x86/platform/uv: Fix !KEXEC build failure · c2209ea5
      Ingo Molnar 提交于
      When KEXEC is disabled, the UV build fails:
      
        arch/x86/platform/uv/uv_nmi.c:875:14: error: ‘uv_nmi_kexec_failed’ undeclared (first use in this function)
      
      Since uv_nmi_kexec_failed is only defined in the KEXEC_CORE #ifdef branch,
      this code cannot ever have been build tested:
      
      	if (main)
      		pr_err("UV: NMI kdump: KEXEC not supported in this kernel\n");
      	atomic_set(&uv_nmi_kexec_failed, 1);
      
      Nor is this use possible in uv_handle_nmi():
      
                      atomic_set(&uv_nmi_kexec_failed, 0);
      
      These bugs were introduced in this commit:
      
          d0a9964e: ("x86/platform/uv: Implement simple dump failover if kdump fails")
      
      Which added the uv_nmi_kexec_failed assignments to !KEXEC code, while making the
      definition KEXEC-only - apparently without testing the !KEXEC case.
      
      Instead of complicating the #ifdef maze, simplify the code by requiring X86_UV
      to depend on KEXEC_CORE. This pattern is present in other architectures as well.
      
      ( We'll remove the untested, 7 years old !KEXEC complications from the file in a
        separate commit. )
      
      Fixes: d0a9964e: ("x86/platform/uv: Implement simple dump failover if kdump fails")
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Mike Travis <travis@sgi.com>
      Cc: linux-kernel@vger.kernel.org
      c2209ea5
  6. 19 4月, 2021 9 次提交
  7. 17 4月, 2021 4 次提交
  8. 16 4月, 2021 14 次提交