================================================================== BUG: KASAN: slab-out-of-bounds in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:664 Read of size 8 at addr ffff88804075f0a8 by task kworker/u4:5/1031 CPU: 1 PID: 1031 Comm: kworker/u4:5 Not tainted 5.17.0-rc5-syzkaller-00306-g2293be58d6a1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net 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:lock_is_held_type+0xff/0x140 kernel/locking/lockdep.c:5687 Code: 00 00 b8 ff ff ff ff 65 0f c1 05 9c 99 b6 76 83 f8 01 75 29 9c 58 f6 c4 02 75 3d 48 f7 04 24 00 02 00 00 74 01 fb 48 83 c4 08 <44> 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 ed eb b9 0f 0b 48 RSP: 0018:ffffc90004cc7ae8 EFLAGS: 00000286 RAX: 0000000000000046 RBX: 0000000000000003 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffffff8bb84580 R08: 000000000007ffff R09: 0000000000000000 R10: ffffffff87b185b7 R11: 0000000000000000 R12: ffff88801c578000 R13: 0000000000000000 R14: 00000000ffffffff R15: ffff88801c578ab0 lock_is_held include/linux/lockdep.h:283 [inline] __might_resched+0x21/0x2c0 kernel/sched/core.c:9547 inet_twsk_purge+0xe8/0x7d0 net/ipv4/inet_timewait_sock.c:267 ops_exit_list+0x125/0x170 net/core/net_namespace.c:173 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 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 26294: 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+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] ipv4_sysctl_init_net+0x164/0x370 net/ipv4/sysctl_net_ipv4.c:1422 ops_init+0xaf/0x470 net/core/net_namespace.c:140 setup_net+0x554/0xbb0 net/core/net_namespace.c:330 copy_net_ns+0x318/0x760 net/core/net_namespace.c:474 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3058 __do_sys_unshare kernel/fork.c:3129 [inline] __se_sys_unshare kernel/fork.c:3127 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3127 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 24010: 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+0x126/0x160 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kfree+0xd0/0x390 mm/slub.c:4562 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 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88804075c000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4264 bytes to the right of 8192-byte region [ffff88804075c000, ffff88804075e000) The buggy address belongs to the page: page:ffffea000101d600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x40758 head:ffffea000101d600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001376e00 dead000000000002 ffff888010c42280 raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 23912, ts 591013159135, free_ts 587328363567 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] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc_trace+0x2f8/0x3d0 mm/slub.c:3255 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] cryptomgr_schedule_probe crypto/algboss.c:85 [inline] cryptomgr_notify+0xc9/0xbe0 crypto/algboss.c:238 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 blocking_notifier_call_chain kernel/notifier.c:319 [inline] blocking_notifier_call_chain+0x67/0x90 kernel/notifier.c:307 crypto_probing_notify crypto/api.c:294 [inline] crypto_probing_notify crypto/api.c:287 [inline] crypto_alg_mod_lookup+0x3a0/0x4d0 crypto/api.c:321 crypto_type_has_alg+0x29/0x80 crypto/algapi.c:1044 xfrm_probe_algs net/xfrm/xfrm_algo.c:830 [inline] xfrm_probe_algs+0x168/0x400 net/xfrm/xfrm_algo.c:817 pfkey_register+0xe9/0x970 net/key/af_key.c:1700 pfkey_process+0x685/0x7e0 net/key/af_key.c:2837 pfkey_sendmsg+0x43c/0x830 net/key/af_key.c:3676 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_slab_alloc+0xa2/0xc0 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_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] __kmalloc+0x256/0x450 mm/slub.c:4420 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:714 [inline] tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45 tomoyo_encode2 security/tomoyo/realpath.c:31 [inline] tomoyo_encode+0x28/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x186/0x620 security/tomoyo/realpath.c:288 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x272/0x380 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:311 [inline] tomoyo_file_open+0xa3/0xd0 security/tomoyo/tomoyo.c:306 security_file_open+0x45/0xb0 security/security.c:1638 do_dentry_open+0x358/0x1250 fs/open.c:811 do_open fs/namei.c:3476 [inline] path_openat+0x1c9e/0x2940 fs/namei.c:3609 do_filp_open+0x1aa/0x400 fs/namei.c:3636 Memory state around the buggy address: ffff88804075ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804075f000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88804075f080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88804075f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804075f180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: b8 ff ff ff ff mov $0xffffffff,%eax 7: 65 0f c1 05 9c 99 b6 xadd %eax,%gs:0x76b6999c(%rip) # 0x76b699ab e: 76 f: 83 f8 01 cmp $0x1,%eax 12: 75 29 jne 0x3d 14: 9c pushfq 15: 58 pop %rax 16: f6 c4 02 test $0x2,%ah 19: 75 3d jne 0x58 1b: 48 f7 04 24 00 02 00 testq $0x200,(%rsp) 22: 00 23: 74 01 je 0x26 25: fb sti 26: 48 83 c4 08 add $0x8,%rsp * 2a: 44 89 e8 mov %r13d,%eax <-- trapping instruction 2d: 5b pop %rbx 2e: 5d pop %rbp 2f: 41 5c pop %r12 31: 41 5d pop %r13 33: 41 5e pop %r14 35: 41 5f pop %r15 37: c3 retq 38: 45 31 ed xor %r13d,%r13d 3b: eb b9 jmp 0xfffffff6 3d: 0f 0b ud2 3f: 48 rex.W