]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ALSA: hda: Hardening for potential Spectre v1
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 Apr 2018 05:50:50 +0000 (07:50 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:24:07 +0000 (12:24 +0200)
commitf5614b1b972fb3af3864e6d65e2f5e814009680d
tree143ea062faf77bfd4586b5f556d1b9cfa11bcb86
parent6dcef6647c591377b88dce178e1061ed8150f744
ALSA: hda: Hardening for potential Spectre v1

BugLink: http://bugs.launchpad.net/bugs/1778265
commit 69fa6f19b95597618ab30438a27b67ad93daa7c7 upstream.

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=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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
sound/pci/hda/hda_hwdep.c