================================================================== 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 ffff88803d323400 by task syz.5.3110/16481 CPU: 0 UID: 0 PID: 16481 Comm: syz.5.3110 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:0x7fa23738f7c9 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:00007fa2382bf038 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007fa2375e5fa0 RCX: 00007fa23738f7c9 RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000000000003 RBP: 00007fa237413f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fa2375e6038 R14: 00007fa2375e5fa0 R15: 00007fff7b8f72e8 Allocated by task 16481: 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 ffff88803d323400 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of allocated 240-byte region [ffff88803d323400, ffff88803d3234f0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3d322 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b442b40 ffffea0000a72600 dead000000000005 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b442b40 ffffea0000a72600 dead000000000005 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0000f4c881 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5930, tgid 5930 (syz-executor), ts 54183001432, free_ts 54160182678 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] ____ip_mc_inc_group+0x403/0x10c0 net/ipv4/igmp.c:1535 __ip_mc_inc_group net/ipv4/igmp.c:1573 [inline] ip_mc_inc_group net/ipv4/igmp.c:1579 [inline] ip_mc_up+0x154/0x380 net/ipv4/igmp.c:1880 inetdev_event+0xafb/0x1870 net/ipv4/devinet.c:1630 notifier_call_chain+0xbc/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2230 call_netdevice_notifiers_extack net/core/dev.c:2268 [inline] call_netdevice_notifiers net/core/dev.c:2282 [inline] __dev_notify_flags+0x12c/0x2e0 net/core/dev.c:9773 netif_change_flags+0x108/0x160 net/core/dev.c:9802 do_setlink.constprop.0+0xb53/0x4380 net/core/rtnetlink.c:3158 page last free pid 5935 tgid 5935 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 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4c/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:349 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_node_noprof+0x298/0x800 mm/slub.c:5315 __alloc_skb+0x156/0x410 net/core/skbuff.c:679 alloc_skb include/linux/skbuff.h:1383 [inline] netlink_alloc_large_skb+0x69/0x140 net/netlink/af_netlink.c:1184 netlink_sendmsg+0x698/0xdd0 net/netlink/af_netlink.c:1869 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] __sys_sendto+0x4a3/0x520 net/socket.c:2206 __do_sys_sendto net/socket.c:2213 [inline] __se_sys_sendto net/socket.c:2209 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2209 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 Memory state around the buggy address: ffff88803d323380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803d323400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88803d323480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ^ ffff88803d323500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803d323580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================