Skip to content
  1. Nov 23, 2017
  2. Nov 22, 2017
    • Takashi Iwai's avatar
      ALSA: hda - Fix yet remaining issue with vmaster 0dB initialization · d6c0615f
      Takashi Iwai authored
      The previous fix for addressing the breakage in vmaster slave
      initialization, commit a91d6612 ("ALSA: hda - Fix incorrect TLV
      callback check introduced during set_fs() removal"), introduced a new
      helper to process over each slave kctl.  However, this helper passes
      only the original kctl, not the virtual slave kctl.  As a result,
      HD-audio driver (which is the only user so far) couldn't initialize
      the slave correctly because it's trying to update the value directly
      with the original kctl, not with the mapped kctl.
      
      This patch fixes the situation again by passing both the mapped slaved
      and original slave kctls to the function.  Luckily there is a single
      caller as of now, so changing the call signature is no big matter.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197959
      Fixes: a91d6612
      
       ("ALSA: hda - Fix incorrect TLV callback check introduced during set_fs() removal")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d6c0615f
    • Takashi Iwai's avatar
      ALSA: usb-audio: Add sanity checks in v2 clock parsers · 0a62d6c9
      Takashi Iwai authored
      The helper functions to parse and look for the clock source, selector
      and multiplier unit may return the descriptor with a too short length
      than required, while there is no sanity check in the caller side.
      Add some sanity checks in the parsers, at least, to guarantee the
      given descriptor size, for avoiding the potential crashes.
      
      Fixes: 79f920fb
      
       ("ALSA: usb-audio: parse clock topology of UAC2 devices")
      Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      0a62d6c9
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix potential zero-division at parsing FU · 8428a8eb
      Takashi Iwai authored
      parse_audio_feature_unit() contains a code dividing potentially with
      zero when a malformed FU descriptor is passed.  Although there is
      already a sanity check, it checks only the value zero, hence it can
      still lead to a zero-division when a value 1 is passed there.
      
      Fix it by correcting the sanity check (and the error message
      thereof).
      
      Fixes: 23caaf19
      
       ("ALSA: usb-mixer: Add support for Audio Class v2.0")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8428a8eb
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix potential out-of-bound access at parsing SU · f658f17b
      Takashi Iwai authored
      The usb-audio driver may trigger an out-of-bound access at parsing a
      malformed selector unit, as it checks the header length only after
      evaluating bNrInPins field, which can be already above the given
      length.  Fix it by adding the length check beforehand.
      
      Fixes: 99fc8645
      
       ("ALSA: usb-mixer: parse descriptors with structs")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f658f17b
    • Takashi Iwai's avatar
      ALSA: usb-audio: Add sanity checks to FE parser · d937cd67
      Takashi Iwai authored
      When the usb-audio descriptor contains the malformed feature unit
      description with a too short length, the driver may access
      out-of-bounds.  Add a sanity check of the header size at the beginning
      of parse_audio_feature_unit().
      
      Fixes: 23caaf19
      
       ("ALSA: usb-mixer: Add support for Audio Class v2.0")
      Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d937cd67
  3. Nov 21, 2017
    • Takashi Iwai's avatar
      ALSA: timer: Remove kernel warning at compat ioctl error paths · 3d4e8303
      Takashi Iwai authored
      
      
      Some timer compat ioctls have NULL checks of timer instance with
      snd_BUG_ON() that bring up WARN_ON() when the debug option is set.
      Actually the condition can be met in the normal situation and it's
      confusing and bad to spew kernel warnings with stack trace there.
      Let's remove snd_BUG_ON() invocation and replace with the simple
      checks.  Also, correct the error code to EBADFD to follow the native
      ioctl error handling.
      
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3d4e8303
    • Henrik Eriksson's avatar
      ALSA: pcm: update tstamp only if audio_tstamp changed · 20e3f985
      Henrik Eriksson authored
      commit 3179f620 ("ALSA: core: add .get_time_info") had a side effect
      of changing the behaviour of the PCM runtime tstamp.  Prior to this
      change tstamp was not updated by snd_pcm_update_hw_ptr0() unless the
      hw_ptr had moved, after this change tstamp was always updated.
      
      For an application using alsa-lib, doing snd_pcm_readi() followed by
      snd_pcm_status() to estimate the age of the read samples by subtracting
      status->avail * [sample rate] from status->tstamp this change degraded
      the accuracy of the estimate on devices where the pcm hw does not
      provide a granular hw_ptr, e.g., devices using
      soc-generic-dmaengine-pcm.c and a dma-engine with residue_granularity
      DMA_RESIDUE_GRANULARITY_DESCRIPTOR.  The accuracy of the estimate
      depended on the latency between the PCM hw completing a period and the
      driver called snd_pcm_period_elapsed() to notify ALSA core, typically
      determined by interrupt handling latency.  After the change the accuracy
      of the estimate depended on the latency between the PCM hw completing a
      period and the application calling snd_pcm_status(), determined by the
      scheduling of the application process.  The maximum error of the
      estimate is one period length in both cases, but the error average and
      variance is smaller when it depends on interrupt latency.
      
      Instead of always updating tstamp, update it only if audio_tstamp
      changed.
      
      Fixes: 3179f620
      
       ("ALSA: core: add .get_time_info")
      Suggested-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: default avatarHenrik Eriksson <henrik.eriksson@axis.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      20e3f985
  4. Nov 20, 2017
  5. Nov 17, 2017
    • Takashi Iwai's avatar
      ALSA: hda: Fix too short HDMI/DP chmap reporting · c2432466
      Takashi Iwai authored
      We got a regression report about the HD-audio HDMI chmap, where some
      surround channels are reported as UNKNOWN.  The git bisection pointed
      the culprit at the commit 9b3dc8aa ("ALSA: hda - Register chmap
      obj as priv data instead of codec").  The story behind scene is like
      this:
      
      - While moving the code out of the legacy HDA to the HDA common place,
        the patch modifies the code to obtain the chmap array indirectly in
        a byte array, and it expands it to kctl value array.
      - At the latter operation, the size of the array is wrongly passed by
        sizeof() to the pointer.
      - It can be 4 on 32bit arch, thus too short for 6+ channels.
        (And that's the reason why it didn't hit other persons; it's 8 on
        64bit arch, thus it's usually enough.)
      
      The code was further changed meanwhile, but the problem persisted.
      Let's fix it by correctly evaluating the array size.
      
      Fixes: 9b3dc8aa
      
       ("ALSA: hda - Register chmap obj as priv data instead of codec")
      Reported-by: default avatarVDR User <user.vdr@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c2432466
    • Julian Scheel's avatar
      ALSA: usb-audio: uac1: Invalidate ctl on interrupt · b2500b58
      Julian Scheel authored
      
      
      When an interrupt occurs, the value of at least one of the belonging
      controls should have changed. To make sure they get re-read from device
      on the next read, invalidate the cache. This was correctly implemented
      for uac2 already, but missing for uac1.
      
      Signed-off-by: default avatarJulian Scheel <julian@jusst.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b2500b58
  6. Nov 16, 2017
  7. Nov 15, 2017
  8. Nov 14, 2017
  9. Nov 13, 2017
    • Takashi Iwai's avatar
      Merge tag 'asoc-v4.15' of... · 76727c2c
      Takashi Iwai authored
      Merge tag 'asoc-v4.15' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Updates for v4.15
      
      The biggest thing this release has been the conversion of the AC98 bus
      to the driver model, that's been a long time coming so thanks to Robert
      Jarzmik for his dedication there.  Due to there being some AC97 MFD
      there's a few fairly large changes in input and the MFD layer, mainly to
      the wm97xx driver.
      
      There's also some drivers/drm changes to support the new AMD Stoney
      platform, these are shared with the DRM subsystem and should be being
      merged via both.
      
      Within the subsystem the overwhelming bulk of the changes is in the
      Intel drivers which continue to need lots of cleanups and fixes, this
      release they've also gained support for their open source firmware.
      There's also some large changs in the core as Morimoto-san continues to
      mirror operations into the component level in preparation for conversion
      of drivers to that.
      
       - The AC97 bus has finally caught up with the driver model ...
      76727c2c
    • Takashi Iwai's avatar
      Merge branch 'for-next' into for-linus · c429bda2
      Takashi Iwai authored
      
      
      Pull 4.15 updates to take over the previous urgent fixes.
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c429bda2
  10. Nov 11, 2017