================================================================== BUG: KASAN: use-after-free in lbmIODone+0x13a5/0x17a0 fs/jfs/jfs_logmgr.c:2194 Read of size 4 at addr ffff88802dc75908 by task ksoftirqd/1/19 CPU: 1 PID: 19 Comm: ksoftirqd/1 Not tainted 5.14.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:105 print_address_description+0x66/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x163/0x210 mm/kasan/report.c:436 lbmIODone+0x13a5/0x17a0 fs/jfs/jfs_logmgr.c:2194 req_bio_endio block/blk-core.c:263 [inline] blk_update_request+0x7f7/0x14f0 block/blk-core.c:1438 blk_mq_end_request+0x39/0x70 block/blk-mq.c:565 blk_complete_reqs block/blk-mq.c:577 [inline] blk_done_softirq+0x104/0x150 block/blk-mq.c:582 __do_softirq+0x372/0x783 kernel/softirq.c:558 run_ksoftirqd+0xa2/0x100 kernel/softirq.c:920 smpboot_thread_fn+0x533/0x9d0 kernel/smpboot.c:164 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 26150: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xc4/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x96/0x340 mm/slub.c:2983 kmalloc include/linux/slab.h:591 [inline] lbmLogInit fs/jfs/jfs_logmgr.c:1830 [inline] lmLogInit+0x336/0x1e90 fs/jfs/jfs_logmgr.c:1278 open_inline_log fs/jfs/jfs_logmgr.c:1183 [inline] lmLogOpen+0x505/0x1190 fs/jfs/jfs_logmgr.c:1077 jfs_mount_rw+0xe7/0x710 fs/jfs/jfs_mount.c:260 jfs_fill_super+0x64c/0xc20 fs/jfs/super.c:570 mount_bdev+0x26c/0x3a0 fs/super.c:1368 legacy_get_tree+0xea/0x180 fs/fs_context.c:610 vfs_get_tree+0x86/0x270 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x196f/0x2be0 fs/namespace.c:3235 do_mount fs/namespace.c:3248 [inline] __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount+0x2f9/0x3b0 fs/namespace.c:3433 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 8630: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x109/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1625 [inline] slab_free_freelist_hook+0x1d8/0x290 mm/slub.c:1650 slab_free mm/slub.c:3210 [inline] kfree+0xcf/0x2d0 mm/slub.c:4262 lbmLogShutdown fs/jfs/jfs_logmgr.c:1873 [inline] lmLogShutdown+0x4b5/0x920 fs/jfs/jfs_logmgr.c:1692 lmLogClose+0x2c2/0x560 fs/jfs/jfs_logmgr.c:1468 jfs_umount+0x297/0x370 fs/jfs/jfs_umount.c:116 jfs_put_super+0x86/0x190 fs/jfs/super.c:194 generic_shutdown_super+0x12e/0x2b0 fs/super.c:465 kill_block_super+0x79/0xd0 fs/super.c:1395 deactivate_locked_super+0xa7/0xf0 fs/super.c:335 cleanup_mnt+0x462/0x510 fs/namespace.c:1136 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x27/0x50 mm/kasan/common.c:38 kasan_record_aux_stack+0xee/0x120 mm/kasan/generic.c:348 insert_work+0x54/0x400 kernel/workqueue.c:1332 __queue_work+0x928/0xc60 kernel/workqueue.c:1498 queue_work_on+0x111/0x200 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x283/0x470 kernel/umh.c:435 kobject_uevent_env+0x1337/0x1700 lib/kobject_uevent.c:618 __loop_clr_fd+0x7ff/0xbf0 drivers/block/loop.c:1343 blkdev_put_whole fs/block_dev.c:1277 [inline] blkdev_put+0x470/0x810 fs/block_dev.c:1574 deactivate_locked_super+0xa7/0xf0 fs/super.c:335 cleanup_mnt+0x462/0x510 fs/namespace.c:1136 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x27/0x50 mm/kasan/common.c:38 kasan_record_aux_stack+0xee/0x120 mm/kasan/generic.c:348 insert_work+0x54/0x400 kernel/workqueue.c:1332 __queue_work+0x928/0xc60 kernel/workqueue.c:1498 queue_work_on+0x111/0x200 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x283/0x470 kernel/umh.c:435 kobject_uevent_env+0x1337/0x1700 lib/kobject_uevent.c:618 loop_set_size drivers/block/loop.c:258 [inline] loop_configure+0x11d6/0x1720 drivers/block/loop.c:1243 lo_ioctl+0x7ef/0x23b0 drivers/block/loop.c:1781 blkdev_ioctl+0x332/0x690 block/ioctl.c:585 block_ioctl+0xae/0xf0 fs/block_dev.c:1602 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88802dc75900 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 8 bytes inside of 192-byte region [ffff88802dc75900, ffff88802dc759c0) The buggy address belongs to the page: page:ffffea0000b71d40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2dc75 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 0000000100000001 ffff888011041a00 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 15511, ts 281715001939, free_ts 281706152070 prep_new_page mm/page_alloc.c:2433 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4166 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5388 alloc_slab_page mm/slub.c:1688 [inline] allocate_slab+0xf1/0x540 mm/slub.c:1828 new_slab mm/slub.c:1891 [inline] new_slab_objects mm/slub.c:2637 [inline] ___slab_alloc+0x1cf/0x350 mm/slub.c:2800 __slab_alloc mm/slub.c:2840 [inline] slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc_trace+0x29d/0x340 mm/slub.c:2981 kmalloc include/linux/slab.h:591 [inline] addr_event+0xc5/0x420 drivers/infiniband/core/roce_gid_mgmt.c:840 inet6addr_event+0xe8/0x150 drivers/infiniband/core/roce_gid_mgmt.c:883 notifier_call_chain kernel/notifier.c:83 [inline] atomic_notifier_call_chain+0x157/0x260 kernel/notifier.c:217 ipv6_add_addr+0xf2c/0x1480 net/ipv6/addrconf.c:1152 addrconf_add_linklocal+0x33b/0xaf0 net/ipv6/addrconf.c:3182 addrconf_addr_gen+0x3ff/0xe60 net/ipv6/addrconf.c:3301 addrconf_notify+0x17ae/0x2110 net/ipv6/addrconf.c:3593 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:410 __dev_notify_flags+0x306/0x5d0 net/core/dev.c:2123 rtnl_configure_link+0x216/0x320 net/core/rtnetlink.c:3140 __rtnl_newlink net/core/rtnetlink.c:3468 [inline] rtnl_newlink+0x164b/0x1cd0 net/core/rtnetlink.c:3508 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1343 [inline] free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1394 free_unref_page_prepare mm/page_alloc.c:3329 [inline] free_unref_page+0x7e/0x550 mm/page_alloc.c:3408 mm_free_pgd kernel/fork.c:636 [inline] __mmdrop+0xae/0x3f0 kernel/fork.c:687 free_bprm+0x136/0x2f0 fs/exec.c:1479 kernel_execve+0x740/0x9a0 fs/exec.c:1976 call_usermodehelper_exec_async+0x262/0x3b0 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88802dc75800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802dc75880: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802dc75900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802dc75980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88802dc75a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================