Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ALSA: hda: Hardening for potential Spectre v1
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 <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
- Loading branch information