================================================================== BUG: KASAN: slab-use-after-free in lbmIODone+0xed4/0x11f0 fs/jfs/jfs_logmgr.c:2179 Read of size 4 at addr ffff8880293a7308 by task ksoftirqd/0/15 CPU: 0 PID: 15 Comm: ksoftirqd/0 Not tainted 6.5.0-rc3-next-20230726-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 lbmIODone+0xed4/0x11f0 fs/jfs/jfs_logmgr.c:2179 bio_endio+0x593/0x6a0 block/bio.c:1599 req_bio_endio block/blk-mq.c:770 [inline] blk_update_request+0x67b/0x1780 block/blk-mq.c:915 blk_mq_end_request+0x57/0x3c0 block/blk-mq.c:1036 lo_complete_rq+0x1c4/0x270 drivers/block/loop.c:370 blk_complete_reqs+0xb2/0xf0 block/blk-mq.c:1114 __do_softirq+0x218/0x965 kernel/softirq.c:553 run_ksoftirqd kernel/softirq.c:921 [inline] run_ksoftirqd+0x31/0x60 kernel/softirq.c:913 smpboot_thread_fn+0x67d/0xa00 kernel/smpboot.c:164 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 7441: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:599 [inline] lbmLogInit fs/jfs/jfs_logmgr.c:1822 [inline] lmLogInit+0x3ec/0x1a80 fs/jfs/jfs_logmgr.c:1270 open_inline_log fs/jfs/jfs_logmgr.c:1175 [inline] lmLogOpen+0x7d9/0x13f0 fs/jfs/jfs_logmgr.c:1069 jfs_mount_rw+0x2ea/0x6f0 fs/jfs/jfs_mount.c:257 jfs_fill_super+0x9d2/0xd20 fs/jfs/super.c:565 mount_bdev+0x30d/0x3d0 fs/super.c:1391 legacy_get_tree+0x109/0x220 fs/fs_context.c:611 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5077: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15e/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822 lbmLogShutdown fs/jfs/jfs_logmgr.c:1865 [inline] lmLogShutdown+0x379/0x780 fs/jfs/jfs_logmgr.c:1684 lmLogClose+0x57a/0x710 fs/jfs/jfs_logmgr.c:1460 jfs_umount+0x2f0/0x430 fs/jfs/jfs_umount.c:114 jfs_put_super+0x88/0x1d0 fs/jfs/super.c:194 generic_shutdown_super+0x158/0x480 fs/super.c:499 kill_block_super+0x64/0xb0 fs/super.c:1417 deactivate_locked_super+0x9a/0x170 fs/super.c:330 deactivate_super+0xde/0x100 fs/super.c:361 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 insert_work+0x4a/0x330 kernel/workqueue.c:1559 __queue_work+0x5f5/0x1040 kernel/workqueue.c:1720 queue_work_on+0xed/0x110 kernel/workqueue.c:1750 queue_work include/linux/workqueue.h:506 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:659 [inline] netdevice_event+0x6be/0x9a0 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1962 call_netdevice_notifiers_extack net/core/dev.c:2000 [inline] call_netdevice_notifiers net/core/dev.c:2014 [inline] __dev_notify_flags+0x12d/0x2e0 net/core/dev.c:8626 dev_change_flags+0x122/0x170 net/core/dev.c:8664 do_setlink+0x1a2a/0x3fa0 net/core/rtnetlink.c:2866 __rtnl_newlink+0xc04/0x18c0 net/core/rtnetlink.c:3654 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3701 rtnetlink_rcv_msg+0x439/0xd30 net/core/rtnetlink.c:6423 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2575 netlink_unicast_kernel net/netlink/af_netlink.c:1344 [inline] netlink_unicast+0x539/0x800 net/netlink/af_netlink.c:1370 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1939 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:748 __sys_sendto+0x255/0x340 net/socket.c:2134 __do_sys_sendto net/socket.c:2146 [inline] __se_sys_sendto net/socket.c:2142 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2142 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 insert_work+0x4a/0x330 kernel/workqueue.c:1559 __queue_work+0x5f5/0x1040 kernel/workqueue.c:1720 queue_work_on+0xed/0x110 kernel/workqueue.c:1750 queue_work include/linux/workqueue.h:506 [inline] call_usermodehelper_exec+0x1d2/0x4c0 kernel/umh.c:434 kobject_uevent_env+0xf6d/0x1800 lib/kobject_uevent.c:618 kernel_add_sysfs_param kernel/params.c:817 [inline] param_sysfs_builtin kernel/params.c:852 [inline] param_sysfs_builtin_init+0x327/0x450 kernel/params.c:986 do_one_initcall+0x117/0x630 init/main.c:1241 do_initcall_level init/main.c:1303 [inline] do_initcalls init/main.c:1319 [inline] do_basic_setup init/main.c:1338 [inline] kernel_init_freeable+0x5bd/0x8f0 init/main.c:1555 kernel_init+0x1c/0x2a0 init/main.c:1446 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff8880293a7300 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 8 bytes inside of freed 192-byte region [ffff8880293a7300, ffff8880293a73c0) The buggy address belongs to the physical page: page:ffffea0000a4e9c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x293a7 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff888012841a00 ffffea0000a55580 dead000000000004 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 23578555554, free_ts 23576603598 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1569 prep_new_page mm/page_alloc.c:1576 [inline] get_page_from_freelist+0x10d7/0x31b0 mm/page_alloc.c:3256 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4512 alloc_page_interleave+0x1e/0x250 mm/mempolicy.c:2112 alloc_pages+0x22a/0x270 mm/mempolicy.c:2274 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x24e/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1115 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] call_usermodehelper_setup+0x9a/0x340 kernel/umh.c:363 kobject_uevent_env+0xf4e/0x1800 lib/kobject_uevent.c:614 kernel_add_sysfs_param kernel/params.c:817 [inline] param_sysfs_builtin kernel/params.c:852 [inline] param_sysfs_builtin_init+0x327/0x450 kernel/params.c:986 do_one_initcall+0x117/0x630 init/main.c:1241 do_initcall_level init/main.c:1303 [inline] do_initcalls init/main.c:1319 [inline] do_basic_setup init/main.c:1338 [inline] kernel_init_freeable+0x5bd/0x8f0 init/main.c:1555 kernel_init+0x1c/0x2a0 init/main.c:1446 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1160 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2383 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2524 release_pages+0x32a/0x14e0 mm/swap.c:1042 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:97 tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu mm/mmu_gather.c:299 [inline] tlb_finish_mmu+0x14b/0x6f0 mm/mmu_gather.c:391 exit_mmap+0x38b/0xa60 mm/mmap.c:3211 __mmput+0x12a/0x4d0 kernel/fork.c:1356 mmput+0x62/0x70 kernel/fork.c:1378 free_bprm+0x144/0x3f0 fs/exec.c:1492 kernel_execve+0x3e7/0x4e0 fs/exec.c:2026 call_usermodehelper_exec_async+0x256/0x4c0 kernel/umh.c:110 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff8880293a7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880293a7280: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880293a7300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880293a7380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880293a7400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================