================================================================== BUG: KASAN: use-after-free in handle_tx+0x200/0x630 drivers/net/caif/caif_serial.c:236 Read of size 8 at addr ffff888037ea3018 by task aoe_tx0/1230 CPU: 0 PID: 1230 Comm: aoe_tx0 Not tainted 5.16.0-rc8-syzkaller #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+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x65/0x380 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:450 handle_tx+0x200/0x630 drivers/net/caif/caif_serial.c:236 __netdev_start_xmit include/linux/netdevice.h:4994 [inline] netdev_start_xmit include/linux/netdevice.h:5008 [inline] xmit_one net/core/dev.c:3590 [inline] dev_hard_start_xmit+0x20b/0x450 net/core/dev.c:3606 __dev_queue_xmit+0x1adc/0x35c0 net/core/dev.c:4229 tx+0x6f/0x110 drivers/block/aoe/aoenet.c:63 kthread+0x241/0x450 drivers/block/aoe/aoecmd.c:1230 kthread+0x468/0x490 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 Allocated by task 13747: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:269 [inline] kmem_cache_alloc_trace+0x9d/0x330 mm/slub.c:3261 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] alloc_tty_struct+0xa5/0x7b0 drivers/tty/tty_io.c:3122 tty_init_dev+0x56/0x4c0 drivers/tty/tty_io.c:1422 tty_open_by_driver drivers/tty/tty_io.c:2098 [inline] tty_open+0x89a/0xdd0 drivers/tty/tty_io.c:2146 chrdev_open+0x5fb/0x680 fs/char_dev.c:414 do_dentry_open+0x78b/0x1020 fs/open.c:822 do_open fs/namei.c:3426 [inline] path_openat+0x2896/0x3660 fs/namei.c:3559 do_filp_open+0x277/0x4f0 fs/namei.c:3586 do_sys_openat2+0x13b/0x500 fs/open.c:1212 do_sys_open fs/open.c:1228 [inline] __do_sys_openat fs/open.c:1244 [inline] __se_sys_openat fs/open.c:1239 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1239 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 7997: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x10d/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1749 slab_free mm/slub.c:3513 [inline] kfree+0xe1/0x330 mm/slub.c:4561 process_one_work+0x853/0x1140 kernel/workqueue.c:2298 worker_thread+0xac1/0x1320 kernel/workqueue.c:2445 kthread+0x468/0x490 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xfa/0x130 mm/kasan/generic.c:348 insert_work+0x54/0x400 kernel/workqueue.c:1354 __queue_work+0x928/0xc60 kernel/workqueue.c:1520 queue_work_on+0x12b/0x220 kernel/workqueue.c:1547 tty_release_struct+0xb8/0xd0 drivers/tty/tty_io.c:1717 tty_release+0xc5f/0xef0 drivers/tty/tty_io.c:1878 __fput+0x3fc/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0x705/0x2340 kernel/exit.c:832 do_group_exit+0x168/0x2d0 kernel/exit.c:929 get_signal+0x1740/0x2120 kernel/signal.c:2852 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xfa/0x130 mm/kasan/generic.c:348 kvfree_call_rcu+0x119/0x880 kernel/rcu/tree.c:3550 drop_sysctl_table+0x2cd/0x400 fs/proc/proc_sysctl.c:1647 unregister_sysctl_table+0x86/0x130 fs/proc/proc_sysctl.c:1685 __devinet_sysctl_unregister net/ipv4/devinet.c:2604 [inline] devinet_exit_net+0x1a9/0x230 net/ipv4/devinet.c:2745 ops_exit_list net/core/net_namespace.c:168 [inline] cleanup_net+0x758/0xc50 net/core/net_namespace.c:593 process_one_work+0x853/0x1140 kernel/workqueue.c:2298 worker_thread+0xac1/0x1320 kernel/workqueue.c:2445 kthread+0x468/0x490 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff888037ea3000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 24 bytes inside of 2048-byte region [ffff888037ea3000, ffff888037ea3800) The buggy address belongs to the page: page:ffffea0000dfa800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x37ea0 head:ffffea0000dfa800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888011442000 raw: 0000000000000000 0000000000080008 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3630, ts 162019398561, free_ts 0 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4149 __alloc_pages+0x255/0x580 mm/page_alloc.c:5369 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab+0xcc/0x540 mm/slub.c:1930 new_slab mm/slub.c:1993 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:3022 __slab_alloc mm/slub.c:3109 [inline] slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] kmem_cache_alloc_trace+0x28c/0x330 mm/slub.c:3259 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] ipv6_add_dev+0xc4/0x1190 net/ipv6/addrconf.c:385 addrconf_notify+0x6a3/0x2130 net/ipv6/addrconf.c:3510 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2002 [inline] call_netdevice_notifiers_extack net/core/dev.c:2014 [inline] call_netdevice_notifiers net/core/dev.c:2028 [inline] register_netdevice+0x15fd/0x1c00 net/core/dev.c:10367 veth_newlink+0x923/0xf80 drivers/net/veth.c:1730 __rtnl_newlink net/core/rtnetlink.c:3458 [inline] rtnl_newlink+0x14b3/0x1d10 net/core/rtnetlink.c:3506 rtnetlink_rcv_msg+0x934/0xe60 net/core/rtnetlink.c:5571 netlink_rcv_skb+0x200/0x470 net/netlink/af_netlink.c:2496 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x814/0x9f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0xaea/0xe60 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] __sys_sendto+0x42e/0x5b0 net/socket.c:2036 page_owner free stack trace missing Memory state around the buggy address: ffff888037ea2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888037ea2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888037ea3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888037ea3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888037ea3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================