System zones: 0-1, 3-36
EXT4-fs (loop0): mounted filesystem without journal. Opts: grpquota,delalloc,resuid=0x0000000000000000,debug,dioread_nolock,bsddf,nomblk_io_submit,noauto_da_alloc,,errors=continue. Quota mode: writeback.
==================================================================
BUG: KASAN: use-after-free in ext4_get_inode_usage+0x401/0x5b0 fs/ext4/xattr.c:821
Read of size 4 at addr ffff88801fe9c070 by task syz.0.18/4529
CPU: 1 PID: 4529 Comm: syz.0.18 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
ext4_get_inode_usage+0x401/0x5b0 fs/ext4/xattr.c:821
__dquot_transfer+0x177/0x2270 fs/quota/dquot.c:2015
dquot_transfer+0x2f1/0x460 fs/quota/dquot.c:2167
ext4_setattr+0x735/0x1b60 fs/ext4/inode.c:5477
notify_change+0xbcd/0xee0 fs/attr.c:505
chown_common+0x4a7/0x660 fs/open.c:680
vfs_fchown fs/open.c:748 [inline]
ksys_fchown+0xe2/0x150 fs/open.c:759
__do_sys_fchown fs/open.c:767 [inline]
__se_sys_fchown fs/open.c:765 [inline]
__x64_sys_fchown+0x76/0x80 fs/open.c:765
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f855e111e59
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:00007ffdfaf81668 EFLAGS: 00000246 ORIG_RAX: 000000000000005d
RAX: ffffffffffffffda RBX: 00007f855e38afa0 RCX: 00007f855e111e59
RDX: 000000000000ee01 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 00007f855e1a7d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f855e38afac R14: 00007f855e38afa0 R15: 00007f855e38afa0
</TASK>
Allocated by task 4211:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0x9c/0xd0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
slab_alloc mm/slub.c:3233 [inline]
kmem_cache_alloc+0x100/0x290 mm/slub.c:3238
kmem_cache_zalloc include/linux/slab.h:728 [inline]
__kernfs_new_node+0xe3/0x6c0 fs/kernfs/dir.c:593
kernfs_new_node+0x148/0x250 fs/kernfs/dir.c:669
__kernfs_create_file+0x47/0x2e0 fs/kernfs/file.c:985
sysfs_add_file_mode_ns+0x2d4/0x3a0 fs/sysfs/file.c:317
create_files fs/sysfs/group.c:64 [inline]
internal_create_group+0x495/0xd00 fs/sysfs/group.c:149
internal_create_groups fs/sysfs/group.c:189 [inline]
sysfs_create_groups+0x55/0x120 fs/sysfs/group.c:215
device_add_groups drivers/base/core.c:2491 [inline]
device_add_attrs+0x83/0x6a0 drivers/base/core.c:2639
device_add+0x64b/0xfb0 drivers/base/core.c:3363
netdev_register_kobject+0x184/0x320 net/core/net-sysfs.c:2014
register_netdevice+0x1042/0x1710 net/core/dev.c:10423
xfrmi_create net/xfrm/xfrm_interface_core.c:156 [inline]
xfrmi_newlink+0x336/0x4c0 net/xfrm/xfrm_interface_core.c:706
__rtnl_newlink net/core/rtnetlink.c:3529 [inline]
rtnl_newlink+0x1359/0x1a50 net/core/rtnetlink.c:3577
rtnetlink_rcv_msg+0x844/0xf30 net/core/rtnetlink.c:5687
netlink_rcv_skb+0x1f5/0x440 net/netlink/af_netlink.c:2507
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x774/0x920 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x8ba/0xbe0 net/netlink/af_netlink.c:1918
sock_sendmsg_nosec net/socket.c:706 [inline]
__sock_sendmsg net/socket.c:718 [inline]
__sys_sendto+0x46d/0x620 net/socket.c:2072
__do_sys_sendto net/socket.c:2084 [inline]
__se_sys_sendto net/socket.c:2080 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:2080
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Freed by task 144:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kmem_cache_free+0x8f/0x210 mm/slub.c:3520
kernfs_put+0x319/0x490 fs/kernfs/dir.c:547
kernfs_remove_by_name_ns+0x99/0x100 fs/kernfs/dir.c:1567
kernfs_remove_by_name include/linux/kernfs.h:598 [inline]
remove_files fs/sysfs/group.c:28 [inline]
sysfs_remove_group+0xf8/0x290 fs/sysfs/group.c:289
sysfs_remove_groups+0x50/0xa0 fs/sysfs/group.c:313
device_del+0x6a7/0xaf0 drivers/base/core.c:3599
unregister_netdevice_many+0x1518/0x19f0 net/core/dev.c:11187
xfrmi_exit_batch_net+0x232/0x280 net/xfrm/xfrm_interface_core.c:810
ops_exit_list net/core/net_namespace.c:177 [inline]
cleanup_net+0x791/0xba0 net/core/net_namespace.c:635
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
The buggy address belongs to the object at ffff88801fe9c000
which belongs to the cache kernfs_node_cache of size 168
The buggy address is located 112 bytes inside of
168-byte region [ffff88801fe9c000, ffff88801fe9c0a8)
The buggy address belongs to the page:
page:ffffea00007fa700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1fe9c
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea000061e880 0000000200000002 ffff888016de9b40
raw: ffff88801fe9c570 0000000080110000 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 4211, ts 69376153786, free_ts 66362603005
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1bbd/0x1ca0 mm/page_alloc.c:4192
__alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
alloc_slab_page mm/slub.c:1780 [inline]
allocate_slab mm/slub.c:1917 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1980
___slab_alloc+0x80a/0xdd0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
slab_alloc mm/slub.c:3233 [inline]
kmem_cache_alloc+0x195/0x290 mm/slub.c:3238
kmem_cache_zalloc include/linux/slab.h:728 [inline]
__kernfs_new_node+0xe3/0x6c0 fs/kernfs/dir.c:593
kernfs_new_node+0x148/0x250 fs/kernfs/dir.c:669
__kernfs_create_file+0x47/0x2e0 fs/kernfs/file.c:985
sysfs_add_file_mode_ns+0x2d4/0x3a0 fs/sysfs/file.c:317
create_files fs/sysfs/group.c:64 [inline]
internal_create_group+0x495/0xd00 fs/sysfs/group.c:149
internal_create_groups fs/sysfs/group.c:189 [inline]
sysfs_create_groups+0x55/0x120 fs/sysfs/group.c:215
device_add_groups drivers/base/core.c:2491 [inline]
device_add_attrs+0x83/0x6a0 drivers/base/core.c:2639
device_add+0x64b/0xfb0 drivers/base/core.c:3363
netdev_register_kobject+0x184/0x320 net/core/net-sysfs.c:2014
register_netdevice+0x1042/0x1710 net/core/dev.c:10423
xfrmi_create net/xfrm/xfrm_interface_core.c:156 [inline]
xfrmi_newlink+0x336/0x4c0 net/xfrm/xfrm_interface_core.c:706
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396
__vunmap+0x8b9/0xa50 mm/vmalloc.c:2628
kcov_mmap+0x89/0x120 kernel/kcov.c:498
call_mmap include/linux/fs.h:2178 [inline]
mmap_file+0x5d/0xb0 mm/util.c:1092
__mmap_region mm/mmap.c:1796 [inline]
mmap_region+0xf88/0x1650 mm/mmap.c:2933
do_mmap+0x819/0xe90 mm/mmap.c:1586
vm_mmap_pgoff+0x1c1/0x2d0 mm/util.c:551
ksys_mmap_pgoff+0x54b/0x790 mm/mmap.c:1635
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Memory state around the buggy address:
ffff88801fe9bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88801fe9bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88801fe9c000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801fe9c080: fb fb fb fb fb fc fc fc fc fc fc fc fc fb fb fb
ffff88801fe9c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================