================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x9c1/0x1e20 fs/ext4/xattr.c:1763 Read of size 18446744073709551600 at addr ffff888055f7c2c8 by task syz.0.0/5325 CPU: 0 UID: 0 PID: 5325 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x264/0x2c0 mm/kasan/generic.c:200 __asan_memmove+0x29/0x70 mm/kasan/shadow.c:94 ext4_xattr_set_entry+0x9c1/0x1e20 fs/ext4/xattr.c:1763 ext4_xattr_ibody_set+0x254/0x6a0 fs/ext4/xattr.c:2275 ext4_destroy_inline_data_nolock+0x23a/0x5e0 fs/ext4/inline.c:472 ext4_convert_inline_data_nolock+0x208/0x990 fs/ext4/inline.c:1123 ext4_convert_inline_data+0x4ce/0x600 fs/ext4/inline.c:1994 ext4_page_mkwrite+0x247/0x1150 fs/ext4/inode.c:6757 do_page_mkwrite+0x14d/0x310 mm/memory.c:3668 wp_page_shared mm/memory.c:4069 [inline] do_wp_page+0x19ba/0x4cc0 mm/memory.c:4288 handle_pte_fault mm/memory.c:6427 [inline] __handle_mm_fault mm/memory.c:6549 [inline] handle_mm_fault+0x151f/0x3170 mm/memory.c:6718 do_user_addr_fault+0xa73/0x1340 arch/x86/mm/fault.c:1334 handle_page_fault arch/x86/mm/fault.c:1474 [inline] exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1527 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618 RIP: 0033:0x7f705db6d4a1 Code: 4c 17 f0 c3 0f 1f 44 00 00 48 8b 4c 16 f8 48 8b 36 48 89 37 48 89 4c 17 f8 c3 62 e1 fe 28 6f 54 16 ff 62 e1 fe 28 6f 5c 16 fe <62> e1 fe 28 7f 07 62 e1 fe 28 7f 4f 01 62 e1 fe 28 7f 54 17 ff 62 RSP: 002b:00007ffd15b7fed8 EFLAGS: 00010283 RAX: 0000200000000700 RBX: 0000000000000004 RCX: 0000000000000007 RDX: 0000000000000072 RSI: 00007f705d60151b RDI: 0000200000000700 RBP: fffffffffffffffe R08: 00007f705d9ff030 R09: 0000000000000001 R10: 0000000000000072 R11: 0000000000000001 R12: 00007ffd15b80000 R13: 00007f705de15fac R14: 0000000000014bee R15: 00007f705de15fa0 The buggy address belongs to the physical page: page: refcount:2 mapcount:0 mapping:ffff88801cc25940 index:0x6 pfn:0x55f7c memcg:ffff88803eb5ed80 aops:def_blk_aops ino:700000 dentry name(?):"" flags: 0x4fff38000004234(referenced|dirty|lru|workingset|private|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff38000004234 ffffea0000cdad48 ffffea00010ed488 ffff88801cc25940 raw: 0000000000000006 ffff888047aa7910 00000002ffffffff ffff88803eb5ed80 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x148c48(GFP_NOFS|__GFP_MOVABLE|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL), pid 5326, tgid 5325 (syz.0.0), ts 85368628642, free_ts 85368543521 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1858 prep_new_page mm/page_alloc.c:1866 [inline] get_page_from_freelist+0x24ba/0x2540 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5226 alloc_pages_mpol+0x235/0x490 mm/mempolicy.c:2490 alloc_frozen_pages_noprof mm/mempolicy.c:2561 [inline] alloc_pages_noprof+0xac/0x2a0 mm/mempolicy.c:2581 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2591 filemap_alloc_folio_noprof+0x111/0x470 mm/filemap.c:1014 __filemap_get_folio_mpol+0x3fc/0xb00 mm/filemap.c:2012 __filemap_get_folio include/linux/pagemap.h:763 [inline] grow_dev_folio fs/buffer.c:954 [inline] grow_buffers fs/buffer.c:1020 [inline] __getblk_slow fs/buffer.c:1038 [inline] bdev_getblk+0x1f6/0x6e0 fs/buffer.c:1358 __getblk include/linux/buffer_head.h:380 [inline] sb_getblk include/linux/buffer_head.h:386 [inline] __ext4_get_inode_loc+0x528/0xfa0 fs/ext4/inode.c:4890 ext4_get_inode_loc fs/ext4/inode.c:5018 [inline] ext4_reserve_inode_write+0x18b/0x360 fs/ext4/inode.c:6372 __ext4_mark_inode_dirty+0x14b/0x710 fs/ext4/inode.c:6550 ext4_dirty_inode+0xd0/0x110 fs/ext4/inode.c:6587 __mark_inode_dirty+0x3a4/0x13b0 fs/fs-writeback.c:2623 generic_update_time fs/inode.c:2192 [inline] touch_atime+0x576/0x6b0 fs/inode.c:2267 file_accessed include/linux/fs.h:2264 [inline] ext4_file_mmap_prepare+0x277/0x450 fs/ext4/file.c:840 page last free pid 5326 tgid 5325 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] free_unref_folios+0xcec/0x1480 mm/page_alloc.c:3004 folios_put_refs+0x9ff/0xb40 mm/swap.c:1008 free_pages_and_swap_cache+0x41d/0x490 mm/swap_state.c:404 __tlb_batch_free_encoded_pages mm/mmu_gather.c:138 [inline] tlb_batch_pages_flush mm/mmu_gather.c:151 [inline] tlb_flush_mmu_free mm/mmu_gather.c:417 [inline] tlb_flush_mmu+0x6d3/0xa30 mm/mmu_gather.c:424 tlb_finish_mmu+0xf9/0x230 mm/mmu_gather.c:549 unmap_region+0x2a5/0x330 mm/vma.c:491 vms_clear_ptes mm/vma.c:1303 [inline] vms_clean_up_area mm/vma.c:1315 [inline] __mmap_setup mm/vma.c:2476 [inline] __mmap_region mm/vma.c:2753 [inline] mmap_region+0xc9a/0x22a0 mm/vma.c:2857 do_mmap+0xc39/0x10c0 mm/mmap.c:560 vm_mmap_pgoff+0x2c9/0x4f0 mm/util.c:581 ksys_mmap_pgoff+0x51e/0x760 mm/mmap.c:606 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888055f7c180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888055f7c200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888055f7c280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888055f7c300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888055f7c380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================