1. 08 9月, 2019 1 次提交
    • L
      Merge tag 'dmaengine-fix-5.3' of git://git.infradead.org/users/vkoul/slave-dma · d3464ccd
      Linus Torvalds 提交于
      Pull dmaengine fixes from Vinod Koul:
       "Some late fixes for drivers:
      
         - memory leak in ti crossbar dma driver
      
         - cleanup of omap dma probe
      
         - Fix for link list configuration in sprd dma driver
      
         - Handling fixed for DMACHCLR if iommu is mapped in rcar dma"
      
      * tag 'dmaengine-fix-5.3' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: rcar-dmac: Fix DMACHCLR handling if iommu is mapped
        dmaengine: sprd: Fix the DMA link-list configuration
        dmaengine: ti: omap-dma: Add cleanup in omap_dma_probe()
        dmaengine: ti: dma-crossbar: Fix a memory leak bug
      d3464ccd
  2. 07 9月, 2019 8 次提交
  3. 06 9月, 2019 13 次提交
  4. 05 9月, 2019 5 次提交
    • A
      Merge tag 'renesas-fixes2-for-v5.3' of... · 13212a64
      Arnd Bergmann 提交于
      Merge tag 'renesas-fixes2-for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into arm/fixes
      
      Second Round of Renesas ARM Based SoC Fixes for v5.3
      
      * RZ/G2M based HiHope main board
        - Re-enabled accidently disabled SDHI3 (eMMC) support
      
      * tag 'renesas-fixes2-for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
        arm64: dts: renesas: hihope-common: Fix eMMC status
      
      Link: https://lore.kernel.org/r/cover.1567675986.git.horms+renesas@verge.net.auSigned-off-by: NArnd Bergmann <arnd@arndb.de>
      13212a64
    • D
      drm/vmwgfx: Fix double free in vmw_recv_msg() · 08b0c891
      Dan Carpenter 提交于
      We recently added a kfree() after the end of the loop:
      
      	if (retries == RETRIES) {
      		kfree(reply);
      		return -EINVAL;
      	}
      
      There are two problems.  First the test is wrong and because retries
      equals RETRIES if we succeed on the last iteration through the loop.
      Second if we fail on the last iteration through the loop then the kfree
      is a double free.
      
      When you're reading this code, please note the break statement at the
      end of the while loop.  This patch changes the loop so that if it's not
      successful then "reply" is NULL and we can test for that afterward.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 6b7c3b86 ("drm/vmwgfx: fix memory leak when too many retries have occurred")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      08b0c891
    • A
      configfs: provide exclusion between IO and removals · b0841eef
      Al Viro 提交于
      Make sure that attribute methods are not called after the item
      has been removed from the tree.  To do so, we
      	* at the point of no return in removals, grab ->frag_sem
      exclusive and mark the fragment dead.
      	* call the methods of attributes with ->frag_sem taken
      shared and only after having verified that the fragment is still
      alive.
      
      	The main benefit is for method instances - they are
      guaranteed that the objects they are accessing *and* all ancestors
      are still there.  Another win is that we don't need to bother
      with extra refcount on config_item when opening a file -
      the item will be alive for as long as it stays in the tree, and
      we won't touch it/attributes/any associated data after it's
      been removed from the tree.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      b0841eef
    • L
      Merge tag 'nfs-for-5.3-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 3b47fd5c
      Linus Torvalds 提交于
      Pull NFS client bugfix from Trond Myklebust:
       "Regression fix inode fileid checks in attribute revalidation code"
      
      * tag 'nfs-for-5.3-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFS: Fix inode fileid checks in attribute revalidation code
      3b47fd5c
    • I
      sched/core: Fix uclamp ABI bug, clean up and robustify sched_read_attr() ABI logic and code · 1251201c
      Ingo Molnar 提交于
      Thadeu Lima de Souza Cascardo reported that 'chrt' broke on recent kernels:
      
        $ chrt -p $$
        chrt: failed to get pid 26306's policy: Argument list too long
      
      and he has root-caused the bug to the following commit increasing sched_attr
      size and breaking sched_read_attr() into returning -EFBIG:
      
        a509a7cd ("sched/uclamp: Extend sched_setattr() to support utilization clamping")
      
      The other, bigger bug is that the whole sched_getattr() and sched_read_attr()
      logic of checking non-zero bits in new ABI components is arguably broken,
      and pretty much any extension of the ABI will spuriously break the ABI.
      That's way too fragile.
      
      Instead implement the perf syscall's extensible ABI instead, which we
      already implement on the sched_setattr() side:
      
       - if user-attributes have the same size as kernel attributes then the
         logic is unchanged.
      
       - if user-attributes are larger than the kernel knows about then simply
         skip the extra bits, but set attr->size to the (smaller) kernel size
         so that tooling can (in principle) handle older kernel as well.
      
       - if user-attributes are smaller than the kernel knows about then just
         copy whatever user-space can accept.
      
      Also clean up the whole logic:
      
       - Simplify the code flow - there's no need for 'ret' for example.
      
       - Standardize on 'kattr/uattr' and 'ksize/usize' naming to make sure we
         always know which side we are dealing with.
      
       - Why is it called 'read' when what it does is to copy to user? This
         code is so far away from VFS read() semantics that the naming is
         actively confusing. Name it sched_attr_copy_to_user() instead, which
         mirrors other copy_to_user() functionality.
      
       - Move the attr->size assignment from the head of sched_getattr() to the
         sched_attr_copy_to_user() function. Nothing else within the kernel
         should care about the size of the structure.
      
      With these fixes the sched_getattr() syscall now nicely supports an
      extensible ABI in both a forward and backward compatible fashion, and
      will also fix the chrt bug.
      
      As an added bonus the bogus -EFBIG return is removed as well, which as
      Thadeu noted should have been -E2BIG to begin with.
      Reported-by: NThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Tested-by: NDietmar Eggemann <dietmar.eggemann@arm.com>
      Tested-by: NThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Acked-by: NThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Patrick Bellasi <patrick.bellasi@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: a509a7cd ("sched/uclamp: Extend sched_setattr() to support utilization clamping")
      Link: https://lkml.kernel.org/r/20190904075532.GA26751@gmail.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      1251201c
  5. 04 9月, 2019 12 次提交
    • A
      Merge tag 'renesas-fixes-for-v5.3' of... · d9a2b63c
      Arnd Bergmann 提交于
      Merge tag 'renesas-fixes-for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into arm/fixes
      
      Renesas ARM Based SoC Fixes for v5.3
      
      * R-Car D3 (r8a77995) based Draak Board
        - Correct backlight regulator name in device tree
      
      * tag 'renesas-fixes-for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
        arm64: dts: renesas: r8a77995: draak: Fix backlight regulator name
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      d9a2b63c
    • G
      powerpc/tm: Fix restoring FP/VMX facility incorrectly on interrupts · a8318c13
      Gustavo Romero 提交于
      When in userspace and MSR FP=0 the hardware FP state is unrelated to
      the current process. This is extended for transactions where if tbegin
      is run with FP=0, the hardware checkpoint FP state will also be
      unrelated to the current process. Due to this, we need to ensure this
      hardware checkpoint is updated with the correct state before we enable
      FP for this process.
      
      Unfortunately we get this wrong when returning to a process from a
      hardware interrupt. A process that starts a transaction with FP=0 can
      take an interrupt. When the kernel returns back to that process, we
      change to FP=1 but with hardware checkpoint FP state not updated. If
      this transaction is then rolled back, the FP registers now contain the
      wrong state.
      
      The process looks like this:
         Userspace:                      Kernel
      
                     Start userspace
                      with MSR FP=0 TM=1
                        < -----
         ...
         tbegin
         bne
                     Hardware interrupt
                         ---- >
                                          <do_IRQ...>
                                          ....
                                          ret_from_except
                                            restore_math()
      				        /* sees FP=0 */
                                              restore_fp()
                                                tm_active_with_fp()
      					    /* sees FP=1 (Incorrect) */
                                                load_fp_state()
                                              FP = 0 -> 1
                        < -----
                     Return to userspace
                       with MSR TM=1 FP=1
                       with junk in the FP TM checkpoint
         TM rollback
         reads FP junk
      
      When returning from the hardware exception, tm_active_with_fp() is
      incorrectly making restore_fp() call load_fp_state() which is setting
      FP=1.
      
      The fix is to remove tm_active_with_fp().
      
      tm_active_with_fp() is attempting to handle the case where FP state
      has been changed inside a transaction. In this case the checkpointed
      and transactional FP state is different and hence we must restore the
      FP state (ie. we can't do lazy FP restore inside a transaction that's
      used FP). It's safe to remove tm_active_with_fp() as this case is
      handled by restore_tm_state(). restore_tm_state() detects if FP has
      been using inside a transaction and will set load_fp and call
      restore_math() to ensure the FP state (checkpoint and transaction) is
      restored.
      
      This is a data integrity problem for the current process as the FP
      registers are corrupted. It's also a security problem as the FP
      registers from one process may be leaked to another.
      
      Similarly for VMX.
      
      A simple testcase to replicate this will be posted to
      tools/testing/selftests/powerpc/tm/tm-poison.c
      
      This fixes CVE-2019-15031.
      
      Fixes: a7771176 ("powerpc: Don't enable FP/Altivec if not checkpointed")
      Cc: stable@vger.kernel.org # 4.15+
      Signed-off-by: NGustavo Romero <gromero@linux.ibm.com>
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20190904045529.23002-2-gromero@linux.vnet.ibm.com
      a8318c13
    • G
      powerpc/tm: Fix FP/VMX unavailable exceptions inside a transaction · 8205d5d9
      Gustavo Romero 提交于
      When we take an FP unavailable exception in a transaction we have to
      account for the hardware FP TM checkpointed registers being
      incorrect. In this case for this process we know the current and
      checkpointed FP registers must be the same (since FP wasn't used
      inside the transaction) hence in the thread_struct we copy the current
      FP registers to the checkpointed ones.
      
      This copy is done in tm_reclaim_thread(). We use thread->ckpt_regs.msr
      to determine if FP was on when in userspace. thread->ckpt_regs.msr
      represents the state of the MSR when exiting userspace. This is setup
      by check_if_tm_restore_required().
      
      Unfortunatley there is an optimisation in giveup_all() which returns
      early if tsk->thread.regs->msr (via local variable `usermsr`) has
      FP=VEC=VSX=SPE=0. This optimisation means that
      check_if_tm_restore_required() is not called and hence
      thread->ckpt_regs.msr is not updated and will contain an old value.
      
      This can happen if due to load_fp=255 we start a userspace process
      with MSR FP=1 and then we are context switched out. In this case
      thread->ckpt_regs.msr will contain FP=1. If that same process is then
      context switched in and load_fp overflows, MSR will have FP=0. If that
      process now enters a transaction and does an FP instruction, the FP
      unavailable will not update thread->ckpt_regs.msr (the bug) and MSR
      FP=1 will be retained in thread->ckpt_regs.msr.  tm_reclaim_thread()
      will then not perform the required memcpy and the checkpointed FP regs
      in the thread struct will contain the wrong values.
      
      The code path for this happening is:
      
             Userspace:                      Kernel
                         Start userspace
                          with MSR FP/VEC/VSX/SPE=0 TM=1
                            < -----
             ...
             tbegin
             bne
             fp instruction
                         FP unavailable
                             ---- >
                                              fp_unavailable_tm()
      					  tm_reclaim_current()
      					    tm_reclaim_thread()
      					      giveup_all()
      					        return early since FP/VMX/VSX=0
      						/* ckpt MSR not updated (Incorrect) */
      					      tm_reclaim()
      					        /* thread_struct ckpt FP regs contain junk (OK) */
                                                    /* Sees ckpt MSR FP=1 (Incorrect) */
      					      no memcpy() performed
      					        /* thread_struct ckpt FP regs not fixed (Incorrect) */
      					  tm_recheckpoint()
      					     /* Put junk in hardware checkpoint FP regs */
                                               ....
                            < -----
                         Return to userspace
                           with MSR TM=1 FP=1
                           with junk in the FP TM checkpoint
             TM rollback
             reads FP junk
      
      This is a data integrity problem for the current process as the FP
      registers are corrupted. It's also a security problem as the FP
      registers from one process may be leaked to another.
      
      This patch moves up check_if_tm_restore_required() in giveup_all() to
      ensure thread->ckpt_regs.msr is updated correctly.
      
      A simple testcase to replicate this will be posted to
      tools/testing/selftests/powerpc/tm/tm-poison.c
      
      Similarly for VMX.
      
      This fixes CVE-2019-15030.
      
      Fixes: f48e91e8 ("powerpc/tm: Fix FP and VMX register corruption")
      Cc: stable@vger.kernel.org # 4.12+
      Signed-off-by: NGustavo Romero <gromero@linux.vnet.ibm.com>
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20190904045529.23002-1-gromero@linux.vnet.ibm.com
      8205d5d9
    • N
      mm/balloon_compaction: suppress allocation warnings · 02fa5d7b
      Nadav Amit 提交于
      There is no reason to print warnings when balloon page allocation fails,
      as they are expected and can be handled gracefully.  Since VMware
      balloon now uses balloon-compaction infrastructure, and suppressed these
      warnings before, it is also beneficial to suppress these warnings to
      keep the same behavior that the balloon had before.
      
      Cc: Jason Wang <jasowang@redhat.com>
      Signed-off-by: NNadav Amit <namit@vmware.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      02fa5d7b
    • M
      Revert "vhost: access vq metadata through kernel virtual address" · 3d2c7d37
      Michael S. Tsirkin 提交于
      This reverts commit 7f466032 ("vhost: access vq metadata through
      kernel virtual address").  The commit caused a bunch of issues, and
      while commit 73f628ec ("vhost: disable metadata prefetch
      optimization") disabled the optimization it's not nice to keep lots of
      dead code around.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      3d2c7d37
    • Y
      vhost: Remove unnecessary variable · 896fc242
      Yunsheng Lin 提交于
      It is unnecessary to use ret variable to return the error
      code, just return the error code directly.
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      896fc242
    • ?
      virtio-net: lower min ring num_free for efficiency · 718be6ba
      ? jiang 提交于
      This change lowers ring buffer reclaim threshold from 1/2*queue to budget
      for better performance. According to our test with qemu + dpdk, packet
      dropping happens when the guest is not able to provide free buffer in
      avail ring timely with default 1/2*queue. The value in the patch has been
      tested and does show better performance.
      
      Test setup: iperf3 to generate packets to guest (total 30mins, pps 400k, UDP)
      avg packets drop before: 2842
      avg packets drop after: 360(-87.3%)
      
      Further, current code suffers from a starvation problem: the amount of
      work done by try_fill_recv is not bounded by the budget parameter, thus
      (with large queues) once in a while userspace gets blocked for a long
      time while queue is being refilled. Trigger refills earlier to make sure
      the amount of work to do is limited.
      Signed-off-by: Njiangkidd <jiangkidd@hotmail.com>
      Acked-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      718be6ba
    • T
      vhost/test: fix build for vhost test · 264b563b
      Tiwei Bie 提交于
      Since vhost_exceeds_weight() was introduced, callers need to specify
      the packet weight and byte weight in vhost_dev_init(). Note that, the
      packet weight isn't counted in this patch to keep the original behavior
      unchanged.
      
      Fixes: e82b9b07 ("vhost: introduce vhost_exceeds_weight()")
      Cc: stable@vger.kernel.org
      Signed-off-by: NTiwei Bie <tiwei.bie@intel.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Acked-by: NJason Wang <jasowang@redhat.com>
      264b563b
    • T
      vhost/test: fix build for vhost test · 93d2c4de
      Tiwei Bie 提交于
      Since below commit, callers need to specify the iov_limit in
      vhost_dev_init() explicitly.
      
      Fixes: b46a0bf7 ("vhost: fix OOB in get_rx_bufs()")
      Cc: stable@vger.kernel.org
      Signed-off-by: NTiwei Bie <tiwei.bie@intel.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Acked-by: NJason Wang <jasowang@redhat.com>
      93d2c4de
    • H
      ALSA: hda/realtek - Fix the problem of two front mics on a ThinkCentre · 2a36c16e
      Hui Wang 提交于
      This ThinkCentre machine has a new realtek codec alc222, it is not
      in the support list, we add it in the realtek.c then this machine
      can apply FIXUPs for the realtek codec.
      
      And this machine has two front mics which can't be handled
      by PA so far, it uses the pin 0x18 and 0x19 as the front mics, as
      a result the existing FIXUP ALC294_FIXUP_LENOVO_MIC_LOCATION doesn't
      work on this machine. Fortunately another FIXUP
      ALC283_FIXUP_HEADSET_MIC also can change the location for one of the
      two mics on this machine.
      
      Link: https://lore.kernel.org/r/20190904055327.9883-1-hui.wang@canonical.comSigned-off-by: NHui Wang <hui.wang@canonical.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2a36c16e
    • Y
      dmaengine: rcar-dmac: Fix DMACHCLR handling if iommu is mapped · cf24aac3
      Yoshihiro Shimoda 提交于
      The commit 20c169ac ("dmaengine: rcar-dmac: clear pertinence
      number of channels") forgets to clear the last channel by
      DMACHCLR in rcar_dmac_init() (and doesn't need to clear the first
      channel) if iommu is mapped to the device. So, this patch fixes it
      by using "channels_mask" bitfield.
      
      Note that the hardware and driver don't support more than 32 bits
      in DMACHCLR register anyway, so this patch should reject more than
      32 channels in rcar_dmac_parse_of().
      
      Fixes: 20c169ac ("dmaengine: rcar-dmac: clear pertinence number of channels")
      Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Reviewed-by: NSimon Horman <horms+renesas@verge.net.au>
      Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Link: https://lore.kernel.org/r/1567424643-26629-1-git-send-email-yoshihiro.shimoda.uh@renesas.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
      cf24aac3
    • B
      dmaengine: sprd: Fix the DMA link-list configuration · 689379c2
      Baolin Wang 提交于
      For the Spreadtrum DMA link-list mode, when the DMA engine got a slave
      hardware request, which will trigger the DMA engine to load the DMA
      configuration from the link-list memory automatically. But before the
      slave hardware request, the slave will get an incorrect residue due
      to the first node used to trigger the link-list was configured as the
      last source address and destination address.
      
      Thus we should make sure the first node was configured the start source
      address and destination address, which can fix this issue.
      
      Fixes: 4ac69546 ("dmaengine: sprd: Support DMA link-list mode")
      Signed-off-by: NBaolin Wang <baolin.wang@linaro.org>
      Link: https://lore.kernel.org/r/77868edb7aff9d5cb12ac3af8827ef2e244441a6.1567150471.git.baolin.wang@linaro.orgSigned-off-by: NVinod Koul <vkoul@kernel.org>
      689379c2
  6. 03 9月, 2019 1 次提交
    • J
      Revert "mmc: core: do not retry CMD6 in __mmc_switch()" · 8ad8e02c
      Jan Kaisrlik 提交于
      Turns out the commit 3a0681c7 ("mmc: core: do not retry CMD6 in
      __mmc_switch()") breaks initialization of a Toshiba THGBMNG5 eMMC card,
      when using the meson-gx-mmc.c driver on a custom board based on Amlogic
      A113D.
      
      The CMD6 that switches the card into HS200 mode is then one that fails and
      according to the below printed messages from the log:
      
      [    1.648951] mmc0: mmc_select_hs200 failed, error -84
      [    1.648988] mmc0: error -84 whilst initialising MMC card
      
      After some analyze, it turns out that adding a delay of ~5ms inside
      mmc_select_bus_width() but after mmc_compare_ext_csds() has been executed,
      also fixes the problem. Adding yet some more debug code, trying to figure
      out if potentially the card could be in a busy state, both by using CMD13
      and ->card_busy() ops concluded that this was not the case.
      
      Therefore, let's simply revert the commit that dropped support for retrying
      of CMD6, as this also fixes the problem.
      
      Fixes: 3a0681c7 ("mmc: core: do not retry CMD6 in __mmc_switch()")
      Cc: stable@vger.kernel.org
      Signed-off-by: NJan Kaisrlik <ja.kaisrlik@gmail.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      8ad8e02c