================================================================== BUG: KASAN: use-after-free in xfs_trans_ail_delete+0x64/0x2b0 fs/xfs/xfs_trans_ail.c:875 Read of size 8 at addr ffff0000c8ce1000 by task kworker/0:1H/79 CPU: 0 PID: 79 Comm: kworker/0:1H Not tainted 6.1.25-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Workqueue: xfs-log/loop2 xlog_ioend_work Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x174/0x4c0 mm/kasan/report.c:395 kasan_report+0xd4/0x130 mm/kasan/report.c:495 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351 xfs_trans_ail_delete+0x64/0x2b0 fs/xfs/xfs_trans_ail.c:875 xfs_buf_item_done+0x58/0x94 fs/xfs/xfs_buf_item.c:1042 xfs_buf_ioend+0x2d4/0x78c fs/xfs/xfs_buf.c:1326 xfs_buf_ioend_fail+0x78/0x90 fs/xfs/xfs_buf.c:1397 xfs_buf_item_unpin+0x224/0x918 fs/xfs/xfs_buf_item.c:549 xfs_trans_committed_bulk+0x2d8/0x73c fs/xfs/xfs_trans.c:806 xlog_cil_committed+0x21c/0xd64 fs/xfs/xfs_log_cil.c:795 xlog_cil_process_committed+0x11c/0x174 fs/xfs/xfs_log_cil.c:823 xlog_state_shutdown_callbacks+0x23c/0x324 fs/xfs/xfs_log.c:538 xlog_force_shutdown+0x29c/0x350 fs/xfs/xfs_log.c:3821 xlog_ioend_work+0xa8/0xf8 fs/xfs/xfs_log.c:1402 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2289 worker_thread+0x8e4/0xfec kernel/workqueue.c:2436 kthread+0x24c/0x2d4 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Allocated by task 10403: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0xd8/0x1c4 mm/slab_common.c:968 kmalloc include/linux/slab.h:558 [inline] kmem_alloc+0x1bc/0x518 fs/xfs/kmem.c:20 kmem_zalloc fs/xfs/kmem.h:69 [inline] xfs_trans_ail_init+0x2c/0x220 fs/xfs/xfs_trans_ail.c:902 xfs_log_mount+0x294/0x6e0 fs/xfs/xfs_log.c:721 xfs_mountfs+0xa04/0x18fc fs/xfs/xfs_mount.c:805 xfs_fs_fill_super+0xd38/0xf50 fs/xfs/xfs_super.c:1666 get_tree_bdev+0x360/0x54c fs/super.c:1346 xfs_fs_get_tree+0x28/0x38 fs/xfs/xfs_super.c:1713 vfs_get_tree+0x90/0x274 fs/super.c:1553 do_new_mount+0x25c/0x8c8 fs/namespace.c:3040 path_mount+0x590/0xe58 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3568 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 Freed by task 4356: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0x2c0/0x4b4 mm/slub.c:3674 kfree+0xcc/0x1b8 mm/slab_common.c:1007 kvfree+0x40/0x50 mm/util.c:627 kmem_free fs/xfs/kmem.h:62 [inline] xfs_trans_ail_destroy+0x60/0x70 fs/xfs/xfs_trans_ail.c:933 xfs_log_unmount+0x54/0xbc fs/xfs/xfs_log.c:1116 xfs_unmountfs+0x130/0x1d0 fs/xfs/xfs_mount.c:1081 xfs_fs_put_super+0x78/0x260 fs/xfs/xfs_super.c:1115 generic_shutdown_super+0x130/0x328 fs/super.c:501 kill_block_super+0x70/0xdc fs/super.c:1450 deactivate_locked_super+0xac/0x124 fs/super.c:332 deactivate_super+0xf0/0x110 fs/super.c:363 cleanup_mnt+0x394/0x41c fs/namespace.c:1186 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193 task_work_run+0x240/0x2f0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2144/0x3470 arch/arm64/kernel/signal.c:1132 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 Last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496 call_rcu+0xfc/0xa40 kernel/rcu/tree.c:2798 free_fib_info+0x68/0xa8 net/ipv4/fib_semantics.c:257 fib_create_info+0x14ac/0x1e60 net/ipv4/fib_semantics.c:1585 fib_table_insert+0x1a4/0x1574 net/ipv4/fib_trie.c:1236 fib_magic net/ipv4/fib_frontend.c:1104 [inline] fib_add_ifaddr+0x368/0x122c net/ipv4/fib_frontend.c:1126 fib_netdev_event+0x56c/0x6b0 net/ipv4/fib_frontend.c:1486 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:455 __dev_notify_flags+0x2ac/0x534 dev_change_flags+0xc8/0x154 net/core/dev.c:8622 do_setlink+0xc70/0x3334 net/core/rtnetlink.c:2788 __rtnl_newlink net/core/rtnetlink.c:3547 [inline] rtnl_newlink+0x13b8/0x1b04 net/core/rtnetlink.c:3594 rtnetlink_rcv_msg+0x72c/0xd94 net/core/rtnetlink.c:6091 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2553 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6109 netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline] netlink_unicast+0x660/0x8d4 net/netlink/af_netlink.c:1354 netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1931 sock_sendmsg_nosec net/socket.c:716 [inline] sock_sendmsg net/socket.c:736 [inline] __sys_sendto+0x3b4/0x504 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __arm64_sys_sendto+0xd8/0xf8 net/socket.c:2125 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 Second to last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496 insert_work+0x64/0x384 kernel/workqueue.c:1358 __queue_work+0xd48/0x136c kernel/workqueue.c:1517 queue_work_on+0xc0/0x16c kernel/workqueue.c:1545 queue_work include/linux/workqueue.h:503 [inline] call_usermodehelper_exec+0x238/0x48c kernel/umh.c:437 kobject_uevent_env+0x654/0x874 lib/kobject_uevent.c:618 kobject_uevent+0x2c/0x3c lib/kobject_uevent.c:642 driver_register+0x29c/0x378 drivers/base/driver.c:254 __platform_driver_register+0x74/0x8c drivers/base/platform.c:867 wm8524_codec_driver_init+0x20/0x2c sound/soc/codecs/wm8524.c:248 do_one_initcall+0x260/0xacc init/main.c:1303 do_initcall_level+0x154/0x214 init/main.c:1376 do_initcalls+0x58/0xac init/main.c:1392 do_basic_setup+0x8c/0xa0 init/main.c:1411 kernel_init_freeable+0x3a4/0x528 init/main.c:1631 kernel_init+0x24/0x29c init/main.c:1519 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 The buggy address belongs to the object at ffff0000c8ce1000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff0000c8ce1000, ffff0000c8ce1100) The buggy address belongs to the physical page: page:000000001b0bd014 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x108ce0 head:000000001b0bd014 order:1 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 fffffc00035bd880 dead000000000004 ffff0000c0002480 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c8ce0f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000c8ce0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000c8ce1000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000c8ce1080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c8ce1100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== XFS: xfs_trans_ail_delete: attempting to delete a log item that is not in the AIL Unable to handle kernel paging request at virtual address dfff800000000002 KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] Mem abort info: ESR = 0x0000000096000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x06: level 2 translation fault Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 [dfff800000000002] address between user and kernel address ranges Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 79 Comm: kworker/0:1H Tainted: G B 6.1.25-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Workqueue: xfs-log/loop2 xlog_ioend_work pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : xlog_cil_force fs/xfs/xfs_log_priv.h:598 [inline] pc : xfs_log_force+0x1c0/0xa4c fs/xfs/xfs_log.c:3207 lr : xfs_log_force+0x1b8/0xa4c fs/xfs/xfs_log.c:3205 sp : ffff80001cf27310 x29: ffff80001cf27310 x28: 0000000000000000 x27: ffff800015581108 x26: dfff800000000000 x25: ffff8000154cf008 x24: ffff80000804fba0 x23: ffff800009c3bfa0 x22: 0000000000000000 x21: ffff800009c3bfa0 x20: 0000000000000010 x19: 0000000000000001 x18: 1fffe000368b6b76 x17: 2074616874206d65 x16: ffff8000120dc5fc x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000001 x11: ff80800009c3f3d8 x10: 0000000000000000 x9 : ffff800009c3f3d8 x8 : 0000000000000002 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff80001cf26bb8 x4 : ffff800015662580 x3 : ffff800009c368e0 x2 : ffff800009c3bfa0 x1 : ffff8000126ff7c0 x0 : 0000000000000001 Call trace: xlog_cil_force fs/xfs/xfs_log_priv.h:598 [inline] xfs_log_force+0x1c0/0xa4c fs/xfs/xfs_log.c:3207 xlog_force_shutdown+0xac/0x350 fs/xfs/xfs_log.c:3765 xfs_trans_ail_delete+0x124/0x2b0 fs/xfs/xfs_trans_ail.c:885 xfs_buf_item_done+0x58/0x94 fs/xfs/xfs_buf_item.c:1042 xfs_buf_ioend+0x2d4/0x78c fs/xfs/xfs_buf.c:1326 xfs_buf_ioend_fail+0x78/0x90 fs/xfs/xfs_buf.c:1397 xfs_buf_item_unpin+0x224/0x918 fs/xfs/xfs_buf_item.c:549 xfs_trans_committed_bulk+0x2d8/0x73c fs/xfs/xfs_trans.c:806 xlog_cil_committed+0x21c/0xd64 fs/xfs/xfs_log_cil.c:795 xlog_cil_process_committed+0x11c/0x174 fs/xfs/xfs_log_cil.c:823 xlog_state_shutdown_callbacks+0x23c/0x324 fs/xfs/xfs_log.c:538 xlog_force_shutdown+0x29c/0x350 fs/xfs/xfs_log.c:3821 xlog_ioend_work+0xa8/0xf8 fs/xfs/xfs_log.c:1402 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2289 worker_thread+0x8e4/0xfec kernel/workqueue.c:2436 kthread+0x24c/0x2d4 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Code: aa1703e2 940023c1 910042d4 d343fe88 (387a6908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: aa1703e2 mov x2, x23 4: 940023c1 bl 0x8f08 8: 910042d4 add x20, x22, #0x10 c: d343fe88 lsr x8, x20, #3 * 10: 387a6908 ldrb w8, [x8, x26] <-- trapping instruction