linux/include/sound
Takashi Iwai 088e861edf ALSA: control: Hardening for potential Spectre v1
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=2
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25 10:37:46 +02:00
..
ac97 ALSA: ac97: Fix copy and paste typo in documentation 2018-02-12 08:38:42 +01:00
ac97_codec.h ALSA: ac97: split out the generic ac97 registers 2017-09-04 18:24:56 +01:00
aci.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ad1816a.h
ad1843.h
adau1373.h
aess.h
ak4xxx-adda.h
ak4113.h
ak4114.h
ak4117.h
ak4531_codec.h
ak4641.h
alc5623.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
asequencer.h
asound.h
asoundef.h
compress_driver.h
control.h ALSA: control: Hardening for potential Spectre v1 2018-04-25 10:37:46 +02:00
core.h ALSA: add snd_card_disconnect_sync() 2017-10-11 15:06:10 +02:00
cs35l33.h
cs35l34.h
cs35l35.h
cs42l52.h
cs42l56.h
cs42l73.h
cs4231-regs.h
cs4271.h
cs8403.h
cs8427.h
da7213.h
da7218.h
da7219-aad.h
da7219.h ASoC: da7219: Add common clock usage for providing DAI clks 2018-03-09 17:40:41 +00:00
da9055.h
designware_i2s.h
dmaengine_pcm.h ASoC: dmaengine_pcm: document process callback 2018-03-13 09:42:08 -07:00
emu10k1.h ALSA: emu10k1: add a IOMMU workaround 2018-02-14 07:46:55 +01:00
emu10k1_synth.h
emu8000.h
emu8000_reg.h
emux_legacy.h
emux_synth.h
es1688.h
gus.h
hda_chmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_hwdep.h
hda_i915.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_register.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_regmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_verbs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hdaudio.h sound updates for 4.17-rc1 2018-04-05 10:42:07 -07:00
hdaudio_ext.h ASoC: hdac_hdmi: clean up hdac_device variable names 2017-12-01 12:48:16 +00:00
hdmi-codec.h
hwdep.h ->poll() methods should return __poll_t 2017-11-27 16:19:52 -05:00
i2c.h
info.h ->poll() methods should return __poll_t 2017-11-27 16:19:52 -05:00
initval.h
jack.h
l3.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
max9768.h
max98088.h
max98090.h
max98095.h
memalloc.h
minors.h
mixer_oss.h
mpu401.h
omap-hdmi-audio.h drm: omapdrm: hdmi: Pass HDMI core version as integer to HDMI audio 2017-08-16 12:52:41 +03:00
omap-pcm.h
opl3.h
opl4.h
pcm-indirect.h
pcm.h ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20 2017-11-29 09:26:33 +01:00
pcm_drm_eld.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcm_iec958.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcm_oss.h ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streams 2018-03-23 22:18:05 +01:00
pcm_params.h
pt2258.h
pxa2xx-lib.h Merge remote-tracking branches 'asoc/topic/ac97', 'asoc/topic/ac97-mfd', 'asoc/topic/amd' and 'asoc/topic/arizona-mfd' into asoc-next 2017-11-10 21:31:02 +00:00
rawmidi.h
rt286.h
rt298.h
rt5514.h ASoC: rt5514: The DSP clock can be calibrated by the other clock source 2017-11-07 11:23:36 +01:00
rt5640.h
rt5645.h ASoC: rt5645: Set card long_name for GPD win / pocket 2017-12-12 10:41:56 +00:00
rt5659.h ASoC: rt5659: Add the support of Intel HDA Header 2018-02-12 09:31:26 +00:00
rt5660.h
rt5663.h ASoC: rt5663: Add the function of impedance sensing 2017-09-19 12:57:59 +01:00
rt5665.h
rt5670.h
s3c24xx_uda134x.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sb.h
sb16_csp.h
seq_device.h
seq_kernel.h ALSA: seq: Avoid invalid lockdep class warning 2017-11-06 20:25:31 +01:00
seq_midi_emul.h
seq_midi_event.h
seq_oss.h
seq_oss_legacy.h
seq_virmidi.h ALSA: seq: Fix copy_from_user() call inside lock 2017-10-09 14:10:13 +02:00
sh_dac_audio.h
sh_fsi.h
simple_card.h
simple_card_utils.h ASoC: make clock direction configurable in asoc-simple 2017-09-01 11:34:23 +01:00
snd_wavefront.h ASoC: Updates for v4.15 2017-11-13 15:45:57 +01:00
soc-acpi-intel-match.h ASoC: acpi: add missing includes for non-ACPI platforms 2018-01-08 15:56:34 +00:00
soc-acpi.h ASoC: Intel - Convert to use acpi_dev_get_first_match_name() 2018-01-12 21:20:29 +00:00
soc-dai.h Merge remote-tracking branches 'asoc/topic/stm32', 'asoc/topic/sun4i-i2s', 'asoc/topic/sunxi', 'asoc/topic/symmetry' and 'asoc/topic/tas5720' into asoc-next 2018-01-18 11:56:17 +00:00
soc-dapm.h ASoC: dapm: add support to pinctrl dapm 2018-03-13 09:45:01 -07:00
soc-dpcm.h
soc-topology.h
soc.h Merge remote-tracking branches 'asoc/topic/88pm860x', 'asoc/topic/ab8500', 'asoc/topic/ac97', 'asoc/topic/ad1836' and 'asoc/topic/ad193x' into asoc-next 2018-03-28 10:28:30 +08:00
soundfont.h
spear_dma.h
spear_spdif.h
sta32x.h
sta350.h
tas2552-plat.h
tas5086.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tea6330t.h
timer.h ALSA: timer: Limit max instances per timer 2017-11-06 10:41:24 +01:00
tlv.h
tlv320aic3x.h
tlv320aic32x4.h ASoC: tlv320aic32x4: Add gpio configuration to the codec 2017-07-17 16:22:28 +01:00
tlv320dac33-plat.h
tpa6130a2-plat.h
uda134x.h
uda1380.h
util_mem.h
vx_core.h
wavefront.h
wm0010.h
wm1250-ev1.h
wm2000.h
wm2200.h
wm5100.h
wm8903.h
wm8904.h
wm8955.h
wm8960.h
wm8962.h
wm8993.h
wm8996.h
wm9081.h
wm9090.h
wss.h