================================================================== BUG: KASAN: use-after-free in get_max_inline_xattr_value_size+0x387/0x530 fs/ext4/inline.c:61 Read of size 4 at addr ffff88811059e018 by task syz-executor255/22726 CPU: 1 PID: 22726 Comm: syz-executor255 Not tainted 5.10.161-syzkaller-00019-g416c4356f372 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3c0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x1a4/0x1f0 mm/kasan/report.c:436 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 get_max_inline_xattr_value_size+0x387/0x530 fs/ext4/inline.c:61 ext4_get_max_inline_size+0x142/0x200 fs/ext4/inline.c:112 ext4_prepare_inline_data+0x8b/0x1e0 fs/ext4/inline.c:392 ext4_da_write_inline_data_begin+0x1f0/0x750 fs/ext4/inline.c:904 ext4_da_write_begin+0x532/0xf10 fs/ext4/inode.c:3039 generic_perform_write+0x309/0x5b0 mm/filemap.c:3468 ext4_buffered_write_iter+0x47c/0x610 fs/ext4/file.c:272 ext4_file_write_iter+0x192/0x1c70 fs/ext4/file.c:689 do_iter_readv_writev+0x52a/0x720 fs/read_write.c:737 do_iter_write+0x182/0x660 fs/read_write.c:866 vfs_iter_write+0x7c/0xa0 fs/read_write.c:907 iter_file_splice_write+0x8a1/0x10c0 fs/splice.c:686 do_splice_from fs/splice.c:764 [inline] direct_splice_actor+0xfe/0x130 fs/splice.c:933 splice_direct_to_actor+0x4f4/0xbd0 fs/splice.c:888 do_splice_direct+0x2a0/0x3f0 fs/splice.c:976 do_sendfile+0x9c7/0x1150 fs/read_write.c:1257 __do_sys_sendfile64 fs/read_write.c:1318 [inline] __se_sys_sendfile64 fs/read_write.c:1304 [inline] __x64_sys_sendfile64+0x1ce/0x230 fs/read_write.c:1304 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7f8041593c39 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 15 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f804153b208 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f80416197e8 RCX: 00007f8041593c39 RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000006 RBP: 00007f80416197e0 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000001ffff R11: 0000000000000246 R12: 00007f80416197ec R13: 00007fffff8a5e9f R14: 00007f804153b300 R15: 0000000000022000 Allocated by task 22320: 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:428 [inline] __kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:461 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook include/../mm/slab.h:583 [inline] slab_alloc_node mm/slub.c:2956 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x16c/0x300 mm/slub.c:2969 skb_clone+0x1d6/0x3b0 net/core/skbuff.c:1459 do_one_broadcast net/netlink/af_netlink.c:1446 [inline] netlink_broadcast_filtered+0x654/0x1200 net/netlink/af_netlink.c:1521 netlink_broadcast+0x3a/0x50 net/netlink/af_netlink.c:1545 uevent_net_broadcast_untagged lib/kobject_uevent.c:331 [inline] kobject_uevent_net_broadcast+0x3b1/0x5a0 lib/kobject_uevent.c:409 kobject_uevent_env+0x540/0x730 lib/kobject_uevent.c:593 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642 loop_set_size+0xb4/0xc0 drivers/block/loop.c:246 loop_configure+0xce8/0x1200 drivers/block/loop.c:1162 lo_ioctl+0x81e/0x22e0 drivers/block/loop.c:1695 __blkdev_driver_ioctl block/ioctl.c:237 [inline] blkdev_ioctl+0x2c2/0x5d0 block/ioctl.c:632 block_ioctl+0xaf/0xf0 fs/block_dev.c:1886 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0x115/0x190 fs/ioctl.c:739 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff88811059e000 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 24 bytes inside of 240-byte region [ffff88811059e000, ffff88811059e0f0) The buggy address belongs to the page: page:ffffea0004416780 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88811059e280 pfn:0x11059e flags: 0x8000000000000200(slab) raw: 8000000000000200 ffffea0004313100 0000000800000008 ffff888107fe9080 raw: ffff88811059e280 00000000800c0006 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 171, ts 4845954415, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2386 [inline] prep_new_page mm/page_alloc.c:2392 [inline] get_page_from_freelist+0x755/0x810 mm/page_alloc.c:4073 __alloc_pages_nodemask+0x3b6/0x890 mm/page_alloc.c:5160 alloc_slab_page mm/slub.c:1815 [inline] allocate_slab+0x78/0x540 mm/slub.c:1817 new_slab mm/slub.c:1878 [inline] new_slab_objects mm/slub.c:2636 [inline] ___slab_alloc+0x131/0x2e0 mm/slub.c:2800 __slab_alloc+0x63/0xa0 mm/slub.c:2840 slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x1ef/0x300 mm/slub.c:2969 kmem_cache_alloc_node include/linux/slab.h:423 [inline] __alloc_skb+0x7e/0x580 net/core/skbuff.c:199 alloc_skb include/linux/skbuff.h:1116 [inline] alloc_uevent_skb+0x7f/0x230 lib/kobject_uevent.c:290 uevent_net_broadcast_tagged lib/kobject_uevent.c:351 [inline] kobject_uevent_net_broadcast+0x187/0x5a0 lib/kobject_uevent.c:412 kobject_uevent_env+0x540/0x730 lib/kobject_uevent.c:593 kobject_synth_uevent+0x3be/0x930 lib/kobject_uevent.c:208 uevent_store+0x25/0x60 drivers/base/core.c:2299 dev_attr_store+0x5c/0x80 drivers/base/core.c:2000 sysfs_kf_write+0x123/0x140 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x2d0/0x410 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:1969 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xc4a/0xf80 fs/read_write.c:605 page_owner free stack trace missing Memory state around the buggy address: ffff88811059df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811059df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88811059e000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811059e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff88811059e100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop1) in ext4_write_inline_data_end:758: Out of memory