EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 7: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) ================================================================== BUG: KASAN: use-after-free in ext4_ext_insert_extent+0x403c/0x4d20 fs/ext4/extents.c:2068 Read of size 4 at addr ffff88812282a4a4 by task kworker/u4:1/9 CPU: 1 PID: 9 Comm: kworker/u4:1 Not tainted 5.10.214-syzkaller-1001996-ga8e7f812fbc1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: ext4-rsv-conversion ext4_end_io_rsv_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_insert_extent+0x403c/0x4d20 fs/ext4/extents.c:2068 ext4_ext_map_blocks+0x1c47/0x6ee0 fs/ext4/extents.c:4332 ext4_map_blocks+0xa65/0x1d10 fs/ext4/inode.c:644 ext4_convert_unwritten_extents+0x2a3/0x5a0 fs/ext4/extents.c:4838 ext4_convert_unwritten_io_end_vec+0x104/0x180 fs/ext4/extents.c:4877 ext4_end_io_end fs/ext4/page-io.c:189 [inline] ext4_do_flush_completed_IO fs/ext4/page-io.c:262 [inline] ext4_end_io_rsv_work+0x358/0x690 fs/ext4/page-io.c:276 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299 Allocated by task 351: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:509 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x18a/0x2e0 mm/slub.c:2974 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] kobject_uevent_env+0x269/0x700 lib/kobject_uevent.c:524 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642 rx_queue_add_kobject net/core/net-sysfs.c:1029 [inline] net_rx_queue_update_kobjects+0x1e3/0x430 net/core/net-sysfs.c:1069 register_queue_kobjects net/core/net-sysfs.c:1750 [inline] netdev_register_kobject+0x231/0x320 net/core/net-sysfs.c:2001 register_netdevice+0xe9b/0x13f0 net/core/dev.c:10036 br_dev_newlink+0x27/0x110 net/bridge/br_netlink.c:1370 __rtnl_newlink net/core/rtnetlink.c:3479 [inline] rtnl_newlink+0x1516/0x2000 net/core/rtnetlink.c:3527 rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5607 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2497 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5625 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1348 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] __sys_sendto+0x545/0x700 net/socket.c:2006 __do_sys_sendto net/socket.c:2018 [inline] __se_sys_sendto net/socket.c:2014 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2014 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 351: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc3/0x270 mm/slub.c:4191 kobject_uevent_env+0x33c/0x700 lib/kobject_uevent.c:626 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642 rx_queue_add_kobject net/core/net-sysfs.c:1029 [inline] net_rx_queue_update_kobjects+0x1e3/0x430 net/core/net-sysfs.c:1069 register_queue_kobjects net/core/net-sysfs.c:1750 [inline] netdev_register_kobject+0x231/0x320 net/core/net-sysfs.c:2001 register_netdevice+0xe9b/0x13f0 net/core/dev.c:10036 br_dev_newlink+0x27/0x110 net/bridge/br_netlink.c:1370 __rtnl_newlink net/core/rtnetlink.c:3479 [inline] rtnl_newlink+0x1516/0x2000 net/core/rtnetlink.c:3527 rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5607 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2497 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5625 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1348 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] __sys_sendto+0x545/0x700 net/socket.c:2006 __do_sys_sendto net/socket.c:2018 [inline] __se_sys_sendto net/socket.c:2014 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2014 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff88812282a000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1188 bytes inside of 4096-byte region [ffff88812282a000, ffff88812282b000) The buggy address belongs to the page: page:ffffea00048a0a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x122828 head:ffffea00048a0a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042c00 raw: 0000000000000000 0000000000040004 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 351, ts 42232966178, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5346 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc_trace+0x1bd/0x2e0 mm/slub.c:2972 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] kobject_uevent_env+0x269/0x700 lib/kobject_uevent.c:524 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642 rx_queue_add_kobject net/core/net-sysfs.c:1029 [inline] net_rx_queue_update_kobjects+0x1e3/0x430 net/core/net-sysfs.c:1069 register_queue_kobjects net/core/net-sysfs.c:1750 [inline] netdev_register_kobject+0x231/0x320 net/core/net-sysfs.c:2001 register_netdevice+0xe9b/0x13f0 net/core/dev.c:10036 br_dev_newlink+0x27/0x110 net/bridge/br_netlink.c:1370 __rtnl_newlink net/core/rtnetlink.c:3479 [inline] rtnl_newlink+0x1516/0x2000 net/core/rtnetlink.c:3527 rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5607 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2497 page_owner free stack trace missing Memory state around the buggy address: ffff88812282a380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88812282a400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88812282a480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88812282a500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88812282a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 8: len 1: ext4_ext_map_blocks returned -28 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -28) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 9: len 1: ext4_ext_map_blocks returned -28 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -28) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 10: len 1: ext4_ext_map_blocks returned -28 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -28) EXT4-fs error (device loop1): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3): ext4_map_blocks:710: inode #19: block 194: comm kworker/u4:1: lblock 2 mapped to illegal pblock 194 (length 1) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 2: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop3): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop0): ext4_map_blocks:710: inode #19: block 251: comm kworker/u4:1: lblock 43 mapped to illegal pblock 251 (length 1) EXT4-fs warning (device loop0): ext4_convert_unwritten_extents:4845: inode #19: block 43: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop0): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop0) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop0): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop0): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3): ext4_map_blocks:710: inode #19: block 244: comm kworker/u4:1: lblock 36 mapped to illegal pblock 244 (length 1) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 36: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop3): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop3): ext4_find_extent:928: inode #19: comm kworker/u4:1: pblk 208 bad header/extent: invalid magic - magic 6f69, entries 29795, max 9324(0), depth 20297(0) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 37: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop3): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop3): ext4_find_extent:928: inode #19: comm kworker/u4:1: pblk 208 bad header/extent: invalid magic - magic 6f69, entries 29795, max 9324(0), depth 20297(0) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 38: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 39: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 40: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 41: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 42: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 43: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 44: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4845: inode #19: block 45: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop2): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop0): ext4_map_blocks:710: inode #19: block 226: comm kworker/u4:1: lblock 18 mapped to illegal pblock 226 (length 1) EXT4-fs warning (device loop0): ext4_convert_unwritten_extents:4845: inode #19: block 18: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop0): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop0) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop0): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop0): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop0): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop0): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop5): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4): ext4_map_blocks:710: inode #19: block 242: comm kworker/u4:1: lblock 34 mapped to illegal pblock 242 (length 1) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 34: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop4): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop4): ext4_ext_split:1071: inode #19: comm kworker/u4:1: p_ext > EXT_MAX_EXTENT! EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 35: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop4): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop4): ext4_map_blocks:710: inode #19: block 61729485602985: comm kworker/u4:1: lblock 36 mapped to illegal pblock 61729485602985 (length 1) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 36: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 37: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 38: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 39: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 40: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 41: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 42: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 43: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117)