ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22 ================================================================== BUG: KASAN: use-after-free in tty_write_room+0x76/0x80 drivers/tty/tty_ioctl.c:78 Read of size 8 at addr ffff88807c62e018 by task aoe_tx0/1225 CPU: 0 PID: 1225 Comm: aoe_tx0 Not tainted 5.17.0-rc6-next-20220303-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+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 tty_write_room+0x76/0x80 drivers/tty/tty_ioctl.c:78 handle_tx+0x159/0x610 drivers/net/caif/caif_serial.c:226 __netdev_start_xmit include/linux/netdevice.h:4721 [inline] netdev_start_xmit include/linux/netdevice.h:4735 [inline] xmit_one net/core/dev.c:3493 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3509 __dev_queue_xmit+0x2aa8/0x38b0 net/core/dev.c:4136 tx+0x68/0xb0 drivers/block/aoe/aoenet.c:63 kthread+0x1e7/0x3b0 drivers/block/aoe/aoecmd.c:1229 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 26216: 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:584 [inline] kzalloc include/linux/slab.h:717 [inline] alloc_tty_struct+0x94/0x920 drivers/tty/tty_io.c:3091 tty_init_dev.part.0+0x20/0x610 drivers/tty/tty_io.c:1412 tty_init_dev include/linux/err.h:36 [inline] tty_open_by_driver drivers/tty/tty_io.c:2086 [inline] tty_open+0xb16/0x1000 drivers/tty/tty_io.c:2133 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4b9/0x1250 fs/open.c:957 do_open fs/namei.c:3476 [inline] path_openat+0x1c9e/0x2940 fs/namei.c:3609 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4d0 fs/open.c:1347 do_sys_open fs/open.c:1363 [inline] __do_sys_openat fs/open.c:1379 [inline] __se_sys_openat fs/open.c:1374 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1374 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 12242: 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+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3523 [inline] kfree+0xd6/0x4d0 mm/slub.c:4576 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x62e/0x1140 kernel/workqueue.c:1517 queue_work_on+0xee/0x110 kernel/workqueue.c:1545 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 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xafa/0x2a30 kernel/exit.c:792 do_group_exit+0xd2/0x2f0 kernel/exit.c:922 get_signal+0x4b0/0x28c0 kernel/signal.c:2863 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:149 [inline] exit_to_user_mode_loop kernel/entry/common.c:173 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301 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+0xbe/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x62e/0x1140 kernel/workqueue.c:1517 queue_work_on+0xee/0x110 kernel/workqueue.c:1545 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 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xafa/0x2a30 kernel/exit.c:792 do_group_exit+0xd2/0x2f0 kernel/exit.c:922 get_signal+0x4b0/0x28c0 kernel/signal.c:2863 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:149 [inline] exit_to_user_mode_loop kernel/entry/common.c:173 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301 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 ffff88807c62e000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 24 bytes inside of 2048-byte region [ffff88807c62e000, ffff88807c62e800) The buggy address belongs to the physical page: page:ffffea0001f18a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c628 head:ffffea0001f18a00 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff88807ccd8a81 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000cf8e00 dead000000000002 ffff888010c4c140 raw: 0000000000000000 0000000080080008 00000001ffffffff ffff88807ccd8a81 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 3622, tgid 3622 (syz-executor.0), ts 776094344570, free_ts 776049537505 prep_new_page mm/page_alloc.c:2438 [inline] get_page_from_freelist+0xa7f/0x3ec0 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5400 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2268 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8d0/0xf30 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] __kmalloc_node+0x2cb/0x390 mm/slub.c:4482 kmalloc_node include/linux/slab.h:607 [inline] kvmalloc_node+0x3e/0x100 mm/util.c:580 kvmalloc include/linux/slab.h:734 [inline] kvmalloc_array include/linux/slab.h:752 [inline] alloc_fdtable+0xee/0x2a0 fs/file.c:120 dup_fd+0x718/0xca0 fs/file.c:325 copy_files kernel/fork.c:1620 [inline] copy_process+0x23b8/0x6fe0 kernel/fork.c:2222 kernel_clone+0xe7/0xab0 kernel/fork.c:2636 __do_sys_clone+0xc8/0x110 kernel/fork.c:2753 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 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1353 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1403 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3420 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2536 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x6a/0x170 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:224 [inline] slab_post_alloc_hook mm/slab.h:749 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] __kmem_cache_alloc_lru mm/slub.c:3245 [inline] kmem_cache_alloc+0x204/0x3b0 mm/slub.c:3255 kmem_cache_zalloc include/linux/slab.h:707 [inline] __alloc_file+0x21/0x280 fs/file_table.c:138 alloc_empty_file+0x6d/0x170 fs/file_table.c:187 path_openat+0xe4/0x2940 fs/namei.c:3595 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4d0 fs/open.c:1347 do_sys_open fs/open.c:1363 [inline] __do_sys_openat fs/open.c:1379 [inline] __se_sys_openat fs/open.c:1374 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1374 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 Memory state around the buggy address: ffff88807c62df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807c62df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807c62e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807c62e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807c62e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================