syzbot


KASAN: slab-use-after-free Read in process_measurement

Status: moderation: reported on 2025/12/07 03:28
Subsystems: integrity lsm
[Documentation on labels]
Reported-by: syzbot+bcbcac0e503af9b02eea@syzkaller.appspotmail.com
First crash: 54d, last: 54d

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in process_measurement+0x18db/0x1a70 security/integrity/ima/ima_main.c:257
Read of size 2 at addr ffff888032fe2200 by task syz.1.115/6577

CPU: 0 UID: 0 PID: 6577 Comm: syz.1.115 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xca/0x240 mm/kasan/report.c:482
 kasan_report+0x118/0x150 mm/kasan/report.c:595
 process_measurement+0x18db/0x1a70 security/integrity/ima/ima_main.c:257
 ima_file_mmap+0x118/0x1f0 security/integrity/ima/ima_main.c:495
 security_mmap_file+0x7a4/0xa60 security/security.c:2504
 vm_mmap_pgoff+0x129/0x4d0 mm/util.c:575
 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:604
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f153ab8f749
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f153ba69038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007f153ade5fa0 RCX: 00007f153ab8f749
RDX: b635773f04ebbeee RSI: 0000000000001000 RDI: 000020000074f000
RBP: 00007f153ac13f91 R08: 0000000000000003 R09: 0000000015b77000
R10: 0000000000000011 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f153ade6038 R14: 00007f153ade5fa0 R15: 00007fff89285798
 </TASK>

Allocated by task 6577:
 kasan_save_stack mm/kasan/common.c:56 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
 unpoison_slab_object mm/kasan/common.c:339 [inline]
 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:365
 kasan_slab_alloc include/linux/kasan.h:252 [inline]
 slab_post_alloc_hook mm/slub.c:4948 [inline]
 slab_alloc_node mm/slub.c:5258 [inline]
 kmem_cache_alloc_lru_noprof+0x36c/0x6e0 mm/slub.c:5277
 mqueue_alloc_inode+0x28/0x40 ipc/mqueue.c:502
 alloc_inode+0x6a/0x1b0 fs/inode.c:346
 new_inode+0x22/0x170 fs/inode.c:1175
 mqueue_get_inode+0x27/0xb50 ipc/mqueue.c:297
 mqueue_create_attr+0x1ac/0x2e0 ipc/mqueue.c:590
 vfs_mkobj+0xcf/0x290 fs/namei.c:4153
 prepare_open ipc/mqueue.c:876 [inline]
 mqueue_file_open ipc/mqueue.c:905 [inline]
 do_mq_open+0x60d/0x7c0 ipc/mqueue.c:928
 __do_sys_mq_open ipc/mqueue.c:941 [inline]
 __se_sys_mq_open ipc/mqueue.c:934 [inline]
 __x64_sys_mq_open+0x16a/0x1c0 ipc/mqueue.c:934
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 6553:
 kasan_save_stack mm/kasan/common.c:56 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584
 poison_slab_object mm/kasan/common.c:252 [inline]
 __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284
 kasan_slab_free include/linux/kasan.h:234 [inline]
 slab_free_hook mm/slub.c:2540 [inline]
 slab_free mm/slub.c:6663 [inline]
 kmem_cache_free+0x197/0x620 mm/slub.c:6774
 rcu_do_batch kernel/rcu/tree.c:2605 [inline]
 rcu_core+0xd70/0x1870 kernel/rcu/tree.c:2857
 handle_softirqs+0x27d/0x850 kernel/softirq.c:626
 __do_softirq kernel/softirq.c:660 [inline]
 invoke_softirq kernel/softirq.c:496 [inline]
 __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:727
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:743
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
 sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1056
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697

Last potentially related work creation:
 kasan_save_stack+0x3e/0x60 mm/kasan/common.c:56
 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556
 __call_rcu_common kernel/rcu/tree.c:3119 [inline]
 call_rcu+0x157/0x9c0 kernel/rcu/tree.c:3239
 destroy_inode fs/inode.c:401 [inline]
 evict+0x931/0xae0 fs/inode.c:861
 __do_sys_mq_unlink ipc/mqueue.c:972 [inline]
 __se_sys_mq_unlink+0x2c5/0x360 ipc/mqueue.c:944
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff888032fe21c0
 which belongs to the cache mqueue_inode_cache of size 1576
The buggy address is located 64 bytes inside of
 freed 1576-byte region [ffff888032fe21c0, ffff888032fe27e8)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x32fe0
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88803095d201
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801cba3280 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080120012 00000000f5000000 ffff88803095d201
head: 00fff00000000040 ffff88801cba3280 dead000000000122 0000000000000000
head: 0000000000000000 0000000080120012 00000000f5000000 ffff88803095d201
head: 00fff00000000003 ffffea0000cbf801 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5820, tgid 5820 (syz-executor), ts 77920319509, free_ts 77839980536
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x234/0x290 mm/page_alloc.c:1846
 prep_new_page mm/page_alloc.c:1854 [inline]
 get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3915
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5210
 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2486
 alloc_slab_page mm/slub.c:3075 [inline]
 allocate_slab+0x86/0x3b0 mm/slub.c:3248
 new_slab mm/slub.c:3302 [inline]
 ___slab_alloc+0xf2b/0x1960 mm/slub.c:4651
 __slab_alloc+0x65/0x100 mm/slub.c:4774
 __slab_alloc_node mm/slub.c:4850 [inline]
 slab_alloc_node mm/slub.c:5246 [inline]
 kmem_cache_alloc_lru_noprof+0x3fe/0x6e0 mm/slub.c:5277
 mqueue_alloc_inode+0x28/0x40 ipc/mqueue.c:502
 alloc_inode+0x6a/0x1b0 fs/inode.c:346
 new_inode+0x22/0x170 fs/inode.c:1175
 mqueue_get_inode ipc/mqueue.c:297 [inline]
 mqueue_fill_super+0xdc/0x380 ipc/mqueue.c:416
 vfs_get_super fs/super.c:1324 [inline]
 get_tree_nodev+0xbb/0x150 fs/super.c:1343
 vfs_get_tree+0x92/0x2a0 fs/super.c:1751
 fc_mount fs/namespace.c:1209 [inline]
 fc_mount_longterm+0x1c/0x100 fs/namespace.c:1220
 mq_create_mount ipc/mqueue.c:486 [inline]
 mq_init_ns+0x275/0x360 ipc/mqueue.c:1639
page last free pid 5825 tgid 5825 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1395 [inline]
 __free_frozen_pages+0xbc8/0xd30 mm/page_alloc.c:2943
 discard_slab mm/slub.c:3346 [inline]
 __put_partials+0x146/0x170 mm/slub.c:3886
 put_cpu_partial+0x1f2/0x2d0 mm/slub.c:3961
 __slab_free+0x288/0x2a0 mm/slub.c:5947
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x97/0x100 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:349
 kasan_slab_alloc include/linux/kasan.h:252 [inline]
 slab_post_alloc_hook mm/slub.c:4948 [inline]
 slab_alloc_node mm/slub.c:5258 [inline]
 __do_kmalloc_node mm/slub.c:5651 [inline]
 __kmalloc_node_track_caller_noprof+0x526/0x820 mm/slub.c:5759
 alloc_dr drivers/base/devres.c:119 [inline]
 devm_kmalloc+0x7f/0x300 drivers/base/devres.c:864
 devm_kzalloc include/linux/device/devres.h:54 [inline]
 led_allocate_basic net/bluetooth/leds.c:62 [inline]
 hci_leds_init+0x39/0x180 net/bluetooth/leds.c:89
 hci_register_dev+0x389/0x8b0 net/bluetooth/hci_core.c:2625
 __vhci_create_device drivers/bluetooth/hci_vhci.c:451 [inline]
 vhci_create_device+0x39c/0x650 drivers/bluetooth/hci_vhci.c:479
 vhci_get_user drivers/bluetooth/hci_vhci.c:536 [inline]
 vhci_write+0x3ce/0x4a0 drivers/bluetooth/hci_vhci.c:616
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x5c9/0xb30 fs/read_write.c:686
 ksys_write+0x145/0x250 fs/read_write.c:738
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xf80 arch/x86/entry/syscall_64.c:94

Memory state around the buggy address:
 ffff888032fe2100: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
 ffff888032fe2180: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
>ffff888032fe2200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff888032fe2280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888032fe2300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/12/03 03:18 linux-next 7d31f578f323 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in process_measurement
* Struck through repros no longer work on HEAD.