================================================================== BUG: KASAN: slab-out-of-bounds in ext4_read_inline_data+0x1f8/0x2e0 fs/ext4/inline.c:209 Read of size 68 at addr ffff88810efabec9 by task syz-executor.0/371 CPU: 0 PID: 371 Comm: syz-executor.0 Tainted: G W 6.9.0-rc4-syzkaller-g0bbac3facb5d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x184/0x200 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x163/0x550 mm/kasan/report.c:488 kasan_report+0x15f/0x190 mm/kasan/report.c:601 kasan_check_range+0x238/0x2b0 mm/kasan/generic.c:189 __asan_memcpy+0x2d/0x70 mm/kasan/shadow.c:105 ext4_read_inline_data+0x1f8/0x2e0 fs/ext4/inline.c:209 ext4_inlinedir_to_tree+0x378/0xed0 fs/ext4/inline.c:1365 ext4_htree_fill_tree+0x5d4/0x13e0 fs/ext4/namei.c:1210 ext4_dx_readdir fs/ext4/dir.c:597 [inline] ext4_readdir+0x2dc3/0x37e0 fs/ext4/dir.c:142 iterate_dir+0x1f2/0x590 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:409 [inline] __se_sys_getdents64+0x1c1/0x470 fs/readdir.c:394 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:394 x64_sys_call+0x2916/0x2cd0 arch/x86/include/generated/asm/syscalls_64.h:218 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x54/0x120 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f38836a9363 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 62 8b fa ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 b0 ff ff ff f7 d8 RSP: 002b:00007ffe9abdfa78 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 000055556205b890 RCX: 00007f38836a9363 RDX: 0000000000008000 RSI: 000055556205b890 RDI: 0000000000000006 RBP: 000055556205b864 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffb0 R13: 0000000000000016 R14: 000055556205b860 R15: 0000000000000008 Allocated by task 371: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3b/0x70 mm/kasan/common.c:68 kasan_save_alloc_info+0x38/0x50 mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x99/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace+0x18c/0x360 mm/slub.c:3997 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] kobject_uevent_env+0x26b/0x710 lib/kobject_uevent.c:525 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:641 netdev_queue_add_kobject net/core/net-sysfs.c:1797 [inline] netdev_queue_update_kobjects+0x2f3/0x600 net/core/net-sysfs.c:1838 register_queue_kobjects net/core/net-sysfs.c:1900 [inline] netdev_register_kobject+0x24d/0x300 net/core/net-sysfs.c:2140 register_netdevice+0xd2e/0x1400 net/core/dev.c:10277 veth_newlink+0x624/0xcd0 drivers/net/veth.c:1828 rtnl_newlink_create net/core/rtnetlink.c:3494 [inline] __rtnl_newlink net/core/rtnetlink.c:3714 [inline] rtnl_newlink+0x156f/0x2070 net/core/rtnetlink.c:3727 rtnetlink_rcv_msg+0xa33/0xe50 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2559 rtnetlink_rcv+0x1c/0x30 net/core/rtnetlink.c:6613 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x90a/0xac0 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8a9/0xc70 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x23b/0x290 net/socket.c:745 __sys_sendto+0x39a/0x4f0 net/socket.c:2191 __do_sys_sendto net/socket.c:2203 [inline] __se_sys_sendto net/socket.c:2199 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2199 x64_sys_call+0x16b4/0x2cd0 arch/x86/include/generated/asm/syscalls_64.h:45 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x54/0x120 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e Freed by task 371: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3b/0x70 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xfd/0x140 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0xe8/0x280 mm/slub.c:4390 kobject_uevent_env+0x516/0x710 lib/kobject_uevent.c:625 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:641 netdev_queue_add_kobject net/core/net-sysfs.c:1797 [inline] netdev_queue_update_kobjects+0x2f3/0x600 net/core/net-sysfs.c:1838 register_queue_kobjects net/core/net-sysfs.c:1900 [inline] netdev_register_kobject+0x24d/0x300 net/core/net-sysfs.c:2140 register_netdevice+0xd2e/0x1400 net/core/dev.c:10277 veth_newlink+0x624/0xcd0 drivers/net/veth.c:1828 rtnl_newlink_create net/core/rtnetlink.c:3494 [inline] __rtnl_newlink net/core/rtnetlink.c:3714 [inline] rtnl_newlink+0x156f/0x2070 net/core/rtnetlink.c:3727 rtnetlink_rcv_msg+0xa33/0xe50 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2559 rtnetlink_rcv+0x1c/0x30 net/core/rtnetlink.c:6613 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x90a/0xac0 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8a9/0xc70 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x23b/0x290 net/socket.c:745 __sys_sendto+0x39a/0x4f0 net/socket.c:2191 __do_sys_sendto net/socket.c:2203 [inline] __se_sys_sendto net/socket.c:2199 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2199 x64_sys_call+0x16b4/0x2cd0 arch/x86/include/generated/asm/syscalls_64.h:45 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x54/0x120 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e The buggy address belongs to the object at ffff88810efaa000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 3785 bytes to the right of allocated 4096-byte region [ffff88810efaa000, ffff88810efab000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10efa8 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x4000000000000840(slab|head|zone=1) page_type: 0xffffffff() raw: 4000000000000840 ffff888100042140 ffffea00043be600 0000000000000003 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 head: 4000000000000840 ffff888100042140 ffffea00043be600 0000000000000003 head: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 head: 4000000000000003 ffffea00043bea01 ffffea00043bea48 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 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 102, tgid 102 (udevadm), ts 4375741182, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x217/0x220 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x3587/0x3650 mm/page_alloc.c:3317 __alloc_pages+0x3ad/0x800 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xe8/0x4b0 mm/slub.c:2391 ___slab_alloc+0x76f/0xc40 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmalloc_trace+0x217/0x360 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] kobject_uevent_env+0x26b/0x710 lib/kobject_uevent.c:525 kobject_synth_uevent+0x4eb/0xae0 lib/kobject_uevent.c:207 store_uevent+0x25/0x50 kernel/module/main.c:916 module_attr_store+0x60/0x90 kernel/params.c:924 sysfs_kf_write+0x127/0x150 fs/sysfs/file.c:136 kernfs_fop_write_iter+0x2c5/0x410 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:2110 [inline] new_sync_write fs/read_write.c:497 [inline] vfs_write+0xbbe/0xf80 fs/read_write.c:590 ksys_write+0x199/0x2c0 fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:652 x64_sys_call+0x2711/0x2cd0 arch/x86/include/generated/asm/syscalls_64.h:2 page_owner free stack trace missing Memory state around the buggy address: ffff88810efabd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810efabe00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88810efabe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88810efabf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810efabf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1403: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir1604901279/syzkaller.t9B9MF/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1829: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1403: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir1604901279/syzkaller.t9B9MF/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1829: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1403: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir1604901279/syzkaller.t9B9MF/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1829: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1403: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir1604901279/syzkaller.t9B9MF/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1829: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1403: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir1604901279/syzkaller.t9B9MF/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1829: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1836: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs (loop0): unmounting filesystem 00000000-0000-0000-0000-000000000000.