================================================================== BUG: KASAN: slab-use-after-free in hlist_add_head include/linux/list.h:1026 [inline] BUG: KASAN: slab-use-after-free in batadv_forw_packet_queue+0x184/0x26c net/batman-adv/send.c:688 Write of size 8 at addr ffff0000f12e6008 by task kworker/u8:17/7890 CPU: 0 UID: 0 PID: 7890 Comm: kworker/u8:17 Not tainted 6.15.0-rc4-syzkaller-ge0f4c8dd9d2d #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 print_address_description+0xa8/0x254 mm/kasan/report.c:408 print_report+0x68/0x84 mm/kasan/report.c:521 kasan_report+0xb0/0x110 mm/kasan/report.c:634 __asan_report_store8_noabort+0x20/0x2c mm/kasan/report_generic.c:386 hlist_add_head include/linux/list.h:1026 [inline] batadv_forw_packet_queue+0x184/0x26c net/batman-adv/send.c:688 batadv_forw_packet_ogmv1_queue+0x38/0x4c net/batman-adv/send.c:729 batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:597 [inline] batadv_iv_ogm_queue_add+0x8f4/0xb58 net/batman-adv/bat_iv_ogm.c:678 batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:857 [inline] batadv_iv_ogm_schedule+0x978/0xd2c net/batman-adv/bat_iv_ogm.c:876 batadv_iv_send_outstanding_bat_ogm_packet+0x69c/0x7f0 net/batman-adv/bat_iv_ogm.c:1720 process_one_work+0x7e8/0x156c kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x958/0xed8 kernel/workqueue.c:3400 kthread+0x5fc/0x75c kernel/kthread.c:464 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Allocated by task 7890: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x44/0x54 mm/kasan/generic.c:562 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x9c/0xb4 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x2a4/0x3fc mm/slub.c:4372 kmalloc_noprof include/linux/slab.h:905 [inline] batadv_forw_packet_alloc+0x190/0x3b4 net/batman-adv/send.c:519 batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:571 [inline] batadv_iv_ogm_queue_add+0x6d0/0xb58 net/batman-adv/bat_iv_ogm.c:678 batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:857 [inline] batadv_iv_ogm_schedule+0x978/0xd2c net/batman-adv/bat_iv_ogm.c:876 batadv_iv_send_outstanding_bat_ogm_packet+0x69c/0x7f0 net/batman-adv/bat_iv_ogm.c:1720 process_one_work+0x7e8/0x156c kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x958/0xed8 kernel/workqueue.c:3400 kthread+0x5fc/0x75c kernel/kthread.c:464 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Freed by task 7890: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x58/0x70 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x68/0x88 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2398 [inline] slab_free mm/slub.c:4656 [inline] kfree+0x17c/0x474 mm/slub.c:4855 batadv_forw_packet_free+0x1c8/0x26c net/batman-adv/send.c:477 batadv_iv_send_outstanding_bat_ogm_packet+0x6c4/0x7f0 net/batman-adv/bat_iv_ogm.c:1726 process_one_work+0x7e8/0x156c kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x958/0xed8 kernel/workqueue.c:3400 kthread+0x5fc/0x75c kernel/kthread.c:464 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:47 kasan_record_aux_stack+0xb0/0xc8 mm/kasan/generic.c:548 insert_work+0x54/0x2cc kernel/workqueue.c:2183 __queue_work+0xcb0/0x1230 kernel/workqueue.c:2345 delayed_work_timer_fn+0x74/0x90 kernel/workqueue.c:2487 call_timer_fn+0x1b4/0x818 kernel/time/timer.c:1789 expire_timers kernel/time/timer.c:1835 [inline] __run_timers kernel/time/timer.c:2414 [inline] __run_timer_base+0x54c/0x76c kernel/time/timer.c:2426 run_timer_base kernel/time/timer.c:2435 [inline] run_timer_softirq+0xcc/0x194 kernel/time/timer.c:2445 handle_softirqs+0x328/0xc88 kernel/softirq.c:579 __do_softirq+0x14/0x20 kernel/softirq.c:613 The buggy address belongs to the object at ffff0000f12e6000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of freed 512-byte region [ffff0000f12e6000, ffff0000f12e6200) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1312e4 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c0001c80 fffffdffc38fbb00 dead000000000002 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 05ffc00000000040 ffff0000c0001c80 fffffdffc38fbb00 dead000000000002 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 05ffc00000000002 fffffdffc3c4b901 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000f12e5f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000f12e5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000f12e6000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000f12e6080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000f12e6100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================