1. 20 6月, 2022 1 次提交
  2. 17 5月, 2022 1 次提交
  3. 16 5月, 2022 1 次提交
  4. 25 4月, 2022 1 次提交
  5. 13 4月, 2022 1 次提交
    • T
      ALSA: memalloc: Add fallback SG-buffer allocations for x86 · 925ca893
      Takashi Iwai 提交于
      The recent change for memory allocator replaced the SG-buffer handling
      helper for x86 with the standard non-contiguous page handler.  This
      works for most cases, but there is a corner case I obviously
      overlooked, namely, the fallback of non-contiguous handler without
      IOMMU.  When the system runs without IOMMU, the core handler tries to
      use the continuous pages with a single SGL entry.  It works nicely for
      most cases, but when the system memory gets fragmented, the large
      allocation may fail frequently.
      
      Ideally the non-contig handler could deal with the proper SG pages,
      it's cumbersome to extend for now.  As a workaround, here we add new
      types for (minimalistic) SG allocations, instead, so that the
      allocator falls back to those types automatically when the allocation
      with the standard API failed.
      
      BTW, one better (but pretty minor) improvement from the previous
      SG-buffer code is that this provides the proper mmap support without
      the PCM's page fault handling.
      
      Fixes: 2c95b92e ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)")
      BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2272
      BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1198248
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20220413054808.7547-1-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      925ca893
  6. 12 4月, 2022 2 次提交
  7. 11 4月, 2022 1 次提交
  8. 30 3月, 2022 1 次提交
    • T
      ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock · bc55cfd5
      Takashi Iwai 提交于
      syzbot caught a potential deadlock between the PCM
      runtime->buffer_mutex and the mm->mmap_lock.  It was brought by the
      recent fix to cover the racy read/write and other ioctls, and in that
      commit, I overlooked a (hopefully only) corner case that may take the
      revert lock, namely, the OSS mmap.  The OSS mmap operation
      exceptionally allows to re-configure the parameters inside the OSS
      mmap syscall, where mm->mmap_mutex is already held.  Meanwhile, the
      copy_from/to_user calls at read/write operations also take the
      mm->mmap_lock internally, hence it may lead to a AB/BA deadlock.
      
      A similar problem was already seen in the past and we fixed it with a
      refcount (in commit b2483716).  The former fix covered only the
      call paths with OSS read/write and OSS ioctls, while we need to cover
      the concurrent access via both ALSA and OSS APIs now.
      
      This patch addresses the problem above by replacing the buffer_mutex
      lock in the read/write operations with a refcount similar as we've
      used for OSS.  The new field, runtime->buffer_accessing, keeps the
      number of concurrent read/write operations.  Unlike the former
      buffer_mutex protection, this protects only around the
      copy_from/to_user() calls; the other codes are basically protected by
      the PCM stream lock.  The refcount can be a negative, meaning blocked
      by the ioctls.  If a negative value is seen, the read/write aborts
      with -EBUSY.  In the ioctl side, OTOH, they check this refcount, too,
      and set to a negative value for blocking unless it's already being
      accessed.
      
      Reported-by: syzbot+6e5c88838328e99c7e1c@syzkaller.appspotmail.com
      Fixes: dca947d4 ("ALSA: pcm: Fix races among concurrent read/write and buffer changes")
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/000000000000381a0d05db622a81@google.com
      Link: https://lore.kernel.org/r/20220330120903.4738-1-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      bc55cfd5
  9. 23 3月, 2022 5 次提交
  10. 18 3月, 2022 3 次提交
  11. 15 3月, 2022 1 次提交
  12. 14 3月, 2022 1 次提交
  13. 13 3月, 2022 1 次提交
  14. 10 2月, 2022 2 次提交
  15. 28 1月, 2022 1 次提交
  16. 22 1月, 2022 1 次提交
  17. 20 1月, 2022 1 次提交
  18. 17 1月, 2022 1 次提交
  19. 06 1月, 2022 1 次提交
  20. 23 12月, 2021 1 次提交
  21. 17 12月, 2021 1 次提交
  22. 13 12月, 2021 1 次提交
  23. 08 12月, 2021 1 次提交
  24. 06 12月, 2021 1 次提交
  25. 02 12月, 2021 4 次提交
  26. 01 12月, 2021 1 次提交
  27. 24 11月, 2021 3 次提交