syzbot


KASAN: use-after-free Read in generic_perform_write (2)

Status: upstream: reported C repro on 2021/12/05 01:05
Subsystems: hfsplus jfs
[Documentation on labels]
Reported-by: syzbot+eafc7bf965d768bf75ca@syzkaller.appspotmail.com
First crash: 929d, last: 511d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: slab-out-of-bounds Read in generic_perform_write origin:upstream C 21 15d 278d 0/3 upstream: reported C repro on 2023/09/17 14:11
upstream KASAN: slab-out-of-bounds Read in generic_perform_write hfs mm C inconclusive 10254 16h02m 271d 0/27 upstream: reported C repro on 2023/09/24 07:49
linux-6.1 KASAN: use-after-free Read in generic_perform_write origin:lts-only C unreliable 21 15d 283d 0/3 upstream: reported C repro on 2023/09/12 02:51
linux-4.14 KASAN: use-after-free Read in generic_perform_write 11 1134d 1364d 0/1 auto-closed as invalid on 2021/09/11 00:48
linux-4.19 KASAN: use-after-free Read in generic_perform_write hfsplus jfs C error 68 474d 1366d 0/1 upstream: reported C repro on 2020/09/24 08:55
upstream KASAN: use-after-free Read in generic_perform_write fs mm C error 73 1101d 2164d 0/27 auto-obsoleted due to no activity on 2023/04/14 08:17

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in memcpy include/linux/string.h:376 [inline]
BUG: KASAN: use-after-free in memcpy_from_page+0x8c/0x110 lib/iov_iter.c:454
Read of size 4096 at addr ffff888090917000 by task loop0/7993

CPU: 1 PID: 7993 Comm: loop0 Not tainted 4.14.304-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report+0x6f/0x80 mm/kasan/report.c:409
 memcpy+0x20/0x50 mm/kasan/kasan.c:302
 memcpy include/linux/string.h:376 [inline]
 memcpy_from_page+0x8c/0x110 lib/iov_iter.c:454
 iov_iter_copy_from_user_atomic+0x5dc/0xa20 lib/iov_iter.c:801
 generic_perform_write+0x22b/0x430 mm/filemap.c:3063
 __generic_file_write_iter+0x227/0x590 mm/filemap.c:3180
 generic_file_write_iter+0x36f/0x650 mm/filemap.c:3208
 call_write_iter include/linux/fs.h:1780 [inline]
 do_iter_readv_writev+0x4cf/0x5f0 fs/read_write.c:675
 do_iter_write+0x152/0x550 fs/read_write.c:954
 vfs_iter_write+0x70/0xa0 fs/read_write.c:967
 lo_write_bvec+0x114/0x310 drivers/block/loop.c:272
 lo_write_simple drivers/block/loop.c:294 [inline]
 do_req_filebacked drivers/block/loop.c:587 [inline]
 loop_handle_cmd drivers/block/loop.c:1784 [inline]
 loop_queue_work+0x9f2/0x21e0 drivers/block/loop.c:1798
 kthread_worker_fn+0x271/0x6c0 kernel/kthread.c:667
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406

The buggy address belongs to the page:
page:ffffea00024245c0 count:0 mapcount:0 mapping:          (null) index:0x0
flags: 0xfff00000000000()
raw: 00fff00000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: ffffea00028c59a0 ffffea0002ada3a0 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888090916f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888090916f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888090917000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888090917080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888090917100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/27 01:58 linux-4.14.y 3949d1610004 9dfcf09c .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/10/02 17:21 linux-4.14.y 9d5c0b3a8e1a feb56351 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/09/24 19:50 linux-4.14.y 4edbf74132a4 0042f2b4 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2023/01/21 18:59 linux-4.14.y 97205fccccdc cc0f9968 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in generic_perform_write
2022/12/03 10:24 linux-4.14.y 179ef7fe8677 e080de16 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in generic_perform_write
2022/10/05 20:38 linux-4.14.y 9d5c0b3a8e1a 267e3bb1 .config console log report syz [disk image] [vmlinux] [mounted in repro] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/09/26 02:40 linux-4.14.y 4edbf74132a4 0042f2b4 .config console log report syz [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/09/26 01:33 linux-4.14.y 4edbf74132a4 0042f2b4 .config console log report syz [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/03/16 09:46 linux-4.14.y af48f51cb593 9e8eaa75 .config console log report syz ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/10/05 12:46 linux-4.14.y 9d5c0b3a8e1a 267e3bb1 .config console log report syz [disk image] [vmlinux] [mounted in repro] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in generic_perform_write
2023/01/03 16:55 linux-4.14.y c4215ee4771b f0036e18 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/12/15 05:51 linux-4.14.y c4215ee4771b b18f0a64 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/12/08 19:47 linux-4.14.y 65afe34ac33d 1034e5fa .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/10/06 02:37 linux-4.14.y 9d5c0b3a8e1a 2c6543ad .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/09/28 09:31 linux-4.14.y 9d5c0b3a8e1a 75c78242 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/08/13 07:04 linux-4.14.y b641242202ed 8dfcaa3d .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/06/06 09:45 linux-4.14.y b8f3be299d51 c8857892 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/01/14 22:02 linux-4.14.y 4ba8e26127c3 53e00b45 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2022/01/14 19:49 linux-4.14.y 4ba8e26127c3 53e00b45 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
2021/12/05 01:04 linux-4.14.y 66722c42ec91 a617004c .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in generic_perform_write
* Struck through repros no longer work on HEAD.