================================================================== 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 ffff888021f385a8 by task syz-executor.1/5098 CPU: 1 PID: 5098 Comm: syz-executor.1 Not tainted 5.17.0-rc4-syzkaller-00217-g7993e65fdd0f #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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:664 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:prefetchw arch/x86/include/asm/processor.h:741 [inline] RIP: 0010:slab_alloc mm/slab.c:3311 [inline] RIP: 0010:kmem_cache_alloc+0x195/0x560 mm/slab.c:3499 Code: 0f 84 a2 01 00 00 4d 85 f6 4c 89 7c 24 08 0f 85 39 02 00 00 9c 58 f6 c4 02 0f 85 b1 02 00 00 4d 85 f6 74 01 fb 48 8b 74 24 08 <0f> 18 0e 0f 1f 44 00 00 48 83 7b 50 00 0f 84 8e 00 00 00 44 23 25 RSP: 0018:ffffc900223cf7b0 EFLAGS: 00000206 RAX: 0000000000000006 RBX: ffff888011842d00 RCX: 1ffffffff2000aae RDX: 0000000000000000 RSI: ffff8880623ba950 RDI: 0000000000000000 RBP: ffff888024d71580 R08: 0000000000000001 R09: ffffffff8ffc69e7 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000408d40 R13: 0000000000408d40 R14: 0000000000000200 R15: ffff8880623ba950 kmem_cache_zalloc include/linux/slab.h:705 [inline] alloc_buffer_head+0x20/0x140 fs/buffer.c:3310 alloc_page_buffers+0x26f/0x5f0 fs/buffer.c:832 create_empty_buffers+0x2c/0x800 fs/buffer.c:1560 ext4_block_write_begin+0xd1d/0x1140 fs/ext4/inode.c:1062 ext4_da_write_begin+0x3eb/0xad0 fs/ext4/inode.c:2949 generic_perform_write+0x205/0x510 mm/filemap.c:3765 ext4_buffered_write_iter+0x1a2/0x390 fs/ext4/file.c:268 ext4_file_write_iter+0x423/0x14d0 fs/ext4/file.c:677 call_write_iter include/linux/fs.h:2074 [inline] new_sync_write+0x431/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 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:0x7f662049a059 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f661ee0f168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f66205acf60 RCX: 00007f662049a059 RDX: 00000000fffffe5e RSI: 0000000020000080 RDI: 0000000000000003 RBP: 00007f66204f408d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd9ec9fabf R14: 00007f661ee0f300 R15: 0000000000022000 Allocated by task 30117: 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_track_caller+0x206/0x4d0 mm/slab.c:3709 kmemdup+0x23/0x50 mm/util.c:128 kmemdup include/linux/fortify-string.h:304 [inline] neigh_sysctl_register+0x9a/0x5e0 net/core/neighbour.c:3731 devinet_sysctl_register+0xb1/0x230 net/ipv4/devinet.c:2618 inetdev_init+0x286/0x580 net/ipv4/devinet.c:278 inetdev_event+0xa8a/0x15d0 net/ipv4/devinet.c:1532 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919 call_netdevice_notifiers_extack net/core/dev.c:1931 [inline] call_netdevice_notifiers net/core/dev.c:1945 [inline] register_netdevice+0x10df/0x1580 net/core/dev.c:9698 veth_newlink+0x59c/0xa90 drivers/net/veth.c:1725 __rtnl_newlink+0x107c/0x1760 net/core/rtnetlink.c:3483 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3531 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5596 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/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 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 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 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1368 __queue_work+0x5ca/0xf30 kernel/workqueue.c:1534 queue_work_on+0xee/0x110 kernel/workqueue.c:1562 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1570 [inline] release_tty+0x4e9/0x610 drivers/tty/tty_io.c:1606 tty_release_struct+0xb4/0xe0 drivers/tty/tty_io.c:1705 tty_release+0xc70/0x1200 drivers/tty/tty_io.c:1865 __fput+0x286/0x9f0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3026 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3106 netlink_release+0xf08/0x1db0 net/netlink/af_netlink.c:813 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1318 __fput+0x286/0x9f0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888021f38000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1448 bytes inside of 2048-byte region [ffff888021f38000, ffff888021f38800) The buggy address belongs to the page: page:ffffea000087ce00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x21f38 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00008baa48 ffffea00009b8988 ffff888010c40800 raw: 0000000000000000 ffff888021f38000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x3d2220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE), pid 29917, ts 2130784880946, free_ts 2130120063549 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] pskb_expand_head+0x15e/0x1060 net/core/skbuff.c:1699 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1299 netlink_broadcast+0x5b/0xd50 net/netlink/af_netlink.c:1495 nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x8f/0x280 net/netlink/af_netlink.c:2537 rtnl_notify net/core/rtnetlink.c:730 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3857 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3872 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3860 [inline] rtmsg_ifinfo+0xf0/0x120 net/core/rtnetlink.c:3878 __dev_notify_flags+0x226/0x2b0 net/core/dev.c:8173 rtnl_configure_link+0x16b/0x240 net/core/rtnetlink.c:3162 __rtnl_newlink+0x10ae/0x1760 net/core/rtnetlink.c:3491 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3531 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5596 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 __put_single_page mm/swap.c:99 [inline] __put_page+0x13d/0x1e0 mm/swap.c:130 folio_put include/linux/mm.h:1199 [inline] put_page include/linux/mm.h:1237 [inline] free_page_and_swap_cache+0x1f2/0x270 mm/swap_state.c:305 __tlb_remove_table arch/x86/include/asm/tlb.h:37 [inline] __tlb_remove_table_free mm/mmu_gather.c:102 [inline] tlb_remove_table_rcu+0x85/0xe0 mm/mmu_gather.c:157 rcu_do_batch kernel/rcu/tree.c:2527 [inline] rcu_core+0x7b1/0x1820 kernel/rcu/tree.c:2778 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 Memory state around the buggy address: ffff888021f38480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888021f38500: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc >ffff888021f38580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888021f38600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888021f38680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 0f 84 a2 01 00 00 je 0x1a8 6: 4d 85 f6 test %r14,%r14 9: 4c 89 7c 24 08 mov %r15,0x8(%rsp) e: 0f 85 39 02 00 00 jne 0x24d 14: 9c pushfq 15: 58 pop %rax 16: f6 c4 02 test $0x2,%ah 19: 0f 85 b1 02 00 00 jne 0x2d0 1f: 4d 85 f6 test %r14,%r14 22: 74 01 je 0x25 24: fb sti 25: 48 8b 74 24 08 mov 0x8(%rsp),%rsi * 2a: 0f 18 0e prefetcht0 (%rsi) <-- trapping instruction 2d: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 32: 48 83 7b 50 00 cmpq $0x0,0x50(%rbx) 37: 0f 84 8e 00 00 00 je 0xcb 3d: 44 rex.R 3e: 23 .byte 0x23 3f: 25 .byte 0x25