ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22 ================================================================== BUG: KASAN: slab-use-after-free in handle_tx+0x5e0/0x620 drivers/net/caif/caif_serial.c:222 Read of size 8 at addr ffff88801b75d020 by task aoe_tx0/1415 CPU: 3 UID: 0 PID: 1415 Comm: aoe_tx0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x156/0x4c9 mm/kasan/report.c:482 kasan_report+0xdf/0x1a0 mm/kasan/report.c:595 handle_tx+0x5e0/0x620 drivers/net/caif/caif_serial.c:222 __netdev_start_xmit include/linux/netdevice.h:5273 [inline] netdev_start_xmit include/linux/netdevice.h:5282 [inline] xmit_one net/core/dev.c:3866 [inline] dev_hard_start_xmit+0x127/0x6c0 net/core/dev.c:3882 __dev_queue_xmit+0x6dd/0x46f0 net/core/dev.c:4832 dev_queue_xmit include/linux/netdevice.h:3381 [inline] tx+0xc4/0x130 drivers/block/aoe/aoenet.c:62 kthread+0x1d8/0x3c0 drivers/block/aoe/aoecmd.c:1241 kthread+0x3b3/0x730 kernel/kthread.c:463 ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Allocated by task 6646: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] alloc_tty_struct+0x96/0x8c0 drivers/tty/tty_io.c:3102 tty_init_dev.part.0+0x20/0x470 drivers/tty/tty_io.c:1400 tty_init_dev include/linux/err.h:78 [inline] tty_open_by_driver drivers/tty/tty_io.c:2073 [inline] tty_open+0xa63/0xfa0 drivers/tty/tty_io.c:2120 chrdev_open+0x234/0x6a0 fs/char_dev.c:411 do_dentry_open+0x6d8/0x1660 fs/open.c:962 vfs_open+0x82/0x3f0 fs/open.c:1094 do_open fs/namei.c:4636 [inline] path_openat+0x208c/0x31a0 fs/namei.c:4795 do_filp_open+0x1f7/0x420 fs/namei.c:4822 do_sys_openat2+0x12e/0x220 fs/open.c:1391 do_sys_open fs/open.c:1397 [inline] __do_compat_sys_openat fs/open.c:1459 [inline] __se_compat_sys_openat fs/open.c:1457 [inline] __ia32_compat_sys_openat+0x12d/0x210 fs/open.c:1457 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xde/0x660 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 6020: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6674 [inline] kfree+0x1c7/0x690 mm/slub.c:6886 process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x5da/0xe40 kernel/workqueue.c:3421 kthread+0x3b3/0x730 kernel/kthread.c:463 ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Last potentially related work creation: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 insert_work+0x36/0x230 kernel/workqueue.c:2180 __queue_work+0x96f/0x10f0 kernel/workqueue.c:2335 queue_work_on+0x180/0x1e0 kernel/workqueue.c:2386 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1557 [inline] tty_kref_put drivers/tty/tty_io.c:1554 [inline] release_tty+0x4f3/0x5f0 drivers/tty/tty_io.c:1593 tty_release_struct+0xb7/0xe0 drivers/tty/tty_io.c:1692 tty_release+0xd7a/0x1300 drivers/tty/tty_io.c:1852 __fput+0x3ff/0xb40 fs/file_table.c:469 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:44 [inline] exit_to_user_mode_loop+0x100/0x4b0 kernel/entry/common.c:75 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline] __do_fast_syscall_32+0x4b6/0x660 arch/x86/entry/syscall_32.c:310 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88801b75d000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 32 bytes inside of freed 2048-byte region [ffff88801b75d000, ffff88801b75d800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88801b75c000 pfn:0x1b758 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888023988f01 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b84c140 ffffea00008a0e10 ffffea00009fd810 raw: ffff88801b75c000 0000000000080004 00000000f5000000 ffff888023988f01 head: 00fff00000000240 ffff88801b84c140 ffffea00008a0e10 ffffea00009fd810 head: ffff88801b75c000 0000000000080004 00000000f5000000 ffff888023988f01 head: 00fff00000000003 ffffea00006dd601 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 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 6068, tgid 6067 (syz.0.19), ts 58496254791, free_ts 58341204401 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0xe3d/0x2e10 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c4/0x440 mm/slub.c:3302 ___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656 __slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __kmalloc_cache_noprof+0x531/0x810 mm/slub.c:5775 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] bpf_prog_alloc_no_stats+0x15f/0x5f0 kernel/bpf/core.c:110 bpf_prog_alloc+0x3b/0x200 kernel/bpf/core.c:153 bpf_prog_load+0x494/0x2bd0 kernel/bpf/syscall.c:2992 __sys_bpf+0x118f/0x5050 kernel/bpf/syscall.c:6164 __do_sys_bpf kernel/bpf/syscall.c:6274 [inline] __se_sys_bpf kernel/bpf/syscall.c:6272 [inline] __ia32_sys_bpf+0x79/0xf0 kernel/bpf/syscall.c:6272 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xde/0x660 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e page last free pid 6002 tgid 6002 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0x822/0x1130 mm/page_alloc.c:2973 __folio_put+0x3b4/0x540 mm/swap.c:112 folio_put include/linux/mm.h:1616 [inline] put_page include/linux/mm.h:1685 [inline] put_netmem+0x294/0x320 net/core/skbuff.c:7420 skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_release_data+0x4b2/0x700 net/core/skbuff.c:1101 skb_release_all net/core/skbuff.c:1182 [inline] __kfree_skb net/core/skbuff.c:1196 [inline] napi_consume_skb+0x2be/0x320 net/core/skbuff.c:1514 skb_defer_free_flush+0x1f1/0x290 net/core/dev.c:6809 net_rx_action+0x3ca/0xf20 net/core/dev.c:7877 handle_softirqs+0x1ea/0x910 kernel/softirq.c:622 do_softirq kernel/softirq.c:523 [inline] do_softirq+0xac/0xe0 kernel/softirq.c:510 __local_bh_enable_ip+0xf8/0x120 kernel/softirq.c:450 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:907 [inline] __dev_queue_xmit+0x7f1/0x46f0 net/core/dev.c:4859 dev_queue_xmit include/linux/netdevice.h:3381 [inline] neigh_hh_output include/net/neighbour.h:540 [inline] neigh_output include/net/neighbour.h:554 [inline] ip6_finish_output2+0x1184/0x1cd0 net/ipv6/ip6_output.c:136 __ip6_finish_output+0x3cd/0x10d0 net/ipv6/ip6_output.c:209 ip6_finish_output net/ipv6/ip6_output.c:220 [inline] NF_HOOK_COND include/linux/netfilter.h:307 [inline] ip6_output+0x2aa/0xa60 net/ipv6/ip6_output.c:247 dst_output include/net/dst.h:464 [inline] NF_HOOK include/linux/netfilter.h:318 [inline] NF_HOOK.constprop.0+0x114/0x8b0 include/linux/netfilter.h:312 mld_sendpack+0x8f7/0xec0 net/ipv6/mcast.c:1855 Memory state around the buggy address: ffff88801b75cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801b75cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801b75d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801b75d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801b75d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================