Skip to content
Snippets Groups Projects
  1. Jun 07, 2017
    • Takashi Iwai's avatar
      ALSA: timer: Fix missing queue indices reset at SNDRV_TIMER_IOCTL_SELECT · ba3021b2
      Takashi Iwai authored
      
      snd_timer_user_tselect() reallocates the queue buffer dynamically, but
      it forgot to reset its indices.  Since the read may happen
      concurrently with ioctl and snd_timer_user_tselect() allocates the
      buffer via kmalloc(), this may lead to the leak of uninitialized
      kernel-space data, as spotted via KMSAN:
      
        BUG: KMSAN: use of unitialized memory in snd_timer_user_read+0x6c4/0xa10
        CPU: 0 PID: 1037 Comm: probe Not tainted 4.11.0-rc5+ #2739
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
        Call Trace:
         __dump_stack lib/dump_stack.c:16
         dump_stack+0x143/0x1b0 lib/dump_stack.c:52
         kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:1007
         kmsan_check_memory+0xc2/0x140 mm/kmsan/kmsan.c:1086
         copy_to_user ./arch/x86/include/asm/uaccess.h:725
         snd_timer_user_read+0x6c4/0xa10 sound/core/timer.c:2004
         do_loop_readv_writev fs/read_write.c:716
         __do_readv_writev+0x94c/0x1380 fs/read_write.c:864
         do_readv_writev fs/read_write.c:894
         vfs_readv fs/read_write.c:908
         do_readv+0x52a/0x5d0 fs/read_write.c:934
         SYSC_readv+0xb6/0xd0 fs/read_write.c:1021
         SyS_readv+0x87/0xb0 fs/read_write.c:1018
      
      This patch adds the missing reset of queue indices.  Together with the
      previous fix for the ioctl/read race, we cover the whole problem.
      
      Reported-by: default avatarAlexander Potapenko <glider@google.com>
      Tested-by: default avatarAlexander Potapenko <glider@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ba3021b2
    • Takashi Iwai's avatar
      ALSA: timer: Fix race between read and ioctl · d11662f4
      Takashi Iwai authored
      
      The read from ALSA timer device, the function snd_timer_user_tread(),
      may access to an uninitialized struct snd_timer_user fields when the
      read is concurrently performed while the ioctl like
      snd_timer_user_tselect() is invoked.  We have already fixed the races
      among ioctls via a mutex, but we seem to have forgotten the race
      between read vs ioctl.
      
      This patch simply applies (more exactly extends the already applied
      range of) tu->ioctl_lock in snd_timer_user_tread() for closing the
      race window.
      
      Reported-by: default avatarAlexander Potapenko <glider@google.com>
      Tested-by: default avatarAlexander Potapenko <glider@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d11662f4
  2. Jun 06, 2017
  3. Jun 01, 2017
    • Takashi Iwai's avatar
      ALSA: hda - Fix applying MSI dual-codec mobo quirk · d2c3b14e
      Takashi Iwai authored
      
      The previous commit [63691587: ALSA: hda - Apply dual-codec quirk
      for MSI Z270-Gaming mobo] attempted to apply the existing dual-codec
      quirk for a MSI mobo.  But it turned out that this isn't applied
      properly due to the MSI-vendor quirk before this entry.  I overlooked
      such two MSI entries just because they were put in the wrong position,
      although we have a list ordered by PCI SSID numbers.
      
      This patch fixes it by rearranging the unordered entries.
      
      Fixes: 63691587 ("ALSA: hda - Apply dual-codec quirk for MSI Z270-Gaming mobo")
      Reported-by: default avatarRudolf Schmidt <info@rudolfschmidt.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d2c3b14e
  4. May 31, 2017
  5. May 26, 2017
  6. May 24, 2017
  7. May 23, 2017
  8. May 22, 2017
  9. May 19, 2017
  10. May 17, 2017
  11. May 16, 2017
  12. May 15, 2017
    • Ville Syrjälä's avatar
      drm/i915: Fix runtime PM for LPE audio · 668e3b01
      Ville Syrjälä authored
      
      Not calling pm_runtime_enable() means that runtime PM can't be
      enabled at all via sysfs. So we definitely need to call it
      from somewhere.
      
      Calling it from the driver seems like a bad idea because it
      would have to be paired with a pm_runtime_disable() at driver
      unload time, otherwise the core gets upset. Also if there's
      no LPE audio driver loaded then we couldn't runtime suspend
      i915 either.
      
      So it looks like a better plan is to call it from i915 when
      we register the platform device. That seems to match how
      pci generally does things. I cargo culted the
      pm_runtime_forbid() and pm_runtime_set_active() calls from
      pci as well.
      
      The exposed runtime PM API is massive an thorougly misleading, so
      I don't actually know if this is how you're supposed to use the API
      or not. But it seems to work. I can now runtime suspend i915 again
      with or without the LPE audio driver loaded, and reloading the
      LPE audio driver also seems to work.
      
      Note that powertop won't auto-tune runtime PM for platform devices,
      which is a little annoying. So I'm not sure that leaving runtime
      PM in "on" mode by default is the best choice here. But I've left
      it like that for now at least.
      
      Also remove the comment about there not being much benefit from
      LPE audio runtime PM. Not allowing runtime PM blocks i915 runtime
      PM, which will also block s0ix, and that could have a measurable
      impact on power consumption.
      
      Cc: stable@vger.kernel.org
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Fixes: 0b6b524f ("ALSA: x86: Don't enable runtime PM as default")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-2-ville.syrjala@linux.intel.com
      
      
      Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
      (cherry picked from commit 183c0035)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      668e3b01
    • Johan Hovold's avatar
      ALSA: usb-audio: fix Amanero Combo384 quirk on big-endian hosts · f83914fd
      Johan Hovold authored
      
      Add missing endianness conversion when using the USB device-descriptor
      bcdDevice field when applying the Amanero Combo384 (endianness!) quirk.
      
      Fixes: 3eff682d ("ALSA: usb-audio: Support both DSD LE/BE Amanero firmware versions")
      Cc: Jussi Laako <jussi@sonarnerd.net>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f83914fd
  13. May 14, 2017
  14. May 12, 2017
    • Takashi Iwai's avatar
      sound: Disable the build of OSS drivers · 31cbee6a
      Takashi Iwai authored
      
      OSS drivers are left as badly unmaintained, and now we're facing a
      problem to clean up the hackish set_fs() usage in their codes.  Since
      most of drivers have been covered by ALSA, and the others are dead old
      and inactive, let's leave them RIP.
      
      This patch is the first step: disable the build of OSS drivers.
      We'll eventually drop the whole codes and clean up later.
      
      Note that sound/oss/dmasound is still kept, since it's a completely
      different implementation of OSS, and it doesn't suffer from set_fs()
      hack.  Moreover, the build of ALSA is disabled on M68K by some reason,
      thus disabling it shall result in a regression.  This one will be
      disabled / removed once when we add the support in ALSA side.
      
      Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      31cbee6a
  15. May 10, 2017
    • Jeeja KP's avatar
      ALSA: hda: Fix cpu lockup when stopping the cmd dmas · 96001376
      Jeeja KP authored
      Using jiffies in hdac_wait_for_cmd_dmas() to determine when to time out
      when interrupts are off (snd_hdac_bus_stop_cmd_io()/spin_lock_irq())
      causes hard lockup so unlock while waiting using jiffies.
      
      ---<-snip->---
      <0>[ 1211.603046] NMI watchdog: Watchdog detected hard LOCKUP on cpu 3
      <4>[ 1211.603047] Modules linked in: snd_hda_intel i915 vgem
      <4>[ 1211.603053] irq event stamp: 13366
      <4>[ 1211.603053] hardirqs last  enabled at (13365):
      ...
      <4>[ 1211.603059] Call Trace:
      <4>[ 1211.603059]  ? delay_tsc+0x3d/0xc0
      <4>[ 1211.603059]  __delay+0xa/0x10
      <4>[ 1211.603060]  __const_udelay+0x31/0x40
      <4>[ 1211.603060]  snd_hdac_bus_stop_cmd_io+0x96/0xe0 [snd_hda_core]
      <4>[ 1211.603060]  ? azx_dev_disconnect+0x20/0x20 [snd_hda_intel]
      <4>[ 1211.603061]  snd_hdac_bus_stop_chip+0xb1/0x100 [snd_hda_core]
      <4>[ 1211.603061]  azx_stop_chip+0x9/0x10 [snd_hda_codec]
      <4>[ 1211.603061]  azx_suspend+0x72/0x220 [snd_hda_intel]
      <4>[ 1211.603061]  pci_pm_suspend+0x71/0x140
      <4>[ 1211.603062]  dpm_run_callback+0x6f/0x330
      <4>[ 1211.603062]  ? pci_pm_freeze+0xe0/0xe0
      <4>[ 1211.603062]  __device_suspend+0xf9/0x370
      <4>[ 1211.603062]  ? dpm_watchdog_set+0x60/0x60
      <4>[ 1211.603063]  async_suspend+0x1a/0x90
      <4>[ 1211.603063]  async_run_entry_fn+0x34/0x160
      <4>[ 1211.603063]  process_one_work+0x1f4/0x6d0
      <4>[ 1211.603063]  ? process_one_work+0x16e/0x6d0
      <4>[ 1211.603064]  worker_thread+0x49/0x4a0
      <4>[ 1211.603064]  kthread+0x107/0x140
      <4>[ 1211.603064]  ? process_one_work+0x6d0/0x6d0
      <4>[ 1211.603065]  ? kthread_create_on_node+0x40/0x40
      <4>[ 1211.603065]  ret_from_fork+0x2e/0x40
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100419
      
      
      Fixes: 38b19ed7 ("ALSA: hda: fix to wait for RIRB & CORB DMA to set")
      Reported-by: default avatarMarta Lofstedt <marta.lofstedt@intel.com>
      Suggested-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarJeeja KP <jeeja.kp@intel.com>
      Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
      CC: stable <stable@vger.kernel.org> # 4.7
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      96001376
  16. May 09, 2017
  17. May 08, 2017
  18. Apr 30, 2017
Loading