linux-stable/sound/core
Kees Cook b38486e82e ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event
[ Upstream commit 05530ef7cf ]

With clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG),
indirect call targets are validated against the expected function
pointer prototype to make sure the call target is valid to help mitigate
ROP attacks. If they are not identical, there is a failure at run time,
which manifests as either a kernel panic or thread getting killed.

seq_copy_in_user() and seq_copy_in_kernel() did not have prototypes
matching snd_seq_dump_func_t. Adjust this and remove the casts. There
are not resulting binary output differences.

This was found as a result of Clang's new -Wcast-function-type-strict
flag, which is more sensitive than the simpler -Wcast-function-type,
which only checks for type width mismatches.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/202211041527.HD8TLSE1-lkp@intel.com
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221118232346.never.380-kees@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-14 11:24:32 +01:00
..
oss ALSA: oss: fix compile error when OSS_DEBUG is enabled 2022-01-27 08:47:35 +01:00
seq ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event 2022-12-14 11:24:32 +01:00
Kconfig ALSA: timer: remove legacy rtctimer 2016-04-25 10:41:46 +02:00
Makefile ALSA: timer: remove legacy rtctimer 2016-04-25 10:41:46 +02:00
compress_offload.c ALSA: compress: fix partial_drain completion state 2020-07-22 09:10:45 +02:00
control.c ALSA: ctl: fix error path at adding user-defined element set 2020-11-24 13:03:06 +01:00
control_compat.c ALSA: ctl: Fix copy of updated id with element read/write 2021-12-14 10:04:47 +01:00
ctljack.c
device.c
hrtimer.c ALSA: timer: Limit max instances per timer 2019-11-06 12:18:28 +01:00
hwdep.c ALSA: hwdep: fix a left shifting 1 by 31 UB bug 2020-06-03 08:16:40 +02:00
hwdep_compat.c
info.c ALSA: info: Fix llseek return value when using callback 2022-08-25 11:09:28 +02:00
info_oss.c
init.c ALSA: core: remove redundant spin_lock pair in snd_card_disconnect 2021-05-22 10:40:26 +02:00
isadma.c
jack.c ALSA: jack: Access input_dev under mutex 2022-06-14 16:52:28 +02:00
memalloc.c ALSA: memalloc: Align buffer allocations in page size 2022-07-29 17:05:47 +02:00
memory.c
misc.c ALSA: core: Add async signal helpers 2022-08-25 11:09:31 +02:00
pcm.c ALSA: PCM: Add missing rwsem around snd_ctl_remove() calls 2022-01-27 08:47:35 +01:00
pcm_compat.c ALSA: pcm: Check PCM state at xfern compat ioctl 2018-05-09 09:50:19 +02:00
pcm_dmaengine.c ALSA: dmaengine: increment buffer pointer atomically 2022-10-26 13:15:40 +02:00
pcm_drm_eld.c
pcm_iec958.c ALSA: pcm: Allow 32 bit sample format in IEC958 channel status helper 2016-04-06 14:33:38 -07:00
pcm_lib.c ALSA: pcm: fix divide error in snd_pcm_lib_ioctl 2021-09-22 11:42:55 +02:00
pcm_memory.c
pcm_misc.c ALSA: pcm: Test for "silence" field in struct "pcm_format_data" 2022-04-20 09:06:46 +02:00
pcm_native.c ALSA: pcm: Add stream lock during PCM reset ioctl operations 2022-03-28 08:06:05 +02:00
pcm_timer.c
pcm_trace.h
rawmidi.c ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free() 2022-10-26 13:15:36 +02:00
rawmidi_compat.c ALSA: rawmidi: Fix missing input substream checks in compat ioctls 2018-04-24 09:34:16 +02:00
sgbuf.c
sound.c
sound_oss.c ALSA: oss: Fix potential deadlock at unregistration 2022-10-26 13:15:36 +02:00
timer.c ALSA: timer: Use deferred fasync helper 2022-08-25 11:09:31 +02:00
timer_compat.c ALSA: timer: Remove kernel warning at compat ioctl error paths 2017-11-30 08:39:05 +00:00
vmaster.c ALSA: vmaster: Propagate slave error 2018-05-30 07:50:48 +02:00