================================================================== BUG: KASAN: slab-out-of-bounds in watch_queue_set_filter+0x78d/0x810 kernel/watch_queue.c:343 Write of size 4 at addr ffff88802426c05c by task syz-executor.1/6902 CPU: 1 PID: 6902 Comm: syz-executor.1 Not tainted 5.17.0-rc6-next-20220303-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 watch_queue_set_filter+0x78d/0x810 kernel/watch_queue.c:343 pipe_ioctl+0x25b/0x2b0 fs/pipe.c:637 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 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+0x44/0xae RIP: 0033:0x7f5f35489049 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5f365ad168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f5f3559bf60 RCX: 00007f5f35489049 RDX: 0000000020000040 RSI: 0000000000005761 RDI: 0000000000000005 RBP: 00007f5f354e308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc0c08cd0f R14: 00007f5f365ad300 R15: 0000000000022000 Allocated by task 6902: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:589 [inline] kzalloc include/linux/slab.h:717 [inline] watch_queue_set_filter+0x2f2/0x810 kernel/watch_queue.c:332 pipe_ioctl+0x25b/0x2b0 fs/pipe.c:637 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 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+0x44/0xae The buggy address belongs to the object at ffff88802426c040 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 28 bytes inside of 32-byte region [ffff88802426c040, ffff88802426c060) The buggy address belongs to the physical page: page:ffffea0000909b00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2426c flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000924a40 dead000000000002 ffff888010c41500 raw: 0000000000000000 0000000080400040 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 0x12c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY), pid 2952, tgid 2952 (rcS), ts 13721638693, free_ts 12707448006 prep_new_page mm/page_alloc.c:2438 [inline] get_page_from_freelist+0xa7f/0x3ec0 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5400 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2268 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8d0/0xf30 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] slab_alloc mm/slub.c:3238 [inline] __kmalloc+0x318/0x350 mm/slub.c:4434 kmalloc include/linux/slab.h:589 [inline] kzalloc include/linux/slab.h:717 [inline] tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45 tomoyo_encode2 security/tomoyo/realpath.c:31 [inline] tomoyo_encode+0x28/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x186/0x620 security/tomoyo/realpath.c:288 tomoyo_init_log+0xbe2/0x1ed0 security/tomoyo/audit.c:263 tomoyo_supervisor+0x34d/0xf00 security/tomoyo/common.c:2088 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_execute_permission+0x37f/0x4a0 security/tomoyo/file.c:619 tomoyo_find_next_domain+0x348/0x1f80 security/tomoyo/domain.c:752 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:101 [inline] tomoyo_bprm_check_security+0x121/0x1a0 security/tomoyo/tomoyo.c:91 security_bprm_check+0x45/0xa0 security/security.c:866 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1353 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1403 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3420 kasan_depopulate_vmalloc_pte+0x5c/0x70 mm/kasan/shadow.c:359 apply_to_pte_range mm/memory.c:2547 [inline] apply_to_pmd_range mm/memory.c:2591 [inline] apply_to_pud_range mm/memory.c:2627 [inline] apply_to_p4d_range mm/memory.c:2663 [inline] __apply_to_page_range+0x686/0x1030 mm/memory.c:2697 kasan_release_vmalloc+0xa7/0xc0 mm/kasan/shadow.c:469 __purge_vmap_area_lazy+0x8f9/0x1c50 mm/vmalloc.c:1735 _vm_unmap_aliases.part.0+0x3f0/0x500 mm/vmalloc.c:2140 _vm_unmap_aliases mm/vmalloc.c:2114 [inline] vm_unmap_aliases+0x45/0x50 mm/vmalloc.c:2163 change_page_attr_set_clr+0x241/0x500 arch/x86/mm/pat/set_memory.c:1743 change_page_attr_set arch/x86/mm/pat/set_memory.c:1793 [inline] set_memory_nx+0xb2/0x110 arch/x86/mm/pat/set_memory.c:1941 free_init_pages+0x73/0xc0 arch/x86/mm/init.c:898 kernel_init+0x2e/0x1d0 init/main.c:1516 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88802426bf00: 00 00 00 00 fc fc 00 00 00 00 fc fc 00 00 00 00 ffff88802426bf80: fc fc 00 00 00 00 fc fc 00 00 00 00 fc fc fc fc >ffff88802426c000: 00 00 00 00 fc fc fc fc 00 00 00 fc fc fc fc fc ^ ffff88802426c080: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ffff88802426c100: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ==================================================================