1. 14 Sep, 2018 5 commits
    • Ding Xiang's avatar
      vme: remove unneeded kfree · a71bcc1b
      Ding Xiang authored
      put_device will call vme_dev_release to free vdev, kfree is
      unnecessary here.
      Signed-off-by: default avatarDing Xiang <dingxiang@cmss.chinamobile.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a71bcc1b
    • Martijn Coenen's avatar
      binder: Add BINDER_GET_NODE_INFO_FOR_REF ioctl. · b7e6a896
      Martijn Coenen authored
      This allows the context manager to retrieve information about nodes
      that it holds a reference to, such as the current number of
      references to those nodes.
      
      Such information can for example be used to determine whether the
      servicemanager is the only process holding a reference to a node.
      This information can then be passed on to the process holding the
      node, which can in turn decide whether it wants to shut down to
      reduce resource usage.
      Signed-off-by: default avatarMartijn Coenen <maco@android.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b7e6a896
    • Rasmus Villemoes's avatar
    • Todd Kjos's avatar
      binder: use standard functions to allocate fds · 44d8047f
      Todd Kjos authored
      Binder uses internal fs interfaces to allocate and install fds:
      
      __alloc_fd
      __fd_install
      __close_fd
      get_files_struct
      put_files_struct
      
      These were used to support the passing of fds between processes
      as part of a transaction. The actual allocation and installation
      of the fds in the target process was handled by the sending
      process so the standard functions, alloc_fd() and fd_install()
      which assume task==current couldn't be used.
      
      This patch refactors this mechanism so that the fds are
      allocated and installed by the target process allowing the
      standard functions to be used.
      
      The sender now creates a list of fd fixups that contains the
      struct *file and the address to fixup with the new fd once
      it is allocated. This list is processed by the target process
      when the transaction is dequeued.
      
      A new error case is introduced by this change. If an async
      transaction with file descriptors cannot allocate new
      fds in the target (probably due to out of file descriptors),
      the transaction is discarded with a log message. In the old
      implementation this would have been detected in the sender
      context and failed prior to sending.
      Signed-off-by: default avatarTodd Kjos <tkjos@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      44d8047f
    • Sherry Yang's avatar
      android: binder: no outgoing transaction when thread todo has transaction · 44b73962
      Sherry Yang authored
      When a process dies, failed reply is sent to the sender of any transaction
      queued on a dead thread's todo list. The sender asserts that the
      received failed reply corresponds to the head of the transaction stack.
      This assert can fail if the dead thread is allowed to send outgoing
      transactions when there is already a transaction on its todo list,
      because this new transaction can end up on the transaction stack of the
      original sender. The following steps illustrate how this assertion can
      fail.
      
      1. Thread1 sends txn19 to Thread2
         (T1->transaction_stack=txn19, T2->todo+=txn19)
      2. Without processing todo list, Thread2 sends txn20 to Thread1
         (T1->todo+=txn20, T2->transaction_stack=txn20)
      3. T1 processes txn20 on its todo list
         (T1->transaction_stack=txn20->txn19, T1->todo=<empty>)
      4. T2 dies, T2->todo cleanup attempts to send failed reply for txn19, but
         T1->transaction_stack points to txn20 -- assertion failes
      
      Step 2. is the incorrect behavior. When there is a transaction on a
      thread's todo list, this thread should not be able to send any outgoing
      synchronous transactions. Only the head of the todo list needs to be
      checked because only threads that are waiting for proc work can directly
      receive work from another thread, and no work is allowed to be queued
      on such a thread without waking up the thread. This patch also enforces
      that a thread is not waiting for proc work when a work is directly
      enqueued to its todo list.
      Acked-by: default avatarArve Hjønnevåg <arve@android.com>
      Signed-off-by: default avatarSherry Yang <sherryy@android.com>
      Reviewed-by: default avatarMartijn Coenen <maco@android.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      44b73962
  2. 12 Sep, 2018 12 commits
  3. 10 Sep, 2018 1 commit
  4. 09 Sep, 2018 7 commits
  5. 08 Sep, 2018 6 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · f8f65382
      Linus Torvalds authored
      Pull KVM fixes from Radim Krčmář:
       "ARM:
         - Fix a VFP corruption in 32-bit guest
         - Add missing cache invalidation for CoW pages
         - Two small cleanups
      
        s390:
         - Fallout from the hugetlbfs support: pfmf interpretion and locking
         - VSIE: fix keywrapping for nested guests
      
        PPC:
         - Fix a bug where pages might not get marked dirty, causing guest
           memory corruption on migration
         - Fix a bug causing reads from guest memory to use the wrong guest
           real address for very large HPT guests (>256G of memory), leading
           to failures in instruction emulation.
      
        x86:
         - Fix out of bound access from malicious pv ipi hypercalls
           (introduced in rc1)
         - Fix delivery of pending interrupts when entering a nested guest,
           preventing arbitrarily late injection
         - Sanitize kvm_stat output after destroying a guest
         - Fix infinite loop when emulating a nested guest page fault and
           improve the surrounding emulation code
         - Two minor cleanups"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (28 commits)
        KVM: LAPIC: Fix pv ipis out-of-bounds access
        KVM: nVMX: Fix loss of pending IRQ/NMI before entering L2
        arm64: KVM: Remove pgd_lock
        KVM: Remove obsolete kvm_unmap_hva notifier backend
        arm64: KVM: Only force FPEXC32_EL2.EN if trapping FPSIMD
        KVM: arm/arm64: Clean dcache to PoC when changing PTE due to CoW
        KVM: s390: Properly lock mm context allow_gmap_hpage_1m setting
        KVM: s390: vsie: copy wrapping keys to right place
        KVM: s390: Fix pfmf and conditional skey emulation
        tools/kvm_stat: re-animate display of dead guests
        tools/kvm_stat: indicate dead guests as such
        tools/kvm_stat: handle guest removals more gracefully
        tools/kvm_stat: don't reset stats when setting PID filter for debugfs
        tools/kvm_stat: fix updates for dead guests
        tools/kvm_stat: fix handling of invalid paths in debugfs provider
        tools/kvm_stat: fix python3 issues
        KVM: x86: Unexport x86_emulate_instruction()
        KVM: x86: Rename emulate_instruction() to kvm_emulate_instruction()
        KVM: x86: Do not re-{try,execute} after failed emulation in L2
        KVM: x86: Default to not allowing emulation retry in kvm_mmu_page_fault
        ...
      f8f65382
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 0f3aa48a
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "A few more fixes who have trickled in:
      
         - MMC bus width fixup for some Allwinner platforms
      
         - Fix for NULL deref in ti-aemif when no platform data is passed in
      
         - Fix div by 0 in SCMI code
      
         - Add a missing module alias in a new RPi driver"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        memory: ti-aemif: fix a potential NULL-pointer dereference
        firmware: arm_scmi: fix divide by zero when sustained_perf_level is zero
        hwmon: rpi: add module alias to raspberrypi-hwmon
        arm64: allwinner: dts: h6: fix Pine H64 MMC bus width
      0f3aa48a
    • Olof Johansson's avatar
      Merge tag 'sunxi-fixes-for-4.19' of... · a132bb90
      Olof Johansson authored
      Merge tag 'sunxi-fixes-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into fixes
      
      Allwinner fixes for 4.19
      
      Just one fix for H6 mmc on the Pine H64: the mmc bus width was missing
      from the device tree. This was added in 4.19-rc1.
      
      * tag 'sunxi-fixes-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
        arm64: allwinner: dts: h6: fix Pine H64 MMC bus width
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      a132bb90
    • Nadav Amit's avatar
      x86/mm: Use WRITE_ONCE() when setting PTEs · 9bc4f28a
      Nadav Amit authored
      When page-table entries are set, the compiler might optimize their
      assignment by using multiple instructions to set the PTE. This might
      turn into a security hazard if the user somehow manages to use the
      interim PTE. L1TF does not make our lives easier, making even an interim
      non-present PTE a security hazard.
      
      Using WRITE_ONCE() to set PTEs and friends should prevent this potential
      security hazard.
      
      I skimmed the differences in the binary with and without this patch. The
      differences are (obviously) greater when CONFIG_PARAVIRT=n as more
      code optimizations are possible. For better and worse, the impact on the
      binary with this patch is pretty small. Skimming the code did not cause
      anything to jump out as a security hazard, but it seems that at least
      move_soft_dirty_pte() caused set_pte_at() to use multiple writes.
      Signed-off-by: default avatarNadav Amit <namit@vmware.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lkml.kernel.org/r/20180902181451.80520-1-namit@vmware.com
      9bc4f28a
    • Thomas Gleixner's avatar
      x86/apic/vector: Make error return value negative · 47b7360c
      Thomas Gleixner authored
      activate_managed() returns EINVAL instead of -EINVAL in case of
      error. While this is unlikely to happen, the positive return value would
      cause further malfunction at the call site.
      
      Fixes: 2db1f959 ("x86/vector: Handle managed interrupts proper")
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: stable@vger.kernel.org
      47b7360c
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · d7b686eb
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
      
       - bugfixes for uniphier, i801, and xiic drivers
      
       - ID removal (never produced) for imx
      
       - one MAINTAINER addition
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: xiic: Record xilinx i2c with Zynq fragment
        i2c: xiic: Make the start and the byte count write atomic
        i2c: i801: fix DNV's SMBCTRL register offset
        i2c: imx-lpi2c: Remove mx8dv compatible entry
        dt-bindings: imx-lpi2c: Remove mx8dv compatible entry
        i2c: uniphier-f: issue STOP only for last message or I2C_M_STOP
        i2c: uniphier: issue STOP only for last message or I2C_M_STOP
      d7b686eb
  6. 07 Sep, 2018 9 commits
    • Linus Torvalds's avatar
      Merge tag 'arc-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · 2c34a0e0
      Linus Torvalds authored
      Pull ARC updates from Vineet Gupta:
      
       - Fix for atomic_fetch_#op  [Will Deacon]
      
       - Enable per device IOC [Eugeniy Paltsev]
      
       - Remove redundant gcc version checks [Masahiro Yamada]
      
       - Miscll platform config/DT updates [Alexey Brodkin]
      
      * tag 'arc-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARC: don't check for HIGHMEM pages in arch_dma_alloc
        ARC: IOC: panic if both IOC and ZONE_HIGHMEM enabled
        ARC: dma [IOC] Enable per device io coherency
        ARC: dma [IOC]: mark DMA devices connected as dma-coherent
        ARC: atomics: unbork atomic_fetch_##op()
        arc: remove redundant GCC version checks
        ARC: sort Kconfig
        ARC: cleanup show_faulting_vma()
        ARC: [plat-axs*]: Enable SWAP
        ARC: [plat-axs*/plat-hsdk]: Allow U-Boot to pass MAC-address to the kernel
        ARC: configs: cleanup
      2c34a0e0
    • David Howells's avatar
      afs: Fix cell specification to permit an empty address list · ecfe951f
      David Howells authored
      Fix the cell specification mechanism to allow cells to be pre-created
      without having to specify at least one address (the addresses will be
      upcalled for).
      
      This allows the cell information preload service to avoid the need to issue
      loads of DNS lookups during boot to get the addresses for each cell (500+
      lookups for the 'standard' cell list[*]).  The lookups can be done later as
      each cell is accessed through the filesystem.
      
      Also remove the print statement that prints a line every time a new cell is
      added.
      
      [*] There are 144 cells in the list.  Each cell is first looked up for an
          SRV record, and if that fails, for an AFSDB record.  These get a list
          of server names, each of which then has to be looked up to get the
          addresses for that server.  E.g.:
      
      	dig srv _afs3-vlserver._udp.grand.central.org
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ecfe951f
    • Linus Torvalds's avatar
      Merge tag 'md/4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md · 3d0e7a9e
      Linus Torvalds authored
      Pull MD fixes from Shaohua Li:
      
       - Fix a locking issue for md-cluster (Guoqing)
      
       - Fix a sync crash for raid10 (Ni)
      
       - Fix a reshape bug with raid5 cache enabled (me)
      
      * tag 'md/4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
        md-cluster: release RESYNC lock after the last resync message
        RAID10 BUG_ON in raise_barrier when force is true and conf->barrier is 0
        md/raid5-cache: disable reshape completely
      3d0e7a9e
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-4.19-rc3' of https://github.com/ceph/ceph-client · a12ed06b
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "Two rbd patches to complete support for images within namespaces that
        went into -rc1 and a use-after-free fix.
      
        The rbd changes have been sitting in a branch for quite a while but
        couldn't be included into the -rc1 pull request because of a pending
        wire protocol backwards compatibility fixup that only got committed
        early this week"
      
      * tag 'ceph-for-4.19-rc3' of https://github.com/ceph/ceph-client:
        rbd: support cloning across namespaces
        rbd: factor out get_parent_info()
        ceph: avoid a use-after-free in ceph_destroy_options()
      a12ed06b
    • Linus Torvalds's avatar
      Merge tag 'for_v4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · d042a240
      Linus Torvalds authored
      Pull fsnotify fix from Jan Kara:
       "A small fsnotify fix from Amir"
      
      * tag 'for_v4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        fsnotify: fix ignore mask logic in fsnotify()
      d042a240
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 4ff8a142
      Linus Torvalds authored
      Pull arm64 fix from Will Deacon:
       "Just one small fix here, preventing a VM_WARN_ON when a !present
        PMD/PUD is "freed" as part of a huge ioremap() operation.
      
        The correct behaviour is to skip the free silently in this case, which
        is a little weird (the function is a bit of a misnomer), but it
        follows the x86 implementation"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: fix erroneous warnings in page freeing functions
      4ff8a142
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 53937340
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix a regression from the 4.18 cycle in the ACPI driver for
        Intel SoCs (LPSS) and prevent dmi_check_system() from being called on
        non-x86 systems in the ACPI core.
      
        Specifics:
      
         - Fix a power management regression in the ACPI driver for Intel SoCs
           (LPSS) introduced by a system-wide suspend/resume fix during the
           4.18 cycle (Zhang Rui).
      
         - Prevent dmi_check_system() from being called on non-x86 systems in
           the ACPI core (Jean Delvare)"
      
      * tag 'acpi-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI / LPSS: Force LPSS quirks on boot
        ACPI / bus: Only call dmi_check_system() on X86
      53937340
    • Linus Torvalds's avatar
      Merge tag 'sound-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 69ddce94
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Just a few small fixes:
      
         - a fix for the recursive work cancellation in a specific HD-audio
           operation mode
      
         - a fix for potentially uninitialized memory access via rawmidi
      
         - the register bit access fixes for ASoC HD-audio"
      
      * tag 'sound-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda: Fix several mismatch for register mask and value
        ALSA: rawmidi: Initialize allocated buffers
        ALSA: hda - Fix cancel_work_sync() stall from jackpoll work
      69ddce94
    • Wanpeng Li's avatar
      KVM: LAPIC: Fix pv ipis out-of-bounds access · bdf7ffc8
      Wanpeng Li authored
      Dan Carpenter reported that the untrusted data returns from kvm_register_read()
      results in the following static checker warning:
        arch/x86/kvm/lapic.c:576 kvm_pv_send_ipi()
        error: buffer underflow 'map->phys_map' 's32min-s32max'
      
      KVM guest can easily trigger this by executing the following assembly sequence
      in Ring0:
      
      mov $10, %rax
      mov $0xFFFFFFFF, %rbx
      mov $0xFFFFFFFF, %rdx
      mov $0, %rsi
      vmcall
      
      As this will cause KVM to execute the following code-path:
      vmx_handle_exit() -> handle_vmcall() -> kvm_emulate_hypercall() -> kvm_pv_send_ipi()
      which will reach out-of-bounds access.
      
      This patch fixes it by adding a check to kvm_pv_send_ipi() against map->max_apic_id,
      ignoring destinations that are not present and delivering the rest. We also check
      whether or not map->phys_map[min + i] is NULL since the max_apic_id is set to the
      max apic id, some phys_map maybe NULL when apic id is sparse, especially kvm
      unconditionally set max_apic_id to 255 to reserve enough space for any xAPIC ID.
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarLiran Alon <liran.alon@oracle.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Liran Alon <liran.alon@oracle.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      [Add second "if (min > map->max_apic_id)" to complete the fix. -Radim]
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      bdf7ffc8