================================================================== 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_flush arch/x86/mm/pat/set_memory.c:449 [inline] BUG: KASAN: slab-out-of-bounds in change_page_attr_set_clr+0x625/0xfc0 arch/x86/mm/pat/set_memory.c:2115 Read of size 8 at addr ffff888077603260 by task syz.0.1/5967 CPU: 1 UID: 0 PID: 5967 Comm: syz.0.1 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 __cpa_addr arch/x86/mm/pat/set_memory.c:309 [inline] cpa_flush arch/x86/mm/pat/set_memory.c:449 [inline] change_page_attr_set_clr+0x625/0xfc0 arch/x86/mm/pat/set_memory.c:2115 cpa_set_pages_array arch/x86/mm/pat/set_memory.c:2137 [inline] _set_pages_array+0x145/0x270 arch/x86/mm/pat/set_memory.c:2521 drm_gem_shmem_get_pages_locked+0x2d0/0x440 drivers/gpu/drm/drm_gem_shmem_helper.c:214 drm_gem_shmem_pin_locked+0x22c/0x460 drivers/gpu/drm/drm_gem_shmem_helper.c:261 drm_gem_map_attach+0x19c/0x1f0 drivers/gpu/drm/drm_prime.c:620 dma_buf_dynamic_attach+0x1ea/0x3d0 drivers/dma-buf/dma-buf.c:974 drm_gem_shmem_prime_import_no_map+0xc1/0x2f0 drivers/gpu/drm/drm_gem_shmem_helper.c:835 drm_gem_prime_fd_to_handle+0x196/0x4d0 drivers/gpu/drm/drm_prime.c:313 drm_ioctl_kernel+0x2cc/0x390 drivers/gpu/drm/drm_ioctl.c:797 drm_ioctl+0x67f/0xb10 drivers/gpu/drm/drm_ioctl.c:894 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd26d98ebe9 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:00007fd26bbf6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fd26dbc5fa0 RCX: 00007fd26d98ebe9 RDX: 0000200000000300 RSI: 00000000c00c642e RDI: 0000000000000004 RBP: 00007fd26da11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fd26dbc6038 R14: 00007fd26dbc5fa0 R15: 00007ffe9d68ac88 Allocated by task 5967: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:397 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:414 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:5366 [inline] __kvmalloc_node_noprof+0x5cd/0x910 mm/slub.c:6527 kvmalloc_array_node_noprof include/linux/slab.h:1118 [inline] drm_gem_get_pages+0x166/0xa20 drivers/gpu/drm/drm_gem.c:647 drm_gem_shmem_get_pages_locked+0x201/0x440 drivers/gpu/drm/drm_gem_shmem_helper.c:200 drm_gem_shmem_pin_locked+0x22c/0x460 drivers/gpu/drm/drm_gem_shmem_helper.c:261 drm_gem_map_attach+0x19c/0x1f0 drivers/gpu/drm/drm_prime.c:620 dma_buf_dynamic_attach+0x1ea/0x3d0 drivers/dma-buf/dma-buf.c:974 drm_gem_shmem_prime_import_no_map+0xc1/0x2f0 drivers/gpu/drm/drm_gem_shmem_helper.c:835 drm_gem_prime_fd_to_handle+0x196/0x4d0 drivers/gpu/drm/drm_prime.c:313 drm_ioctl_kernel+0x2cc/0x390 drivers/gpu/drm/drm_ioctl.c:797 drm_ioctl+0x67f/0xb10 drivers/gpu/drm/drm_ioctl.c:894 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888077603200 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 0 bytes to the right of allocated 96-byte region [ffff888077603200, ffff888077603260) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x77603 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801a841280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080200020 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5967, tgid 5966 (syz.0.1), ts 96042416142, free_ts 96017113206 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3863 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5153 alloc_slab_page mm/slub.c:2998 [inline] allocate_slab+0x65/0x330 mm/slub.c:3164 new_slab mm/slub.c:3218 [inline] ___slab_alloc+0xbd1/0x13f0 mm/slub.c:4420 __slab_alloc+0x55/0xa0 mm/slub.c:4511 __slab_alloc_node mm/slub.c:4586 [inline] slab_alloc_node mm/slub.c:4996 [inline] __do_kmalloc_node mm/slub.c:5365 [inline] __kmalloc_node_noprof+0x5cc/0x800 mm/slub.c:5372 kmalloc_array_node_noprof include/linux/slab.h:1071 [inline] alloc_slab_obj_exts mm/slub.c:2095 [inline] account_slab mm/slub.c:3123 [inline] allocate_slab+0x160/0x330 mm/slub.c:3183 new_slab mm/slub.c:3218 [inline] ___slab_alloc+0xbd1/0x13f0 mm/slub.c:4420 __slab_alloc+0x55/0xa0 mm/slub.c:4511 __slab_alloc_node mm/slub.c:4586 [inline] slab_alloc_node mm/slub.c:4996 [inline] kmem_cache_alloc_lru_noprof+0x3ef/0x6d0 mm/slub.c:5027 alloc_inode+0x67/0x1b0 fs/inode.c:346 new_inode+0x22/0x170 fs/inode.c:1145 debugfs_get_inode fs/debugfs/inode.c:72 [inline] __debugfs_create_file+0x14d/0x4f0 fs/debugfs/inode.c:441 debugfs_create_file_full+0x3f/0x60 fs/debugfs/inode.c:468 drm_debugfs_clients_add+0xca/0x1a0 drivers/gpu/drm/drm_debugfs.c:368 page last free pid 23 tgid 23 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2900 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0xcab/0x1770 kernel/rcu/tree.c:2861 handle_softirqs+0x283/0x870 kernel/softirq.c:579 run_ksoftirqd+0x9b/0x100 kernel/softirq.c:968 smpboot_thread_fn+0x542/0xa60 kernel/smpboot.c:160 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x47c/0x820 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888077603100: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ffff888077603180: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff888077603200: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ^ ffff888077603280: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888077603300: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ==================================================================