syzbot


KASAN: null-ptr-deref Write in snd_pcm_format_set_silence

Status: fixed on 2023/02/24 13:50
Subsystems: sound
[Documentation on labels]
Reported-by: syzbot+205eb15961852c2c5974@syzkaller.appspotmail.com
Fix commit: 2f7a26abb824 ALSA: pcm: Test for "silence" field in struct "pcm_format_data"
First crash: 922d, last: 774d
Cause bisection: introduced by (bisect log) [merge commit]:
commit f18e345dd156cc0fcf4a4911af2f959120613871
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed Mar 30 17:36:41 2022 +0000

  Merge tag 'i3c/for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux

Crash: KASAN: null-ptr-deref Write in snd_pcm_format_set_silence (log)
Repro: C syz .config
  
Discussions (9)
Title Replies (including bot) Last reply
[PATCH 4.14 000/284] 4.14.276-rc1 review 297 (298) 2022/09/12 10:15
[PATCH] ALSA: pcm: Test for "silence" field in struct "pcm_format_data" 9 (9) 2022/06/14 11:46
[PATCH 5.17 000/219] 5.17.4-rc1 review 231 (231) 2022/04/20 04:44
[PATCH 5.10 000/105] 5.10.112-rc1 review 112 (112) 2022/04/20 01:39
[PATCH 5.4 00/63] 5.4.190-rc1 review 70 (70) 2022/04/19 12:00
[PATCH 4.19 00/32] 4.19.239-rc1 review 39 (39) 2022/04/19 11:59
[PATCH 4.9 000/218] 4.9.311-rc1 review 224 (225) 2022/04/19 10:09
[PATCH 5.15 000/189] 5.15.35-rc1 review 199 (199) 2022/04/19 07:32
[syzbot] KASAN: null-ptr-deref Write in snd_pcm_format_set_silence 1 (3) 2022/04/09 00:51
Last patch testing requests (1)
Created Duration User Patch Repo Result
2022/04/09 00:41 8m fmdefrancesco@gmail.com patch upstream OK

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in snd_pcm_format_set_silence sound/core/pcm_misc.c:441 [inline]
BUG: KASAN: null-ptr-deref in snd_pcm_format_set_silence+0x215/0x350 sound/core/pcm_misc.c:424
Write of size 16383 at addr 0000000000000001 by task syz-executor156/3605

CPU: 0 PID: 3605 Comm: syz-executor156 Not tainted 5.18.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_report mm/kasan/report.c:432 [inline]
 kasan_report.cold+0x61/0x1c6 mm/kasan/report.c:491
 check_region_inline mm/kasan/generic.c:183 [inline]
 kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189
 memset+0x20/0x40 mm/kasan/shadow.c:44
 snd_pcm_format_set_silence sound/core/pcm_misc.c:441 [inline]
 snd_pcm_format_set_silence+0x215/0x350 sound/core/pcm_misc.c:424
 snd_pcm_oss_sync+0x60e/0x800 sound/core/oss/pcm_oss.c:1690
 snd_pcm_oss_ioctl+0x208c/0x3430 sound/core/oss/pcm_oss.c:2634
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f0846a59e69
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 18 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0846c74318 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f0846af0028 RCX: 00007f0846a59e69
RDX: 0000000000000000 RSI: 0000000000005001 RDI: 0000000000000003
RBP: 00007f0846af0020 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 6475612f7665642f
R13: 00007f0846bffd8f R14: 00007f0846c74400 R15: 0000000000022000
 </TASK>
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/04/04 23:04 upstream 312310928417 5915c2cb .config console log report syz C ci-upstream-kasan-gce KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
2022/04/05 02:26 upstream 312310928417 5915c2cb .config console log report syz C ci-upstream-kasan-gce-386 KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
2022/08/31 16:15 upstream dcf8e5633e2e 51e54e30 .config console log report syz ci-upstream-kasan-gce-selinux-root KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
2022/08/06 01:04 upstream 200e340f2196 e853abd9 .config console log report syz ci-upstream-kasan-gce-smack-root KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
2022/06/18 10:22 upstream 4b35035bcf80 8f633d84 .config console log report syz ci-upstream-kasan-gce-root KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
2022/07/27 00:59 linux-next cb71b93c2dc3 279b89c2 .config console log report syz ci-upstream-linux-next-kasan-gce-root KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
2022/04/07 17:34 upstream 3e732ebf7316 c6ff3e05 .config console log report info ci-upstream-kasan-gce KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
2022/04/04 22:46 upstream 312310928417 5915c2cb .config console log report info ci-upstream-kasan-gce KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
* Struck through repros no longer work on HEAD.