================================================================== 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 ffff888033e77430 by task syz.6.2170/16114 CPU: 1 UID: 0 PID: 16114 Comm: syz.6.2170 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_mmap+0x193/0x460 drivers/gpu/drm/drm_gem_shmem_helper.c:646 drm_gem_mmap_obj+0x187/0x4e0 drivers/gpu/drm/drm_gem.c:1167 drm_gem_mmap+0x384/0x640 drivers/gpu/drm/drm_gem.c:1245 vfs_mmap include/linux/fs.h:2283 [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 mm/vma.c:2669 [inline] mmap_region+0x18a8/0x2100 mm/vma.c:2739 do_mmap+0xc45/0x10d0 mm/mmap.c:558 vm_mmap_pgoff+0x2a6/0x4d0 mm/util.c:580 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:604 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:0x7fdf5478ebe9 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:00007fdf529d5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007fdf549c6180 RCX: 00007fdf5478ebe9 RDX: 0000000000000004 RSI: 0000000000004000 RDI: 0000200000001000 RBP: 00007fdf54811e19 R08: 0000000000000007 R09: 0000000100000000 R10: 0000000000000011 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdf549c6218 R14: 00007fdf549c6180 R15: 00007ffed9cce238 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888033e77400 pfn:0x33e74 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f8(unknown) raw: 00fff00000000040 0000000000000000 dead000000000122 0000000000000000 raw: ffff888033e77400 0000000000000000 00000000f8000000 0000000000000000 head: 00fff00000000040 0000000000000000 dead000000000122 0000000000000000 head: ffff888033e77400 0000000000000000 00000000f8000000 0000000000000000 head: 00fff00000000002 ffffea0000cf9d01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x428c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_COMP), pid 16114, tgid 16107 (syz.6.2170), ts 803192497666, free_ts 784022389598 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_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 ___kmalloc_large_node+0x5f/0x1b0 mm/slub.c:5307 __kmalloc_large_node_noprof+0x18/0x90 mm/slub.c:5338 __do_kmalloc_node mm/slub.c:5354 [inline] __kvmalloc_node_noprof+0x6e/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_mmap+0x193/0x460 drivers/gpu/drm/drm_gem_shmem_helper.c:646 drm_gem_mmap_obj+0x187/0x4e0 drivers/gpu/drm/drm_gem.c:1167 drm_gem_mmap+0x384/0x640 drivers/gpu/drm/drm_gem.c:1245 vfs_mmap include/linux/fs.h:2283 [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 mm/vma.c:2669 [inline] mmap_region+0x18a8/0x2100 mm/vma.c:2739 do_mmap+0xc45/0x10d0 mm/mmap.c:558 vm_mmap_pgoff+0x2a6/0x4d0 mm/util.c:580 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:604 page last free pid 15828 tgid 15826 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 stack_depot_save_flags+0x436/0x860 lib/stackdepot.c:727 kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x4f/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] __kmalloc_cache_noprof+0x3d5/0x6f0 mm/slub.c:5397 kmalloc_noprof include/linux/slab.h:956 [inline] kzalloc_noprof include/linux/slab.h:1090 [inline] kobject_uevent_env+0x27c/0x8c0 lib/kobject_uevent.c:540 device_del+0x73a/0x8e0 drivers/base/core.c:3896 device_unregister drivers/base/core.c:3919 [inline] device_destroy+0xa6/0x160 drivers/base/core.c:4473 drop_ref+0x100/0x360 drivers/hid/hidraw.c:349 hidraw_disconnect+0x4f/0x60 drivers/hid/hidraw.c:642 hid_disconnect drivers/hid/hid-core.c:2345 [inline] hid_hw_stop drivers/hid/hid-core.c:2390 [inline] hid_device_remove+0x1c2/0x370 drivers/hid/hid-core.c:2798 device_remove drivers/base/dd.c:569 [inline] __device_release_driver drivers/base/dd.c:1274 [inline] device_release_driver_internal+0x46c/0x800 drivers/base/dd.c:1297 bus_remove_device+0x34d/0x410 drivers/base/bus.c:579 device_del+0x511/0x8e0 drivers/base/core.c:3878 hid_remove_device drivers/hid/hid-core.c:2980 [inline] hid_destroy_device+0x6b/0x1b0 drivers/hid/hid-core.c:3002 uhid_dev_destroy drivers/hid/uhid.c:586 [inline] uhid_char_release+0xc3/0x600 drivers/hid/uhid.c:662 Memory state around the buggy address: ffff888033e77300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888033e77380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888033e77400: 00 00 00 00 00 00 fe fe fe fe fe fe fe fe fe fe ^ ffff888033e77480: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ffff888033e77500: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ==================================================================