]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: rme9652: Hardening for potential Spectre v1
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 Apr 2018 06:04:41 +0000 (08:04 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 25 Apr 2018 08:37:48 +0000 (10:37 +0200)
commite269c99d70fd84aa51f33bedf1c9485b16d4254d
tree910de0bc4f2596055400f6c7e501ad28b3dd664f
parent2db7ace6c1be18699a2b07e139a0d95f47020848
ALSA: rme9652: Hardening for potential Spectre v1

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