]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: opl3: Hardening for potential Spectre v1
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 Apr 2018 05:56:07 +0000 (07:56 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 25 Apr 2018 08:37:47 +0000 (10:37 +0200)
commitda8100d2e71ba87cd2889c5dff2af50bd24467c9
tree31ef4ea6ea8237bba834fcbedac06c8463318338
parenta05fada1d4b61962d237c61ab056154928cb107f
ALSA: opl3: Hardening for potential Spectre v1

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=2
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/opl3/opl3_synth.c