================================================================== BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0x9a4/0x1104 lib/iov_iter.c:820 Read of size 4096 at addr ffff0000fe695000 by task kworker/u4:25/6302 CPU: 0 PID: 6302 Comm: kworker/u4:25 Not tainted 6.1.27-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Workqueue: loop5 loop_workfn 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 kasan_check_range+0x264/0x2a4 mm/kasan/generic.c:189 memcpy+0x48/0x90 mm/kasan/shadow.c:65 copy_page_from_iter_atomic+0x9a4/0x1104 lib/iov_iter.c:820 generic_perform_write+0x2fc/0x55c mm/filemap.c:3762 __generic_file_write_iter+0x168/0x388 mm/filemap.c:3882 generic_file_write_iter+0xb8/0x2b4 mm/filemap.c:3914 do_iter_write+0x534/0x964 fs/read_write.c:861 vfs_iter_write+0x88/0xac fs/read_write.c:902 lo_write_bvec drivers/block/loop.c:249 [inline] lo_write_simple drivers/block/loop.c:271 [inline] do_req_filebacked drivers/block/loop.c:495 [inline] loop_handle_cmd drivers/block/loop.c:1882 [inline] loop_process_work+0x15fc/0x256c drivers/block/loop.c:1917 loop_workfn+0x54/0x68 drivers/block/loop.c:1941 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2289 worker_thread+0x8e4/0xfec kernel/workqueue.c:2436 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 The buggy address belongs to the physical page: page:000000004a39d02a refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13e695 flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000000000 fffffc00033c5848 fffffc00043e52c8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000fe694f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000fe694f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000fe695000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff0000fe695080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff0000fe695100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== Unable to handle kernel paging request at virtual address dfff800000000005 KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f] 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 [dfff800000000005] address between user and kernel address ranges Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 6302 Comm: kworker/u4:25 Tainted: G B 6.1.27-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Workqueue: loop5 loop_workfn pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : fsnotify_parent include/linux/fsnotify.h:62 [inline] pc : fsnotify_file include/linux/fsnotify.h:99 [inline] pc : fsnotify_modify include/linux/fsnotify.h:317 [inline] pc : do_iter_write+0x640/0x964 fs/read_write.c:865 lr : fsnotify_file include/linux/fsnotify.h:96 [inline] lr : fsnotify_modify include/linux/fsnotify.h:317 [inline] lr : do_iter_write+0x5fc/0x964 fs/read_write.c:865 sp : ffff800024df7680 x29: ffff800024df7780 x28: 1ffff000049beee4 x27: ffff7000049beedc x26: ffff800024df7708 x25: 1fffe00021d60caf x24: 0000000000001000 x23: 0000000000000028 x22: dfff800000000000 x21: ffff0000e25e02f0 x20: 0000000000000000 x19: ffff00010eb06500 x18: 1fffe000368b6776 x17: ffff80001558d000 x16: ffff8000120e6354 x15: ffff0001b45b3bbc x14: ffff0001b45b3bb8 x13: 1fffe000368b6776 x12: 0000000000000001 x11: ff80800008a35a9c x10: 0000000000000000 x9 : ffff0000ff3651c0 x8 : 0000000000000005 x7 : 0000000000000000 x6 : 1fffe000368b6776 x5 : ffff80001562fac0 x4 : 0000000000000008 x3 : ffff8000082fd254 x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000 Call trace: fsnotify_parent include/linux/fsnotify.h:62 [inline] fsnotify_file include/linux/fsnotify.h:99 [inline] fsnotify_modify include/linux/fsnotify.h:317 [inline] do_iter_write+0x640/0x964 fs/read_write.c:865 vfs_iter_write+0x88/0xac fs/read_write.c:902 lo_write_bvec drivers/block/loop.c:249 [inline] lo_write_simple drivers/block/loop.c:271 [inline] do_req_filebacked drivers/block/loop.c:495 [inline] loop_handle_cmd drivers/block/loop.c:1882 [inline] loop_process_work+0x15fc/0x256c drivers/block/loop.c:1917 loop_workfn+0x54/0x68 drivers/block/loop.c:1941 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2289 worker_thread+0x8e4/0xfec kernel/workqueue.c:2436 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Code: 97fcd2cb f9400294 9100a297 d343fee8 (38766908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: 97fcd2cb bl 0xfffffffffff34b2c 4: f9400294 ldr x20, [x20] 8: 9100a297 add x23, x20, #0x28 c: d343fee8 lsr x8, x23, #3 * 10: 38766908 ldrb w8, [x8, x22] <-- trapping instruction