================================================================== BUG: KASAN: slab-use-after-free in handle_tx+0x5a5/0x630 drivers/net/caif/caif_serial.c:222 Read of size 8 at addr ffff88802ab49020 by task aoe_tx0/1420 CPU: 1 UID: 0 PID: 1420 Comm: aoe_tx0 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 handle_tx+0x5a5/0x630 drivers/net/caif/caif_serial.c:222 __netdev_start_xmit include/linux/netdevice.h:5273 [inline] netdev_start_xmit include/linux/netdevice.h:5282 [inline] xmit_one net/core/dev.c:3853 [inline] dev_hard_start_xmit+0x97/0x6e0 net/core/dev.c:3869 __dev_queue_xmit+0x6d7/0x4650 net/core/dev.c:4817 dev_queue_xmit include/linux/netdevice.h:3381 [inline] tx+0xcc/0x190 drivers/block/aoe/aoenet.c:62 kthread+0x1e4/0x3e0 drivers/block/aoe/aoecmd.c:1241 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Allocated by task 6852: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:397 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:414 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] alloc_tty_struct+0x96/0x8c0 drivers/tty/tty_io.c:3102 tty_init_dev.part.0+0x1e/0x500 drivers/tty/tty_io.c:1400 tty_init_dev include/linux/err.h:78 [inline] tty_open_by_driver drivers/tty/tty_io.c:2073 [inline] tty_open+0xa4f/0xf90 drivers/tty/tty_io.c:2120 chrdev_open+0x234/0x6a0 fs/char_dev.c:414 do_dentry_open+0x748/0x1590 fs/open.c:962 vfs_open+0x82/0x3f0 fs/open.c:1094 do_open fs/namei.c:4628 [inline] path_openat+0x2078/0x3140 fs/namei.c:4787 do_filp_open+0x20b/0x470 fs/namei.c:4814 do_sys_openat2+0x121/0x290 fs/open.c:1430 do_sys_open fs/open.c:1436 [inline] __do_sys_openat fs/open.c:1452 [inline] __se_sys_openat fs/open.c:1447 [inline] __x64_sys_openat+0x174/0x210 fs/open.c:1447 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5998: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6668 [inline] kfree+0x2f8/0x6e0 mm/slub.c:6876 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 insert_work+0x36/0x230 kernel/workqueue.c:2180 __queue_work+0x94f/0x10e0 kernel/workqueue.c:2335 queue_work_on+0x1a4/0x1f0 kernel/workqueue.c:2386 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1557 [inline] tty_kref_put drivers/tty/tty_io.c:1554 [inline] release_tty+0x4de/0x5d0 drivers/tty/tty_io.c:1593 tty_release_struct+0xb7/0xe0 drivers/tty/tty_io.c:1692 tty_release+0xe2d/0x1470 drivers/tty/tty_io.c:1852 __fput+0x402/0xb70 fs/file_table.c:468 task_work_run+0x150/0x240 kernel/task_work.c:233 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x87f/0x2bd0 kernel/exit.c:971 do_group_exit+0xd3/0x2a0 kernel/exit.c:1112 get_signal+0x2671/0x26d0 kernel/signal.c:3034 arch_do_signal_or_restart+0x8f/0x7e0 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:41 [inline] exit_to_user_mode_loop+0x8c/0x540 kernel/entry/common.c:75 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline] do_syscall_64+0x4ee/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802ab49000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 32 bytes inside of freed 2048-byte region [ffff88802ab49000, ffff88802ab49800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2ab48 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888053b61f81 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b44c140 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000080008 00000000f5000000 ffff888053b61f81 head: 00fff00000000040 ffff88801b44c140 0000000000000000 dead000000000001 head: 0000000000000000 0000000000080008 00000000f5000000 ffff888053b61f81 head: 00fff00000000003 ffffea0000aad201 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5939, tgid 5939 (syz-executor), ts 54523499094, free_ts 54059374055 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1846 prep_new_page mm/page_alloc.c:1854 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c3/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4656 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_node_track_caller_noprof+0x4d6/0x930 mm/slub.c:5764 kmemdup_noprof+0x29/0x60 mm/util.c:138 kmemdup_noprof include/linux/fortify-string.h:765 [inline] __devinet_sysctl_register+0xbc/0x360 net/ipv4/devinet.c:2665 devinet_sysctl_register net/ipv4/devinet.c:2717 [inline] devinet_sysctl_register+0x17b/0x200 net/ipv4/devinet.c:2707 inetdev_init+0x2b8/0x580 net/ipv4/devinet.c:291 inetdev_event+0xc32/0x1870 net/ipv4/devinet.c:1590 notifier_call_chain+0xbc/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2230 call_netdevice_notifiers_extack net/core/dev.c:2268 [inline] call_netdevice_notifiers net/core/dev.c:2282 [inline] register_netdevice+0x1792/0x21d0 net/core/dev.c:11429 page last free pid 3329 tgid 3329 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943 __folio_put+0x329/0x450 mm/swap.c:112 folio_put include/linux/mm.h:1612 [inline] put_page include/linux/mm.h:1681 [inline] put_netmem net/core/skbuff.c:7417 [inline] skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_release_data+0x81a/0x9e0 net/core/skbuff.c:1101 skb_release_all net/core/skbuff.c:1182 [inline] __kfree_skb net/core/skbuff.c:1196 [inline] napi_consume_skb+0x2a0/0x300 net/core/skbuff.c:1513 skb_defer_free_flush+0x1ec/0x280 net/core/dev.c:6794 net_rx_action+0x39f/0xfa0 net/core/dev.c:7862 handle_softirqs+0x219/0x950 kernel/softirq.c:622 do_softirq kernel/softirq.c:523 [inline] do_softirq+0xb2/0xf0 kernel/softirq.c:510 __local_bh_enable_ip+0x100/0x120 kernel/softirq.c:450 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:936 [inline] __dev_queue_xmit+0x797/0x4650 net/core/dev.c:4844 dev_queue_xmit include/linux/netdevice.h:3381 [inline] neigh_resolve_output net/core/neighbour.c:1594 [inline] neigh_resolve_output+0x53a/0x940 net/core/neighbour.c:1574 neigh_output include/net/neighbour.h:556 [inline] ip6_finish_output2+0xad1/0x1cf0 net/ipv6/ip6_output.c:136 __ip6_finish_output+0x3cd/0x1010 net/ipv6/ip6_output.c:209 ip6_finish_output net/ipv6/ip6_output.c:220 [inline] NF_HOOK_COND include/linux/netfilter.h:307 [inline] ip6_output+0x253/0x710 net/ipv6/ip6_output.c:247 dst_output+0xa8/0x4b0 include/net/dst.h:464 NF_HOOK include/linux/netfilter.h:318 [inline] NF_HOOK include/linux/netfilter.h:312 [inline] mld_sendpack+0xa30/0xed0 net/ipv6/mcast.c:1855 Memory state around the buggy address: ffff88802ab48f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802ab48f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802ab49000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802ab49080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802ab49100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================