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 ffff88807a88d018 by task aoe_tx0/1237 CPU: 0 PID: 1237 Comm: aoe_tx0 Not tainted 6.0.0-rc2-syzkaller-00159-g4c612826bec1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 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:4819 [inline] netdev_start_xmit include/linux/netdevice.h:4833 [inline] xmit_one net/core/dev.c:3590 [inline] dev_hard_start_xmit+0x183/0x880 net/core/dev.c:3606 __dev_queue_xmit+0x2c31/0x3ad0 net/core/dev.c:4256 dev_queue_xmit include/linux/netdevice.h:3008 [inline] tx+0x6a/0xc0 drivers/block/aoe/aoenet.c:63 kthread+0x1e7/0x3b0 drivers/block/aoe/aoecmd.c:1229 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 24035: 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:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:525 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace+0x25a/0x460 mm/slab.c:3559 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [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+0xb07/0xff0 drivers/tty/tty_io.c:2133 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4a4/0x13a0 fs/open.c:878 do_open fs/namei.c:3557 [inline] path_openat+0x1c92/0x28f0 fs/namei.c:3691 do_filp_open+0x1b6/0x400 fs/namei.c:3718 do_sys_openat2+0x16d/0x4c0 fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_sys_openat fs/open.c:1343 [inline] __se_sys_openat fs/open.c:1338 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1338 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+0x63/0xcd Freed by task 29442: 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:367 [inline] ____kasan_slab_free+0x13d/0x1a0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3418 [inline] kfree+0x173/0x390 mm/slab.c:3786 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x625/0x1210 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+0x277/0x9d0 fs/file_table.c:320 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad5/0x29b0 kernel/exit.c:795 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:934 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+0x63/0xcd The buggy address belongs to the object at ffff88807a88d000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 24 bytes inside of 2048-byte region [ffff88807a88d000, ffff88807a88d800) The buggy address belongs to the physical page: page:ffffea0001ea2340 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a88d memcg:ffff8880379d3801 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000c557c8 ffffea0000ba9fc8 ffff888011843c00 raw: 0000000000000000 ffff88807a88d000 0000000100000001 ffff8880379d3801 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 3640, tgid 3640 (syz-executor.4), ts 1444712574170, free_ts 1444712490218 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515 __alloc_pages_node include/linux/gfp.h:243 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] slab_alloc_node mm/slab.c:3220 [inline] kmem_cache_alloc_node_trace+0x50a/0x570 mm/slab.c:3601 __do_kmalloc_node mm/slab.c:3623 [inline] __kmalloc_node+0x38/0x60 mm/slab.c:3631 kmalloc_node include/linux/slab.h:623 [inline] kvmalloc_node+0x3e/0x190 mm/util.c:613 kvmalloc include/linux/slab.h:750 [inline] xt_alloc_table_info+0x3c/0xa0 net/netfilter/x_tables.c:1192 do_replace net/ipv6/netfilter/ip6_tables.c:1142 [inline] do_ip6t_set_ctl+0x500/0xb90 net/ipv6/netfilter/ip6_tables.c:1639 nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x122/0x180 net/ipv6/ipv6_sockglue.c:1026 tcp_setsockopt+0x136/0x2520 net/ipv4/tcp.c:3789 __sys_setsockopt+0x2d6/0x690 net/socket.c:2252 __do_sys_setsockopt net/socket.c:2263 [inline] __se_sys_setsockopt net/socket.c:2260 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2260 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+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 __vunmap+0x85d/0xd30 mm/vmalloc.c:2696 __vfree+0x3c/0xd0 mm/vmalloc.c:2744 vfree+0x5a/0x90 mm/vmalloc.c:2775 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:884 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1041 [inline] do_ip6t_get_ctl+0x82f/0xa10 net/ipv6/netfilter/ip6_tables.c:1672 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1be/0x270 net/ipv6/ipv6_sockglue.c:1504 tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:4388 __sys_getsockopt+0x216/0x690 net/socket.c:2296 __do_sys_getsockopt net/socket.c:2311 [inline] __se_sys_getsockopt net/socket.c:2308 [inline] __x64_sys_getsockopt+0xba/0x150 net/socket.c:2308 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+0x63/0xcd Memory state around the buggy address: ffff88807a88cf00: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff88807a88cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807a88d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807a88d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807a88d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================