1. 05 Dec, 2017 16 commits
    • Heiner Kallweit's avatar
      eeprom: at24: check at24_read/write arguments · 6b4901e0
      Heiner Kallweit authored
      commit d9bcd462 upstream.
      
      So far we completely rely on the caller to provide valid arguments.
      To be on the safe side perform an own sanity check.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6b4901e0
    • Adrian Hunter's avatar
      mmc: core: Do not leave the block driver in a suspended state · 5c65b739
      Adrian Hunter authored
      commit ebe7dd45 upstream.
      
      The block driver must be resumed if the mmc bus fails to suspend the card.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5c65b739
    • Paolo Bonzini's avatar
      KVM: x86: inject exceptions produced by x86_decode_insn · a6493ad6
      Paolo Bonzini authored
      commit 6ea6e843 upstream.
      
      Sometimes, a processor might execute an instruction while another
      processor is updating the page tables for that instruction's code page,
      but before the TLB shootdown completes.  The interesting case happens
      if the page is in the TLB.
      
      In general, the processor will succeed in executing the instruction and
      nothing bad happens.  However, what if the instruction is an MMIO access?
      If *that* happens, KVM invokes the emulator, and the emulator gets the
      updated page tables.  If the update side had marked the code page as non
      present, the page table walk then will fail and so will x86_decode_insn.
      
      Unfortunately, even though kvm_fetch_guest_virt is correctly returning
      X86EMUL_PROPAGATE_FAULT, x86_decode_insn's caller treats the failure as
      a fatal error if the instruction cannot simply be reexecuted (as is the
      case for MMIO).  And this in fact happened sometimes when rebooting
      Windows 2012r2 guests.  Just checking ctxt->have_exception and injecting
      the exception if true is enough to fix the case.
      
      Thanks to Eduardo Habkost for helping in the debugging of this issue.
      Reported-by: default avatarYanan Fu <yfu@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a6493ad6
    • Liran Alon's avatar
      KVM: x86: Exit to user-mode on #UD intercept when emulator requires · 1e9e6bdc
      Liran Alon authored
      commit 61cb57c9 upstream.
      
      Instruction emulation after trapping a #UD exception can result in an
      MMIO access, for example when emulating a MOVBE on a processor that
      doesn't support the instruction.  In this case, the #UD vmexit handler
      must exit to user mode, but there wasn't any code to do so.  Add it for
      both VMX and SVM.
      Signed-off-by: default avatarLiran Alon <liran.alon@oracle.com>
      Reviewed-by: default avatarNikita Leshenko <nikita.leshchenko@oracle.com>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1e9e6bdc
    • Liran Alon's avatar
      KVM: x86: pvclock: Handle first-time write to pvclock-page contains random junk · ab29b6b8
      Liran Alon authored
      commit 51c4b8bb upstream.
      
      When guest passes KVM it's pvclock-page GPA via WRMSR to
      MSR_KVM_SYSTEM_TIME / MSR_KVM_SYSTEM_TIME_NEW, KVM don't initialize
      pvclock-page to some start-values. It just requests a clock-update which
      will happen before entering to guest.
      
      The clock-update logic will call kvm_setup_pvclock_page() to update the
      pvclock-page with info. However, kvm_setup_pvclock_page() *wrongly*
      assumes that the version-field is initialized to an even number. This is
      wrong because at first-time write, field could be any-value.
      
      Fix simply makes sure that if first-time version-field is odd, increment
      it once more to make it even and only then start standard logic.
      This follows same logic as done in other pvclock shared-pages (See
      kvm_write_wall_clock() and record_steal_time()).
      Signed-off-by: default avatarLiran Alon <liran.alon@oracle.com>
      Reviewed-by: default avatarNikita Leshenko <nikita.leshchenko@oracle.com>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ab29b6b8
    • Josef Bacik's avatar
      btrfs: clear space cache inode generation always · 591ddc92
      Josef Bacik authored
      commit 8e138e0d upstream.
      
      We discovered a box that had double allocations, and suspected the space
      cache may be to blame.  While auditing the write out path I noticed that
      if we've already setup the space cache we will just carry on.  This
      means that any error we hit after cache_save_setup before we go to
      actually write the cache out we won't reset the inode generation, so
      whatever was already written will be considered correct, except it'll be
      stale.  Fix this by _always_ resetting the generation on the block group
      inode, this way we only ever have valid or invalid cache.
      
      With this patch I was no longer able to reproduce cache corruption with
      dm-log-writes and my bpf error injection tool.
      Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      591ddc92
    • chenjie's avatar
      mm/madvise.c: fix madvise() infinite loop under special circumstances · 0d05a559
      chenjie authored
      commit 6ea8d958 upstream.
      
      MADVISE_WILLNEED has always been a noop for DAX (formerly XIP) mappings.
      Unfortunately madvise_willneed() doesn't communicate this information
      properly to the generic madvise syscall implementation.  The calling
      convention is quite subtle there.  madvise_vma() is supposed to either
      return an error or update &prev otherwise the main loop will never
      advance to the next vma and it will keep looping for ever without a way
      to get out of the kernel.
      
      It seems this has been broken since introduction.  Nobody has noticed
      because nobody seems to be using MADVISE_WILLNEED on these DAX mappings.
      
      [mhocko@suse.com: rewrite changelog]
      Link: http://lkml.kernel.org/r/20171127115318.911-1-guoxuenan@huawei.com
      Fixes: fe77ba6f ("[PATCH] xip: madvice/fadvice: execute in place")
      Signed-off-by: default avatarchenjie <chenjie6@huawei.com>
      Signed-off-by: default avatarguoxuenan <guoxuenan@huawei.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: zhangyi (F) <yi.zhang@huawei.com>
      Cc: Miao Xie <miaoxie@huawei.com>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: Shaohua Li <shli@fb.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Carsten Otte <cotte@de.ibm.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0d05a559
    • Kirill A. Shutemov's avatar
      mm, thp: Do not make page table dirty unconditionally in touch_p[mu]d() · 2b7ef6bd
      Kirill A. Shutemov authored
      commit a8f97366 upstream.
      
      Currently, we unconditionally make page table dirty in touch_pmd().
      It may result in false-positive can_follow_write_pmd().
      
      We may avoid the situation, if we would only make the page table entry
      dirty if caller asks for write access -- FOLL_WRITE.
      
      The patch also changes touch_pud() in the same way.
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Hugh Dickins <hughd@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      [Salvatore Bonaccorso: backport for 3.16:
       - Adjust context
       - Drop specific part for PUD-sized transparent hugepages. Support
         for PUD-sized transparent hugepages was added in v4.11-rc1
      ]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2b7ef6bd
    • Matt Fleming's avatar
      x86/efi-bgrt: Replace early_memremap() with memremap() · f97fc9ab
      Matt Fleming authored
      commit e2c90dd7 upstream.
      
      Môshe reported the following warning triggered on his machine since
      commit 50a0cb56 ("x86/efi-bgrt: Fix kernel panic when mapping BGRT
      data"),
      
        [    0.026936] ------------[ cut here ]------------
        [    0.026941] WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:137 __early_ioremap+0x102/0x1bb()
        [    0.026941] Modules linked in:
        [    0.026944] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.0-rc1 #2
        [    0.026945] Hardware name: Dell Inc. XPS 13 9343/09K8G1, BIOS A05 07/14/2015
        [    0.026946]  0000000000000000 900f03d5a116524d ffffffff81c03e60 ffffffff813a3fff
        [    0.026948]  0000000000000000 ffffffff81c03e98 ffffffff810a0852 00000000d7b76000
        [    0.026949]  0000000000000000 0000000000000001 0000000000000001 000000000000017c
        [    0.026951] Call Trace:
        [    0.026955]  [<ffffffff813a3fff>] dump_stack+0x44/0x55
        [    0.026958]  [<ffffffff810a0852>] warn_slowpath_common+0x82/0xc0
        [    0.026959]  [<ffffffff810a099a>] warn_slowpath_null+0x1a/0x20
        [    0.026961]  [<ffffffff81d8c395>] __early_ioremap+0x102/0x1bb
        [    0.026962]  [<ffffffff81d8c602>] early_memremap+0x13/0x15
        [    0.026964]  [<ffffffff81d78361>] efi_bgrt_init+0x162/0x1ad
        [    0.026966]  [<ffffffff81d778ec>] efi_late_init+0x9/0xb
        [    0.026968]  [<ffffffff81d58ff5>] start_kernel+0x46f/0x49f
        [    0.026970]  [<ffffffff81d58120>] ? early_idt_handler_array+0x120/0x120
        [    0.026972]  [<ffffffff81d58339>] x86_64_start_reservations+0x2a/0x2c
        [    0.026974]  [<ffffffff81d58485>] x86_64_start_kernel+0x14a/0x16d
        [    0.026977] ---[ end trace f9b3812eb8e24c58 ]---
        [    0.026978] efi_bgrt: Ignoring BGRT: failed to map image memory
      
      early_memremap() has an upper limit on the size of mapping it can
      handle which is ~200KB. Clearly the BGRT image on Môshe's machine is
      much larger than that.
      
      There's actually no reason to restrict ourselves to using the early_*
      version of memremap() - the ACPI BGRT driver is invoked late enough in
      boot that we can use the standard version, with the benefit that the
      late version allows mappings of arbitrary size.
      Reported-by: default avatarMôshe van der Sterre <me@moshe.nl>
      Tested-by: default avatarMôshe van der Sterre <me@moshe.nl>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Link: http://lkml.kernel.org/r/1450707172-12561-1-git-send-email-matt@codeblueprint.co.ukSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f97fc9ab
    • Sai Praneeth's avatar
      x86/efi-bgrt: Fix kernel panic when mapping BGRT data · e85c6907
      Sai Praneeth authored
      commit 50a0cb56 upstream.
      
      Starting with this commit 35eb8b81edd4 ("x86/efi: Build our own page
      table structures") efi regions have a separate page directory called
      "efi_pgd". In order to access any efi region we have to first shift %cr3
      to this page table. In the bgrt code we are trying to copy bgrt_header
      and image, but these regions fall under "EFI_BOOT_SERVICES_DATA"
      and to access these regions we have to shift %cr3 to efi_pgd and not
      doing so will cause page fault as shown below.
      
      [    0.251599] Last level dTLB entries: 4KB 64, 2MB 0, 4MB 0, 1GB 4
      [    0.259126] Freeing SMP alternatives memory: 32K (ffffffff8230e000 - ffffffff82316000)
      [    0.271803] BUG: unable to handle kernel paging request at fffffffefce35002
      [    0.279740] IP: [<ffffffff821bca49>] efi_bgrt_init+0x144/0x1fd
      [    0.286383] PGD 300f067 PUD 0
      [    0.289879] Oops: 0000 [#1] SMP
      [    0.293566] Modules linked in:
      [    0.297039] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.0-rc1-eywa-eywa-built-in-47041+ #2
      [    0.306619] Hardware name: Intel Corporation Skylake Client platform/Skylake Y LPDDR3 RVP3, BIOS SKLSE2R1.R00.B104.B01.1511110114 11/11/2015
      [    0.320925] task: ffffffff820134c0 ti: ffffffff82000000 task.ti: ffffffff82000000
      [    0.329420] RIP: 0010:[<ffffffff821bca49>]  [<ffffffff821bca49>] efi_bgrt_init+0x144/0x1fd
      [    0.338821] RSP: 0000:ffffffff82003f18  EFLAGS: 00010246
      [    0.344852] RAX: fffffffefce35000 RBX: fffffffefce35000 RCX: fffffffefce2b000
      [    0.352952] RDX: 000000008a82b000 RSI: ffffffff8235bb80 RDI: 000000008a835000
      [    0.361050] RBP: ffffffff82003f30 R08: 000000008a865000 R09: ffffffffff202850
      [    0.369149] R10: ffffffff811ad62f R11: 0000000000000000 R12: 0000000000000000
      [    0.377248] R13: ffff88016dbaea40 R14: ffffffff822622c0 R15: ffffffff82003fb0
      [    0.385348] FS:  0000000000000000(0000) GS:ffff88016d800000(0000) knlGS:0000000000000000
      [    0.394533] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [    0.401054] CR2: fffffffefce35002 CR3: 000000000300c000 CR4: 00000000003406f0
      [    0.409153] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [    0.417252] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [    0.425350] Stack:
      [    0.427638]  ffffffffffffffff ffffffff82256900 ffff88016dbaea40 ffffffff82003f40
      [    0.436086]  ffffffff821bbce0 ffffffff82003f88 ffffffff8219c0c2 0000000000000000
      [    0.444533]  ffffffff8219ba4a ffffffff822622c0 0000000000083000 00000000ffffffff
      [    0.452978] Call Trace:
      [    0.455763]  [<ffffffff821bbce0>] efi_late_init+0x9/0xb
      [    0.461697]  [<ffffffff8219c0c2>] start_kernel+0x463/0x47f
      [    0.467928]  [<ffffffff8219ba4a>] ? set_init_arg+0x55/0x55
      [    0.474159]  [<ffffffff8219b120>] ? early_idt_handler_array+0x120/0x120
      [    0.481669]  [<ffffffff8219b5ee>] x86_64_start_reservations+0x2a/0x2c
      [    0.488982]  [<ffffffff8219b72d>] x86_64_start_kernel+0x13d/0x14c
      [    0.495897] Code: 00 41 b4 01 48 8b 78 28 e8 09 36 01 00 48 85 c0 48 89 c3 75 13 48 c7 c7 f8 ac d3 81 31 c0 e8 d7 3b fb fe e9 b5 00 00 00 45 84 e4 <44> 8b 6b 02 74 0d be 06 00 00 00 48 89 df e8 ae 34 0$
      [    0.518151] RIP  [<ffffffff821bca49>] efi_bgrt_init+0x144/0x1fd
      [    0.524888]  RSP <ffffffff82003f18>
      [    0.528851] CR2: fffffffefce35002
      [    0.532615] ---[ end trace 7b06521e6ebf2aea ]---
      [    0.537852] Kernel panic - not syncing: Attempted to kill the idle task!
      
      As said above one way to fix this bug is to shift %cr3 to efi_pgd but we
      are not doing that way because it leaks inner details of how we switch
      to EFI page tables into a new call site and it also adds duplicate code.
      Instead, we remove the call to efi_lookup_mapped_addr() and always
      perform early_mem*() instead of early_io*() because we want to remap RAM
      regions and not I/O regions. We also delete efi_lookup_mapped_addr()
      because we are no longer using it.
      Signed-off-by: default avatarSai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
      Reported-by: default avatarWendy Wang <wendy.wang@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Ricardo Neri <ricardo.neri@intel.com>
      Cc: Ravi Shankar <ravi.v.shankar@intel.com>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Cc: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e85c6907
    • Adam Ford's avatar
      ARM: dts: omap3: logicpd-torpedo-37xx-devkit: Fix MMC1 cd-gpio · 44ff3af8
      Adam Ford authored
      commit b7ace5ed upstream.
      
      Fixes commit 687c2767 ("ARM: dts: Add minimal support for LogicPD
      Torpedo DM3730 devkit")
      
      This patch corrects an issue where the cd-gpios was improperly setup
      using IRQ_TYPE_LEVEL_LOW instead of GPIO_ACTIVE_LOW.
      Signed-off-by: default avatarAdam Ford <aford173@gmail.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      44ff3af8
    • Matt Fleming's avatar
      x86/efi: Build our own page table structures · 36e0f05a
      Matt Fleming authored
      commit 67a9108e upstream.
      
      With commit e1a58320 ("x86/mm: Warn on W^X mappings") all
      users booting on 64-bit UEFI machines see the following warning,
      
        ------------[ cut here ]------------
        WARNING: CPU: 7 PID: 1 at arch/x86/mm/dump_pagetables.c:225 note_page+0x5dc/0x780()
        x86/mm: Found insecure W+X mapping at address ffff88000005f000/0xffff88000005f000
        ...
        x86/mm: Checked W+X mappings: FAILED, 165660 W+X pages found.
        ...
      
      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 d2f7cbe7 ("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.
      
      But 'trampoline_pgd' shares some PGD entries with
      'swapper_pg_dir' and does not provide the isolation we require.
      Notably the virtual address for __START_KERNEL_map and
      MODULES_START are mapped by the same PGD entry so we need to be
      more careful when copying changes over in
      efi_sync_low_kernel_mappings().
      
      This patch doesn't go the full mile, we still want to share some
      PGD entries with 'swapper_pg_dir'. Having completely separate
      page tables brings its own issues such as synchronising new
      mappings after memory hotplug and module loading. Sharing also
      keeps memory usage down.
      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: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      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: Stephen Smalley <sds@tycho.nsa.gov>
      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-6-git-send-email-matt@codeblueprint.co.ukSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      36e0f05a
    • Matt Fleming's avatar
      x86/efi: Hoist page table switching code into efi_call_virt() · b73adb60
      Matt Fleming authored
      commit c9f2a9a6 upstream.
      
      This change is a prerequisite for pending patches that switch to
      a dedicated EFI page table, instead of using 'trampoline_pgd'
      which shares PGD entries with 'swapper_pg_dir'. The pending
      patches make it impossible to dereference the runtime service
      function pointer without first switching %cr3.
      
      It's true that we now have duplicated switching code in
      efi_call_virt() and efi_call_phys_{prolog,epilog}() but we are
      sacrificing code duplication for a little more clarity and the
      ease of writing the page table switching code in C instead of
      asm.
      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: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      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: Stephen Smalley <sds@tycho.nsa.gov>
      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-5-git-send-email-matt@codeblueprint.co.ukSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b73adb60
    • Matt Fleming's avatar
      x86/mm/pat: Ensure cpa->pfn only contains page frame numbers · 87e2bd89
      Matt Fleming authored
      commit edc3b912 upstream.
      
      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>
      Cc: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      87e2bd89
    • Herbert Xu's avatar
      ipsec: Fix aborted xfrm policy dump crash · b377c453
      Herbert Xu authored
      commit 1137b5e2 upstream.
      
      An independent security researcher, Mohamed Ghannam, has reported
      this vulnerability to Beyond Security's SecuriTeam Secure Disclosure
      program.
      
      The xfrm_dump_policy_done function expects xfrm_dump_policy to
      have been called at least once or it will crash.  This can be
      triggered if a dump fails because the target socket's receive
      buffer is full.
      
      This patch fixes it by using the cb->start mechanism to ensure that
      the initialisation is always done regardless of the buffer situation.
      
      Fixes: 12a169e7 ("ipsec: Put dumpers on the dump list")
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b377c453
    • Tom Herbert's avatar
      netlink: add a start callback for starting a netlink dump · 27248d2f
      Tom Herbert authored
      commit fc9e50f5 upstream.
      
      The start callback allows the caller to set up a context for the
      dump callbacks. Presumably, the context can then be destroyed in
      the done callback.
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      27248d2f
  2. 30 Nov, 2017 24 commits