1
0
Fork 0
alistair23-linux/sound
Takashi Iwai c9a4c63888 ALSA: seq: Fix UBSAN warning at SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT ioctl
The kernel may spew a WARNING with UBSAN undefined behavior at
handling ALSA sequencer ioctl SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT:

UBSAN: Undefined behaviour in sound/core/seq/seq_clientmgr.c:2007:14
signed integer overflow:
2147483647 + 1 cannot be represented in type 'int'
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x122/0x1c8 lib/dump_stack.c:113
 ubsan_epilogue+0x12/0x86 lib/ubsan.c:159
 handle_overflow+0x1c2/0x21f lib/ubsan.c:190
  __ubsan_handle_add_overflow+0x2a/0x31 lib/ubsan.c:198
 snd_seq_ioctl_query_next_client+0x1ac/0x1d0 sound/core/seq/seq_clientmgr.c:2007
 snd_seq_ioctl+0x264/0x3d0 sound/core/seq/seq_clientmgr.c:2144
 ....

It happens only when INT_MAX is passed there, as we're incrementing it
unconditionally.  So the fix is trivial, check the value with
INT_MAX.  Although the bug itself is fairly harmless, it's better to
fix it so that fuzzers won't hit this again later.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200211
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-25 11:18:04 +02:00
..
ac97 ALSA: ac97: kconfig: Remove select of undefined symbol AC97 2018-02-12 08:16:39 +01:00
aoa License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arm Merge remote-tracking branches 'asoc/topic/ac97', 'asoc/topic/ac97-mfd', 'asoc/topic/amd' and 'asoc/topic/arizona-mfd' into asoc-next 2017-11-10 21:31:02 +00:00
atmel ASoC: Updates for v4.14 2017-09-04 14:50:49 +02:00
core ALSA: seq: Fix UBSAN warning at SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT ioctl 2018-06-25 11:18:04 +02:00
drivers docs: Fix some broken references 2018-06-15 18:10:01 -03:00
firewire treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
hda ALSA: hda - Use a macro for snd_array iteration loops 2018-04-24 13:41:53 +02:00
i2c ASoC: Updates for v4.15 2017-11-13 15:45:57 +01:00
isa media updates for v4.18-rc1 2018-06-07 12:34:37 -07:00
mips ALSA: sgio2audio: Improve a size determination in snd_sgio2audio_create() 2017-11-29 09:29:31 +01:00
oss treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
parisc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci ALSA: hda/realtek - Fix the problem of two front mics on more machines 2018-06-25 10:01:29 +02:00
pcmcia ALSA: pcmcia: constify snd_pcm_ops structures 2017-08-19 11:02:21 +02:00
ppc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sh ALSA: sh: aica: Convert timers to use timer_setup() 2017-10-05 08:20:17 +02:00
soc - Error path bug fix for overflow tests (Dan) 2018-06-12 18:28:00 -07:00
sparc sound: Use octal not symbolic permissions 2018-05-28 11:27:20 +02:00
spi License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
synth ASoC: Updates for v4.15 2017-11-13 15:45:57 +01:00
usb sound fixes for 4.18-rc1 2018-06-15 17:24:40 +09:00
x86 ALSA: x86: Fix potential crash at error path 2018-02-28 08:46:00 +01:00
xen ALSA: xen-front: fix a loop timeout 2018-05-31 09:11:03 +02:00
Kconfig ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver 2018-05-16 12:58:36 +02:00
Makefile ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver 2018-05-16 12:58:36 +02:00
ac97_bus.c
last.c
sound_core.c sound: Use octal not symbolic permissions 2018-05-28 11:27:20 +02:00