================================================================== BUG: KASAN: slab-out-of-bounds in __cpa_addr arch/x86/mm/pat/set_memory.c:309 [inline] BUG: KASAN: slab-out-of-bounds in __cpa_addr+0x1d3/0x220 arch/x86/mm/pat/set_memory.c:306 Read of size 8 at addr ffff888028aa1688 by task syz.3.1548/12099 CPU: 1 UID: 0 PID: 12099 Comm: syz.3.1548 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 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+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 __cpa_addr arch/x86/mm/pat/set_memory.c:309 [inline] __cpa_addr+0x1d3/0x220 arch/x86/mm/pat/set_memory.c:306 cpa_flush+0xec/0x8a0 arch/x86/mm/pat/set_memory.c:449 change_page_attr_set_clr arch/x86/mm/pat/set_memory.c:2115 [inline] cpa_clear_pages_array arch/x86/mm/pat/set_memory.c:2144 [inline] set_pages_array_wb+0x238/0x280 arch/x86/mm/pat/set_memory.c:2572 drm_gem_shmem_put_pages_locked+0x27e/0x300 drivers/gpu/drm/drm_gem_shmem_helper.c:239 drm_gem_shmem_vm_close+0x63/0xc0 drivers/gpu/drm/drm_gem_shmem_helper.c:596 vma_close mm/internal.h:190 [inline] remove_vma+0x85/0x160 mm/vma.c:464 exit_mmap+0x50a/0xb90 mm/mmap.c:1305 __mmput+0x12a/0x410 kernel/fork.c:1133 mmput+0x62/0x70 kernel/fork.c:1156 exit_mm kernel/exit.c:582 [inline] do_exit+0x7c7/0x2bf0 kernel/exit.c:954 do_group_exit+0xd3/0x2a0 kernel/exit.c:1107 get_signal+0x2671/0x26d0 kernel/signal.c:3034 arch_do_signal_or_restart+0x8f/0x7c0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop+0x85/0x130 kernel/entry/common.c:40 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x419/0x4e0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f57fd58eec9 Code: Unable to access opcode bytes at 0x7f57fd58ee9f. RSP: 002b:00007f57fe3a7038 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: 000000000000fabd RBX: 00007f57fd7e5fa0 RCX: 00007f57fd58eec9 RDX: 0000000000010106 RSI: 00002000000000c0 RDI: 0000000000000003 RBP: 00007f57fd611f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f57fd7e6038 R14: 00007f57fd7e5fa0 R15: 00007ffe8923ea88 Allocated by task 12103: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5603 [inline] __kvmalloc_node_noprof+0x3a3/0x9c0 mm/slub.c:7036 kvmalloc_array_node_noprof include/linux/slab.h:1122 [inline] drm_gem_get_pages+0x144/0xa10 drivers/gpu/drm/drm_gem.c:647 drm_gem_shmem_get_pages_locked+0x1e6/0x490 drivers/gpu/drm/drm_gem_shmem_helper.c:200 drm_gem_shmem_mmap drivers/gpu/drm/drm_gem_shmem_helper.c:646 [inline] drm_gem_shmem_mmap+0xc9/0x550 drivers/gpu/drm/drm_gem_shmem_helper.c:620 drm_gem_mmap_obj+0x1b5/0x560 drivers/gpu/drm/drm_gem.c:1167 drm_gem_mmap+0x40b/0x620 drivers/gpu/drm/drm_gem.c:1245 vfs_mmap include/linux/fs.h:2404 [inline] mmap_file mm/internal.h:167 [inline] __mmap_new_file_vma mm/vma.c:2413 [inline] __mmap_new_vma mm/vma.c:2476 [inline] __mmap_region+0x1306/0x27a0 mm/vma.c:2670 mmap_region+0x32b/0x3f0 mm/vma.c:2740 do_mmap+0xa3e/0x1210 mm/mmap.c:558 vm_mmap_pgoff+0x29e/0x470 mm/util.c:580 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:604 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888028aa1600 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes to the right of allocated 136-byte region [ffff888028aa1600, ffff888028aa1688) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28aa1 ksm flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b0263c0 ffffea000137a000 dead000000000003 raw: 0000000000000000 0000000000100010 00000000f5000000 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 11218, tgid 11207 (syz.1.1383), ts 545190184100, free_ts 544096120385 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5183 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3030 [inline] allocate_slab mm/slub.c:3203 [inline] new_slab+0x24a/0x360 mm/slub.c:3257 ___slab_alloc+0xdc4/0x1ae0 mm/slub.c:4627 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4746 __slab_alloc_node mm/slub.c:4822 [inline] slab_alloc_node mm/slub.c:5233 [inline] __kmalloc_cache_noprof+0x477/0x780 mm/slub.c:5719 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] ovl_encode_real_fh+0xca/0x420 fs/overlayfs/copy_up.c:431 ovl_dentry_to_fid fs/overlayfs/export.c:250 [inline] ovl_encode_fh+0x276/0xe80 fs/overlayfs/export.c:280 exportfs_encode_inode_fh+0x11d/0x2d0 fs/exportfs/expfs.c:392 exportfs_encode_fid include/linux/exportfs.h:350 [inline] fanotify_encode_fh+0x3ba/0x670 fs/notify/fanotify/fanotify.c:455 fanotify_alloc_name_event fs/notify/fanotify/fanotify.c:672 [inline] fanotify_alloc_event fs/notify/fanotify/fanotify.c:851 [inline] fanotify_handle_event+0x3496/0x4850 fs/notify/fanotify/fanotify.c:982 send_to_group fs/notify/fsnotify.c:420 [inline] fsnotify+0xc58/0x1dc0 fs/notify/fsnotify.c:641 __fsnotify_parent+0x915/0xc40 fs/notify/fsnotify.c:287 fsnotify_parent include/linux/fsnotify.h:96 [inline] fsnotify_path include/linux/fsnotify.h:113 [inline] fsnotify_file include/linux/fsnotify.h:127 [inline] fsnotify_file include/linux/fsnotify.h:116 [inline] fsnotify_access include/linux/fsnotify.h:425 [inline] __kernel_read+0x617/0xbf0 fs/read_write.c:534 page last free pid 11213 tgid 11213 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2906 tlb_batch_list_free mm/mmu_gather.c:159 [inline] tlb_finish_mmu+0x237/0x7c0 mm/mmu_gather.c:500 exit_mmap+0x3fc/0xb90 mm/mmap.c:1293 __mmput+0x12a/0x410 kernel/fork.c:1133 mmput+0x62/0x70 kernel/fork.c:1156 exit_mm kernel/exit.c:582 [inline] do_exit+0x7c7/0x2bf0 kernel/exit.c:954 do_group_exit+0xd3/0x2a0 kernel/exit.c:1107 __do_sys_exit_group kernel/exit.c:1118 [inline] __se_sys_exit_group kernel/exit.c:1116 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1116 x64_sys_call+0x150b/0x1730 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888028aa1580: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888028aa1600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888028aa1680: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888028aa1700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888028aa1780: 00 00 00 00 00 00 00 05 fc fc fc fc fc fc fc fc ==================================================================