================================================================== BUG: KASAN: slab-use-after-free in lbmIODone+0xed4/0x11f0 fs/jfs/jfs_logmgr.c:2179 Read of size 4 at addr ffff888020050308 by task ksoftirqd/3/31 CPU: 3 PID: 31 Comm: ksoftirqd/3 Not tainted 6.6.0-rc3-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 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:1603 req_bio_endio block/blk-mq.c:783 [inline] blk_update_request+0x67b/0x1780 block/blk-mq.c:928 blk_mq_end_request+0x57/0x520 block/blk-mq.c:1051 lo_complete_rq+0x232/0x2f0 drivers/block/loop.c:370 blk_complete_reqs+0xb2/0xf0 block/blk-mq.c:1131 __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+0x660/0xa00 kernel/smpboot.c:164 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 14949: 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+0xa3/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+0x1f3/0x2e0 fs/super.c:1629 legacy_get_tree+0x109/0x220 fs/fs_context.c:638 vfs_get_tree+0x8c/0x370 fs/super.c:1750 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 5194: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x138/0x190 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] __cache_free mm/slab.c:3370 [inline] __do_kmem_cache_free mm/slab.c:3557 [inline] __kmem_cache_free+0xcc/0x2d0 mm/slab.c:3564 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+0x161/0x3c0 fs/super.c:693 kill_block_super+0x3b/0x70 fs/super.c:1646 deactivate_locked_super+0x9a/0x170 fs/super.c:481 deactivate_super+0xde/0x100 fs/super.c:514 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:180 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+0x215/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 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+0x78/0x80 mm/kasan/generic.c:492 insert_work+0x38/0x230 kernel/workqueue.c:1647 __queue_work+0x5d0/0x1050 kernel/workqueue.c:1799 queue_work_on+0xed/0x110 kernel/workqueue.c:1834 queue_work include/linux/workqueue.h:554 [inline] addr_event.constprop.0+0x391/0x560 drivers/infiniband/core/roce_gid_mgmt.c:853 inet6addr_event+0x113/0x180 drivers/infiniband/core/roce_gid_mgmt.c:883 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 atomic_notifier_call_chain+0x71/0x1b0 kernel/notifier.c:231 ipv6_add_addr+0x137a/0x2000 net/ipv6/addrconf.c:1174 inet6_addr_add+0x3bb/0xbe0 net/ipv6/addrconf.c:2997 inet6_rtm_newaddr+0x11d5/0x1aa0 net/ipv6/addrconf.c:4972 rtnetlink_rcv_msg+0x3c4/0xdf0 net/core/rtnetlink.c:6444 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x536/0x810 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:753 __sys_sendto+0x255/0x340 net/socket.c:2177 __do_sys_sendto net/socket.c:2189 [inline] __se_sys_sendto net/socket.c:2185 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2185 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 The buggy address belongs to the object at ffff888020050300 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 8 bytes inside of freed 192-byte region [ffff888020050300, ffff8880200503c0) The buggy address belongs to the physical page: page:ffffea0000801400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20050 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x10() raw: 00fff00000000800 ffff888012c40000 ffffea000082a410 ffffea00006a5590 raw: 0000000000000000 ffff888020050000 0000000100000010 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 0x242000(__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 201, tgid 201 (kworker/u16:4), ts 8518049160, free_ts 8517952659 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] __kmem_cache_alloc_node+0x3c5/0x470 mm/slab.c:3521 __do_kmalloc_node mm/slab_common.c:1022 [inline] __kmalloc+0x4f/0x100 mm/slab_common.c:1036 kmalloc include/linux/slab.h:603 [inline] bio_kmalloc+0x41/0x60 block/bio.c:605 bio_copy_kern block/blk-map.c:484 [inline] blk_rq_map_kern+0x40a/0x7b0 block/blk-map.c:790 scsi_execute_cmd+0x59c/0x770 drivers/scsi/scsi_lib.c:222 scsi_vpd_inquiry+0xee/0x220 drivers/scsi/scsi.c:312 scsi_get_vpd_buf+0x92/0x160 drivers/scsi/scsi.c:428 scsi_attach_vpd+0xe7/0x510 drivers/scsi/scsi.c:483 scsi_add_lun drivers/scsi/scsi_scan.c:1088 [inline] scsi_probe_and_add_lun+0x208c/0x27d0 drivers/scsi/scsi_scan.c:1266 __scsi_add_device+0x247/0x280 drivers/scsi/scsi_scan.c:1592 ata_scsi_scan_host+0x215/0x780 drivers/ata/libata-scsi.c:4428 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 bio_free_pages+0x1a9/0x2d0 block/bio.c:1434 bio_copy_kern_endio block/blk-map.c:437 [inline] bio_copy_kern_endio_read+0x8b/0x310 block/blk-map.c:453 bio_endio+0x593/0x6a0 block/bio.c:1603 req_bio_endio block/blk-mq.c:783 [inline] blk_update_request+0x67b/0x1780 block/blk-mq.c:928 scsi_end_request+0x7b/0x9a0 drivers/scsi/scsi_lib.c:537 scsi_io_completion+0x178/0x14a0 drivers/scsi/scsi_lib.c:974 scsi_complete+0x124/0x250 drivers/scsi/scsi_lib.c:1438 blk_complete_reqs+0xb2/0xf0 block/blk-mq.c:1131 __do_softirq+0x218/0x965 kernel/softirq.c:553 Memory state around the buggy address: ffff888020050200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888020050280: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888020050300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020050380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888020050400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================