diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-11-23 15:44:00 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-11-23 18:09:22 +0100 |
commit | 7194eda1ba0872d917faf3b322540b4f57f11ba5 (patch) | |
tree | bf7b0ad9b193f4766c0a979c4a298076548d0281 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | a6b0961b39896a9f9f1350d26d202f078a7d9dbc (diff) |
ALSA: ac97: Fix incorrect bit shift at AC97-SPSA control write
The function snd_ac97_put_spsa() gets the bit shift value from the
associated private_value, but it extracts too much; the current code
extracts 8 bit values in bits 8-15, but this is a combination of two
nibbles (bits 8-11 and bits 12-15) for left and right shifts.
Due to the incorrect bits extraction, the actual shift may go beyond
the 32bit value, as spotted recently by UBSAN check:
UBSAN: Undefined behaviour in sound/pci/ac97/ac97_codec.c:836:7
shift exponent 68 is too large for 32-bit type 'int'
This patch fixes the shift value extraction by masking the properly
with 0x0f instead of 0xff.
Reported-and-tested-by: Meelis Roos <mroos@linux.ee>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions