================================================================== BUG: KASAN: use-after-free in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:670 Read of size 8 at addr ffff8880795af0e8 by task kworker/u4:8/4035 CPU: 0 PID: 4035 Comm: kworker/u4:8 Not tainted 5.17.0-rc6-syzkaller-00228-gac84e82f78cb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: bat_events batadv_nc_worker 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/0x303 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:670 sk_error_report+0x35/0x310 net/core/sock.c:340 tcp_write_err net/ipv4/tcp_timer.c:71 [inline] tcp_probe_timer net/ipv4/tcp_timer.c:395 [inline] tcp_write_timer_handler+0x437/0xbc0 net/ipv4/tcp_timer.c:626 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:check_region_inline mm/kasan/generic.c:175 [inline] RIP: 0010:kasan_check_range+0x27/0x180 mm/kasan/generic.c:189 Code: 00 00 90 48 85 f6 0f 84 3c 01 00 00 49 89 f9 41 54 44 0f b6 c2 49 01 f1 55 53 0f 82 18 01 00 00 48 b8 ff ff ff ff ff 7f ff ff <48> 39 c7 0f 86 05 01 00 00 49 83 e9 01 48 89 fd 48 b8 00 00 00 00 RSP: 0018:ffffc90006247bb0 EFLAGS: 00000282 RAX: ffff7fffffffffff RBX: 0000000000000000 RCX: ffffffff815ca931 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff8d93e890 RBP: 1ffff92000c48f7c R08: 0000000000000000 R09: ffffffff8d93e898 R10: ffffffff88e74851 R11: 0000000000000000 R12: ffffffff8bb81ae0 R13: 0000000000000000 R14: dffffc0000000000 R15: 000000000000030a instrument_atomic_read include/linux/instrumented.h:71 [inline] test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline] cpumask_test_cpu include/linux/cpumask.h:379 [inline] cpu_online include/linux/cpumask.h:921 [inline] trace_lock_release include/trace/events/lock.h:58 [inline] lock_release+0xa1/0x720 kernel/locking/lockdep.c:5650 rcu_lock_release include/linux/rcupdate.h:273 [inline] rcu_read_unlock include/linux/rcupdate.h:727 [inline] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline] batadv_nc_worker+0x86b/0xfa0 net/batman-adv/network-coding.c:719 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the page: page:ffffea0001e56bc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x795af flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 ffffffff00000101 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 1, migratetype Unmovable, gfp_mask 0x3c2220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE), pid 3745, ts 412631937141, free_ts 413432286103 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_node include/linux/gfp.h:572 [inline] kmem_getpages mm/slab.c:1378 [inline] cache_grow_begin+0x75/0x390 mm/slab.c:2584 cache_alloc_refill+0x27f/0x380 mm/slab.c:2957 ____cache_alloc mm/slab.c:3040 [inline] ____cache_alloc mm/slab.c:3023 [inline] slab_alloc_node mm/slab.c:3241 [inline] kmem_cache_alloc_node_trace+0x49c/0x5b0 mm/slab.c:3609 __do_kmalloc_node mm/slab.c:3631 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3646 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] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:745 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:802 [inline] nsim_dev_trap_report_work+0x29a/0xbc0 drivers/net/netdevsim/dev.c:843 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 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 slab_destroy mm/slab.c:1630 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1650 cache_flusharray mm/slab.c:3410 [inline] ___cache_free+0x303/0x600 mm/slab.c:3472 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x50/0x1a0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc mm/slab.c:3315 [inline] kmem_cache_alloc+0x265/0x560 mm/slab.c:3499 p9_tag_alloc net/9p/client.c:266 [inline] p9_client_prepare_req.part.0+0x3a/0xc20 net/9p/client.c:697 p9_client_prepare_req net/9p/client.c:802 [inline] p9_client_rpc+0x21c/0x1260 net/9p/client.c:734 p9_client_read_once+0x23b/0x600 net/9p/client.c:1602 p9_client_read+0x13b/0x1a0 net/9p/client.c:1561 v9fs_dir_readdir+0x4ac/0x6d0 fs/9p/vfs_dir.c:113 iterate_dir+0x576/0x700 fs/readdir.c:65 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64 fs/readdir.c:354 [inline] __x64_sys_getdents64+0x13a/0x2c0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff8880795aef80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880795af000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880795af080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880795af100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880795af180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 90 nop 3: 48 85 f6 test %rsi,%rsi 6: 0f 84 3c 01 00 00 je 0x148 c: 49 89 f9 mov %rdi,%r9 f: 41 54 push %r12 11: 44 0f b6 c2 movzbl %dl,%r8d 15: 49 01 f1 add %rsi,%r9 18: 55 push %rbp 19: 53 push %rbx 1a: 0f 82 18 01 00 00 jb 0x138 20: 48 b8 ff ff ff ff ff movabs $0xffff7fffffffffff,%rax 27: 7f ff ff * 2a: 48 39 c7 cmp %rax,%rdi <-- trapping instruction 2d: 0f 86 05 01 00 00 jbe 0x138 33: 49 83 e9 01 sub $0x1,%r9 37: 48 89 fd mov %rdi,%rbp 3a: 48 rex.W 3b: b8 00 00 00 00 mov $0x0,%eax