================================================================== BUG: KASAN: slab-use-after-free in lbmIODone+0xeb7/0x11d0 fs/jfs/jfs_logmgr.c:2179 Read of size 4 at addr ffff88802a4aae08 by task ksoftirqd/1/21 CPU: 1 PID: 21 Comm: ksoftirqd/1 Not tainted 6.3.0-rc7-next-20230417-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 lbmIODone+0xeb7/0x11d0 fs/jfs/jfs_logmgr.c:2179 bio_endio+0x589/0x690 block/bio.c:1609 req_bio_endio block/blk-mq.c:761 [inline] blk_update_request+0x56b/0x14f0 block/blk-mq.c:906 blk_mq_end_request+0x59/0x4c0 block/blk-mq.c:1023 lo_complete_rq+0x1c6/0x280 drivers/block/loop.c:370 blk_complete_reqs+0xad/0xe0 block/blk-mq.c:1101 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 run_ksoftirqd kernel/softirq.c:939 [inline] run_ksoftirqd+0x31/0x60 kernel/softirq.c:931 smpboot_thread_fn+0x659/0x9f0 kernel/smpboot.c:164 kthread+0x33e/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 31394: kasan_save_stack+0x22/0x40 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 mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:559 [inline] lbmLogInit fs/jfs/jfs_logmgr.c:1822 [inline] lmLogInit+0x3b3/0x1a50 fs/jfs/jfs_logmgr.c:1270 open_inline_log fs/jfs/jfs_logmgr.c:1175 [inline] lmLogOpen+0x7db/0x1430 fs/jfs/jfs_logmgr.c:1069 jfs_mount_rw+0x2ed/0x6d0 fs/jfs/jfs_mount.c:257 jfs_fill_super+0xa00/0xd40 fs/jfs/super.c:565 mount_bdev+0x357/0x420 fs/super.c:1380 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1510 do_new_mount fs/namespace.c:3039 [inline] path_mount+0x134b/0x1e40 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5106: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3799 lbmLogShutdown fs/jfs/jfs_logmgr.c:1865 [inline] lmLogShutdown+0x349/0x6e0 fs/jfs/jfs_logmgr.c:1684 lmLogClose+0x58a/0x720 fs/jfs/jfs_logmgr.c:1460 jfs_umount+0x2ef/0x430 fs/jfs/jfs_umount.c:114 jfs_put_super+0x85/0x1d0 fs/jfs/super.c:194 generic_shutdown_super+0x158/0x480 fs/super.c:500 kill_block_super+0xa1/0x100 fs/super.c:1407 deactivate_locked_super+0x98/0x160 fs/super.c:331 deactivate_super+0xb1/0xd0 fs/super.c:362 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1177 task_work_run+0x16f/0x270 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+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 insert_work+0x48/0x360 kernel/workqueue.c:1365 __queue_work+0x5c6/0xfb0 kernel/workqueue.c:1526 queue_work_on+0xf2/0x110 kernel/workqueue.c:1554 queue_work include/linux/workqueue.h:505 [inline] addr_event.part.0+0x33e/0x4f0 drivers/infiniband/core/roce_gid_mgmt.c:853 addr_event drivers/infiniband/core/roce_gid_mgmt.c:824 [inline] inet6addr_event+0x142/0x1c0 drivers/infiniband/core/roce_gid_mgmt.c:883 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 atomic_notifier_call_chain+0x73/0x1c0 kernel/notifier.c:231 addrconf_ifdown.isra.0+0xcb5/0x1940 net/ipv6/addrconf.c:3880 addrconf_notify+0x106/0x19f0 net/ipv6/addrconf.c:3678 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] dev_close_many+0x309/0x630 net/core/dev.c:1528 vlan_device_event+0x13cf/0x1fe0 net/8021q/vlan.c:449 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] __dev_notify_flags+0x1ea/0x2d0 net/core/dev.c:8596 dev_change_flags+0x11b/0x170 net/core/dev.c:8632 do_setlink+0x9f4/0x3d30 net/core/rtnetlink.c:2836 rtnl_group_changelink net/core/rtnetlink.c:3380 [inline] __rtnl_newlink+0xb90/0x1840 net/core/rtnetlink.c:3636 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3673 rtnetlink_rcv_msg+0x43d/0xd50 net/core/rtnetlink.c:6395 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2575 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 ____sys_sendmsg+0x71c/0x900 net/socket.c:2501 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2555 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2584 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x790 kernel/rcu/tree.c:2627 neigh_parms_release net/core/neighbour.c:1750 [inline] neigh_parms_release+0x209/0x290 net/core/neighbour.c:1741 inetdev_destroy net/ipv4/devinet.c:329 [inline] inetdev_event+0x1121/0x1720 net/ipv4/devinet.c:1606 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] unregister_netdevice_many_notify+0x75f/0x18c0 net/core/dev.c:10871 ip_tunnel_delete_nets+0x2c2/0x3a0 net/ipv4/ip_tunnel.c:1144 ops_exit_list+0x125/0x170 net/core/net_namespace.c:175 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:614 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552 kthread+0x33e/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88802a4aae00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 8 bytes inside of freed 192-byte region [ffff88802a4aae00, ffff88802a4aaec0) The buggy address belongs to the physical page: page:ffffea0000a92a80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a4aa anon flags: 0x17ff00000000200(slab|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 017ff00000000200 ffff888000141a00 0000000000000000 dead000000000001 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5682, tgid 5678 (syz-executor.4), ts 267751461621, free_ts 267638352341 prep_new_page mm/page_alloc.c:1729 [inline] get_page_from_freelist+0xf7c/0x2aa0 mm/page_alloc.c:3493 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4759 __alloc_pages_node include/linux/gfp.h:237 [inline] alloc_slab_page mm/slub.c:1853 [inline] allocate_slab+0xa7/0x380 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc_node+0x51/0x1a0 mm/slab_common.c:973 kmalloc_array_node include/linux/slab.h:657 [inline] kcalloc_node include/linux/slab.h:662 [inline] memcg_alloc_slab_cgroups+0x8f/0x150 mm/memcontrol.c:2914 memcg_slab_post_alloc_hook+0xa9/0x390 mm/slab.h:491 slab_post_alloc_hook mm/slab.h:719 [inline] slab_alloc_node mm/slub.c:3451 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc+0x1af/0x3b0 mm/slub.c:3475 vma_lock_alloc kernel/fork.c:463 [inline] vm_area_dup+0x55/0x300 kernel/fork.c:516 dup_mmap+0x6be/0x1960 kernel/fork.c:712 dup_mm kernel/fork.c:1685 [inline] copy_mm kernel/fork.c:1734 [inline] copy_process+0x4625/0x75a0 kernel/fork.c:2500 kernel_clone+0xeb/0x890 kernel/fork.c:2911 __do_sys_clone3+0x1d1/0x300 kernel/fork.c:3212 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x4d8/0xb80 mm/page_alloc.c:2555 free_unref_page_list+0xe3/0xa70 mm/page_alloc.c:2696 release_pages+0xcd8/0x1380 mm/swap.c:1042 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:97 zap_pte_range mm/memory.c:1515 [inline] zap_pmd_range mm/memory.c:1564 [inline] zap_pud_range mm/memory.c:1593 [inline] zap_p4d_range mm/memory.c:1614 [inline] unmap_page_range+0x25a9/0x39b0 mm/memory.c:1635 unmap_single_vma+0x19a/0x2b0 mm/memory.c:1681 unmap_vmas+0x234/0x380 mm/memory.c:1720 exit_mmap+0x190/0x930 mm/mmap.c:3101 __mmput+0x128/0x4c0 kernel/fork.c:1344 mmput+0x60/0x70 kernel/fork.c:1366 exit_mm kernel/exit.c:564 [inline] do_exit+0x9d7/0x29f0 kernel/exit.c:858 do_group_exit+0xd4/0x2a0 kernel/exit.c:1021 get_signal+0x2315/0x25b0 kernel/signal.c:2874 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:307 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/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 Memory state around the buggy address: ffff88802a4aad00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802a4aad80: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc >ffff88802a4aae00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802a4aae80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88802a4aaf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================