================================================================== 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 ffff888020c69120 by task syz.1.425/6993 CPU: 0 UID: 0 PID: 6993 Comm: syz.1.425 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 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+0x28b/0x8a0 arch/x86/mm/pat/set_memory.c:449 change_page_attr_set_clr+0x34e/0x4a0 arch/x86/mm/pat/set_memory.c:2115 cpa_set_pages_array arch/x86/mm/pat/set_memory.c:2137 [inline] _set_pages_array+0x1ab/0x2c0 arch/x86/mm/pat/set_memory.c:2521 drm_gem_shmem_get_pages_locked+0x384/0x490 drivers/gpu/drm/drm_gem_shmem_helper.c:214 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+0x1ab/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_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x300 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f41579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f543655c EFLAGS: 00000296 ORIG_RAX: 00000000000000c0 RAX: ffffffffffffffda RBX: 0000000080001000 RCX: 0000000000004000 RDX: 0000000000000004 RSI: 0000000000000011 RDI: 0000000000000003 RBP: 0000000000100000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 6993: 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+0x1ab/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_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x300 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888020c69000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes to the right of allocated 288-byte region [ffff888020c69000, ffff888020c69120) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888020c68400 pfn:0x20c68 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: f5(slab) raw: 00fff00000000040 ffff88801b042c80 ffffea00009b3000 dead000000000002 raw: ffff888020c68400 000000008010000f 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b042c80 ffffea00009b3000 dead000000000002 head: ffff888020c68400 000000008010000f 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea0000831a01 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5957, tgid 5957 (syz-executor), ts 54374218859, free_ts 54290544039 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] __do_kmalloc_node mm/slub.c:5602 [inline] __kmalloc_noprof+0x501/0x880 mm/slub.c:5615 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x14c/0x870 net/ipv6/route.c:3809 ip6_route_add.part.0+0x22/0x1d0 net/ipv6/route.c:3938 ip6_route_add+0x45/0x60 net/ipv6/route.c:3935 addrconf_prefix_route+0x2fd/0x510 net/ipv6/addrconf.c:2488 addrconf_add_linklocal+0x329/0x500 net/ipv6/addrconf.c:3313 addrconf_addr_gen+0x364/0x3b0 net/ipv6/addrconf.c:3442 addrconf_dev_config net/ipv6/addrconf.c:3489 [inline] addrconf_init_auto_addrs+0x2ba/0x810 net/ipv6/addrconf.c:3567 page last free pid 841 tgid 841 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 __folio_put+0x329/0x450 mm/swap.c:112 folio_put include/linux/mm.h:1425 [inline] put_page include/linux/mm.h:1494 [inline] put_netmem net/core/skbuff.c:7375 [inline] skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_release_data+0x81a/0x9e0 net/core/skbuff.c:1081 skb_release_all net/core/skbuff.c:1152 [inline] napi_consume_skb+0x15a/0x220 net/core/skbuff.c:1480 skb_defer_free_flush+0x1e2/0x280 net/core/dev.c:6735 net_rx_action+0x3b3/0xef0 net/core/dev.c:7765 handle_softirqs+0x216/0x8e0 kernel/softirq.c:622 do_softirq kernel/softirq.c:523 [inline] do_softirq+0xb2/0xf0 kernel/softirq.c:510 __local_bh_enable_ip+0x100/0x120 kernel/softirq.c:450 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:936 [inline] __dev_queue_xmit+0xb06/0x4490 net/core/dev.c:4790 dev_queue_xmit include/linux/netdevice.h:3365 [inline] neigh_resolve_output net/core/neighbour.c:1595 [inline] neigh_resolve_output+0x53a/0x940 net/core/neighbour.c:1575 neigh_output include/net/neighbour.h:547 [inline] ip6_finish_output2+0xad1/0x1cf0 net/ipv6/ip6_output.c:136 __ip6_finish_output+0x3cd/0x1010 net/ipv6/ip6_output.c:209 ip6_finish_output net/ipv6/ip6_output.c:220 [inline] NF_HOOK_COND include/linux/netfilter.h:307 [inline] ip6_output+0x253/0x710 net/ipv6/ip6_output.c:247 dst_output include/net/dst.h:464 [inline] NF_HOOK include/linux/netfilter.h:318 [inline] NF_HOOK include/linux/netfilter.h:312 [inline] mld_sendpack+0xac1/0x1350 net/ipv6/mcast.c:1855 mld_send_cr net/ipv6/mcast.c:2154 [inline] mld_ifc_work+0x740/0xbf0 net/ipv6/mcast.c:2693 Memory state around the buggy address: ffff888020c69000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888020c69080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888020c69100: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888020c69180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888020c69200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi