================================================================== BUG: KASAN: slab-use-after-free in smk_access+0xab/0x3f0 security/smack/smack_access.c:147 Read of size 8 at addr ffff8881046ab380 by task syz.0.16/4945 CPU: 1 UID: 3327 PID: 4945 Comm: syz.0.16 Not tainted 6.11.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x231/0x330 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 smk_access+0xab/0x3f0 security/smack/smack_access.c:147 smack_watch_key+0x2ac/0x370 security/smack/smack_lsm.c:4656 security_watch_key+0x65/0x90 security/security.c:4359 keyctl_watch_key+0x2b7/0x480 security/keys/keyctl.c:1813 __do_sys_keyctl security/keys/keyctl.c:2021 [inline] __se_sys_keyctl+0x409/0xc10 security/keys/keyctl.c:1874 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x8d/0x190 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff9e68ddef9 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:00007ff9e6359038 EFLAGS: 00000246 ORIG_RAX: 00000000000000fa RAX: ffffffffffffffda RBX: 00007ff9e6a95f80 RCX: 00007ff9e68ddef9 RDX: 0000000000000004 RSI: 000000003f1cf8d0 RDI: 0000000000000020 RBP: 00007ff9e6950b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ff9e6a95f80 R15: 00007ffcd6e8a018 Allocated by task 2438: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4158 [inline] __kmalloc_node_track_caller_noprof+0x1fb/0x460 mm/slub.c:4177 memdup_user mm/util.c:226 [inline] strndup_user+0x75/0x150 mm/util.c:285 copy_mount_string fs/namespace.c:3707 [inline] __do_sys_mount fs/namespace.c:4010 [inline] __se_sys_mount+0xe2/0x3b0 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x8d/0x190 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 2438: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x12f/0x310 mm/slub.c:4594 __do_sys_mount fs/namespace.c:4024 [inline] __se_sys_mount+0x360/0x3b0 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x8d/0x190 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8881046ab380 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of freed 8-byte region [ffff8881046ab380, ffff8881046ab388) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8881046abb80 pfn:0x1046ab flags: 0x200000000000000(node=0|zone=2) page_type: 0xfdffffff(slab) raw: 0200000000000000 ffff888100041500 ffffea00041daf80 dead000000000002 raw: ffff8881046abb80 000000008080006e 00000001fdffffff 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 3658111035, free_ts 3525992713 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x10f/0x130 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x37f4/0x3920 mm/page_alloc.c:3442 __alloc_pages_noprof+0x256/0x670 mm/page_alloc.c:4700 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5d/0x290 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xa7f/0x11d0 mm/slub.c:3723 __slab_alloc mm/slub.c:3813 [inline] __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __do_kmalloc_node mm/slub.c:4157 [inline] __kmalloc_noprof+0x25a/0x440 mm/slub.c:4170 kmalloc_noprof include/linux/slab.h:685 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] acpi_ns_internalize_name+0x419/0x610 drivers/acpi/acpica/nsutils.c:331 acpi_ns_get_node_unlocked drivers/acpi/acpica/nsutils.c:666 [inline] acpi_ns_get_node+0x1b7/0x3c0 drivers/acpi/acpica/nsutils.c:726 acpi_ns_evaluate+0x35f/0xa40 drivers/acpi/acpica/nseval.c:62 acpi_ut_evaluate_object+0x154/0x4a0 drivers/acpi/acpica/uteval.c:60 acpi_rs_get_method_data+0xb4/0x160 drivers/acpi/acpica/rsutils.c:650 acpi_walk_resources+0x183/0x5a0 drivers/acpi/acpica/rsxface.c:616 __acpi_dev_get_resources drivers/acpi/resource.c:935 [inline] acpi_dev_get_resources+0x257/0x380 drivers/acpi/resource.c:973 acpi_device_enumeration_by_parent drivers/acpi/scan.c:1806 [inline] acpi_init_device_object+0x27d0/0x34b0 drivers/acpi/scan.c:1834 acpi_add_single_object+0x106/0x1e00 drivers/acpi/scan.c:1879 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xbae/0xcf0 mm/page_alloc.c:2612 discard_slab mm/slub.c:2583 [inline] __put_partials+0x18e/0x1d0 mm/slub.c:3051 put_cpu_partial+0x151/0x1b0 mm/slub.c:3126 __slab_free+0x2b8/0x3a0 mm/slub.c:4343 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_remove_cache+0x14a/0x170 mm/kasan/quarantine.c:378 kmem_cache_shrink+0xd/0x20 mm/slab_common.c:610 acpi_os_purge_cache+0x15/0x20 drivers/acpi/osl.c:1573 acpi_purge_cached_objects+0x8f/0xc0 drivers/acpi/acpica/utxface.c:239 acpi_initialize_objects+0x2e/0xa0 drivers/acpi/acpica/utxfinit.c:250 acpi_bus_init+0xda/0xbc0 drivers/acpi/bus.c:1364 acpi_init+0xb4/0x240 drivers/acpi/bus.c:1449 do_one_initcall+0x211/0x6e0 init/main.c:1267 do_initcall_level+0x15a/0x280 init/main.c:1329 do_initcalls+0x3f/0x80 init/main.c:1345 kernel_init_freeable+0x3f2/0x580 init/main.c:1578 Memory state around the buggy address: ffff8881046ab280: 00 fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc ffff8881046ab300: fa fc fc fc fa fc fc fc fa fc fc fc 00 fc fc fc >ffff8881046ab380: fa fc fc fc fa fc fc fc 00 fc fc fc 05 fc fc fc ^ ffff8881046ab400: fa fc fc fc 05 fc fc fc 00 fc fc fc fa fc fc fc ffff8881046ab480: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc ==================================================================