syzbot


BUG: unable to handle kernel NULL pointer dereference in __writepage

Status: fixed on 2023/06/08 14:41
Subsystems: udf
[Documentation on labels]
Reported-by: syzbot+c27475eb921c46bbdc62@syzkaller.appspotmail.com
Fix commit: 79d3c6dbada4 udf: Convert in-ICB files to use udf_writepages()
First crash: 662d, last: 594d
Cause bisection: introduced by (bisect log) :
commit 36273e5b4e3a934c6d346c8f0b16b97e018094af
Author: Christoph Hellwig <hch@lst.de>
Date: Sun Nov 13 16:29:02 2022 +0000

  udf: remove ->writepage

Crash: BUG: unable to handle kernel NULL pointer dereference in __writepage (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH v2 0/12] udf: Unify aops 13 (13) 2023/01/25 09:41
[PATCH 0/10] udf: Unify aops 22 (22) 2023/01/25 09:28
[syzbot] [udf?] BUG: unable to handle kernel NULL pointer dereference in __writepage 2 (4) 2023/01/23 17:18

Sample crash report:
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0010) - not-present page
PGD 2bff1067 P4D 2bff1067 PUD 1f5dc067 PMD 0 
Oops: 0010 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 9019 Comm: syz-executor202 Not tainted 6.1.0-syzkaller-13031-g77856d911a8c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 0018:ffffc9000be3f6a8 EFLAGS: 00010246
RAX: 1ffffffff1659874 RBX: ffffea0001bf0e00 RCX: ffff8880183c57c0
RDX: 0000000000000000 RSI: ffffc9000be3fb00 RDI: ffffea0001bf0e00
RBP: ffffffff8b2cc3a0 R08: ffffffff81bf03f6 R09: fffffbfff1d200ae
R10: fffffbfff1d200ae R11: 1ffffffff1d200ad R12: dffffc0000000000
R13: ffffea0001bf0e00 R14: ffff8880738dbd28 R15: ffffc9000be3fb00
FS:  00007ff98e385700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 000000001ca8e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __writepage+0x60/0x120 mm/page-writeback.c:2537
 write_cache_pages+0x7dd/0x1350 mm/page-writeback.c:2472
 generic_writepages mm/page-writeback.c:2563 [inline]
 do_writepages+0x438/0x690 mm/page-writeback.c:2583
 filemap_fdatawrite_wbc+0x11e/0x170 mm/filemap.c:388
 __filemap_fdatawrite_range mm/filemap.c:421 [inline]
 file_write_and_wait_range+0x228/0x330 mm/filemap.c:777
 __generic_file_fsync+0x6e/0x190 fs/libfs.c:1132
 generic_file_fsync+0x6f/0xe0 fs/libfs.c:1173
 generic_write_sync include/linux/fs.h:2882 [inline]
 udf_file_write_iter+0x4d6/0x5f0 fs/udf/file.c:176
 call_write_iter include/linux/fs.h:2186 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x7b5/0xbb0 fs/read_write.c:584
 ksys_write+0x19b/0x2c0 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7ff9967027f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 91 18 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff98e3852f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ff996780790 RCX: 00007ff9967027f9
RDX: 0000000000000008 RSI: 0000000020000040 RDI: 0000000000000004
RBP: 00007ff99678079c R08: 00007ff98e385700 R09: 0000000000000000
R10: 00007ff98e385700 R11: 0000000000000246 R12: 00007ff99674cd70
R13: 00007ff99674c180 R14: 0000000020000c80 R15: 00007ff996780798
 </TASK>
Modules linked in:
CR2: 0000000000000000
---[ end trace 0000000000000000 ]---
RIP: 0010:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 0018:ffffc9000be3f6a8 EFLAGS: 00010246
RAX: 1ffffffff1659874 RBX: ffffea0001bf0e00 RCX: ffff8880183c57c0
RDX: 0000000000000000 RSI: ffffc9000be3fb00 RDI: ffffea0001bf0e00
RBP: ffffffff8b2cc3a0 R08: ffffffff81bf03f6 R09: fffffbfff1d200ae
R10: fffffbfff1d200ae R11: 1ffffffff1d200ad R12: dffffc0000000000
R13: ffffea0001bf0e00 R14: ffff8880738dbd28 R15: ffffc9000be3fb00
FS:  00007ff98e385700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 000000001ca8e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/12/17 10:29 upstream 77856d911a8c 05494336 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-smack-root BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/02/19 22:57 upstream 925cf0457d7e bcdf85f8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/02/12 08:16 upstream d12aca5c0cee 93e26d60 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/02/09 12:04 upstream 0983f6bf2bfc 14a312c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/02/03 15:15 upstream 66a87fff1a87 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/02/03 02:49 upstream e7368fd30165 33fc5c09 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/02/01 16:58 upstream c0b67534c95c 9a6f477c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/01/30 14:36 upstream 6d796c50f84c 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/01/29 06:43 upstream c96618275234 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/01/26 17:59 upstream 7c46948a6e9c 9dfcf09c .config console log report info ci-upstream-kasan-gce-selinux-root BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/01/25 12:24 upstream 948ef7bb70c4 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/01/23 08:11 upstream 2475bf0250de 44388686 .config console log report info ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/01/23 05:29 upstream 2475bf0250de cc0f9968 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2023/01/16 22:08 upstream d532dd102151 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
2022/12/22 19:33 upstream 9d2f6060fe4c c692fab1 .config console log report info ci-upstream-kasan-gce-root BUG: unable to handle kernel NULL pointer dereference in __writepage
2022/12/17 09:28 upstream 77856d911a8c 05494336 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: unable to handle kernel NULL pointer dereference in __writepage
2022/12/13 15:00 upstream 764822972d64 67be1ae7 .config console log report info ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in __writepage
* Struck through repros no longer work on HEAD.