================================================================== BUG: KASAN: slab-out-of-bounds in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:670 Read of size 8 at addr ffff88802a8e7468 by task udevd/2966 CPU: 1 PID: 2966 Comm: udevd Not tainted 5.17.0-rc6-syzkaller-00184-g38f80f42147f #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/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_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:kfree+0x125/0x2b0 mm/slab.c:3796 Code: 0e 4c 89 ea 48 89 ee 4c 89 e7 e8 f6 f8 ff ff 48 85 db 0f 85 a6 00 00 00 9c 58 f6 c4 02 0f 85 72 01 00 00 48 85 db 74 01 fb 5b <5d> 41 5c 41 5d c3 65 8b 05 96 be 43 7e 83 f8 07 0f 87 5f 01 00 00 RSP: 0018:ffffc9000b607a30 EFLAGS: 00000206 RAX: 0000000000000002 RBX: dffffc0000000000 RCX: 1ffffffff1b277a1 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff88804c970000 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff817e2178 R11: 0000000000088078 R12: ffff888010c40900 R13: ffffffff83ad8fc1 R14: ffff88804c970fd6 R15: 0000000000001000 tomoyo_realpath_from_path+0x191/0x620 security/tomoyo/realpath.c:291 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_statx+0x164/0x390 fs/stat.c:225 vfs_fstatat fs/stat.c:243 [inline] __do_sys_newfstatat+0x96/0x120 fs/stat.c:412 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f914d55e1da Code: 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 0b 00 00 00 66 2e 0f 1f 84 00 00 00 00 00 90 41 89 ca b8 06 01 00 00 0f 05 <3d> 00 f0 ff ff 77 07 31 c0 c3 0f 1f 40 00 48 8b 15 69 fc 0c 00 f7 RSP: 002b:00007ffe73f1fab8 EFLAGS: 00000202 ORIG_RAX: 0000000000000106 RAX: ffffffffffffffda RBX: 000055f5be6b87c0 RCX: 00007f914d55e1da RDX: 00007ffe73f1fac0 RSI: 00007f914d5f475a RDI: 000000000000000d RBP: 000000000000000d R08: 0000000000090800 R09: 000055f5be6bcfb0 R10: 0000000000001000 R11: 0000000000000202 R12: 00007ffe73f1fac0 R13: 00000000000000ff R14: 00007ffe73f1fbb0 R15: 0000000000000000 Allocated by task 6441: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524 kasan_kmalloc include/linux/kasan.h:270 [inline] __do_kmalloc mm/slab.c:3694 [inline] __kmalloc+0x209/0x4d0 mm/slab.c:3703 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 tomoyo_path_unlink+0x8e/0xd0 security/tomoyo/tomoyo.c:149 security_path_unlink+0xd7/0x150 security/security.c:1159 do_unlinkat+0x360/0x650 fs/namei.c:4214 __do_sys_unlink fs/namei.c:4266 [inline] __se_sys_unlink fs/namei.c:4264 [inline] __x64_sys_unlink+0xc6/0x110 fs/namei.c:4264 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 6441: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0xff/0x140 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] __cache_free mm/slab.c:3437 [inline] kfree+0xf8/0x2b0 mm/slab.c:3794 tomoyo_realpath_from_path+0x191/0x620 security/tomoyo/realpath.c:291 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 tomoyo_path_unlink+0x8e/0xd0 security/tomoyo/tomoyo.c:149 security_path_unlink+0xd7/0x150 security/security.c:1159 do_unlinkat+0x360/0x650 fs/namei.c:4214 __do_sys_unlink fs/namei.c:4266 [inline] __se_sys_unlink fs/namei.c:4264 [inline] __x64_sys_unlink+0xc6/0x110 fs/namei.c:4264 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88802a8e6000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1128 bytes to the right of 4096-byte region [ffff88802a8e6000, ffff88802a8e7000) The buggy address belongs to the page: page:ffffea0000aa3980 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a8e6 head:ffffea0000aa3980 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001d83a88 ffffea0001f33708 ffff888010c40900 raw: 0000000000000000 ffff88802a8e6000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x342040(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 6441, ts 1943251579872, free_ts 1933048663237 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] __do_cache_alloc mm/slab.c:3267 [inline] slab_alloc mm/slab.c:3308 [inline] __do_kmalloc mm/slab.c:3692 [inline] __kmalloc+0x3b3/0x4d0 mm/slab.c:3703 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 tomoyo_path_unlink+0x8e/0xd0 security/tomoyo/tomoyo.c:149 security_path_unlink+0xd7/0x150 security/security.c:1159 do_unlinkat+0x360/0x650 fs/namei.c:4214 __do_sys_unlink fs/namei.c:4266 [inline] __se_sys_unlink fs/namei.c:4264 [inline] __x64_sys_unlink+0xc6/0x110 fs/namei.c:4264 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae 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_trace+0x258/0x4a0 mm/slab.c:3565 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] kobject_uevent_env+0x235/0x1600 lib/kobject_uevent.c:524 nfs_netns_sysfs_destroy+0x48/0xa0 fs/nfs/sysfs.c:187 nfs_clients_exit+0x144/0x5e0 fs/nfs/client.c:1151 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:168 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:597 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 Memory state around the buggy address: ffff88802a8e7300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802a8e7380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802a8e7400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802a8e7480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802a8e7500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 4c 89 ea mov %r13,%rdx 3: 48 89 ee mov %rbp,%rsi 6: 4c 89 e7 mov %r12,%rdi 9: e8 f6 f8 ff ff callq 0xfffff904 e: 48 85 db test %rbx,%rbx 11: 0f 85 a6 00 00 00 jne 0xbd 17: 9c pushfq 18: 58 pop %rax 19: f6 c4 02 test $0x2,%ah 1c: 0f 85 72 01 00 00 jne 0x194 22: 48 85 db test %rbx,%rbx 25: 74 01 je 0x28 27: fb sti 28: 5b pop %rbx * 29: 5d pop %rbp <-- trapping instruction 2a: 41 5c pop %r12 2c: 41 5d pop %r13 2e: c3 retq 2f: 65 8b 05 96 be 43 7e mov %gs:0x7e43be96(%rip),%eax # 0x7e43becc 36: 83 f8 07 cmp $0x7,%eax 39: 0f 87 5f 01 00 00 ja 0x19e