UBSAN: undefined-behaviour in snd_pcm_oss_change_params_locked

5 views
Skip to first unread message

syzbot

unread,
Sep 16, 2020, 9:42:23 PM9/16/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a87f9628 Linux 4.19.145
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15116cc5900000
kernel config: https://syzkaller.appspot.com/x/.config?x=9688ecb5b728ce13
dashboard link: https://syzkaller.appspot.com/bug?extid=f7bb59ef98481f233322
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f7bb59...@syzkaller.appspotmail.com

================================================================================
UBSAN: Undefined behaviour in sound/core/oss/pcm_oss.c:720:23
shift exponent 4096 is too large for 32-bit type 'int'
CPU: 0 PID: 14705 Comm: syz-executor.5 Not tainted 4.19.145-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x22c/0x33e lib/dump_stack.c:118
ubsan_epilogue+0xe/0x3a lib/ubsan.c:161
__ubsan_handle_shift_out_of_bounds.cold+0x1c4/0x250 lib/ubsan.c:422
snd_pcm_oss_period_size sound/core/oss/pcm_oss.c:720 [inline]
snd_pcm_oss_change_params_locked.cold+0xf7/0x11a sound/core/oss/pcm_oss.c:943
snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1102 [inline]
snd_pcm_oss_mmap+0x442/0x550 sound/core/oss/pcm_oss.c:2893
call_mmap include/linux/fs.h:1826 [inline]
mmap_region+0xb62/0x1510 mm/mmap.c:1757
do_mmap+0x8e8/0x1080 mm/mmap.c:1530
do_mmap_pgoff include/linux/mm.h:2326 [inline]
vm_mmap_pgoff+0x197/0x200 mm/util.c:357
ksys_mmap_pgoff+0x2d1/0x660 mm/mmap.c:1580
do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45d5f9
Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fb74366cc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000020f00 RCX: 000000000045d5f9
RDX: 0000000000000001 RSI: 0000000000001000 RDI: 0000000020ffc000
RBP: 000000000118cf98 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000012 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007ffecfaa73ff R14: 00007fb74366d9c0 R15: 000000000118cf4c
================================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Sep 20, 2020, 3:02:17 PM9/20/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 015e94d0 Linux 4.19.146
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17f12c81900000
kernel config: https://syzkaller.appspot.com/x/.config?x=243dd74ad58a8a57
dashboard link: https://syzkaller.appspot.com/bug?extid=f7bb59ef98481f233322
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1189d69b900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=134946c5900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f7bb59...@syzkaller.appspotmail.com

audit: type=1400 audit(1600628383.851:8): avc: denied { execmem } for pid=6466 comm="syz-executor789" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=process permissive=1
================================================================================
UBSAN: Undefined behaviour in ./include/linux/log2.h:61:13
shift exponent 64 is too large for 64-bit type 'long unsigned int'
CPU: 0 PID: 6466 Comm: syz-executor789 Not tainted 4.19.146-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x22c/0x33e lib/dump_stack.c:118
ubsan_epilogue+0xe/0x3a lib/ubsan.c:161
__ubsan_handle_shift_out_of_bounds.cold+0x1c4/0x250 lib/ubsan.c:422
__roundup_pow_of_two include/linux/log2.h:61 [inline]
snd_pcm_oss_period_size sound/core/oss/pcm_oss.c:747 [inline]
snd_pcm_oss_change_params_locked.cold+0x6d/0x11a sound/core/oss/pcm_oss.c:943
snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1102 [inline]
snd_pcm_oss_get_active_substream+0x164/0x1c0 sound/core/oss/pcm_oss.c:1119
snd_pcm_oss_get_channels sound/core/oss/pcm_oss.c:1806 [inline]
snd_pcm_oss_set_channels+0x244/0x380 sound/core/oss/pcm_oss.c:1798
snd_pcm_oss_ioctl+0x12dd/0x33c0 sound/core/oss/pcm_oss.c:2644
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440269
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffc5f0ff428 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440269
RDX: 00000

Reply all
Reply to author
Forward
0 new messages