================================================================== 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 ffff88805a77a800 by task syz.6.1143/10257 CPU: 2 UID: 0 PID: 10257 Comm: syz.6.1143 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/0xfb0 sound/usb/endpoint.c:1596 start_endpoints+0xfb/0x1d0 sound/usb/pcm.c:291 snd_usb_substream_playback_trigger+0x66d/0x840 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/0x1ec0 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_write1 sound/core/oss/pcm_oss.c:1439 [inline] snd_pcm_oss_write+0x710/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_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe8/0x680 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf70cd579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f549c55c EFLAGS: 00000296 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 000000000000000a RCX: 0000000080000640 RDX: 00000000000005ce RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 10257: 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:400 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5652 [inline] __kmalloc_noprof+0x32f/0x8f0 mm/slub.c:5664 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:1008 data_ep_set_params sound/usb/endpoint.c:1242 [inline] snd_usb_endpoint_set_params+0x189f/0x28b0 sound/usb/endpoint.c:1379 snd_usb_hw_params+0x715/0x1020 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+0x1435/0x3a40 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_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe8/0x680 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88805a77a800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of allocated 240-byte region [ffff88805a77a800, ffff88805a77a8f0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5a77a head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801b442b40 ffffea000169d600 dead000000000004 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801b442b40 ffffea000169d600 dead000000000004 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 04fff00000000001 ffffea000169de81 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 10092, tgid 10091 (syz.6.1103), ts 274976355490, free_ts 244105279018 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1845 prep_new_page mm/page_alloc.c:1853 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3879 __alloc_frozen_pages_noprof+0x25f/0x2440 mm/page_alloc.c:5183 alloc_slab_page mm/slub.c:3077 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0xaf/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4651 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4774 __slab_alloc_node mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:5246 [inline] __do_kmalloc_node mm/slub.c:5651 [inline] __kmalloc_node_noprof+0x4dd/0x920 mm/slub.c:5658 kmalloc_array_node_noprof include/linux/slab.h:1075 [inline] alloc_slab_obj_exts+0x43/0xf0 mm/slub.c:2123 account_slab mm/slub.c:3202 [inline] allocate_slab mm/slub.c:3267 [inline] new_slab+0x353/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4651 __kmem_cache_alloc_bulk+0x1fb/0x6c0 mm/slub.c:7417 kmem_cache_alloc_bulk_noprof+0x4d3/0x7f0 mm/slub.c:7483 __io_alloc_req_refill+0x9d/0x5e0 io_uring/io_uring.c:1025 io_alloc_req io_uring/io_uring.h:562 [inline] io_submit_sqes+0xf94/0x28e0 io_uring/io_uring.c:2423 __do_sys_io_uring_enter+0xd6b/0x1630 io_uring/io_uring.c:3277 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe8/0x680 arch/x86/entry/syscall_32.c:307 page last free pid 9607 tgid 9604 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2901 __folio_put+0x329/0x450 mm/swap.c:112 folio_put include/linux/mm.h:1425 [inline] hugetlb_free_folio+0xfc/0x140 mm/hugetlb.c:135 __update_and_free_hugetlb_folio+0x1e3/0x420 mm/hugetlb.c:1646 update_and_free_hugetlb_folio+0xce/0x210 mm/hugetlb.c:1701 free_huge_folio+0x822/0xff0 mm/hugetlb.c:1879 folios_put_refs+0x61b/0x750 mm/swap.c:983 folio_batch_release include/linux/pagevec.h:101 [inline] remove_inode_hugepages+0xbef/0xed0 fs/hugetlbfs/inode.c:589 hugetlbfs_evict_inode+0x90/0x220 fs/hugetlbfs/inode.c:604 evict+0x3c2/0xad0 fs/inode.c:837 iput_final fs/inode.c:1951 [inline] iput.part.0+0x621/0x1190 fs/inode.c:2003 iput+0x35/0x40 fs/inode.c:1966 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:467 __dentry_kill+0x1d0/0x600 fs/dcache.c:670 dput.part.0+0x4b1/0x9b0 fs/dcache.c:912 dput+0x1f/0x30 fs/dcache.c:902 Memory state around the buggy address: ffff88805a77a780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805a77a800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805a77a880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ^ ffff88805a77a900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805a77a980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi