================================================================== BUG: KASAN: stack-out-of-bounds in post_one_notification.isra.0+0x438/0x930 kernel/watch_queue.c:128 Read of size 80 at addr ffffc90004217d40 by task syz-executor414/11258 CPU: 1 PID: 11258 Comm: syz-executor414 Not tainted 6.0.0-syzkaller-06205-gffb39098bf87 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x59/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x20/0x60 mm/kasan/shadow.c:65 post_one_notification.isra.0+0x438/0x930 kernel/watch_queue.c:128 __post_watch_notification kernel/watch_queue.c:229 [inline] __post_watch_notification+0x5af/0x8b0 kernel/watch_queue.c:198 post_watch_notification include/linux/watch_queue.h:109 [inline] notify_key security/keys/internal.h:197 [inline] __key_update security/keys/key.c:775 [inline] key_create_or_update+0xdbf/0xde0 security/keys/key.c:979 __do_sys_add_key+0x215/0x430 security/keys/keyctl.c:134 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f286eb63f49 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 90 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe852681c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 00007f286eb63f49 RDX: 0000000020000280 RSI: 0000000020000100 RDI: 00000000200000c0 RBP: 0000000000000000 R08: 00000000fffffffc R09: 0000000000000001 R10: 0000000000000048 R11: 0000000000000246 R12: 0000000000010fe5 R13: 00007ffe852681dc R14: 00007ffe852681f0 R15: 00007ffe852681e0 The buggy address belongs to stack of task syz-executor414/11258 and is located at offset 64 in frame: key_create_or_update+0x0/0xde0 security/keys/key.c:293 This frame has 4 objects: [32, 40) 'edit' [64, 80) 'n' [96, 136) 'index_key' [176, 256) 'prep' The buggy address belongs to the virtual mapping at [ffffc90004210000, ffffc90004219000) created by: kernel_clone+0xe7/0xab0 kernel/fork.c:2671 The buggy address belongs to the physical page: page:ffffea0001ec8e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b238 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 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 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 3606, tgid 3606 (syz-executor414), ts 69634752820, free_ts 67353214477 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 vm_area_alloc_pages mm/vmalloc.c:2958 [inline] __vmalloc_area_node mm/vmalloc.c:3026 [inline] __vmalloc_node_range+0x954/0x13a0 mm/vmalloc.c:3196 alloc_thread_stack_node kernel/fork.c:312 [inline] dup_task_struct kernel/fork.c:977 [inline] copy_process+0x156c/0x7090 kernel/fork.c:2085 kernel_clone+0xe7/0xab0 kernel/fork.c:2671 __do_sys_clone+0xba/0x100 kernel/fork.c:2805 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 kasan_depopulate_vmalloc_pte+0x5c/0x70 mm/kasan/shadow.c:372 apply_to_pte_range mm/memory.c:2633 [inline] apply_to_pmd_range mm/memory.c:2677 [inline] apply_to_pud_range mm/memory.c:2713 [inline] apply_to_p4d_range mm/memory.c:2749 [inline] __apply_to_page_range+0x686/0x1030 mm/memory.c:2783 kasan_release_vmalloc+0xa7/0xc0 mm/kasan/shadow.c:486 __purge_vmap_area_lazy+0x885/0x1c50 mm/vmalloc.c:1753 drain_vmap_area_work+0x52/0xe0 mm/vmalloc.c:1782 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffffc90004217c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90004217c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90004217d00: f1 f1 f1 f1 00 f2 f2 f2 00 00 f2 f2 00 00 00 00 ^ ffffc90004217d80: 00 f2 f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 00 ffffc90004217e00: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================