trusted_key: encrypted_key: insufficient parameters specified ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] BUG: KASAN: slab-use-after-free in key_put security/keys/key.c:655 [inline] BUG: KASAN: slab-use-after-free in key_put+0x9c/0x2a0 security/keys/key.c:646 Read of size 8 at addr ffff88802993f438 by task syz.4.4111/21324 CPU: 0 UID: 0 PID: 21324 Comm: syz.4.4111 Not tainted 6.13.0-rc1-syzkaller-gcdd30ebb1b9f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:68 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] key_put security/keys/key.c:655 [inline] key_put+0x9c/0x2a0 security/keys/key.c:646 __key_create_or_update+0x92b/0xe10 security/keys/key.c:940 key_create_or_update+0x42/0x60 security/keys/key.c:1018 __do_sys_add_key+0x29c/0x460 security/keys/keyctl.c:134 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8b5257e759 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:00007f8b53366038 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00007f8b52736058 RCX: 00007f8b5257e759 RDX: 0000000020000100 RSI: 0000000020000180 RDI: 0000000020000140 RBP: 00007f8b525f175e R08: fffffffffffffffe R09: 0000000000000000 R10: 00000000000000ca R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8b52736058 R15: 00007ffef9995a88 Allocated by task 21324: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4104 [inline] slab_alloc_node mm/slub.c:4153 [inline] kmem_cache_alloc_noprof+0x226/0x3d0 mm/slub.c:4160 key_alloc+0x3e3/0x13a0 security/keys/key.c:277 __key_create_or_update+0x71f/0xe10 security/keys/key.c:930 key_create_or_update+0x42/0x60 security/keys/key.c:1018 __do_sys_add_key+0x29c/0x460 security/keys/keyctl.c:134 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5968: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2338 [inline] slab_free mm/slub.c:4598 [inline] kmem_cache_free+0x152/0x4c0 mm/slub.c:4700 key_gc_unused_keys.constprop.0+0x134/0x480 security/keys/gc.c:167 key_garbage_collector+0x432/0x990 security/keys/gc.c:300 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/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 ffff88802993f340 which belongs to the cache key_jar of size 336 The buggy address is located 248 bytes inside of freed 336-byte region [ffff88802993f340, ffff88802993f490) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2993e 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: f5(slab) raw: 00fff00000000040 ffff88801c2be140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080120012 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff88801c2be140 dead000000000122 0000000000000000 head: 0000000000000000 0000000080120012 00000001f5000000 0000000000000000 head: 00fff00000000001 ffffea0000a64f81 ffffffffffffffff 0000000000000000 head: ffff888000000002 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 21273, tgid 21266 (syz.1.4097), ts 335063650093, free_ts 334892479403 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2408 [inline] allocate_slab mm/slub.c:2574 [inline] new_slab+0x2c9/0x410 mm/slub.c:2627 ___slab_alloc+0xdac/0x1870 mm/slub.c:3815 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3905 __slab_alloc_node mm/slub.c:3980 [inline] slab_alloc_node mm/slub.c:4141 [inline] kmem_cache_alloc_noprof+0xfa/0x3d0 mm/slub.c:4160 key_alloc+0x3e3/0x13a0 security/keys/key.c:277 keyring_alloc+0x44/0xc0 security/keys/keyring.c:526 install_process_keyring_to_cred security/keys/process_keys.c:275 [inline] install_process_keyring security/keys/process_keys.c:300 [inline] lookup_user_key+0xa34/0x12f0 security/keys/process_keys.c:653 __do_sys_add_key+0x25a/0x460 security/keys/keyctl.c:126 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 16 tgid 16 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0x79d/0x14d0 kernel/rcu/tree.c:2823 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554 run_ksoftirqd kernel/softirq.c:943 [inline] run_ksoftirqd+0x3a/0x60 kernel/softirq.c:935 smpboot_thread_fn+0x661/0xa30 kernel/smpboot.c:164 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88802993f300: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88802993f380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802993f400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802993f480: fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802993f500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================