1. 09 Aug, 2018 4 commits
    • Matt Fleming's avatar
      x86/mm/pat: Ensure cpa->pfn only contains page frame numbers · 319f01bb
      Matt Fleming authored
      The x86 pageattr code is confused about the data that is stored
      in cpa->pfn, sometimes it's treated as a page frame number,
      sometimes it's treated as an unshifted physical address, and in
      one place it's treated as a pte.
      
      The result of this is that the mapping functions do not map the
      intended physical address.
      
      This isn't a problem in practice because most of the addresses
      we're mapping in the EFI code paths are already mapped in
      'trampoline_pgd' and so the pageattr mapping functions don't
      actually do anything in this case. But when we move to using a
      separate page table for the EFI runtime this will be an issue.
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Toshi Kani <toshi.kani@hp.com>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1448658575-17029-3-git-send-email-matt@codeblueprint.co.ukSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      
      CVE-2018-3620
      CVE-2018-3646
      
      (cherry picked from commit edc3b912)
      Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
      319f01bb
    • Andi Kleen's avatar
      x86/speculation/l1tf: Make pmd/pud_mknotpresent() invert · efb357f0
      Andi Kleen authored
      Some cases in THP like:
        - MADV_FREE
        - mprotect
        - split
      
      mark the PMD non present for temporarily to prevent races. The window for
      an L1TF attack in these contexts is very small, but it wants to be fixed
      for correctness sake.
      
      Use the proper low level functions for pmd/pud_mknotpresent() to address
      this.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      
      CVE-2018-3620
      CVE-2018-3646
      
      [smb: Drop pud_mknotpresent() changes as it does not exist]
      Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
      efb357f0
    • Andi Kleen's avatar
      x86/speculation/l1tf: Invert all not present mappings · e847687e
      Andi Kleen authored
      For kernel mappings PAGE_PROTNONE is not necessarily set for a non present
      mapping, but the inversion logic explicitely checks for !PRESENT and
      PROT_NONE.
      
      Remove the PROT_NONE check and make the inversion unconditional for all not
      present mappings.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      
      CVE-2018-3620
      CVE-2018-3646
      Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
      e847687e
    • Thomas Gleixner's avatar
      cpu/hotplug: Fix SMT supported evaluation · 2319dd9d
      Thomas Gleixner authored
      Josh reported that the late SMT evaluation in cpu_smt_state_init() sets
      cpu_smt_control to CPU_SMT_NOT_SUPPORTED in case that 'nosmt' was supplied
      on the kernel command line as it cannot differentiate between SMT disabled
      by BIOS and SMT soft disable via 'nosmt'. That wreckages the state and
      makes the sysfs interface unusable.
      
      Rework this so that during bringup of the non boot CPUs the availability of
      SMT is determined in cpu_smt_allowed(). If a newly booted CPU is not a
      'primary' thread then set the local cpu_smt_available marker and evaluate
      this explicitely right after the initial SMP bringup has finished.
      
      SMT evaulation on x86 is a trainwreck as the firmware has all the
      information _before_ booting the kernel, but there is no interface to query
      it.
      
      Fixes: 73d5e2b4 ("cpu/hotplug: detect SMT disabled by BIOS")
      Reported-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      
      CVE-2018-3620
      CVE-2018-3646
      
      [smb: Context and also adjust to alternative booted_once scheme,
            including a move of the smt check into _cpu_up()]
      Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
      2319dd9d
  2. 08 Aug, 2018 36 commits