loop3: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-out-of-bounds in diWrite+0xde3/0x19b0 fs/jfs/jfs_imap.c:750 Write of size 32 at addr ffff88802989d0c0 by task syz-executor.3/8379 CPU: 0 PID: 8379 Comm: syz-executor.3 Not tainted 6.9.0-rc4-next-20240418-syzkaller #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+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 diWrite+0xde3/0x19b0 fs/jfs/jfs_imap.c:750 txCommit+0xa1a/0x6a20 fs/jfs/jfs_txnmgr.c:1255 add_missing_indices fs/jfs/jfs_dtree.c:2661 [inline] jfs_readdir+0x28e9/0x4660 fs/jfs/jfs_dtree.c:3009 wrap_directory_iterator+0x94/0xe0 fs/readdir.c:67 iterate_dir+0x65e/0x820 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:409 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:394 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa2ace7dea9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa2adb8d0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007fa2acfabf80 RCX: 00007fa2ace7dea9 RDX: 000000000000005d RSI: 00000000200002c0 RDI: 0000000000000005 RBP: 00007fa2aceca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fa2acfabf80 R15: 00007ffd0a7dc208 Allocated by task 7830: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3897 [inline] slab_alloc_node mm/slub.c:3957 [inline] kmem_cache_alloc_noprof+0x135/0x290 mm/slub.c:3964 __kernfs_new_node+0xd8/0x870 fs/kernfs/dir.c:624 kernfs_new_node+0x137/0x240 fs/kernfs/dir.c:700 __kernfs_create_file+0x49/0x2e0 fs/kernfs/file.c:1034 sysfs_add_file_mode_ns+0x24a/0x310 fs/sysfs/file.c:307 create_files fs/sysfs/group.c:76 [inline] internal_create_group+0x7a7/0x11d0 fs/sysfs/group.c:180 internal_create_groups fs/sysfs/group.c:220 [inline] sysfs_create_groups+0x56/0x120 fs/sysfs/group.c:246 device_add_groups drivers/base/core.c:2814 [inline] device_add_attrs+0x199/0x600 drivers/base/core.c:2934 device_add+0x576/0xbf0 drivers/base/core.c:3666 netdev_register_kobject+0x17e/0x320 net/core/net-sysfs.c:2136 register_netdevice+0x11ff/0x1a10 net/core/dev.c:10348 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:505 [inline] nsim_create+0x41d/0x500 drivers/net/netdevsim/netdev.c:563 __nsim_dev_port_add+0x6c0/0xae0 drivers/net/netdevsim/dev.c:1390 nsim_dev_port_add_all+0x33/0xf0 drivers/net/netdevsim/dev.c:1446 nsim_drv_probe+0x85f/0xb80 drivers/net/netdevsim/dev.c:1604 really_probe+0x2b8/0xad0 drivers/base/dd.c:656 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:798 driver_probe_device+0x50/0x430 drivers/base/dd.c:828 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:956 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:457 __device_attach+0x333/0x520 drivers/base/dd.c:1028 bus_probe_device+0x189/0x260 drivers/base/bus.c:532 device_add+0x856/0xbf0 drivers/base/core.c:3712 nsim_bus_dev_new drivers/net/netdevsim/bus.c:442 [inline] new_device_store+0x3f3/0x890 drivers/net/netdevsim/bus.c:173 kernfs_fop_write_iter+0x3a1/0x500 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:497 [inline] vfs_write+0xa72/0xc90 fs/read_write.c:590 ksys_write+0x1a0/0x2c0 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802989d000 which belongs to the cache kernfs_node_cache of size 176 The buggy address is located 16 bytes to the right of allocated 176-byte region [ffff88802989d000, ffff88802989d0b0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2989d flags: 0xfff80000000000(node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffefff(slab) raw: 00fff80000000000 ffff888015ef0dc0 ffffea0001da2f80 000000000000000c raw: 0000000000000000 0000000000110011 00000001ffffefff 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 0x152cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 35, tgid 1201215089 (kworker/u8:2), ts 35, free_ts 189473816139 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1476 prep_new_page mm/page_alloc.c:1484 [inline] get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3446 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4704 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2259 allocate_slab+0x5a/0x2e0 mm/slub.c:2422 new_slab mm/slub.c:2475 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3624 __slab_alloc+0x58/0xa0 mm/slub.c:3714 __slab_alloc_node mm/slub.c:3767 [inline] slab_alloc_node mm/slub.c:3945 [inline] kmem_cache_alloc_noprof+0x1c1/0x290 mm/slub.c:3964 __kernfs_new_node+0xd8/0x870 fs/kernfs/dir.c:624 kernfs_new_node+0x137/0x240 fs/kernfs/dir.c:700 kernfs_create_link+0xa5/0x1f0 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x85/0x110 fs/sysfs/symlink.c:44 device_add_class_symlinks+0x1c5/0x250 drivers/base/core.c:3471 device_add+0x553/0xbf0 drivers/base/core.c:3663 netdev_register_kobject+0x17e/0x320 net/core/net-sysfs.c:2136 register_netdevice+0x11ff/0x1a10 net/core/dev.c:10348 page last free pid 1578 tgid 1578 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1096 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2609 vfree+0x186/0x2e0 mm/vmalloc.c:3338 delayed_vfree_work+0x56/0x80 mm/vmalloc.c:3259 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88802989cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802989d000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802989d080: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 ^ ffff88802989d100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802989d180: 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 ==================================================================