================================================================== BUG: KASAN: slab-use-after-free in handle_tx+0x5a5/0x630 drivers/net/caif/caif_serial.c:222 Read of size 8 at addr ffff888023352020 by task aoe_tx0/1417 CPU: 0 UID: 0 PID: 1417 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 10467: 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_compat_sys_openat fs/open.c:1498 [inline] __se_compat_sys_openat fs/open.c:1496 [inline] __ia32_compat_sys_openat+0x16d/0x210 fs/open.c:1496 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe8/0x680 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 6077: 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:6670 [inline] kfree+0x2f8/0x6e0 mm/slub.c:6878 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 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:44 [inline] exit_to_user_mode_loop+0xfb/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_fast_syscall_32+0x4a4/0x680 arch/x86/entry/syscall_32.c:310 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888023352000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 32 bytes inside of freed 2048-byte region [ffff888023352000, ffff888023352800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x23350 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8880294b6c81 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b44c140 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000080008 00000000f5000000 ffff8880294b6c81 head: 00fff00000000040 ffff88801b44c140 0000000000000000 dead000000000001 head: 0000000000000000 0000000000080008 00000000f5000000 ffff8880294b6c81 head: 00fff00000000003 ffffea00008cd401 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 5950, tgid 5950 (syz-executor), ts 53374065522, free_ts 51158468194 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 23 tgid 23 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+0x28b/0x300 net/core/skbuff.c:7417 skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_frag_unref include/linux/skbuff_ref.h:71 [inline] __pskb_trim_head+0x5c7/0x7b0 net/ipv4/tcp_output.c:1867 tcp_trim_head+0x85/0x5f0 net/ipv4/tcp_output.c:1894 tcp_tso_acked net/ipv4/tcp_input.c:3364 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3430 [inline] tcp_ack+0x1dad/0x6150 net/ipv4/tcp_input.c:4119 tcp_rcv_established+0x10b6/0x36e0 net/ipv4/tcp_input.c:6374 tcp_v4_do_rcv+0xc65/0x10a0 net/ipv4/tcp_ipv4.c:1881 tcp_v4_rcv+0x3077/0x4db0 net/ipv4/tcp_ipv4.c:2324 ip_protocol_deliver_rcu+0xba/0x4c0 net/ipv4/ip_input.c:207 ip_local_deliver_finish+0x3f2/0x720 net/ipv4/ip_input.c:241 NF_HOOK include/linux/netfilter.h:318 [inline] NF_HOOK include/linux/netfilter.h:312 [inline] ip_local_deliver+0x18e/0x1f0 net/ipv4/ip_input.c:262 dst_input include/net/dst.h:474 [inline] ip_sublist_rcv_finish+0x2ce/0x660 net/ipv4/ip_input.c:584 ip_list_rcv_finish+0x590/0x780 net/ipv4/ip_input.c:636 ip_sublist_rcv net/ipv4/ip_input.c:644 [inline] ip_list_rcv+0x335/0x450 net/ipv4/ip_input.c:678 __netif_receive_skb_list_ptype net/core/dev.c:6180 [inline] __netif_receive_skb_list_core+0x752/0x950 net/core/dev.c:6227 Memory state around the buggy address: ffff888023351f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888023351f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888023352000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888023352080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888023352100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================