ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22 ================================================================== BUG: KASAN: use-after-free in update_tty_status drivers/net/caif/caif_serial.c:90 [inline] BUG: KASAN: use-after-free in handle_tx+0x5aa/0x610 drivers/net/caif/caif_serial.c:237 Read of size 1 at addr ffff888018ecf490 by task aoe_tx0/1486 CPU: 2 PID: 1486 Comm: aoe_tx0 Not tainted 5.15.0-rc6-syzkaller #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+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x2d6 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 update_tty_status drivers/net/caif/caif_serial.c:90 [inline] handle_tx+0x5aa/0x610 drivers/net/caif/caif_serial.c:237 __netdev_start_xmit include/linux/netdevice.h:4988 [inline] netdev_start_xmit include/linux/netdevice.h:5002 [inline] xmit_one net/core/dev.c:3576 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3592 __dev_queue_xmit+0x2a26/0x36e0 net/core/dev.c:4202 tx+0x68/0xb0 drivers/block/aoe/aoenet.c:63 kthread+0x1e7/0x3b0 drivers/block/aoe/aoecmd.c:1230 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 23355: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa1/0xd0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x1e4/0x480 mm/slab.c:3575 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] alloc_tty_struct+0x95/0x920 drivers/tty/tty_io.c:3122 tty_init_dev.part.0+0x20/0x610 drivers/tty/tty_io.c:1422 tty_init_dev include/linux/err.h:36 [inline] tty_open_by_driver drivers/tty/tty_io.c:2098 [inline] tty_open+0xb16/0x1000 drivers/tty/tty_io.c:2146 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4c8/0x11d0 fs/open.c:822 do_open fs/namei.c:3428 [inline] path_openat+0x1c9a/0x2740 fs/namei.c:3561 do_filp_open+0x1aa/0x400 fs/namei.c:3588 do_sys_openat2+0x16d/0x4d0 fs/open.c:1200 do_sys_open fs/open.c:1216 [inline] __do_sys_openat fs/open.c:1232 [inline] __se_sys_openat fs/open.c:1227 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1227 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 23433: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xd1/0x110 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] __cache_free mm/slab.c:3445 [inline] kfree+0x10a/0x2c0 mm/slab.c:3803 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xa7/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1353 __queue_work+0x5ca/0xee0 kernel/workqueue.c:1519 queue_work_on+0xee/0x110 kernel/workqueue.c:1546 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1581 [inline] release_tty+0x4e9/0x610 drivers/tty/tty_io.c:1618 tty_release_struct+0xb4/0xe0 drivers/tty/tty_io.c:1717 tty_release+0xc70/0x1200 drivers/tty/tty_io.c:1878 __fput+0x288/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xbae/0x2a30 kernel/exit.c:825 do_group_exit+0x125/0x310 kernel/exit.c:922 get_signal+0x47f/0x21d0 kernel/signal.c:2855 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865 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+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 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+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xa7/0xd0 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3552 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1647 unregister_sysctl_table fs/proc/proc_sysctl.c:1685 [inline] unregister_sysctl_table+0xc2/0x190 fs/proc/proc_sysctl.c:1660 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7045 [inline] addrconf_sysctl_unregister+0xee/0x1c0 net/ipv6/addrconf.c:7073 addrconf_ifdown.isra.0+0xfc2/0x1630 net/ipv6/addrconf.c:3865 addrconf_notify+0xeb/0x1bb0 net/ipv6/addrconf.c:3646 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] unregister_netdevice_many+0x951/0x1790 net/core/dev.c:11043 default_device_exit_batch+0x2fa/0x3c0 net/core/dev.c:11573 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:591 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888018ecf000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1168 bytes inside of 2048-byte region [ffff888018ecf000, ffff888018ecf800) The buggy address belongs to the page: page:ffffea000063b3c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x18ecf flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00009bc608 ffffea00005277c8 ffff888010c40800 raw: 0000000000000000 ffff888018ecf000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 27960, ts 1876649939345, free_ts 1820720640047 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4153 __alloc_pages_slowpath.constprop.0+0x2e6/0x21b0 mm/page_alloc.c:4924 __alloc_pages+0x412/0x500 mm/page_alloc.c:5388 __alloc_pages_node include/linux/gfp.h:570 [inline] kmem_getpages mm/slab.c:1377 [inline] cache_grow_begin+0x75/0x460 mm/slab.c:2593 cache_alloc_refill+0x27f/0x380 mm/slab.c:2965 ____cache_alloc mm/slab.c:3048 [inline] ____cache_alloc mm/slab.c:3031 [inline] slab_alloc_node mm/slab.c:3249 [inline] kmem_cache_alloc_node_trace+0x4ca/0x5d0 mm/slab.c:3617 __do_kmalloc_node mm/slab.c:3639 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3654 kmalloc_reserve net/core/skbuff.c:355 [inline] pskb_expand_head+0x15e/0x1060 net/core/skbuff.c:1700 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1301 netlink_broadcast_filtered+0x65/0xdc0 net/netlink/af_netlink.c:1506 netlink_broadcast net/netlink/af_netlink.c:1551 [inline] nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x94/0x290 net/netlink/af_netlink.c:2553 rtnl_notify net/core/rtnetlink.c:730 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3833 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3848 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3836 [inline] rtmsg_ifinfo+0xf0/0x120 net/core/rtnetlink.c:3854 register_netdevice+0x11d2/0x1500 net/core/dev.c:10344 register_netdev+0x2d/0x50 net/core/dev.c:10423 ip6gre_init_net+0x3cd/0x630 net/ipv6/ip6_gre.c:1607 ops_init+0xaf/0x470 net/core/net_namespace.c:140 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3394 slab_destroy mm/slab.c:1627 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1647 drain_array+0x93/0xa0 mm/slab.c:3981 cache_reap+0x188/0x290 mm/slab.c:4030 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff888018ecf380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888018ecf400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888018ecf480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888018ecf500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888018ecf580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================