================================================================== BUG: KASAN: stack-out-of-bounds in post_one_notification+0x324/0x8b0 kernel/watch_queue.c:128 Read of size 112 at addr ffffc9000cd67c00 by task syz-executor226/14279 CPU: 1 PID: 14279 Comm: syz-executor226 Not tainted 6.0.0-rc4-syzkaller-00302-gb96fbd602d35 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x220 mm/kasan/report.c:433 kasan_report+0xfb/0x130 mm/kasan/report.c:495 kasan_check_range+0x2a7/0x2e0 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 post_one_notification+0x324/0x8b0 kernel/watch_queue.c:128 __post_watch_notification+0x3bc/0x900 kernel/watch_queue.c:229 post_watch_notification include/linux/watch_queue.h:109 [inline] notify_key security/keys/internal.h:199 [inline] __key_update+0x428/0x4e0 security/keys/key.c:775 key_create_or_update+0xa8f/0xd60 security/keys/key.c:979 __do_sys_add_key security/keys/keyctl.c:134 [inline] __se_sys_add_key+0x338/0x480 security/keys/keyctl.c:74 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd326ba7f49 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:00007ffcbc09f3a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 00007fd326ba7f49 RDX: 0000000020000280 RSI: 0000000020000100 RDI: 00000000200000c0 RBP: 0000000000000000 R08: 00000000fffffffc R09: 0000000000000001 R10: 0000000000000048 R11: 0000000000000246 R12: 000000000001b2bd R13: 00007ffcbc09f3bc R14: 00007ffcbc09f3d0 R15: 00007ffcbc09f3c0 The buggy address belongs to stack of task syz-executor226/14279 and is located at offset 32 in frame: __key_update+0x0/0x4e0 This frame has 1 object: [32, 48) 'n.i' The buggy address belongs to the virtual mapping at [ffffc9000cd60000, ffffc9000cd69000) created by: dup_task_struct+0x8b/0x490 kernel/fork.c:977 The buggy address belongs to the physical page: page:ffffea0000739dc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1ce77 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 3609, tgid 3609 (syz-executor226), ts 111328841966, free_ts 111322498096 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5515 vm_area_alloc_pages mm/vmalloc.c:2958 [inline] __vmalloc_area_node mm/vmalloc.c:3026 [inline] __vmalloc_node_range+0x8f4/0x1290 mm/vmalloc.c:3196 alloc_thread_stack_node+0x307/0x500 kernel/fork.c:312 dup_task_struct+0x8b/0x490 kernel/fork.c:977 copy_process+0x65b/0x4010 kernel/fork.c:2088 kernel_clone+0x22f/0x7a0 kernel/fork.c:2674 __do_sys_clone kernel/fork.c:2808 [inline] __se_sys_clone kernel/fork.c:2792 [inline] __x64_sys_clone+0x276/0x2e0 kernel/fork.c:2792 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 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+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x7d/0x630 mm/page_alloc.c:3476 __put_watch_queue kernel/watch_queue.c:397 [inline] kref_put include/linux/kref.h:65 [inline] put_watch_queue+0xe1/0x260 kernel/watch_queue.c:413 free_watch+0x3c/0x130 kernel/watch_queue.c:421 rcu_do_batch kernel/rcu/tree.c:2245 [inline] rcu_core+0xa61/0x1710 kernel/rcu/tree.c:2505 __do_softirq+0x382/0x793 kernel/softirq.c:571 Memory state around the buggy address: ffffc9000cd67b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000cd67b80: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 >ffffc9000cd67c00: 00 00 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffffc9000cd67c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000cd67d00: f1 f1 f1 f1 00 00 00 00 00 f2 f2 f2 f2 f2 00 00 ==================================================================