summaryrefslogtreecommitdiff
path: root/include/sound/dmaengine_pcm.h
diff options
context:
space:
mode:
authorBaisong Zhong <zhongbaisong@huawei.com>2022-11-21 14:00:44 +0300
committerTakashi Iwai <tiwai@suse.de>2022-11-23 09:56:47 +0300
commitb5172e62458f8e6ff359e5f096044a488db90ac5 (patch)
tree0d886968b20fcf05353cea7e09031b4f36ecc739 /include/sound/dmaengine_pcm.h
parent1cf47b044acdf248155bf40ba99be92baa22c47d (diff)
downloadlinux-b5172e62458f8e6ff359e5f096044a488db90ac5.tar.xz
ALSA: pcm: fix undefined behavior in bit shift for SNDRV_PCM_RATE_KNOT
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/pcm_native.c:2676:21 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_pcm_open_substream+0x9f0/0xa90 snd_pcm_oss_open.part.26+0x313/0x670 snd_pcm_oss_open+0x30/0x40 soundcore_open+0x18b/0x2e0 chrdev_open+0xe2/0x270 do_dentry_open+0x2f7/0x620 path_openat+0xd66/0xe70 do_filp_open+0xe3/0x170 do_sys_openat2+0x357/0x4a0 do_sys_open+0x87/0xd0 do_syscall_64+0x34/0x80 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Baisong Zhong <zhongbaisong@huawei.com> Link: https://lore.kernel.org/r/20221121110044.3115686-1-zhongbaisong@huawei.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/dmaengine_pcm.h')
0 files changed, 0 insertions, 0 deletions