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:79 Read of size 8 at addr ffff88804bc8d018 by task aoe_tx0/1325 CPU: 3 PID: 1325 Comm: aoe_tx0 Not tainted 6.3.0-rc7-syzkaller-00060-g789b4a41c247 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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:319 print_report mm/kasan/report.c:430 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:536 tty_write_room+0x7a/0x90 drivers/tty/tty_ioctl.c:79 handle_tx+0x159/0x610 drivers/net/caif/caif_serial.c:226 __netdev_start_xmit include/linux/netdevice.h:4884 [inline] netdev_start_xmit include/linux/netdevice.h:4898 [inline] xmit_one net/core/dev.c:3581 [inline] dev_hard_start_xmit+0x187/0x700 net/core/dev.c:3597 __dev_queue_xmit+0x2ce4/0x3c40 net/core/dev.c:4247 dev_queue_xmit include/linux/netdevice.h:3054 [inline] tx+0x76/0x100 drivers/block/aoe/aoenet.c:63 kthread+0x1eb/0x3b0 drivers/block/aoe/aoecmd.c:1229 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 18167: 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:580 [inline] kzalloc include/linux/slab.h:720 [inline] alloc_tty_struct+0x98/0x8e0 drivers/tty/tty_io.c:3090 pty_common_install+0x1ab/0xb00 drivers/tty/pty.c:379 tty_driver_install_tty drivers/tty/tty_io.c:1303 [inline] tty_init_dev.part.0+0x9e/0x670 drivers/tty/tty_io.c:1415 tty_init_dev+0x5f/0x80 drivers/tty/tty_io.c:1405 ptmx_open drivers/tty/pty.c:824 [inline] ptmx_open+0x110/0x360 drivers/tty/pty.c:790 chrdev_open+0x26a/0x770 fs/char_dev.c:414 do_dentry_open+0x6cc/0x13f0 fs/open.c:920 do_open fs/namei.c:3560 [inline] path_openat+0x1baa/0x2750 fs/namei.c:3715 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x16d/0x4c0 fs/open.c:1348 do_sys_open fs/open.c:1364 [inline] __do_compat_sys_openat fs/open.c:1424 [inline] __se_compat_sys_openat fs/open.c:1422 [inline] __ia32_compat_sys_openat+0x143/0x1f0 fs/open.c:1422 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Freed by task 38: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/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:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3800 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 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+0xbc/0xd0 mm/kasan/generic.c:491 insert_work+0x48/0x350 kernel/workqueue.c:1361 __queue_work+0x625/0x1120 kernel/workqueue.c:1524 queue_work_on+0xf2/0x110 kernel/workqueue.c:1552 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1565 [inline] release_tty+0x4c7/0x600 drivers/tty/tty_io.c:1600 tty_release_struct+0xb8/0xf0 drivers/tty/tty_io.c:1700 tty_release+0xd9e/0x1380 drivers/tty/tty_io.c:1860 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 get_signal+0x1c7/0x25b0 kernel/signal.c:2635 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/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_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2622 in6_dev_finish_destroy+0x176/0x220 net/ipv6/addrconf_core.c:271 in6_dev_put include/net/addrconf.h:380 [inline] addrconf_ifdown.isra.0+0x15c0/0x1940 net/ipv6/addrconf.c:3911 addrconf_notify+0x106/0x19f0 net/ipv6/addrconf.c:3678 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1937 call_netdevice_notifiers_extack net/core/dev.c:1975 [inline] call_netdevice_notifiers net/core/dev.c:1989 [inline] unregister_netdevice_many_notify+0x75f/0x18c0 net/core/dev.c:10844 unregister_netdevice_many net/core/dev.c:10900 [inline] unregister_netdevice_queue+0x2e5/0x3c0 net/core/dev.c:10780 unregister_netdevice include/linux/netdevice.h:3078 [inline] ser_release+0x183/0x270 drivers/net/caif/caif_serial.c:310 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 process_scheduled_works kernel/workqueue.c:2453 [inline] worker_thread+0x858/0x1090 kernel/workqueue.c:2539 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88804bc8d000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 24 bytes inside of freed 2048-byte region [ffff88804bc8d000, ffff88804bc8d800) The buggy address belongs to the physical page: page:ffffea00012f2200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4bc88 head:ffffea00012f2200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888077a00e01 anon flags: 0x4fff00000010200(slab|head|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000010200 ffff888012450140 0000000000000000 0000000000000001 raw: 0000000000000000 0000000000080008 00000001ffffffff ffff888077a00e01 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 18065, tgid 18063 (syz-executor.3), ts 1615750499460, free_ts 1615719561597 prep_new_page mm/page_alloc.c:2553 [inline] get_page_from_freelist+0x1190/0x2e20 mm/page_alloc.c:4326 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:5592 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0x4e/0x190 mm/slab_common.c:980 kmalloc include/linux/slab.h:584 [inline] kzalloc include/linux/slab.h:720 [inline] __register_sysctl_table+0x117/0x1550 fs/proc/proc_sysctl.c:1343 __addrconf_sysctl_register+0x1db/0x3d0 net/ipv6/addrconf.c:7088 addrconf_sysctl_register net/ipv6/addrconf.c:7135 [inline] addrconf_sysctl_register+0x139/0x1d0 net/ipv6/addrconf.c:7124 ipv6_add_dev+0xa0d/0x13b0 net/ipv6/addrconf.c:450 addrconf_notify+0x63d/0x19f0 net/ipv6/addrconf.c:3552 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1937 call_netdevice_notifiers_extack net/core/dev.c:1975 [inline] call_netdevice_notifiers net/core/dev.c:1989 [inline] register_netdevice+0xfb4/0x1640 net/core/dev.c:10080 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1454 [inline] free_pcp_prepare+0x5d5/0xa50 mm/page_alloc.c:1504 free_unref_page_prepare mm/page_alloc.c:3388 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3483 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:769 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x17c/0x3b0 mm/slub.c:3476 getname_flags.part.0+0x50/0x4f0 fs/namei.c:140 getname_flags+0x9e/0xe0 include/linux/audit.h:321 getname fs/namei.c:219 [inline] __do_sys_mkdirat fs/namei.c:4076 [inline] __se_sys_mkdirat fs/namei.c:4074 [inline] __ia32_sys_mkdirat+0x78/0xb0 fs/namei.c:4074 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Memory state around the buggy address: ffff88804bc8cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804bc8cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88804bc8d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804bc8d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804bc8d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================