================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 Read of size 4 at addr ffff888123da3000 by task syz-executor/467 CPU: 1 PID: 467 Comm: syz-executor Not tainted 6.1.129-syzkaller-1168466-g6684cdb34eae #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 ext4_evict_inode+0xef9/0x1550 fs/ext4/inode.c:296 evict+0x529/0x930 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x616/0x690 fs/inode.c:1860 d_delete_notify include/linux/fsnotify.h:292 [inline] vfs_rmdir+0x3c2/0x500 fs/namei.c:4203 do_rmdir+0x3ab/0x630 fs/namei.c:4251 __do_sys_unlinkat fs/namei.c:4431 [inline] __se_sys_unlinkat fs/namei.c:4425 [inline] __x64_sys_unlinkat+0xdf/0xf0 fs/namei.c:4425 x64_sys_call+0x6e9/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:264 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0x80 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f0142179457 Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 07 01 00 00 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:00007ffc342ca518 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f0142179457 RDX: 0000000000000200 RSI: 00007ffc342cb6c0 RDI: 00000000ffffff9c RBP: 00007f01421e77b4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffc342cb6c0 R13: 00007f01421e77b4 R14: 000000000000c8d4 R15: 00007ffc342cd870 Allocated by task 322: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:333 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:768 slab_alloc_node mm/slub.c:3421 [inline] slab_alloc mm/slub.c:3431 [inline] __kmem_cache_alloc_lru mm/slub.c:3438 [inline] kmem_cache_alloc+0x175/0x320 mm/slub.c:3447 kmem_cache_zalloc include/linux/slab.h:689 [inline] lsm_inode_alloc security/security.c:596 [inline] security_inode_alloc+0x29/0x120 security/security.c:1040 inode_init_always+0x720/0x970 fs/inode.c:232 alloc_inode fs/inode.c:268 [inline] new_inode_pseudo+0x98/0x1d0 fs/inode.c:1063 sock_alloc net/socket.c:629 [inline] sock_create_lite+0x8d/0x500 net/socket.c:1339 __netlink_kernel_create+0x11f/0x920 net/netlink/af_netlink.c:1991 netlink_kernel_create include/linux/netlink.h:62 [inline] uevent_net_init+0xe0/0x2d0 lib/kobject_uevent.c:785 ops_init+0x1cd/0x480 net/core/net_namespace.c:138 setup_net+0x4ca/0xd60 net/core/net_namespace.c:335 copy_net_ns+0x35f/0x5b0 net/core/net_namespace.c:481 create_new_namespaces+0x416/0x670 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x126/0x180 kernel/nsproxy.c:226 ksys_unshare+0x545/0x980 kernel/fork.c:3310 __do_sys_unshare kernel/fork.c:3381 [inline] __se_sys_unshare kernel/fork.c:3379 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3379 x64_sys_call+0x728/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:273 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0x80 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 23: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook mm/slub.c:1771 [inline] slab_free mm/slub.c:3686 [inline] kmem_cache_free+0x291/0x560 mm/slub.c:3711 inode_free_by_rcu+0x1c/0x20 security/security.c:1055 rcu_do_batch+0x552/0xbe0 kernel/rcu/tree.c:2297 rcu_core+0x502/0xf40 kernel/rcu/tree.c:2557 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2574 handle_softirqs+0x1db/0x650 kernel/softirq.c:624 run_ksoftirqd+0x28/0x30 kernel/softirq.c:1001 smpboot_thread_fn+0x466/0x8d0 kernel/smpboot.c:164 kthread+0x26d/0x300 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb4/0xc0 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496 __call_rcu_common kernel/rcu/tree.c:2807 [inline] call_rcu+0xdc/0x10f0 kernel/rcu/tree.c:2926 security_inode_free+0xb3/0xd0 security/security.c:1072 __destroy_inode+0x179/0x4e0 fs/inode.c:286 destroy_inode fs/inode.c:309 [inline] evict+0x7d6/0x930 fs/inode.c:720 iput_final fs/inode.c:1834 [inline] iput+0x616/0x690 fs/inode.c:1860 __sock_release net/socket.c:664 [inline] sock_release+0x110/0x140 net/socket.c:680 netlink_kernel_release+0x4d/0x60 net/netlink/af_netlink.c:2056 uevent_net_exit+0xc2/0x200 lib/kobject_uevent.c:814 ops_exit_list net/core/net_namespace.c:172 [inline] cleanup_net+0x64b/0xbf0 net/core/net_namespace.c:604 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2299 worker_thread+0xa60/0x1260 kernel/workqueue.c:2446 kthread+0x26d/0x300 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888123da3000 which belongs to the cache lsm_inode_cache of size 56 The buggy address is located 0 bytes inside of 56-byte region [ffff888123da3000, ffff888123da3038) The buggy address belongs to the physical page: page:ffffea00048f68c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x123da3 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881002a9200 raw: 0000000000000000 00000000002e002e 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 317, tgid 317 (syz-executor), ts 28415435553, free_ts 28415351437 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2637 prep_new_page+0x1b/0x110 mm/page_alloc.c:2644 get_page_from_freelist+0x3a98/0x3b10 mm/page_alloc.c:4539 __alloc_pages+0x234/0x610 mm/page_alloc.c:5837 alloc_slab_page+0x6c/0xf0 include/linux/gfp.h:-1 allocate_slab mm/slub.c:1962 [inline] new_slab+0x90/0x3e0 mm/slub.c:2015 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203 __slab_alloc+0x5d/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] slab_alloc mm/slub.c:3431 [inline] __kmem_cache_alloc_lru mm/slub.c:3438 [inline] kmem_cache_alloc+0x1be/0x320 mm/slub.c:3447 kmem_cache_zalloc include/linux/slab.h:689 [inline] lsm_inode_alloc security/security.c:596 [inline] security_inode_alloc+0x29/0x120 security/security.c:1040 inode_init_always+0x720/0x970 fs/inode.c:232 alloc_inode fs/inode.c:268 [inline] new_inode_pseudo+0x98/0x1d0 fs/inode.c:1063 sock_alloc net/socket.c:629 [inline] __sock_create+0x132/0x7e0 net/socket.c:1504 sock_create net/socket.c:1596 [inline] __sys_socket_create net/socket.c:1633 [inline] __sys_socket+0x136/0x3a0 net/socket.c:1661 __do_sys_socket net/socket.c:1674 [inline] __se_sys_socket net/socket.c:1672 [inline] __x64_sys_socket+0x7a/0x90 net/socket.c:1672 x64_sys_call+0x147/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:42 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1545 [inline] free_pcp_prepare mm/page_alloc.c:1619 [inline] free_unref_page_prepare+0x9f1/0xa00 mm/page_alloc.c:3581 free_unref_page+0xb2/0x5c0 mm/page_alloc.c:3677 free_the_page mm/page_alloc.c:830 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5926 __vunmap+0x9c6/0xb80 mm/vmalloc.c:2729 __vfree mm/vmalloc.c:2778 [inline] vfree+0x5c/0x80 mm/vmalloc.c:2809 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:868 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1024 [inline] do_ipt_get_ctl+0x1010/0x15e0 net/ipv4/netfilter/ip_tables.c:1670 nf_getsockopt+0x26c/0x290 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x1dd/0x290 net/ipv4/ip_sockglue.c:1826 tcp_getsockopt+0x15c/0x1c0 net/ipv4/tcp.c:4434 sock_common_getsockopt+0x99/0xb0 net/core/sock.c:3671 __sys_getsockopt+0x21f/0x490 net/socket.c:2322 __do_sys_getsockopt net/socket.c:2337 [inline] __se_sys_getsockopt net/socket.c:2334 [inline] __x64_sys_getsockopt+0xbf/0xd0 net/socket.c:2334 x64_sys_call+0x1a9/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:56 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0x80 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff888123da2f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888123da2f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888123da3000: fa fb fb fb fb fb fb fc fc fc fc fa fb fb fb fb ^ ffff888123da3080: fb fb fc fc fc fc fa fb fb fb fb fb fb fc fc fc ffff888123da3100: fc fa fb fb fb fb fb fb fc fc fc fc fa fb fb fb ================================================================== EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor: inode #1: comm syz-executor: iget: illegal inode # EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor: error while reading EA inode 1 err=-117 EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor: inode #1: comm syz-executor: iget: illegal inode # EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor: error while reading EA inode 1 err=-117 EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor: inode #1: comm syz-executor: iget: illegal inode #