]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:36:38 +0000 (21:36 -0400)
commitcb16ce2d14abb5278c7058488b47c63f92fa59c2
tree8ea8bfcf709cee429206e46bbad75219a4e93fc4
parent9024c599ac2afeb7b1c3032bcb745cac92107859
ALSA: rme9652: Hardening for potential Spectre v1

[ Upstream commit f526afcd8f71945c23ce581d7864ace93de8a4f7 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
sound/pci/rme9652/rme9652.c