1. 08 Apr, 2021 6 commits
    • Linus Torvalds's avatar
      Merge tag 'sound-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · e0a472ff
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "This batch became unexpectedly bigger due to the pending ASoC patches,
        but all look small and fine device-specific fixes.
      
        Many of the commits are for ASoC Intel drivers, while the rest are for
        ASoC small codec/platform fixes and HD-audio quirks"
      
      * tag 'sound-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits)
        ALSA: hda/realtek: Fix speaker amp setup on Acer Aspire E1
        ALSA: aloop: Fix initialization of controls
        ALSA: hda/conexant: Apply quirk for another HP ZBook G5 model
        ASoC: fsl_esai: Fix TDM slot setup for I2S mode
        ASoC: codecs: lpass-rx-macro: set npl clock rate correctly
        ASoC: codecs: lpass-tx-macro: set npl clock rate correctly
        ASoC: sunxi: sun4i-codec: fill ASoC card owner
        ASoC: cygnus: fix for_each_child.cocci warnings
        ASoC: max98373: Added 30ms turn on/off time delay
        ASoC: max98373: Changed amp shutdown register as volatile
        ASoC: intel: atom: Remove 44100 sample-rate from the media and deep-buffer DAI descriptions
        ASoC: intel: atom: Stop advertising non working S24LE support
        ASoC: wm8960: Fix wrong bclk and lrclk with pll enabled for some chips
        ASoC: SOF: Intel: move ELH chip info
        ASoC: SOF: Intel: APL: set shutdown callback to hda_dsp_shutdown
        ASoC: SOF: Intel: CNL: set shutdown callback to hda_dsp_shutdown
        ASoC: SOF: Intel: ICL: set shutdown callback to hda_dsp_shutdown
        ASoC: SOF: Intel: TGL: set shutdown callback to hda_dsp_shutdown
        ASoC: SOF: Intel: TGL: fix EHL ops
        ASoC: SOF: core: harden shutdown helper
        ...
      e0a472ff
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · d381b05e
      Linus Torvalds authored
      Pull kvm fix from Paolo Bonzini:
       "A lone x86 patch, for a bug found while developing a backport to
        stable versions"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: x86/mmu: preserve pending TLB flush across calls to kvm_tdp_mmu_zap_sp
      d381b05e
    • Linus Torvalds's avatar
      Merge tag 'for-linus-2021-04-08' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · 4ea51e0e
      Linus Torvalds authored
      Pull close_range() fix from Christian Brauner:
       "Syzbot reported a bug in close_range.
      
        Debugging this showed we didn't recalculate the current maximum fd
        number for CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC after we unshared
        the file descriptors table. As a result, max_fd could exceed the
        current fdtable maximum causing us to set excessive bits.
      
        As a concrete example, let's say the user requested everything from fd
        4 to ~0UL to be closed and their current fdtable size is 256 with
        their highest open fd being 4. With CLOSE_RANGE_UNSHARE the caller
        will end up with a new fdtable which has room for 64 file descriptors
        since that is the lowest fdtable size we accept. But now max_fd will
        still point to 255 and needs to be adjusted. Fix this by retrieving
        the correct maximum fd value in __range_cloexec().
      
        I've carried this fix for a little while but since there was no
        linux-next release over easter I waited until now.
      
        With this change close_range() can be further simplified but imho we
        are in no hurry to do that and so I'll defer this for the 5.13 merge
        window"
      
      * tag 'for-linus-2021-04-08' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        file: fix close_range() for unshare+cloexec
      4ea51e0e
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 035d8069
      Linus Torvalds authored
      Pull umount fix from Al Viro:
       "Brown paperbag time: dumb braino in the series that went into 5.7
        broke the 'don't step into ->d_weak_revalidate() when umount(2) looks
        the victim up' behaviour.
      
        Spotted only now - saw
      
              if (!err && unlikely(nd->flags & LOOKUP_MOUNTPOINT)) {
                      err = handle_lookup_down(nd);
                      nd->flags &= ~LOOKUP_JUMPED; // no d_weak_revalidate(), please...
              }
      
        and went "why do we clear that flag here - nothing below that point is
        going to check it anyway" / "wait a minute, what is it doing *after*
        complete_walk() (which is where we check that flag and call
        ->d_weak_revalidate())" / "how could that possibly _not_ break?",
        followed by reproducing the breakage and verifying that the obvious
        fix of that braino does, indeed, fix it.
      
        The reproducer is (assuming that $DIR exists and is exported r/w to
        localhost)
      
            mkdir $DIR/a
            mkdir /tmp/foo
            mount --bind /tmp/foo /tmp/foo
            mkdir /tmp/foo/a
            mkdir /tmp/foo/b
            mount -t nfs4 localhost:$DIR/a /tmp/foo/a
            mount -t nfs4 localhost:$DIR /tmp/foo/b
            rmdir /tmp/foo/b/a
            umount /tmp/foo/b
            umount /tmp/foo/a
            umount -l /tmp/foo      # will get everything under /tmp/foo, no matter what
      
        Correct behaviour is successful umount; broken kernels (5.7-rc1 and
        later) get
      
            umount.nfs4: /tmp/foo/a: Stale file handle
      
        Note that bind mount is there to be able to recover - on broken
        kernels we'd get stuck with impossible-to-umount filesystem if not for
        that.
      
        FWIW, that braino had been posted for review back then, at least
        twice. Unfortunately, the call of complete_walk() was outside of diff
        context, so the bogosity hadn't been immediately obvious from the
        patch alone ;-/"
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        LOOKUP_MOUNTPOINT: we are cleaning "jumped" flag too late
      035d8069
    • Paolo Bonzini's avatar
      KVM: x86/mmu: preserve pending TLB flush across calls to kvm_tdp_mmu_zap_sp · 315f02c6
      Paolo Bonzini authored
      Right now, if a call to kvm_tdp_mmu_zap_sp returns false, the caller
      will skip the TLB flush, which is wrong.  There are two ways to fix
      it:
      
      - since kvm_tdp_mmu_zap_sp will not yield and therefore will not flush
        the TLB itself, we could change the call to kvm_tdp_mmu_zap_sp to
        use "flush |= ..."
      
      - or we can chain the flush argument through kvm_tdp_mmu_zap_sp down
        to __kvm_tdp_mmu_zap_gfn_range.  Note that kvm_tdp_mmu_zap_sp will
        neither yield nor flush, so flush would never go from true to
        false.
      
      This patch does the former to simplify application to stable kernels,
      and to make it further clearer that kvm_tdp_mmu_zap_sp will not flush.
      
      Cc: seanjc@google.com
      Fixes: 048f4980 ("KVM: x86/mmu: Ensure TLBs are flushed for TDP MMU during NX zapping")
      Cc: <stable@vger.kernel.org> # 5.10.x: 048f4980: KVM: x86/mmu: Ensure TLBs are flushed for TDP MMU during NX zapping
      Cc: <stable@vger.kernel.org> # 5.10.x: 33a31641: KVM: x86/mmu: Don't allow TDP MMU to yield when recovering NX pages
      Cc: <stable@vger.kernel.org>
      Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      315f02c6
    • Takashi Iwai's avatar
      ALSA: hda/realtek: Fix speaker amp setup on Acer Aspire E1 · c8426b27
      Takashi Iwai authored
      We've got a report about Acer Aspire E1 (PCI SSID 1025:0840) that
      loses the speaker output after resume.  With the comparison of COEF
      dumps, it was identified that the COEF 0x0d bits 0x6000 corresponds to
      the speaker amp.
      
      This patch adds the specific quirk for the device to restore the COEF
      bits at the codec (re-)initialization.
      
      BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1183869
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20210407095730.12560-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c8426b27
  2. 07 Apr, 2021 8 commits
  3. 06 Apr, 2021 9 commits
  4. 05 Apr, 2021 1 commit
  5. 04 Apr, 2021 4 commits
    • Linus Torvalds's avatar
      Linux 5.12-rc6 · e49d033b
      Linus Torvalds authored
      e49d033b
    • Zheyu Ma's avatar
      firewire: nosy: Fix a use-after-free bug in nosy_ioctl() · 829933ef
      Zheyu Ma authored
      For each device, the nosy driver allocates a pcilynx structure.
      A use-after-free might happen in the following scenario:
      
       1. Open nosy device for the first time and call ioctl with command
          NOSY_IOC_START, then a new client A will be malloced and added to
          doubly linked list.
       2. Open nosy device for the second time and call ioctl with command
          NOSY_IOC_START, then a new client B will be malloced and added to
          doubly linked list.
       3. Call ioctl with command NOSY_IOC_START for client A, then client A
          will be readded to the doubly linked list. Now the doubly linked
          list is messed up.
       4. Close the first nosy device and nosy_release will be called. In
          nosy_release, client A will be unlinked and freed.
       5. Close the second nosy device, and client A will be referenced,
          resulting in UAF.
      
      The root cause of this bug is that the element in the doubly linked list
      is reentered into the list.
      
      Fix this bug by adding a check before inserting a client.  If a client
      is already in the linked list, don't insert it.
      
      The following KASAN report reveals it:
      
         BUG: KASAN: use-after-free in nosy_release+0x1ea/0x210
         Write of size 8 at addr ffff888102ad7360 by task poc
         CPU: 3 PID: 337 Comm: poc Not tainted 5.12.0-rc5+ #6
         Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
         Call Trace:
           nosy_release+0x1ea/0x210
           __fput+0x1e2/0x840
           task_work_run+0xe8/0x180
           exit_to_user_mode_prepare+0x114/0x120
           syscall_exit_to_user_mode+0x1d/0x40
           entry_SYSCALL_64_after_hwframe+0x44/0xae
      
         Allocated by task 337:
           nosy_open+0x154/0x4d0
           misc_open+0x2ec/0x410
           chrdev_open+0x20d/0x5a0
           do_dentry_open+0x40f/0xe80
           path_openat+0x1cf9/0x37b0
           do_filp_open+0x16d/0x390
           do_sys_openat2+0x11d/0x360
           __x64_sys_open+0xfd/0x1a0
           do_syscall_64+0x33/0x40
           entry_SYSCALL_64_after_hwframe+0x44/0xae
      
         Freed by task 337:
           kfree+0x8f/0x210
           nosy_release+0x158/0x210
           __fput+0x1e2/0x840
           task_work_run+0xe8/0x180
           exit_to_user_mode_prepare+0x114/0x120
           syscall_exit_to_user_mode+0x1d/0x40
           entry_SYSCALL_64_after_hwframe+0x44/0xae
      
         The buggy address belongs to the object at ffff888102ad7300 which belongs to the cache kmalloc-128 of size 128
         The buggy address is located 96 bytes inside of 128-byte region [ffff888102ad7300, ffff888102ad7380)
      
      [ Modified to use 'list_empty()' inside proper lock  - Linus ]
      
      Link: https://lore.kernel.org/lkml/1617433116-5930-1-git-send-email-zheyuma97@gmail.com/Reported-and-tested-by: default avatar马哲宇 (Zheyu Ma) <zheyuma97@gmail.com>
      Signed-off-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Cc: Greg Kroah-Hartman <greg@kroah.com>
      Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      829933ef
    • Wang Qing's avatar
      workqueue/watchdog: Make unbound workqueues aware of touch_softlockup_watchdog() · 89e28ce6
      Wang Qing authored
      84;0;0c84;0;0c
      There are two workqueue-specific watchdog timestamps:
      
          + @wq_watchdog_touched_cpu (per-CPU) updated by
            touch_softlockup_watchdog()
      
          + @wq_watchdog_touched (global) updated by
            touch_all_softlockup_watchdogs()
      
      watchdog_timer_fn() checks only the global @wq_watchdog_touched for
      unbound workqueues. As a result, unbound workqueues are not aware
      of touch_softlockup_watchdog(). The watchdog might report a stall
      even when the unbound workqueues are blocked by a known slow code.
      
      Solution:
      touch_softlockup_watchdog() must touch also the global @wq_watchdog_touched
      timestamp.
      
      The global timestamp can no longer be used for bound workqueues because
      it is now updated from all CPUs. Instead, bound workqueues have to check
      only @wq_watchdog_touched_cpu and these timestamps have to be updated for
      all CPUs in touch_all_softlockup_watchdogs().
      
      Beware:
      The change might cause the opposite problem. An unbound workqueue
      might get blocked on CPU A because of a real softlockup. The workqueue
      watchdog would miss it when the timestamp got touched on CPU B.
      
      It is acceptable because softlockups are detected by softlockup
      watchdog. The workqueue watchdog is there to detect stalls where
      a work never finishes, for example, because of dependencies of works
      queued into the same workqueue.
      
      V3:
      - Modify the commit message clearly according to Petr's suggestion.
      Signed-off-by: default avatarWang Qing <wangqing@vivo.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      89e28ce6
    • Zqiang's avatar
      workqueue: Move the position of debug_work_activate() in __queue_work() · 0687c66b
      Zqiang authored
      The debug_work_activate() is called on the premise that
      the work can be inserted, because if wq be in WQ_DRAINING
      status, insert work may be failed.
      
      Fixes: e41e704b ("workqueue: improve destroy_workqueue() debuggability")
      Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
      Reviewed-by: default avatarLai Jiangshan <jiangshanlai@gmail.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      0687c66b
  6. 03 Apr, 2021 12 commits