trusted_key: encrypted_key: keyword 'ep[ate' not recognized ================================================================== BUG: KASAN: slab-use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:206 [inline] BUG: KASAN: slab-use-after-free in arch_test_bit arch/x86/include/asm/bitops.h:238 [inline] BUG: KASAN: slab-use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] BUG: KASAN: slab-use-after-free in key_put+0x76/0x230 security/keys/key.c:655 Read of size 8 at addr ffff888063e65eb8 by task syz.2.562/7998 CPU: 1 UID: 0 PID: 7998 Comm: syz.2.562 Not tainted 6.11.0-rc5-syzkaller-00219-g1934261d8974 #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+0x241/0x360 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 constant_test_bit arch/x86/include/asm/bitops.h:206 [inline] arch_test_bit arch/x86/include/asm/bitops.h:238 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] key_put+0x76/0x230 security/keys/key.c:655 __key_create_or_update+0xaf4/0xc70 security/keys/key.c:940 key_create_or_update+0x42/0x60 security/keys/key.c:1018 __do_sys_add_key security/keys/keyctl.c:134 [inline] __se_sys_add_key+0x33f/0x490 security/keys/keyctl.c:74 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fcafd579eb9 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:00007fcafcfbd038 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00007fcafd716130 RCX: 00007fcafd579eb9 RDX: 0000000020000100 RSI: 0000000020000180 RDI: 0000000020000140 RBP: 00007fcafd5e793e R08: fffffffffffffffe R09: 0000000000000000 R10: 00000000000000ca R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fcafd716130 R15: 00007ffd7d093298 Allocated by task 7998: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4044 key_alloc+0x341/0xff0 security/keys/key.c:277 __key_create_or_update+0xa55/0xc70 security/keys/key.c:930 key_create_or_update+0x42/0x60 security/keys/key.c:1018 __do_sys_add_key security/keys/keyctl.c:134 [inline] __se_sys_add_key+0x33f/0x490 security/keys/keyctl.c:74 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5234: 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] kmem_cache_free+0x145/0x350 mm/slub.c:4548 key_gc_unused_keys+0x389/0x400 security/keys/gc.c:167 key_garbage_collector+0x8b5/0xa00 security/keys/gc.c:300 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff888063e65dc0 which belongs to the cache key_jar of size 336 The buggy address is located 248 bytes inside of freed 336-byte region [ffff888063e65dc0, ffff888063e65f10) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888063e65880 pfn:0x63e64 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff88801b6fe140 dead000000000122 0000000000000000 raw: ffff888063e65880 0000000080120011 00000001fdffffff 0000000000000000 head: 00fff00000000040 ffff88801b6fe140 dead000000000122 0000000000000000 head: ffff888063e65880 0000000080120011 00000001fdffffff 0000000000000000 head: 00fff00000000001 ffffea00018f9901 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5618, tgid 5612 (syz.3.77), ts 127302737701, free_ts 127290880986 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3439 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4695 __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+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4044 key_alloc+0x341/0xff0 security/keys/key.c:277 keyring_alloc+0x44/0xb0 security/keys/keyring.c:526 install_thread_keyring_to_cred security/keys/process_keys.c:228 [inline] install_thread_keyring security/keys/process_keys.c:253 [inline] lookup_user_key+0x4b0/0x1500 security/keys/process_keys.c:635 __do_sys_add_key security/keys/keyctl.c:126 [inline] __se_sys_add_key+0x2fa/0x490 security/keys/keyctl.c:74 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5617 tgid 5617 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd19/0xea0 mm/page_alloc.c:2612 mm_free_pgd kernel/fork.c:802 [inline] __mmdrop+0xb9/0x3d0 kernel/fork.c:918 exit_mm+0x220/0x310 kernel/exit.c:571 do_exit+0x9b2/0x27f0 kernel/exit.c:869 do_group_exit+0x207/0x2c0 kernel/exit.c:1031 __do_sys_exit_group kernel/exit.c:1042 [inline] __se_sys_exit_group kernel/exit.c:1040 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1040 x64_sys_call+0x2634/0x2640 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888063e65d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff888063e65e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888063e65e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888063e65f00: fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888063e65f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================