================================================================== BUG: KASAN: use-after-free in decode_session6 net/xfrm/xfrm_policy.c:3376 [inline] BUG: KASAN: use-after-free in __xfrm_decode_session+0x1520/0x1d20 net/xfrm/xfrm_policy.c:3483 Read of size 1 at addr ffff0000d5e2290c by task kworker/u4:9/1863 CPU: 1 PID: 1863 Comm: kworker/u4:9 Not tainted 5.15.113-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Workqueue: phy7 ieee80211_iface_work Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x174/0x1e4 mm/kasan/report.c:451 __asan_report_load1_noabort+0x44/0x50 mm/kasan/report_generic.c:306 decode_session6 net/xfrm/xfrm_policy.c:3376 [inline] __xfrm_decode_session+0x1520/0x1d20 net/xfrm/xfrm_policy.c:3483 xfrm_decode_session include/net/xfrm.h:1155 [inline] xfrmi_xmit+0x1a0/0x12f8 net/xfrm/xfrm_interface.c:356 __netdev_start_xmit include/linux/netdevice.h:5019 [inline] netdev_start_xmit include/linux/netdevice.h:5033 [inline] xmit_one net/core/dev.c:3594 [inline] dev_hard_start_xmit+0x2bc/0x92c net/core/dev.c:3610 sch_direct_xmit+0x2e0/0x484 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x878/0x1fc0 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3879 [inline] __dev_queue_xmit+0x1068/0x2a6c net/core/dev.c:4190 dev_queue_xmit+0x24/0x34 net/core/dev.c:4258 neigh_connected_output+0x334/0x378 net/core/neighbour.c:1553 neigh_output include/net/neighbour.h:516 [inline] ip6_finish_output2+0x1344/0x1c48 net/ipv6/ip6_output.c:126 __ip6_finish_output+0x518/0x67c net/ipv6/ip6_output.c:191 ip6_finish_output+0x40/0x218 net/ipv6/ip6_output.c:201 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x270/0x594 net/ipv6/ip6_output.c:224 dst_output include/net/dst.h:449 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] ndisc_send_skb+0xbf8/0x1788 net/ipv6/ndisc.c:508 ndisc_send_rs+0x494/0x5fc net/ipv6/ndisc.c:702 addrconf_rs_timer+0x308/0x5a8 net/ipv6/addrconf.c:3932 call_timer_fn+0x19c/0x8f0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers+0x554/0x718 kernel/time/timer.c:1737 run_timer_softirq+0x7c/0x114 kernel/time/timer.c:1750 __do_softirq+0x344/0xe20 kernel/softirq.c:558 do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline] invoke_softirq kernel/softirq.c:439 [inline] __irq_exit_rcu+0x28c/0x534 kernel/softirq.c:636 irq_exit+0x14/0x88 kernel/softirq.c:660 handle_domain_irq+0xf4/0x178 kernel/irq/irqdesc.c:710 gic_handle_irq+0x78/0x1c8 drivers/irqchip/irq-gic-v3.c:757 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:899 do_interrupt_handler+0x74/0x94 arch/arm64/kernel/entry-common.c:267 el1_interrupt+0x30/0x58 arch/arm64/kernel/entry-common.c:442 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:458 el1h_64_irq+0x78/0x7c arch/arm64/kernel/entry.S:580 arch_local_irq_restore arch/arm64/include/asm/irqflags.h:122 [inline] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irqrestore+0xbc/0x158 kernel/locking/spinlock.c:194 __debug_check_no_obj_freed lib/debugobjects.c:1025 [inline] debug_check_no_obj_freed+0x4f0/0x50c lib/debugobjects.c:1046 slab_free_hook mm/slub.c:1680 [inline] slab_free_freelist_hook+0x9c/0x1ec mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0x178/0x410 mm/slub.c:4559 ieee80211_bss_info_update+0x818/0xab0 net/mac80211/scan.c:232 ieee80211_rx_bss_info net/mac80211/ibss.c:1123 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1614 [inline] ieee80211_ibss_rx_queued_mgmt+0x7d8/0x2814 net/mac80211/ibss.c:1643 ieee80211_iface_process_skb net/mac80211/iface.c:1441 [inline] ieee80211_iface_work+0x5b4/0xa80 net/mac80211/iface.c:1495 process_one_work+0x790/0x11b8 kernel/workqueue.c:2307 worker_thread+0x910/0x1034 kernel/workqueue.c:2454 kthread+0x37c/0x45c kernel/kthread.c:319 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Allocated by task 4010: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x29c/0x4c8 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] tomoyo_realpath_from_path+0xd0/0x508 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x208/0x568 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x28/0x38 security/tomoyo/tomoyo.c:122 security_inode_getattr+0xd8/0x124 security/security.c:1348 vfs_getattr fs/stat.c:157 [inline] vfs_statx+0x16c/0x378 fs/stat.c:225 vfs_fstatat fs/stat.c:243 [inline] __do_sys_newfstatat fs/stat.c:411 [inline] __se_sys_newfstatat fs/stat.c:405 [inline] __arm64_sys_newfstatat+0x110/0x194 fs/stat.c:405 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Freed by task 4010: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0x178/0x410 mm/slub.c:4559 tomoyo_realpath_from_path+0x4c0/0x508 security/tomoyo/realpath.c:291 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x208/0x568 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x28/0x38 security/tomoyo/tomoyo.c:122 security_inode_getattr+0xd8/0x124 security/security.c:1348 vfs_getattr fs/stat.c:157 [inline] vfs_statx+0x16c/0x378 fs/stat.c:225 vfs_fstatat fs/stat.c:243 [inline] __do_sys_newfstatat fs/stat.c:411 [inline] __se_sys_newfstatat fs/stat.c:405 [inline] __arm64_sys_newfstatat+0x110/0x194 fs/stat.c:405 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 insert_work+0x64/0x394 kernel/workqueue.c:1363 __queue_work+0xb84/0x114c kernel/workqueue.c:1529 queue_work_on+0xc4/0x17c kernel/workqueue.c:1556 queue_work include/linux/workqueue.h:502 [inline] schedule_work include/linux/workqueue.h:563 [inline] destroy_super_rcu+0x110/0x128 fs/super.c:172 rcu_do_batch kernel/rcu/tree.c:2510 [inline] rcu_core+0x830/0x1b34 kernel/rcu/tree.c:2750 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2763 __do_softirq+0x344/0xe20 kernel/softirq.c:558 Second to last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2994 [inline] call_rcu+0x118/0xb40 kernel/rcu/tree.c:3074 __put_super+0x258/0x2e4 fs/super.c:299 put_super fs/super.c:313 [inline] deactivate_locked_super+0xe8/0x13c fs/super.c:346 deactivate_super+0x108/0x128 fs/super.c:366 cleanup_mnt+0x3c0/0x474 fs/namespace.c:1143 __cleanup_mnt+0x20/0x30 fs/namespace.c:1150 task_work_run+0x130/0x1e4 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] do_notify_resume+0x262c/0x32b8 arch/arm64/kernel/signal.c:946 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:597 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 The buggy address belongs to the object at ffff0000d5e22000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2316 bytes inside of 4096-byte region [ffff0000d5e22000, ffff0000d5e23000) The buggy address belongs to the page: page:000000003ec20b02 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x115e20 head:000000003ec20b02 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002a80 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d5e22800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d5e22880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000d5e22900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d5e22980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d5e22a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================