loop0: detected capacity change from 0 to 512 EXT4-fs: Warning: mounting with data=journal disables delayed allocation, dioread_nolock, O_DIRECT and fast_commit support! EXT4-fs (loop0): encrypted files will use data=ordered instead of data journaling mode EXT4-fs warning (device loop0): ext4_expand_extra_isize_ea:2860: Unable to expand inode 15. Delete some EAs or run e2fsck. EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none. ================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x92b/0x1ed0 fs/ext4/xattr.c:1763 Read of size 18446744073709551540 at addr ffff888052384070 by task syz.0.0/5330 CPU: 0 UID: 0 PID: 5330 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+0x92b/0x1ed0 fs/ext4/xattr.c:1763 ext4_xattr_block_set+0x71e/0x2a80 fs/ext4/xattr.c:2032 ext4_xattr_set_handle+0xe77/0x1540 fs/ext4/xattr.c:2450 ext4_xattr_set+0x257/0x340 fs/ext4/xattr.c:2561 __vfs_setxattr+0x442/0x480 fs/xattr.c:223 __vfs_setxattr_noperm+0x12a/0x660 fs/xattr.c:257 vfs_setxattr+0x163/0x360 fs/xattr.c:344 do_setxattr fs/xattr.c:662 [inline] filename_setxattr+0x296/0x630 fs/xattr.c:690 path_setxattrat+0x408/0x450 fs/xattr.c:734 __do_sys_lsetxattr fs/xattr.c:775 [inline] __se_sys_lsetxattr fs/xattr.c:771 [inline] __x64_sys_lsetxattr+0xbf/0xe0 fs/xattr.c:771 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f183cd9ce59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f183dbbafe8 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f183d015fa0 RCX: 00007f183cd9ce59 RDX: 0000200000000080 RSI: 00002000000000c0 RDI: 0000200000000100 RBP: 00007f183ce32e6f R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000fe37 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f183d016038 R14: 00007f183d015fa0 R15: 00007fff3c1f3268 Allocated by task 5330: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5362 [inline] __kmalloc_node_track_caller_noprof+0x4c3/0x730 mm/slub.c:5497 kmemdup_noprof+0x2b/0x70 mm/util.c:138 kmemdup_noprof include/linux/fortify-string.h:715 [inline] ext4_xattr_block_set+0x633/0x2a80 fs/ext4/xattr.c:1980 ext4_xattr_set_handle+0xe77/0x1540 fs/ext4/xattr.c:2450 ext4_xattr_set+0x257/0x340 fs/ext4/xattr.c:2561 __vfs_setxattr+0x442/0x480 fs/xattr.c:223 __vfs_setxattr_noperm+0x12a/0x660 fs/xattr.c:257 vfs_setxattr+0x163/0x360 fs/xattr.c:344 do_setxattr fs/xattr.c:662 [inline] filename_setxattr+0x296/0x630 fs/xattr.c:690 path_setxattrat+0x408/0x450 fs/xattr.c:734 __do_sys_lsetxattr fs/xattr.c:775 [inline] __se_sys_lsetxattr fs/xattr.c:771 [inline] __x64_sys_lsetxattr+0xbf/0xe0 fs/xattr.c:771 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888052384000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 112 bytes inside of 1024-byte region [ffff888052384000, ffff888052384400) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x52384 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801ac41dc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000800080008 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801ac41dc0 dead000000000122 0000000000000000 head: 0000000000000000 0000000800080008 00000000f5000000 0000000000000000 head: 04fff00000000002 ffffffffffffff01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5330, tgid 5329 (syz.0.0), ts 108685814095, free_ts 108677747022 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0x21fa/0x2270 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3294 [inline] allocate_slab+0x79/0x5e0 mm/slub.c:3408 new_slab mm/slub.c:3454 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7338 refill_sheaf mm/slub.c:2832 [inline] __pcs_replace_empty_main+0x2bf/0x6b0 mm/slub.c:4703 alloc_from_pcs mm/slub.c:4801 [inline] slab_alloc_node mm/slub.c:4933 [inline] __do_kmalloc_node mm/slub.c:5361 [inline] __kmalloc_noprof+0x485/0x720 mm/slub.c:5387 _kmalloc_noprof include/linux/slab.h:973 [inline] ext4_mb_init+0x767/0x29b0 fs/ext4/mballoc.c:3770 __ext4_fill_super fs/ext4/super.c:5658 [inline] ext4_fill_super+0x58fb/0x65c0 fs/ext4/super.c:5828 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1634 vfs_get_tree+0x92/0x2a0 fs/super.c:1694 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3841 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4367 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 9 tgid 9 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0xc1e/0xd10 mm/page_alloc.c:2950 stack_depot_save_flags+0x407/0x800 lib/stackdepot.c:735 kasan_save_stack mm/kasan/common.c:58 [inline] kasan_save_track+0x4f/0x80 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4612 [inline] slab_alloc_node mm/slub.c:4945 [inline] kmem_cache_alloc_noprof+0x2a0/0x5f0 mm/slub.c:4959 skb_clone+0x212/0x3a0 net/core/skbuff.c:2110 macvlan_broadcast_enqueue drivers/net/macvlan.c:366 [inline] macvlan_handle_frame+0xa22/0x1360 drivers/net/macvlan.c:502 __netif_receive_skb_core+0x989/0x30b0 net/core/dev.c:6093 __netif_receive_skb_one_core net/core/dev.c:6204 [inline] __netif_receive_skb net/core/dev.c:6319 [inline] process_backlog+0x706/0x1860 net/core/dev.c:6670 __napi_poll+0xaa/0x330 net/core/dev.c:7729 napi_poll net/core/dev.c:7792 [inline] net_rx_action+0x61d/0xf50 net/core/dev.c:7949 handle_softirqs+0x225/0x840 kernel/softirq.c:622 do_softirq+0x76/0xd0 kernel/softirq.c:523 __local_bh_enable_ip+0xf8/0x130 kernel/softirq.c:450 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:914 [inline] __dev_queue_xmit+0x1ed7/0x37f0 net/core/dev.c:4907 __ip6_finish_output net/ipv6/ip6_output.c:-1 [inline] ip6_finish_output+0x292/0x770 net/ipv6/ip6_output.c:219 Memory state around the buggy address: ffff888052383f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888052383f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888052384000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888052384080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888052384100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================