android_kernel_xiaomi_sm7250/sound/pci/ctxfi
Takashi Iwai de8f8b39c9 ALSA: ctxfi: Fix out-of-range access
commit 76c47183224c86e4011048b80f0e2d0d166f01c2 upstream.

The master and next_conj of rcs_ops are used for iterating the
resource list entries, and currently those are supposed to return the
current value.  The problem is that next_conf may go over the last
entry before the loop abort condition is evaluated, and it may return
the "current" value that is beyond the array size.  It was caught
recently as a GPF, for example.

Those return values are, however, never actually evaluated, hence
basically we don't have to consider the current value as the return at
all.  By dropping those return values, the potential out-of-range
access above is also fixed automatically.

This patch changes the return type of master and next_conj callbacks
to void and drop the superfluous code accordingly.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214985
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211118215729.26257-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-01 09:27:39 +01:00
..
ct20k1reg.h
ct20k2reg.h
ctamixer.c ALSA: ctxfi: Fix out-of-range access 2021-12-01 09:27:39 +01:00
ctamixer.h
ctatc.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
ctatc.h
ctdaio.c ALSA: ctxfi: Fix out-of-range access 2021-12-01 09:27:39 +01:00
ctdaio.h
cthardware.c
cthardware.h
cthw20k1.c ALSA:: ctxfi: cthw20k1: Replace mdelay() with msleep() 2018-07-27 11:48:50 +02:00
cthw20k1.h
cthw20k2.c ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits 2021-03-11 14:05:00 +01:00
cthw20k2.h
ctimap.c
ctimap.h
ctmixer.c ALSA: ctxfi: use enum type CT_SUM_CTL where appropriate 2018-06-18 17:40:18 +02:00
ctmixer.h
ctpcm.c ALSA: ctxfi: Use common error handling code in two functions 2017-08-22 19:43:29 +02:00
ctpcm.h
ctresource.c ALSA: ctxfi: Fix out-of-range access 2021-12-01 09:27:39 +01:00
ctresource.h ALSA: ctxfi: Fix out-of-range access 2021-12-01 09:27:39 +01:00
ctsrc.c ALSA: ctxfi: Fix out-of-range access 2021-12-01 09:27:39 +01:00
ctsrc.h
cttimer.c sound: Use octal not symbolic permissions 2018-05-28 11:27:20 +02:00
cttimer.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ctvmem.c ALSA: squash lines for simple wrapper functions 2016-09-07 20:35:29 +02:00
ctvmem.h
Makefile
xfi.c sound: Use octal not symbolic permissions 2018-05-28 11:27:20 +02:00