================================================================== BUG: KASAN: slab-use-after-free in ext4_dirent_get_data_len fs/ext4/ext4.h:4156 [inline] BUG: KASAN: slab-use-after-free in ext4_dir_entry_len fs/ext4/ext4.h:4183 [inline] BUG: KASAN: slab-use-after-free in __ext4_check_dir_entry+0x659/0xbe0 fs/ext4/dir.c:96 Read of size 1 at addr ffff888103e89c1d by task syz.2.19/5867 CPU: 0 UID: 0 PID: 5867 Comm: syz.2.19 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 ext4_dirent_get_data_len fs/ext4/ext4.h:4156 [inline] ext4_dir_entry_len fs/ext4/ext4.h:4183 [inline] __ext4_check_dir_entry+0x659/0xbe0 fs/ext4/dir.c:96 ext4_check_all_de+0x6a/0x140 fs/ext4/dir.c:657 ext4_convert_inline_data_nolock+0x1b7/0x980 fs/ext4/inline.c:1121 ext4_try_add_inline_entry+0x5cc/0x8a0 fs/ext4/inline.c:1247 __ext4_add_entry+0x385/0x3470 fs/ext4/namei.c:2552 ext4_add_entry fs/ext4/namei.c:2636 [inline] ext4_mkdir+0x5f3/0xd30 fs/ext4/namei.c:3203 vfs_mkdir+0x406/0x620 fs/namei.c:5272 filename_mkdirat+0x285/0x510 fs/namei.c:5305 __do_sys_mkdirat fs/namei.c:5326 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5323 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb01d39ce59 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:00007fb01e269028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fb01d615fa0 RCX: 00007fb01d39ce59 RDX: 0000000000000037 RSI: 0000200000000380 RDI: 0000000000000004 RBP: 00007fb01d432e6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb01d616038 R14: 00007fb01d615fa0 R15: 00007ffdec822cc8 Allocated by task 5630: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x318/0x660 mm/slub.c:5451 _kmalloc_noprof include/linux/slab.h:969 [inline] __hw_addr_create+0x62/0x240 net/core/dev_addr_lists.c:69 __hw_addr_add_ex+0x1ce/0x520 net/core/dev_addr_lists.c:127 __hw_addr_add net/core/dev_addr_lists.c:144 [inline] dev_addr_init+0x15a/0x240 net/core/dev_addr_lists.c:696 alloc_netdev_mqs+0x2b4/0x1270 net/core/dev.c:12064 __ip_tunnel_create+0x348/0x560 net/ipv4/ip_tunnel.c:255 ip_tunnel_init_net+0x2ea/0x810 net/ipv4/ip_tunnel.c:1150 ops_init+0x35d/0x5d0 net/core/net_namespace.c:137 setup_net+0x118/0x350 net/core/net_namespace.c:446 copy_net_ns+0x4f9/0x720 net/core/net_namespace.c:579 create_new_namespaces+0x3f0/0x6b0 kernel/nsproxy.c:132 unshare_nsproxy_namespaces+0x149/0x190 kernel/nsproxy.c:234 ksys_unshare+0x57d/0xa00 kernel/fork.c:3266 __do_sys_unshare kernel/fork.c:3340 [inline] __se_sys_unshare kernel/fork.c:3338 [inline] __x64_sys_unshare+0x38/0x50 kernel/fork.c:3338 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 68: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2700 [inline] slab_free_freelist_hook mm/slub.c:2729 [inline] slab_free_bulk mm/slub.c:6344 [inline] kmem_cache_free_bulk+0x30f/0x1180 mm/slub.c:7076 kfree_bulk include/linux/slab.h:891 [inline] kvfree_rcu_bulk+0xc6/0x190 mm/slab_common.c:1502 kvfree_rcu_drain_ready mm/slab_common.c:1704 [inline] kfree_rcu_monitor+0x21a/0x2b0 mm/slab_common.c:1777 process_one_work kernel/workqueue.c:3322 [inline] process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3486 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556 kvfree_call_rcu+0x100/0x430 mm/slab_common.c:1970 __hw_addr_flush net/core/dev_addr_lists.c:500 [inline] dev_addr_flush+0x16c/0x210 net/core/dev_addr_lists.c:673 free_netdev+0x26c/0x6e0 net/core/dev.c:12209 netdev_run_todo+0xf3d/0x10d0 net/core/dev.c:11743 ops_exit_rtnl_list net/core/net_namespace.c:189 [inline] ops_undo_list+0x396/0x8d0 net/core/net_namespace.c:248 cleanup_net+0x572/0x810 net/core/net_namespace.c:702 process_one_work kernel/workqueue.c:3322 [inline] process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3486 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888103e89c00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 29 bytes inside of freed 128-byte region [ffff888103e89c00, ffff888103e89c80) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103e89 flags: 0x17ff00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 017ff00000000000 ffff888100041a00 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 00000000f5000000 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 2773920656, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x22d/0x280 mm/page_alloc.c:1853 prep_new_page mm/page_alloc.c:1861 [inline] get_page_from_freelist+0x24ae/0x2530 mm/page_alloc.c:3941 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5221 alloc_slab_page mm/slub.c:3289 [inline] allocate_slab+0x74/0x5d0 mm/slub.c:3404 new_slab mm/slub.c:3447 [inline] refill_objects+0x328/0x3c0 mm/slub.c:7241 refill_sheaf mm/slub.c:2827 [inline] __pcs_replace_empty_main+0x2e0/0x6b0 mm/slub.c:4692 alloc_from_pcs mm/slub.c:4790 [inline] slab_alloc_node mm/slub.c:4924 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kmalloc_noprof+0x464/0x750 mm/slub.c:5347 _kmalloc_noprof include/linux/slab.h:973 [inline] _kzalloc_noprof include/linux/slab.h:1286 [inline] __alloc_empty_sheaf+0x24/0x40 mm/slub.c:2774 alloc_empty_sheaf mm/slub.c:2794 [inline] __pcs_replace_empty_main+0x447/0x6b0 mm/slub.c:4687 alloc_from_pcs mm/slub.c:4790 [inline] slab_alloc_node mm/slub.c:4924 [inline] kmem_cache_alloc_lru_noprof+0x372/0x640 mm/slub.c:4958 alloc_inode+0x6a/0x1b0 fs/inode.c:341 new_inode+0x1f/0x170 fs/inode.c:1177 debugfs_get_inode fs/debugfs/inode.c:72 [inline] debugfs_create_dir+0x68/0x350 fs/debugfs/inode.c:578 blk_dev_init+0xdf/0x150 block/blk-core.c:1333 genhd_device_init+0x1c/0x50 block/genhd.c:1002 do_one_initcall+0x250/0x870 init/main.c:1347 page_owner free stack trace missing Memory state around the buggy address: ffff888103e89b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888103e89b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888103e89c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888103e89c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888103e89d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================