ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22 ================================================================== BUG: KASAN: slab-use-after-free in tty_write_room+0x7a/0x90 drivers/tty/tty_ioctl.c:80 Read of size 8 at addr ffff88808c0d5018 by task aoe_tx0/1233 CPU: 1 PID: 1233 Comm: aoe_tx0 Not tainted 6.4.0-rc7-next-20230626-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:364 print_report mm/kasan/report.c:475 [inline] kasan_report+0x11d/0x130 mm/kasan/report.c:588 tty_write_room+0x7a/0x90 drivers/tty/tty_ioctl.c:80 handle_tx+0x159/0x610 drivers/net/caif/caif_serial.c:226 __netdev_start_xmit include/linux/netdevice.h:4910 [inline] netdev_start_xmit include/linux/netdevice.h:4924 [inline] xmit_one net/core/dev.c:3537 [inline] dev_hard_start_xmit+0x187/0x700 net/core/dev.c:3553 __dev_queue_xmit+0x2be2/0x3b10 net/core/dev.c:4203 dev_queue_xmit include/linux/netdevice.h:3088 [inline] tx+0x76/0x100 drivers/block/aoe/aoenet.c:63 kthread+0x1eb/0x3b0 drivers/block/aoe/aoecmd.c:1229 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 3979: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:579 [inline] kzalloc include/linux/slab.h:700 [inline] alloc_tty_struct+0x98/0x8e0 drivers/tty/tty_io.c:3099 tty_init_dev.part.0+0x20/0x670 drivers/tty/tty_io.c:1417 tty_init_dev+0x5f/0x80 drivers/tty/tty_io.c:1414 ptmx_open drivers/tty/pty.c:824 [inline] ptmx_open+0x107/0x350 drivers/tty/pty.c:790 chrdev_open+0x273/0x780 fs/char_dev.c:414 do_dentry_open+0x6ce/0x17b0 fs/open.c:914 do_open fs/namei.c:3636 [inline] path_openat+0x1b65/0x2710 fs/namei.c:3793 do_filp_open+0x1ba/0x410 fs/namei.c:3820 do_sys_openat2+0x160/0x1c0 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_sys_openat fs/open.c:1438 [inline] __se_sys_openat fs/open.c:1433 [inline] __x64_sys_openat+0x143/0x1f0 fs/open.c:1433 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5117: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0xb8/0x2d0 mm/slub.c:3814 process_one_work+0xa34/0x16f0 kernel/workqueue.c:2597 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2748 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb9/0xd0 mm/kasan/generic.c:491 insert_work+0x48/0x360 kernel/workqueue.c:1553 __queue_work+0x625/0x1120 kernel/workqueue.c:1714 queue_work_on+0xf2/0x110 kernel/workqueue.c:1744 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1574 [inline] release_tty+0x4d9/0x600 drivers/tty/tty_io.c:1610 tty_release_struct+0xb8/0xf0 drivers/tty/tty_io.c:1709 tty_release+0xd9e/0x1380 drivers/tty/tty_io.c:1869 __fput+0x40c/0xad0 fs/file_table.c:378 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb9/0xd0 mm/kasan/generic.c:491 insert_work+0x48/0x360 kernel/workqueue.c:1553 __queue_work+0x625/0x1120 kernel/workqueue.c:1714 queue_work_on+0xf2/0x110 kernel/workqueue.c:1744 __bpf_prog_release net/core/filter.c:1172 [inline] __bpf_prog_release net/core/filter.c:1166 [inline] __sk_filter_release net/core/filter.c:1178 [inline] sk_filter_release_rcu+0xe2/0x130 net/core/filter.c:1190 rcu_do_batch kernel/rcu/tree.c:2135 [inline] rcu_core+0x802/0x1c10 kernel/rcu/tree.c:2399 __do_softirq+0x1d4/0x905 kernel/softirq.c:553 The buggy address belongs to the object at ffff88808c0d5000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 24 bytes inside of freed 2048-byte region [ffff88808c0d5000, ffff88808c0d5800) The buggy address belongs to the physical page: page:ffffea0002303400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8c0d0 head:ffffea0002303400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888018aa8f81 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff88801284f3c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000080008 00000001ffffffff ffff888018aa8f81 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 5664, tgid 5654 (syz-executor.4), ts 283447863890, free_ts 283340644121 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0xfd9/0x2c40 mm/page_alloc.c:3257 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4513 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x25f/0x390 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0xbc3/0x15d0 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x143/0x350 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc_node_track_caller+0x4f/0x1a0 mm/slab_common.c:1005 kmemdup+0x2c/0x60 mm/util.c:131 kmemdup include/linux/fortify-string.h:765 [inline] neigh_sysctl_register+0x9f/0x6c0 net/core/neighbour.c:3783 devinet_sysctl_register+0xb1/0x230 net/ipv4/devinet.c:2627 inetdev_init+0x286/0x580 net/ipv4/devinet.c:286 inetdev_event+0xf92/0x1850 net/ipv4/devinet.c:1538 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1962 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2384 free_unref_page+0x33/0x370 mm/page_alloc.c:2479 __unfreeze_partials+0x1fe/0x220 mm/slub.c:2647 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x195/0x220 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3470 [inline] slab_alloc mm/slub.c:3478 [inline] __kmem_cache_alloc_lru mm/slub.c:3485 [inline] kmem_cache_alloc+0x16c/0x380 mm/slub.c:3494 getname_flags.part.0+0x50/0x4f0 fs/namei.c:140 getname_flags+0x9e/0xe0 include/linux/audit.h:319 getname fs/namei.c:219 [inline] __do_sys_rename fs/namei.c:5056 [inline] __se_sys_rename fs/namei.c:5054 [inline] __x64_sys_rename+0x5a/0xa0 fs/namei.c:5054 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88808c0d4f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808c0d4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808c0d5000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808c0d5080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808c0d5100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================