================================================================== BUG: KASAN: use-after-free in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:664 Read of size 8 at addr ffff88804cf0bae8 by task syz-executor.0/23553 CPU: 0 PID: 23553 Comm: syz-executor.0 Not tainted 5.17.0-rc6-syzkaller-00066-g5859a2b19911 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:664 sk_error_report+0x35/0x310 net/core/sock.c:340 tcp_write_err net/ipv4/tcp_timer.c:71 [inline] tcp_write_timeout net/ipv4/tcp_timer.c:276 [inline] tcp_retransmit_timer+0x20c2/0x3320 net/ipv4/tcp_timer.c:512 tcp_write_timer_handler+0x5e6/0xbc0 net/ipv4/tcp_timer.c:622 tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:642 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x67c/0xa30 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:unwind_next_frame+0xda/0x1ce0 arch/x86/kernel/unwind_orc.c:419 Code: 81 c4 a0 00 00 00 5b 5d 41 5c 41 5d 41 5e 41 5f c3 4d 8d 66 48 48 b8 00 00 00 00 00 fc ff df 4c 89 e2 48 c1 ea 03 80 3c 02 00 <0f> 85 34 15 00 00 49 8b 46 48 48 89 44 24 10 49 8d 46 38 48 89 c2 RSP: 0018:ffffc900041a7140 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: 1ffff92000834e30 RCX: 0000000000000000 RDX: 1ffff92000834e4c RSI: 0000000000000000 RDI: ffffc900041a7218 RBP: 0000000000000001 R08: ffffffff8e81b5b6 R09: 0000000000000001 R10: fffff52000834e4e R11: 0000000000088078 R12: ffffc900041a7260 R13: 0000000000000000 R14: ffffc900041a7218 R15: 0000000000000000 arch_stack_walk+0x7d/0xe0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:122 save_stack+0x151/0x1e0 mm/page_owner.c:121 __set_page_owner+0x45/0x2d0 mm/page_owner.c:183 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271 vm_area_alloc_pages mm/vmalloc.c:2902 [inline] __vmalloc_area_node mm/vmalloc.c:2962 [inline] __vmalloc_node_range+0xbef/0x1060 mm/vmalloc.c:3107 __vmalloc_node mm/vmalloc.c:3157 [inline] __vmalloc+0x69/0x80 mm/vmalloc.c:3171 __snd_dma_alloc_pages+0xcf/0x150 sound/core/memalloc.c:39 snd_dma_alloc_dir_pages+0x14d/0x240 sound/core/memalloc.c:73 do_alloc_pages+0xc2/0x180 sound/core/pcm_memory.c:48 snd_pcm_lib_malloc_pages+0x3d8/0x990 sound/core/pcm_memory.c:424 snd_pcm_hw_params+0x1408/0x1990 sound/core/pcm_native.c:732 snd_pcm_kernel_ioctl+0x164/0x310 sound/core/pcm_native.c:3385 snd_pcm_oss_change_params_locked+0x13c8/0x3bf0 sound/core/oss/pcm_oss.c:960 snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1104 [inline] snd_pcm_oss_get_active_substream+0x164/0x1c0 sound/core/oss/pcm_oss.c:1121 snd_pcm_oss_get_channels sound/core/oss/pcm_oss.c:1816 [inline] snd_pcm_oss_set_channels+0x244/0x380 sound/core/oss/pcm_oss.c:1808 snd_pcm_oss_ioctl+0x1a84/0x3430 sound/core/oss/pcm_oss.c:2669 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:972 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf6f3f549 Code: 03 74 c0 01 10 05 03 74 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 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:00000000f59395cc EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000c0045006 RDX: 0000000020000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:ffffea000133c2c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x100 pfn:0x4cf0b flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 ffffea000133c288 0000000000000000 raw: 0000000000000100 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 19942, ts 458307583714, free_ts 469377598361 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x27f/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0xbe1/0x12b0 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] __kmalloc_node_track_caller+0x339/0x470 mm/slub.c:4957 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1158 [inline] netlink_to_full_skb net/netlink/af_netlink.c:171 [inline] __netlink_deliver_tap_skb net/netlink/af_netlink.c:296 [inline] __netlink_deliver_tap net/netlink/af_netlink.c:323 [inline] netlink_deliver_tap+0x655/0xc30 net/netlink/af_netlink.c:336 netlink_deliver_tap_kernel net/netlink/af_netlink.c:345 [inline] netlink_unicast_kernel net/netlink/af_netlink.c:1316 [inline] netlink_unicast+0x5eb/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 sock_no_sendpage+0xf6/0x140 net/core/sock.c:3091 kernel_sendpage.part.0+0x1a0/0x340 net/socket.c:3492 kernel_sendpage net/socket.c:3489 [inline] sock_sendpage+0xe5/0x140 net/socket.c:1007 pipe_to_sendpage+0x2ad/0x380 fs/splice.c:364 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3404 __unfreeze_partials+0x320/0x340 mm/slub.c:2536 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x6d/0x160 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283 ____kasan_kmalloc mm/kasan/common.c:481 [inline] __kasan_kmalloc+0xbd/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:586 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x140 security/security.c:1337 vfs_getattr fs/stat.c:157 [inline] vfs_fstat+0x43/0xb0 fs/stat.c:182 __do_compat_sys_ia32_fstat64+0x72/0xd0 arch/x86/kernel/sys_ia32.c:189 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Memory state around the buggy address: ffff88804cf0b980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804cf0ba00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88804cf0ba80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804cf0bb00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804cf0bb80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess): 0: 81 c4 a0 00 00 00 add $0xa0,%esp 6: 5b pop %rbx 7: 5d pop %rbp 8: 41 5c pop %r12 a: 41 5d pop %r13 c: 41 5e pop %r14 e: 41 5f pop %r15 10: c3 retq 11: 4d 8d 66 48 lea 0x48(%r14),%r12 15: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 1c: fc ff df 1f: 4c 89 e2 mov %r12,%rdx 22: 48 c1 ea 03 shr $0x3,%rdx 26: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) * 2a: 0f 85 34 15 00 00 jne 0x1564 <-- trapping instruction 30: 49 8b 46 48 mov 0x48(%r14),%rax 34: 48 89 44 24 10 mov %rax,0x10(%rsp) 39: 49 8d 46 38 lea 0x38(%r14),%rax 3d: 48 89 c2 mov %rax,%rdx