1. 04 May, 2018 4 commits
  2. 03 May, 2018 2 commits
  3. 02 May, 2018 22 commits
  4. 27 Apr, 2018 1 commit
  5. 25 Apr, 2018 11 commits
    • Takashi Iwai's avatar
      Merge branch 'for-linus' into for-next · 4d31c6e4
      Takashi Iwai authored
      Back-merge 4.17-rc3 fixes for further development.
      This will bump the base to 4.17-rc2, too.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4d31c6e4
    • Takashi Iwai's avatar
      ALSA: hda - Skip jack and others for non-existing PCM streams · 8a7d6003
      Takashi Iwai authored
      When CONFIG_SND_DYNAMIC_MINORS isn't set, there are only limited
      number of devices available, and HD-audio, especially with HDMI/DP
      codec, will fail to create more than two devices.
      
      The driver warns about the lack of such devices and skips the PCM
      device creations, but the HDMI driver still tries to create the
      corresponding JACK, SPDIF and ELD controls even for the non-existing
      PCM substreams.  This results in confusion on user-space, and even may
      break the operation.
      
      Similarly, Intel HDMI/DP codec builds the ELD notification from i915
      graphics driver, and this may be broken if a notification is sent for
      the non-existing PCM stream.
      
      This patch adds the check of the existence of the assigned PCM
      substream in the both scenarios above, and skips the further operation
      if the PCM substream is not assigned.
      
      Fixes: 9152085d ("ALSA: hda - add DP MST audio support")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8a7d6003
    • Takashi Iwai's avatar
      Merge tag 'asoc-fix-4.17-rc2' of... · 3a230f7d
      Takashi Iwai authored
      Merge tag 'asoc-fix-4.17-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Fixes for v4.17
      
      A small batch of fixes collected since the merge window, none of which
      are particularly large or remarkable.  They've all been cooking in -next
      for a while.
      3a230f7d
    • Kailang Yang's avatar
      ALSA: hda/realtek - change the location for one of two front mics · 65811834
      Kailang Yang authored
      On this Lenovo ThinkCentre machine. There are two front mics,
      we change the location for one of them.
      
      Relation: f33f79f3 ("ALSA: hda/realtek - change the location for
      one of two front microphones")
      Signed-off-by: default avatarKailang Yang <kailang@realtek.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      65811834
    • Takashi Iwai's avatar
      ALSA: rme9652: Hardening for potential Spectre v1 · f526afcd
      Takashi Iwai authored
      As recently Smatch suggested, one place in RME9652 driver may expand
      the array directly from the user-space value with speculation:
        sound/pci/rme9652/rme9652.c:2074 snd_rme9652_channel_info() warn: potential spectre issue 'rme9652->channel_map' (local cap)
      
      This patch puts array_index_nospec() for hardening against it.
      
      BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f526afcd
    • Takashi Iwai's avatar
      ALSA: hdspm: Hardening for potential Spectre v1 · 10513142
      Takashi Iwai authored
      As recently Smatch suggested, a couple of places in HDSP MADI driver
      may expand the array directly from the user-space value with
      speculation:
        sound/pci/rme9652/hdspm.c:5717 snd_hdspm_channel_info() warn: potential spectre issue 'hdspm->channel_map_out' (local cap)
        sound/pci/rme9652/hdspm.c:5734 snd_hdspm_channel_info() warn: potential spectre issue 'hdspm->channel_map_in' (local cap)
      
      This patch puts array_index_nospec() for hardening against them.
      
      BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      10513142
    • Takashi Iwai's avatar
      ALSA: asihpi: Hardening for potential Spectre v1 · f9d94b57
      Takashi Iwai authored
      As recently Smatch suggested, a couple of places in ASIHPI driver may
      expand the array directly from the user-space value with speculation:
        sound/pci/asihpi/hpimsginit.c:70 hpi_init_response() warn: potential spectre issue 'res_size' (local cap)
        sound/pci/asihpi/hpioctl.c:189 asihpi_hpi_ioctl() warn: potential spectre issue 'adapters'
      
      This patch puts array_index_nospec() for hardening against them.
      
      BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f9d94b57
    • Takashi Iwai's avatar
      ALSA: opl3: Hardening for potential Spectre v1 · 7f054a5b
      Takashi Iwai authored
      As recently Smatch suggested, one place in OPL3 driver may expand the
      array directly from the user-space value with speculation:
        sound/drivers/opl3/opl3_synth.c:476 snd_opl3_set_voice() warn: potential spectre issue 'snd_opl3_regmap'
      
      This patch puts array_index_nospec() for hardening against it.
      
      BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7f054a5b
    • Takashi Iwai's avatar
      ALSA: hda: Hardening for potential Spectre v1 · 69fa6f19
      Takashi Iwai authored
      As recently Smatch suggested, one place in HD-audio hwdep ioctl codes
      may expand the array directly from the user-space value with
      speculation:
        sound/pci/hda/hda_local.h:467 get_wcaps() warn: potential spectre issue 'codec->wcaps'
      
      As get_wcaps() itself is a fairly frequently called inline function,
      and there is only one single call with a user-space value, we replace
      only the latter one to open-code locally with array_index_nospec()
      hardening in this patch.
      
      BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      69fa6f19
    • Takashi Iwai's avatar
      ALSA: control: Hardening for potential Spectre v1 · 088e861e
      Takashi Iwai authored
      As recently Smatch suggested, a few places in ALSA control core codes
      may expand the array directly from the user-space value with
      speculation:
      
        sound/core/control.c:1003 snd_ctl_elem_lock() warn: potential spectre issue 'kctl->vd'
        sound/core/control.c:1031 snd_ctl_elem_unlock() warn: potential spectre issue 'kctl->vd'
        sound/core/control.c:844 snd_ctl_elem_info() warn: potential spectre issue 'kctl->vd'
        sound/core/control.c:891 snd_ctl_elem_read() warn: potential spectre issue 'kctl->vd'
        sound/core/control.c:939 snd_ctl_elem_write() warn: potential spectre issue 'kctl->vd'
      
      Although all these seem doing only the first load without further
      reference, we may want to stay in a safer side, so hardening with
      array_index_nospec() would still make sense.
      
      In this patch, we put array_index_nospec() to the common
      snd_ctl_get_ioff*() helpers instead of each caller.  These helpers are
      also referred from some drivers, too, and basically all usages are to
      calculate the array index from the user-space value, hence it's better
      to cover there.
      
      BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      088e861e
    • Takashi Iwai's avatar
      ALSA: seq: oss: Hardening for potential Spectre v1 · 8d218dd8
      Takashi Iwai authored
      As Smatch recently suggested, a few places in OSS sequencer codes may
      expand the array directly from the user-space value with speculation,
      namely there are a significant amount of references to either
      info->ch[] or dp->synths[] array:
      
        sound/core/seq/oss/seq_oss_event.c:315 note_on_event() warn: potential spectre issue 'info->ch' (local cap)
        sound/core/seq/oss/seq_oss_event.c:362 note_off_event() warn: potential spectre issue 'info->ch' (local cap)
        sound/core/seq/oss/seq_oss_synth.c:470 snd_seq_oss_synth_load_patch() warn: potential spectre issue 'dp->synths' (local cap)
        sound/core/seq/oss/seq_oss_event.c:293 note_on_event() warn: potential spectre issue 'dp->synths'
        sound/core/seq/oss/seq_oss_event.c:353 note_off_event() warn: potential spectre issue 'dp->synths'
        sound/core/seq/oss/seq_oss_synth.c:506 snd_seq_oss_synth_sysex() warn: potential spectre issue 'dp->synths'
        sound/core/seq/oss/seq_oss_synth.c:580 snd_seq_oss_synth_ioctl() warn: potential spectre issue 'dp->synths'
      
      Although all these seem doing only the first load without further
      reference, we may want to stay in a safer side, so hardening with
      array_index_nospec() would still make sense.
      
      We may put array_index_nospec() at each place, but here we take a
      different approach:
      
      - For dp->synths[], change the helpers to retrieve seq_oss_synthinfo
        pointer directly instead of the array expansion at each place
      
      - For info->ch[], harden in a normal way, as there are only a couple
        of places
      
      As a result, the existing helper, snd_seq_oss_synth_is_valid() is
      replaced with snd_seq_oss_synth_info().  Also, we cover MIDI device
      where a similar array expansion is done, too, although it wasn't
      reported by Smatch.
      
      BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8d218dd8