syzbot


general protection fault in nilfs_clear_dirty_page

Status: fixed on 2023/09/28 17:51
Subsystems: nilfs
[Documentation on labels]
Reported-by: syzbot+53369d11851d8f26735c@syzkaller.appspotmail.com
Fix commit: 782e53d0c144 nilfs2: prevent general protection fault in nilfs_clear_dirty_page()
First crash: 494d, last: 260d
Cause bisection: introduced by (bisect log) :
commit 4a445b7b6178d88956192c0202463063f52e8667
Author: Qu Wenruo <wqu@suse.com>
Date: Sat Aug 13 08:06:53 2022 +0000

  btrfs: don't merge pages into bio if their page offset is not contiguous

Crash: kernel BUG in find_lock_entries (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] general protection fault in nilfs_clear_dirty_page 2 (5) 2023/06/12 03:59
[PATCH] nilfs2: prevent general protection fault in nilfs_clear_dirty_page() 1 (1) 2023/06/12 02:14

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 5040 Comm: syz-executor116 Not tainted 6.4.0-rc5-syzkaller-00305-g022ce8862dff #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
RIP: 0010:nilfs_clear_dirty_page+0xa9/0x1130 fs/nilfs2/page.c:388
Code: 48 89 d8 48 c1 e8 03 42 80 3c 30 00 74 08 48 89 df e8 1b 38 97 fe 48 8b 1b 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 48 89 df e8 f9 37 97 fe 4c 8b 2b 49 8d 5d 28 48
RSP: 0018:ffffc90003d2f2e0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffea0001cb1900
RBP: ffffc90003d2f3b0 R08: ffffffff834bef29 R09: fffff94000396321
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea0001cb1900
R13: 0000000000000000 R14: dffffc0000000000 R15: dffffc0000000000
FS:  00007f996874e700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055fe30356e00 CR3: 000000002995d000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 nilfs_clear_dirty_pages+0x1e0/0x370 fs/nilfs2/page.c:373
 nilfs_writepages+0x11c/0x160 fs/nilfs2/inode.c:165
 do_writepages+0x3a6/0x670 mm/page-writeback.c:2551
 filemap_fdatawrite_wbc+0x125/0x180 mm/filemap.c:390
 __filemap_fdatawrite_range mm/filemap.c:423 [inline]
 filemap_write_and_wait_range+0x1d4/0x2c0 mm/filemap.c:678
 generic_file_read_iter+0x19e/0x540 mm/filemap.c:2805
 call_read_iter include/linux/fs.h:1862 [inline]
 generic_file_splice_read+0x240/0x640 fs/splice.c:419
 do_splice_to fs/splice.c:902 [inline]
 splice_direct_to_actor+0x40c/0xbd0 fs/splice.c:973
 do_splice_direct+0x283/0x3d0 fs/splice.c:1082
 do_sendfile+0x620/0xff0 fs/read_write.c:1254
 __do_sys_sendfile64 fs/read_write.c:1322 [inline]
 __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1308
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f9970ac36f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 15 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:00007f996874e2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f9970b497b0 RCX: 00007f9970ac36f9
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000007
RBP: 00007f9970b15b1c R08: 0000000000000000 R09: 0000000000000000
R10: 0001000000201005 R11: 0000000000000246 R12: 00007f9970b150c0
R13: 00000000200026c0 R14: 0032656c69662f2e R15: 00007f9970b497b8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:nilfs_clear_dirty_page+0xa9/0x1130 fs/nilfs2/page.c:388
Code: 48 89 d8 48 c1 e8 03 42 80 3c 30 00 74 08 48 89 df e8 1b 38 97 fe 48 8b 1b 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 48 89 df e8 f9 37 97 fe 4c 8b 2b 49 8d 5d 28 48
RSP: 0018:ffffc90003d2f2e0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffea0001cb1900
RBP: ffffc90003d2f3b0 R08: ffffffff834bef29 R09: fffff94000396321
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea0001cb1900
R13: 0000000000000000 R14: dffffc0000000000 R15: dffffc0000000000
FS:  00007f996874e700(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f9970b1500a CR3: 000000002995d000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 89 d8             	mov    %rbx,%rax
   3:	48 c1 e8 03          	shr    $0x3,%rax
   7:	42 80 3c 30 00       	cmpb   $0x0,(%rax,%r14,1)
   c:	74 08                	je     0x16
   e:	48 89 df             	mov    %rbx,%rdi
  11:	e8 1b 38 97 fe       	callq  0xfe973831
  16:	48 8b 1b             	mov    (%rbx),%rbx
  19:	48 89 d8             	mov    %rbx,%rax
  1c:	48 c1 e8 03          	shr    $0x3,%rax
  20:	48 b9 00 00 00 00 00 	movabs $0xdffffc0000000000,%rcx
  27:	fc ff df
* 2a:	80 3c 08 00          	cmpb   $0x0,(%rax,%rcx,1) <-- trapping instruction
  2e:	74 08                	je     0x38
  30:	48 89 df             	mov    %rbx,%rdi
  33:	e8 f9 37 97 fe       	callq  0xfe973831
  38:	4c 8b 2b             	mov    (%rbx),%r13
  3b:	49 8d 5d 28          	lea    0x28(%r13),%rbx
  3f:	48                   	rex.W

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/11 03:55 upstream 022ce8862dff 49519f06 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2023/06/13 07:25 upstream fd37b884003c 749afb64 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in nilfs_clear_dirty_page
2023/06/11 03:24 upstream 022ce8862dff 49519f06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2023/05/30 21:32 upstream 8b817fded42d df37c7f1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2023/04/05 08:12 upstream 76f598ba7d8e 831373d3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2023/02/27 20:18 upstream 982818426a0f 9189cb53 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2023/02/25 16:13 upstream 489fa31ea873 ee50e71c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2022/11/15 02:20 upstream e01d50cbd6ee 97de9cfc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2022/11/02 18:48 upstream b229b6ca5abb 08977f5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2022/11/01 18:42 upstream b229b6ca5abb a1d8560a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2022/10/31 02:57 upstream b229b6ca5abb 2a71366b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2022/10/30 22:49 upstream b229b6ca5abb 2a71366b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2022/10/26 09:26 upstream 1a2dcbdde82e 2159e4d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2022/10/24 00:40 upstream d47136c28015 23bf86af .config console log report info [disk image] [vmlinux] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
2022/10/22 01:18 upstream 6d36c728bc2e 63e790dd .config console log report info [disk image] [vmlinux] ci2-upstream-fs general protection fault in nilfs_clear_dirty_page
* Struck through repros no longer work on HEAD.