syzbot


KMSAN: uninit-value in linear_transfer (2)

Status: fixed on 2018/12/07 08:24
Subsystems: sound
[Documentation on labels]
Reported-by: syzbot+1cb36954e127c98dd037@syzkaller.appspotmail.com
Fix commit: 65766ee0bf7f ALSA: oss: Use kvzalloc() for local buffer allocations
First crash: 2205d, last: 2181d
Discussions (4)
Title Replies (including bot) Last reply
[PATCH 3.16 000/305] 3.16.63-rc1 review 313 (313) 2019/06/07 15:34
[PATCH 4.19 000/110] 4.19.6-stable review 142 (142) 2018/12/14 17:42
[PATCH 4.14 000/100] 4.14.85-stable review 116 (116) 2018/12/03 11:38
KMSAN: uninit-value in linear_transfer (2) 4 (5) 2018/11/09 13:00
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: uninit-value in linear_transfer sound 4 2323d 2333d 0/28 closed as invalid on 2018/09/05 16:42
upstream KMSAN: uninit-value in linear_transfer (3) sound C 469 2080d 2142d 0/28 closed as invalid on 2019/04/12 16:05

Sample crash report:
==================================================================
BUG: KMSAN: uninit-value in __arch_swab32 arch/x86/include/uapi/asm/swab.h:10 [inline]
BUG: KMSAN: uninit-value in __fswab32 include/uapi/linux/swab.h:59 [inline]
BUG: KMSAN: uninit-value in do_convert sound/core/oss/linear.c:50 [inline]
BUG: KMSAN: uninit-value in convert sound/core/oss/linear.c:81 [inline]
BUG: KMSAN: uninit-value in linear_transfer+0x92d/0xca0 sound/core/oss/linear.c:110
CPU: 1 PID: 6835 Comm: syz-executor866 Not tainted 4.19.0+ #78
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+0x32d/0x480 lib/dump_stack.c:113
 kmsan_report+0x19f/0x300 mm/kmsan/kmsan.c:911
 __msan_warning+0x76/0xd0 mm/kmsan/kmsan_instr.c:415
 __arch_swab32 arch/x86/include/uapi/asm/swab.h:10 [inline]
 __fswab32 include/uapi/linux/swab.h:59 [inline]
 do_convert sound/core/oss/linear.c:50 [inline]
 convert sound/core/oss/linear.c:81 [inline]
 linear_transfer+0x92d/0xca0 sound/core/oss/linear.c:110
 snd_pcm_plug_read_transfer+0x3bf/0x590 sound/core/oss/pcm_plugin.c:659
 snd_pcm_oss_read2 sound/core/oss/pcm_oss.c:1480 [inline]
 snd_pcm_oss_read1 sound/core/oss/pcm_oss.c:1518 [inline]
 snd_pcm_oss_read+0xe6d/0x1cb0 sound/core/oss/pcm_oss.c:2758
 __vfs_read+0x1e2/0xb10 fs/read_write.c:416
 vfs_read+0x380/0x6b0 fs/read_write.c:452
 ksys_read fs/read_write.c:578 [inline]
 __do_sys_read fs/read_write.c:588 [inline]
 __se_sys_read+0x17a/0x370 fs/read_write.c:586
 __x64_sys_read+0x4a/0x70 fs/read_write.c:586
 do_syscall_64+0xcf/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7
RIP: 0033:0x446379
Code: e8 0c e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 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 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fcd5b97cda8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00000000006dac38 RCX: 0000000000446379
RDX: 0000000000000184 RSI: 0000000020002180 RDI: 0000000000000003
RBP: 00000000006dac30 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dac3c
R13: 7073642f7665642f R14: 00800000c0045002 R15: 0000000000000001

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:252 [inline]
 kmsan_save_stack mm/kmsan/kmsan.c:267 [inline]
 kmsan_internal_chain_origin+0x136/0x240 mm/kmsan/kmsan.c:569
 kmsan_memcpy_origins+0x13d/0x1b0 mm/kmsan/kmsan.c:393
 __msan_memcpy+0x6f/0x80 mm/kmsan/kmsan_instr.c:242
 do_convert sound/core/oss/linear.c:48 [inline]
 convert sound/core/oss/linear.c:81 [inline]
 linear_transfer+0x74c/0xca0 sound/core/oss/linear.c:110
 snd_pcm_plug_read_transfer+0x3bf/0x590 sound/core/oss/pcm_plugin.c:659
 snd_pcm_oss_read2 sound/core/oss/pcm_oss.c:1480 [inline]
 snd_pcm_oss_read1 sound/core/oss/pcm_oss.c:1518 [inline]
 snd_pcm_oss_read+0xe6d/0x1cb0 sound/core/oss/pcm_oss.c:2758
 __vfs_read+0x1e2/0xb10 fs/read_write.c:416
 vfs_read+0x380/0x6b0 fs/read_write.c:452
 ksys_read fs/read_write.c:578 [inline]
 __do_sys_read fs/read_write.c:588 [inline]
 __se_sys_read+0x17a/0x370 fs/read_write.c:586
 __x64_sys_read+0x4a/0x70 fs/read_write.c:586
 do_syscall_64+0xcf/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:252 [inline]
 kmsan_internal_alloc_meta_for_pages+0x155/0x740 mm/kmsan/kmsan.c:689
 kmsan_alloc_page+0x77/0xe0 mm/kmsan/kmsan_hooks.c:320
 __alloc_pages_nodemask+0x12cc/0x6640 mm/page_alloc.c:4416
 alloc_pages_current+0x584/0x7e0 mm/mempolicy.c:2093
 alloc_pages include/linux/gfp.h:511 [inline]
 __vmalloc_area_node mm/vmalloc.c:1689 [inline]
 __vmalloc_node_range+0x879/0x12a0 mm/vmalloc.c:1752
 __vmalloc_node mm/vmalloc.c:1797 [inline]
 __vmalloc_node_flags mm/vmalloc.c:1811 [inline]
 vmalloc+0xd8/0xf0 mm/vmalloc.c:1833
 snd_pcm_plugin_alloc+0x255/0xc80 sound/core/oss/pcm_plugin.c:71
 snd_pcm_plug_alloc+0x281/0x600 sound/core/oss/pcm_plugin.c:137
 snd_pcm_oss_change_params_locked+0x5e40/0x6e30 sound/core/oss/pcm_oss.c:1039
 snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1107 [inline]
 snd_pcm_oss_get_active_substream+0x4f7/0x5a0 sound/core/oss/pcm_oss.c:1124
 snd_pcm_oss_get_rate sound/core/oss/pcm_oss.c:1774 [inline]
 snd_pcm_oss_set_rate sound/core/oss/pcm_oss.c:1766 [inline]
 snd_pcm_oss_ioctl+0x4adb/0x8860 sound/core/oss/pcm_oss.c:2614
 do_vfs_ioctl+0xf77/0x2d30 fs/ioctl.c:46
 ksys_ioctl fs/ioctl.c:702 [inline]
 __do_sys_ioctl fs/ioctl.c:709 [inline]
 __se_sys_ioctl+0x1da/0x270 fs/ioctl.c:707
 __x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:707
 do_syscall_64+0xcf/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7
==================================================================

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/11/07 13:34 https://github.com/google/kmsan.git master 7438a3b20295 8bd6bd63 .config console log report syz C ci-upstream-kmsan-gce
2018/12/01 20:48 https://github.com/google/kmsan.git master 9fbf73b8d4af 5a581673 .config console log report ci-upstream-kmsan-gce
2018/11/22 09:07 https://github.com/google/kmsan.git master 3ededcaa1606 2ee77802 .config console log report ci-upstream-kmsan-gce
2018/11/17 18:18 https://github.com/google/kmsan.git master cddc52641fd2 b08ee62a .config console log report ci-upstream-kmsan-gce
2018/11/16 20:51 https://github.com/google/kmsan.git master cddc52641fd2 b08ee62a .config console log report ci-upstream-kmsan-gce
2018/11/14 10:11 https://github.com/google/kmsan.git master 006aa39cddee 5f5f6d14 .config console log report ci-upstream-kmsan-gce
2018/11/07 12:27 https://github.com/google/kmsan.git master 7438a3b20295 8bd6bd63 .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.