================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x8ca/0x1f30 fs/ext4/xattr.c:1732 Read of size 18446744073709551572 at addr ffff888079ae9850 by task syz.9.1375/10965 CPU: 1 PID: 10965 Comm: syz.9.1375 Tainted: G W 6.1.121-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:427 kasan_report+0x136/0x160 mm/kasan/report.c:531 kasan_check_range+0x27f/0x290 mm/kasan/generic.c:189 memmove+0x25/0x60 mm/kasan/shadow.c:54 ext4_xattr_set_entry+0x8ca/0x1f30 fs/ext4/xattr.c:1732 ext4_xattr_block_set+0xa58/0x3920 fs/ext4/xattr.c:1979 ext4_xattr_move_to_block fs/ext4/xattr.c:2616 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2691 [inline] ext4_expand_extra_isize_ea+0x10d5/0x1bb0 fs/ext4/xattr.c:2783 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5936 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5979 [inline] __ext4_mark_inode_dirty+0x54f/0x920 fs/ext4/inode.c:6057 __ext4_unlink+0x6ed/0xba0 fs/ext4/namei.c:3341 ext4_unlink+0x1d5/0x670 fs/ext4/namei.c:3370 vfs_unlink+0x359/0x5f0 fs/namei.c:4322 do_unlinkat+0x4a5/0x820 fs/namei.c:4390 __do_sys_unlink fs/namei.c:4438 [inline] __se_sys_unlink fs/namei.c:4436 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4436 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f5d7ed85d29 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:00007f5d7fbbe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 00007f5d7ef76080 RCX: 00007f5d7ed85d29 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000180 RBP: 00007f5d7ee01aa8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f5d7ef76080 R15: 00007fff5df25008 Allocated by task 10965: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:936 [inline] __kmalloc_node_track_caller+0xb1/0x220 mm/slab_common.c:956 kmemdup+0x26/0x60 mm/util.c:129 ext4_xattr_block_set+0x884/0x3920 fs/ext4/xattr.c:1927 ext4_xattr_move_to_block fs/ext4/xattr.c:2616 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2691 [inline] ext4_expand_extra_isize_ea+0x10d5/0x1bb0 fs/ext4/xattr.c:2783 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5936 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5979 [inline] __ext4_mark_inode_dirty+0x54f/0x920 fs/ext4/inode.c:6057 __ext4_unlink+0x6ed/0xba0 fs/ext4/namei.c:3341 ext4_unlink+0x1d5/0x670 fs/ext4/namei.c:3370 vfs_unlink+0x359/0x5f0 fs/namei.c:4322 do_unlinkat+0x4a5/0x820 fs/namei.c:4390 __do_sys_unlink fs/namei.c:4438 [inline] __se_sys_unlink fs/namei.c:4436 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4436 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486 kvfree_call_rcu+0x116/0x8c0 kernel/rcu/tree.c:3401 batadv_hardif_release net/batman-adv/hard-interface.c:55 [inline] kref_put include/linux/kref.h:65 [inline] batadv_hardif_put net/batman-adv/hard-interface.h:95 [inline] batadv_hard_if_event+0x774/0x1540 net/batman-adv/hard-interface.c:1014 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:1970 [inline] call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] unregister_netdevice_many+0xebf/0x17a0 net/core/dev.c:10945 unregister_netdevice_queue+0x2e6/0x350 net/core/dev.c:10876 unregister_netdevice include/linux/netdevice.h:3067 [inline] __tun_detach+0x6b6/0x1600 drivers/net/tun.c:685 tun_detach drivers/net/tun.c:701 [inline] tun_chr_close+0x104/0x1b0 drivers/net/tun.c:3492 __fput+0x3f6/0x8d0 fs/file_table.c:320 task_work_run+0x246/0x300 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0xa73/0x26a0 kernel/exit.c:871 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 get_signal+0x16f7/0x17d0 kernel/signal.c:2871 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff888079ae9800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 80 bytes inside of 1024-byte region [ffff888079ae9800, ffff888079ae9c00) The buggy address belongs to the physical page: page:ffffea0001e6ba00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79ae8 head:ffffea0001e6ba00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888017c41dc0 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3635, tgid 3635 (udevd), ts 61428600989, free_ts 61412267165 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x3731/0x38d0 mm/page_alloc.c:4328 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5605 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc_node_track_caller+0xa0/0x220 mm/slab_common.c:956 kmalloc_reserve net/core/skbuff.c:446 [inline] __alloc_skb+0x135/0x670 net/core/skbuff.c:515 alloc_skb include/linux/skbuff.h:1271 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1183 [inline] netlink_sendmsg+0x6f8/0xd60 net/netlink/af_netlink.c:1834 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] ____sys_sendmsg+0x5a5/0x8f0 net/socket.c:2519 ___sys_sendmsg net/socket.c:2573 [inline] __sys_sendmsg+0x2a9/0x390 net/socket.c:2602 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare mm/page_alloc.c:1509 [inline] free_unref_page_prepare+0x12a6/0x15b0 mm/page_alloc.c:3384 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3479 free_slab mm/slub.c:2031 [inline] discard_slab mm/slub.c:2037 [inline] __unfreeze_partials+0x1b7/0x210 mm/slub.c:2586 put_cpu_partial+0x17b/0x250 mm/slub.c:2662 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x156/0x170 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422 vm_area_dup+0x23/0x1b0 kernel/fork.c:467 __split_vma+0xcc/0x4c0 mm/mmap.c:2351 mprotect_fixup+0x753/0x840 mm/mprotect.c:623 do_mprotect_pkey+0x8b6/0xbe0 mm/mprotect.c:792 __do_sys_mprotect mm/mprotect.c:819 [inline] __se_sys_mprotect mm/mprotect.c:816 [inline] __x64_sys_mprotect+0x7c/0x90 mm/mprotect.c:816 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff888079ae9700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079ae9780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888079ae9800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888079ae9880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888079ae9900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================