================================================================== BUG: KASAN: slab-out-of-bounds in copy_to_urb.constprop.0+0x30f/0x440 sound/usb/pcm.c:1487 Write of size 264 at addr ffff888024fd5e00 by task syz.4.1690/11928 CPU: 2 UID: 0 PID: 11928 Comm: syz.4.1690 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:194 [inline] kasan_check_range+0x100/0x1b0 mm/kasan/generic.c:200 __asan_memcpy+0x3c/0x60 mm/kasan/shadow.c:106 copy_to_urb.constprop.0+0x30f/0x440 sound/usb/pcm.c:1487 prepare_playback_urb+0xc3b/0x1e70 sound/usb/pcm.c:1611 prepare_outbound_urb+0x419/0xdd0 sound/usb/endpoint.c:333 snd_usb_endpoint_start+0x42c/0x1040 sound/usb/endpoint.c:1596 start_endpoints+0xfb/0x1d0 sound/usb/pcm.c:291 snd_usb_substream_playback_trigger+0x6a0/0x870 sound/usb/pcm.c:1711 snd_pcm_do_start sound/core/pcm_native.c:1454 [inline] snd_pcm_do_start+0xd4/0x1f0 sound/core/pcm_native.c:1447 snd_pcm_action_single+0x80/0x150 sound/core/pcm_native.c:1310 snd_pcm_action+0x70/0x90 sound/core/pcm_native.c:1393 __snd_pcm_lib_xfer+0x1403/0x1ef0 sound/core/pcm_lib.c:2405 snd_pcm_oss_write3+0xcf/0x1e0 sound/core/oss/pcm_oss.c:1241 io_playback_transfer+0x26e/0x2f0 sound/core/oss/io.c:47 snd_pcm_plug_write_transfer+0x2cf/0x400 sound/core/oss/pcm_plugin.c:630 snd_pcm_oss_write2+0x24a/0x410 sound/core/oss/pcm_oss.c:1373 snd_pcm_oss_sync1+0x1c3/0x560 sound/core/oss/pcm_oss.c:1615 snd_pcm_oss_sync+0x5ef/0x840 sound/core/oss/pcm_oss.c:1691 snd_pcm_oss_release+0x28b/0x310 sound/core/oss/pcm_oss.c:2573 __fput+0x402/0xb70 fs/file_table.c:468 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:44 [inline] exit_to_user_mode_loop+0xfb/0x540 kernel/entry/common.c:75 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline] do_syscall_64+0x4ee/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5ec918f7c9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5ec9f77038 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007f5ec93e5fa0 RCX: 00007f5ec918f7c9 RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000000000005 RBP: 00007f5ec9213f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f5ec93e6038 R14: 00007f5ec93e5fa0 R15: 00007ffcd626f548 Allocated by task 11928: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:397 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:414 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5657 [inline] __kmalloc_noprof+0x33d/0x910 mm/slub.c:5669 kmalloc_noprof include/linux/slab.h:961 [inline] hcd_buffer_alloc+0x1f5/0x290 drivers/usb/core/buffer.c:134 usb_alloc_coherent+0x5f/0xa0 drivers/usb/core/usb.c:1010 data_ep_set_params sound/usb/endpoint.c:1242 [inline] snd_usb_endpoint_set_params+0x18c8/0x2980 sound/usb/endpoint.c:1379 snd_usb_hw_params+0x715/0x1070 sound/usb/pcm.c:576 snd_pcm_hw_params+0xafc/0x1ba0 sound/core/pcm_native.c:804 snd_pcm_kernel_ioctl+0x147/0x2e0 sound/core/pcm_native.c:3499 snd_pcm_oss_change_params_locked+0x15ab/0x3ab0 sound/core/oss/pcm_oss.c:965 snd_pcm_oss_make_ready_locked+0xb7/0x130 sound/core/oss/pcm_oss.c:1186 snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1404 [inline] snd_pcm_oss_write+0x4c2/0xa10 sound/core/oss/pcm_oss.c:2794 vfs_write+0x2a0/0x11d0 fs/read_write.c:684 ksys_write+0x12a/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888024fd5e00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes inside of allocated 192-byte region [ffff888024fd5e00, ffff888024fd5ec0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24fd5 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b4423c0 ffffea0000e39640 dead000000000004 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 8222785660, free_ts 7855303555 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1846 prep_new_page mm/page_alloc.c:1854 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c3/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4656 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __kmalloc_cache_noprof+0x485/0x800 mm/slub.c:5771 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] call_usermodehelper_setup+0xaf/0x360 kernel/umh.c:362 kobject_uevent_env+0x179c/0x1920 lib/kobject_uevent.c:628 tty_register_device_attr+0x4ba/0x7c0 drivers/tty/tty_io.c:3282 tty_register_device drivers/tty/tty_io.c:3196 [inline] tty_register_driver+0x50c/0x860 drivers/tty/tty_io.c:3460 legacy_pty_init drivers/tty/pty.c:575 [inline] pty_init+0x668/0x10f0 drivers/tty/pty.c:915 do_one_initcall+0x123/0x680 init/main.c:1378 do_initcall_level init/main.c:1440 [inline] do_initcalls init/main.c:1456 [inline] do_basic_setup init/main.c:1475 [inline] kernel_init_freeable+0x5c8/0x920 init/main.c:1688 kernel_init+0x1c/0x2b0 init/main.c:1578 page last free pid 34 tgid 34 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943 vfree+0x1fd/0xb50 mm/vmalloc.c:3466 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:3385 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Memory state around the buggy address: ffff888024fd5d80: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff888024fd5e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888024fd5e80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff888024fd5f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888024fd5f80: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================