1. 27 Jan, 2023 1 commit
  2. 24 Jan, 2023 1 commit
  3. 23 Jan, 2023 1 commit
    • Cezary Rojewski's avatar
      ALSA: hda: Do not unset preset when cleaning up codec · 87978e6a
      Cezary Rojewski authored
      Several functions that take part in codec's initialization and removal
      are re-used by ASoC codec drivers implementations. Drivers mimic the
      behavior of hda_codec_driver_probe/remove() found in
      sound/pci/hda/hda_bind.c with their component->probe/remove() instead.
      
      One of the reasons for that is the expectation of
      snd_hda_codec_device_new() to receive a valid pointer to an instance of
      struct snd_card. This expectation can be met only once sound card
      components probing commences.
      
      As ASoC sound card may be unbound without codec device being actually
      removed from the system, unsetting ->preset in
      snd_hda_codec_cleanup_for_unbind() interferes with module unload -> load
      scenario causing null-ptr-deref. Preset is assigned only once, during
      device/driver matching whereas ASoC codec driver's module reloading may
      occur several times throughout the lifetime of an audio stack.
      Suggested-by: default avatarTakashi Iwai <tiwai@suse.com>
      Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Link: https://lore.kernel.org/r/20230119143235.1159814-1-cezary.rojewski@intel.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      87978e6a
  4. 19 Jan, 2023 1 commit
  5. 18 Jan, 2023 2 commits
  6. 17 Jan, 2023 1 commit
    • Takashi Sakamoto's avatar
      firewire: fix memory leak for payload of request subaction to IEC 61883-1 FCP region · 531390a2
      Takashi Sakamoto authored
      This patch is fix for Linux kernel v2.6.33 or later.
      
      For request subaction to IEC 61883-1 FCP region, Linux FireWire subsystem
      have had an issue of use-after-free. The subsystem allows multiple
      user space listeners to the region, while data of the payload was likely
      released before the listeners execute read(2) to access to it for copying
      to user space.
      
      The issue was fixed by a commit 281e2032 ("firewire: core: fix
      use-after-free regression in FCP handler"). The object of payload is
      duplicated in kernel space for each listener. When the listener executes
      ioctl(2) with FW_CDEV_IOC_SEND_RESPONSE request, the object is going to
      be released.
      
      However, it causes memory leak since the commit relies on call of
      release_request() in drivers/firewire/core-cdev.c. Against the
      expectation, the function is never called due to the design of
      release_client_resource(). The function delegates release task
      to caller when called with non-NULL fourth argument. The implementation
      of ioctl_send_response() is the case. It should release the object
      explicitly.
      
      This commit fixes the bug.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 281e2032 ("firewire: core: fix use-after-free regression in FCP handler")
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20230117090610.93792-2-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      531390a2
  7. 13 Jan, 2023 2 commits
  8. 12 Jan, 2023 2 commits
  9. 10 Jan, 2023 3 commits
  10. 09 Jan, 2023 5 commits
  11. 07 Jan, 2023 2 commits
  12. 05 Jan, 2023 2 commits
  13. 04 Jan, 2023 4 commits
  14. 03 Jan, 2023 2 commits
  15. 01 Jan, 2023 1 commit
  16. 29 Dec, 2022 8 commits
  17. 28 Dec, 2022 1 commit
    • Takashi Iwai's avatar
      ALSA: hda/hdmi: Static PCM mapping again with AMD HDMI codecs · 090ddad4
      Takashi Iwai authored
      The recent code refactoring for HD-audio HDMI codec driver caused a
      regression on AMD/ATI HDMI codecs; namely, PulseAudioand pipewire
      don't recognize HDMI outputs any longer while the direct output via
      ALSA raw access still works.
      
      The problem turned out that, after the code refactoring, the driver
      assumes only the dynamic PCM assignment, and when a PCM stream that
      still isn't assigned to any pin gets opened, the driver tries to
      assign any free converter to the PCM stream.  This behavior is OK for
      Intel and other codecs, as they have arbitrary connections between
      pins and converters.  OTOH, on AMD chips that have a 1:1 mapping
      between pins and converters, this may end up with blocking the open of
      the next PCM stream for the pin that is tied with the formerly taken
      converter.
      
      Also, with the code refactoring, more PCM streams are exposed than
      necessary as we assume all converters can be used, while this isn't
      true for AMD case.  This may change the PCM stream assignment and
      confuse users as well.
      
      This patch fixes those problems by:
      
      - Introducing a flag spec->static_pcm_mapping, and if it's set, the
        driver applies the static mapping between pins and converters at the
        probe time
      - Limiting the number of PCM streams per pins, too; this avoids the
        superfluous PCM streams
      
      Fixes: ef6f5494 ("ALSA: hda/hdmi: Use only dynamic PCM device allocation")
      Cc: <stable@vger.kernel.org>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=216836Co-developed-by: default avatarJaroslav Kysela <perex@perex.cz>
      Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
      Link: https://lore.kernel.org/r/20221228125714.16329-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      090ddad4
  18. 27 Dec, 2022 1 commit