linux-stable/include
Baisong Zhong b1330cc645 ALSA: seq: fix undefined behavior in bit shift for SNDRV_SEQ_FILTER_USE_EVENT
[ Upstream commit cf59e1e4c7 ]

Shifting signed 32-bit value by 31 bits is undefined, so changing
significant bit to unsigned. The UBSAN warning calltrace like below:

UBSAN: shift-out-of-bounds in sound/core/seq/seq_clientmgr.c:509:22
left shift of 1 by 31 places cannot be represented in type 'int'
...
Call Trace:
 <TASK>
 dump_stack_lvl+0x8d/0xcf
 ubsan_epilogue+0xa/0x44
 __ubsan_handle_shift_out_of_bounds+0x1e7/0x208
 snd_seq_deliver_single_event.constprop.21+0x191/0x2f0
 snd_seq_deliver_event+0x1a2/0x350
 snd_seq_kernel_client_dispatch+0x8b/0xb0
 snd_seq_client_notify_subscription+0x72/0xa0
 snd_seq_ioctl_subscribe_port+0x128/0x160
 snd_seq_kernel_client_ctl+0xce/0xf0
 snd_seq_oss_create_client+0x109/0x15b
 alsa_seq_oss_init+0x11c/0x1aa
 do_one_initcall+0x80/0x440
 kernel_init_freeable+0x370/0x3c3
 kernel_init+0x1b/0x190
 ret_from_fork+0x1f/0x30
 </TASK>

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Baisong Zhong <zhongbaisong@huawei.com>
Link: https://lore.kernel.org/r/20221121111630.3119259-1-zhongbaisong@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-18 09:26:14 +01:00
..
acpi ACPICA: actypes.h: Expand the ACPI_ACCESS_ definitions 2022-01-27 09:00:56 +01:00
asm-generic mm/khugepaged: fix GUP-fast interaction by sending IPI 2023-01-18 09:26:04 +01:00
clocksource
crypto crypto: drbg - make reseeding from get_random_bytes() synchronous 2022-06-25 11:46:41 +02:00
drm drm: fix EDID struct for old ARM OABI format 2022-06-14 16:53:47 +02:00
dt-bindings dt-bindings: reset: meson8b: fix duplicate reset IDs 2020-01-23 08:20:29 +01:00
keys KEYS: Don't write out to userspace while holding key semaphore 2020-04-24 08:01:25 +02:00
kvm
linux eventfd: change int to __u64 in eventfd_signal() ifndef CONFIG_EVENTFD 2023-01-18 09:26:11 +01:00
math-emu
media media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros 2020-02-28 16:36:00 +01:00
memory
misc
net tcp/udp: Make early_demux back namespacified. 2022-11-10 15:47:22 +01:00
pcmcia
ras
rdma RDMA/netlink: Add __maybe_unused to static inline in C file 2021-11-26 11:40:41 +01:00
scsi scsi: stex: Properly zero out the passthrough command structure 2022-10-26 13:16:54 +02:00
soc irqchip/eznps: Fix build error for !ARC700 builds 2020-09-23 10:46:27 +02:00
sound ALSA: core: Add async signal helpers 2022-08-25 11:11:37 +02:00
target scsi: target: Fix ordered tag handling 2021-11-26 11:40:38 +01:00
trace spmi: trace: fix stack-out-of-bound access in SPMI tracing functions 2022-08-25 11:11:27 +02:00
uapi ALSA: seq: fix undefined behavior in bit shift for SNDRV_SEQ_FILTER_USE_EVENT 2023-01-18 09:26:14 +01:00
video video: of_display_timing.h: include errno.h 2022-07-12 16:27:28 +02:00
xen xen/gnttab: fix gnttab_end_foreign_access() without page specified 2022-03-11 10:13:33 +01:00