loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-use-after-free in diWrite+0x1209/0x1f40 fs/jfs/jfs_imap.c:753 Write of size 32 at addr ffff88803f9c40c0 by task syz.0.16/5942 CPU: 0 UID: 0 PID: 5942 Comm: syz.0.16 Not tainted 6.15.0-rc6-syzkaller-00300-g205b2bd7939c #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x29a/0x2b0 mm/kasan/generic.c:189 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 diWrite+0x1209/0x1f40 fs/jfs/jfs_imap.c:753 txCommit+0x852/0x5430 fs/jfs/jfs_txnmgr.c:1255 add_missing_indices+0x87d/0xbc0 fs/jfs/jfs_dtree.c:2664 jfs_readdir+0x1da4/0x3ac0 fs/jfs/jfs_dtree.c:3020 wrap_directory_iterator+0x93/0xe0 fs/readdir.c:65 iterate_dir+0x5ac/0x770 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64+0xe4/0x260 fs/readdir.c:389 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4dd938e969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4dda18f038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f4dd95b5fa0 RCX: 00007f4dd938e969 RDX: 0000000000001000 RSI: 00002000000038c0 RDI: 0000000000000005 RBP: 00007f4dd9410ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4dd95b5fa0 R15: 00007ffd4e493878 Allocated by task 5836: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203 __proc_create+0x384/0x8f0 fs/proc/generic.c:427 proc_create_reg+0x8b/0x110 fs/proc/generic.c:554 proc_create_net_data+0x98/0x1b0 fs/proc/proc_net.c:120 netlink_net_init+0x56/0x70 net/netlink/af_netlink.c:2815 ops_init+0x35c/0x5c0 net/core/net_namespace.c:138 setup_net+0x238/0x830 net/core/net_namespace.c:364 copy_net_ns+0x32e/0x590 net/core/net_namespace.c:518 create_new_namespaces+0x3d3/0x700 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11c/0x170 kernel/nsproxy.c:228 ksys_unshare+0x4c8/0x8c0 kernel/fork.c:3375 __do_sys_unshare kernel/fork.c:3446 [inline] __se_sys_unshare kernel/fork.c:3444 [inline] __x64_sys_unshare+0x38/0x50 kernel/fork.c:3444 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 56: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2380 [inline] slab_free mm/slub.c:4642 [inline] kmem_cache_free+0x192/0x3f0 mm/slub.c:4744 ops_exit_list net/core/net_namespace.c:172 [inline] cleanup_net+0x717/0xbd0 net/core/net_namespace.c:654 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xade/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x711/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88803f9c4000 which belongs to the cache proc_dir_entry of size 256 The buggy address is located 192 bytes inside of freed 256-byte region [ffff88803f9c4000, ffff88803f9c4100) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88803f9c4dc0 pfn:0x3f9c4 flags: 0x4fff00000000200(workingset|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000200 ffff888030ab88c0 ffffea000100f590 ffffea0001643750 raw: ffff88803f9c4dc0 00000000000c0007 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5737, tgid 5737 (syz-executor), ts 133970695000, free_ts 130725972075 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x21ce/0x22b0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2618 new_slab mm/slub.c:2672 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3858 __slab_alloc mm/slub.c:3948 [inline] __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] kmem_cache_alloc_noprof+0x283/0x3c0 mm/slub.c:4203 __proc_create+0x384/0x8f0 fs/proc/generic.c:427 proc_create_reg+0x8b/0x110 fs/proc/generic.c:554 proc_create_net_data+0x98/0x1b0 fs/proc/proc_net.c:120 udplite4_proc_init_net+0x5b/0x70 net/ipv4/udplite.c:90 ops_init+0x35c/0x5c0 net/core/net_namespace.c:138 setup_net+0x238/0x830 net/core/net_namespace.c:364 copy_net_ns+0x32e/0x590 net/core/net_namespace.c:518 create_new_namespaces+0x3d3/0x700 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11c/0x170 kernel/nsproxy.c:228 page last free pid 5724 tgid 5724 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xb0e/0xcd0 mm/page_alloc.c:2725 __slab_free+0x326/0x400 mm/slub.c:4553 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203 ptlock_alloc+0x20/0x70 mm/memory.c:7354 ptlock_init include/linux/mm.h:3074 [inline] pagetable_pte_ctor include/linux/mm.h:3122 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:73 [inline] pte_alloc_one+0x6d/0x160 arch/x86/mm/pgtable.c:17 __pte_alloc+0x25/0x160 mm/memory.c:430 do_anonymous_page mm/memory.c:4968 [inline] do_pte_missing mm/memory.c:4158 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x49e9/0x5380 mm/memory.c:6140 handle_mm_fault+0x3f6/0x8c0 mm/memory.c:6309 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1337 handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x68/0x110 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 Memory state around the buggy address: ffff88803f9c3f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88803f9c4000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88803f9c4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803f9c4100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88803f9c4180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================