syzbot


general protection fault in bio_first_folio

Status: fixed on 2024/01/30 15:47
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+8b23309d5788a79d3eea@syzkaller.appspotmail.com
Fix commit: 7bed6f3d08b7 block: Fix iterating over an empty bio with bio_for_each_folio_all
First crash: 365d, last: 327d
Cause bisection: introduced by (bisect log) :
commit 1b151e2435fc3a9b10c8946c6aebe9f3e1938c55
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
Date: Mon Aug 14 14:41:00 2023 +0000

  block: Remove special-casing of compound pages

Crash: BUG: unable to handle kernel NULL pointer dereference in __bio_release_pages (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH] block: Fix iterating over an empty bio with bio_for_each_folio_all 3 (3) 2024/01/19 16:03
[syzbot] Monthly block report (Jan 2024) 0 (1) 2024/01/09 18:20
[syzbot] [block?] general protection fault in bio_first_folio 2 (7) 2023/12/16 08:11
Last patch testing requests (4)
Created Duration User Patch Repo Result
2023/12/16 07:29 37m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git abb240f7a2bd OK log
2023/12/16 07:00 41m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git abb240f7a2bd OK log
2023/12/16 06:22 28m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git abb240f7a2bd report log
2023/12/16 05:53 38m willy@infradead.org patch git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next abb240f7a2bd OK log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 1 PID: 5061 Comm: syz-executor226 Not tainted 6.7.0-rc8-next-20240102-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:_compound_head include/linux/page-flags.h:247 [inline]
RIP: 0010:bio_first_folio+0xcb/0x5c0 include/linux/bio.h:289
Code: 48 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 76 04 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 6d 00 49 8d 7d 08 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 49 04 00 00 4d 8b 7d 08 31 ff 4d 89 fc 41 83 e4
RSP: 0018:ffffc900039b7430 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffffc900039b74d0 RCX: ffffffff8448396d
RDX: 0000000000000001 RSI: ffffffff8448397b RDI: 0000000000000008
RBP: ffff88807cfd8088 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff8a8ed780 R12: ffff88807cfd8000
R13: 0000000000000000 R14: 0000000000000000 R15: ffff88807cfd8000
FS:  0000555556fdc380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005fdeb8 CR3: 000000007849f000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __bio_release_pages+0x9d/0x4b0 block/bio.c:1153
 bio_release_pages include/linux/bio.h:508 [inline]
 bio_map_user_iov+0x8df/0xa50 block/blk-map.c:347
 blk_rq_map_user_iov+0x6a5/0x1840 block/blk-map.c:663
 blk_rq_map_user block/blk-map.c:690 [inline]
 blk_rq_map_user_io+0x202/0x230 block/blk-map.c:723
 sg_io+0x537/0xd70 drivers/scsi/scsi_ioctl.c:456
 scsi_cdrom_send_packet+0x276/0x640 drivers/scsi/scsi_ioctl.c:820
 scsi_ioctl+0x146/0x1840 drivers/scsi/scsi_ioctl.c:903
 sg_ioctl+0xb7b/0x2760 drivers/scsi/sg.c:1163
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl fs/ioctl.c:857 [inline]
 __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xd0/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x62/0x6a
RIP: 0033:0x7f08ef35f129
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 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:00007ffe21de0d58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffe21de0f28 RCX: 00007f08ef35f129
RDX: 0000000020000000 RSI: 0000000000005393 RDI: 0000000000000003
RBP: 00007f08ef3d2610 R08: 002367732f766564 R09: 00007ffe21de0f28
R10: 000000000000000f R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe21de0f18 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:_compound_head include/linux/page-flags.h:247 [inline]
RIP: 0010:bio_first_folio+0xcb/0x5c0 include/linux/bio.h:289
Code: 48 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 76 04 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 6d 00 49 8d 7d 08 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 49 04 00 00 4d 8b 7d 08 31 ff 4d 89 fc 41 83 e4
RSP: 0018:ffffc900039b7430 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffffc900039b74d0 RCX: ffffffff8448396d
RDX: 0000000000000001 RSI: ffffffff8448397b RDI: 0000000000000008
RBP: ffff88807cfd8088 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff8a8ed780 R12: ffff88807cfd8000
R13: 0000000000000000 R14: 0000000000000000 R15: ffff88807cfd8000
FS:  0000555556fdc380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005fdeb8 CR3: 000000007849f000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 89 ea             	mov    %rbp,%rdx
   3:	48 c1 ea 03          	shr    $0x3,%rdx
   7:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   b:	0f 85 76 04 00 00    	jne    0x487
  11:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  18:	fc ff df
  1b:	4c 8b 6d 00          	mov    0x0(%rbp),%r13
  1f:	49 8d 7d 08          	lea    0x8(%r13),%rdi
  23:	48 89 fa             	mov    %rdi,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2e:	0f 85 49 04 00 00    	jne    0x47d
  34:	4d 8b 7d 08          	mov    0x8(%r13),%r15
  38:	31 ff                	xor    %edi,%edi
  3a:	4d 89 fc             	mov    %r15,%r12
  3d:	41                   	rex.B
  3e:	83                   	.byte 0x83
  3f:	e4                   	.byte 0xe4

Crashes (683):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/01/03 05:13 linux-next ab0b3e6ef50d fb427a07 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_first_folio
2023/12/12 11:03 linux-next abb240f7a2bd 28b24332 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_first_folio
2024/01/19 04:35 upstream 296455ade1fd 239abf84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/18 21:36 upstream 296455ade1fd 239abf84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/18 05:57 upstream 1b1934dbbdcf 915053c7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in bio_first_folio
2024/01/17 16:38 upstream 052d534373b7 915053c7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in bio_first_folio
2024/01/17 15:14 upstream 052d534373b7 915053c7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in bio_first_folio
2024/01/17 13:12 upstream 052d534373b7 c9a1c95b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/17 09:08 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/17 06:52 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/17 03:08 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/17 00:27 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/16 21:02 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/16 20:01 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/16 15:56 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/16 14:47 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/16 10:33 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/16 07:55 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/16 03:39 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/15 22:07 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/15 14:02 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/15 12:42 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in bio_first_folio
2024/01/15 10:04 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/15 09:01 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/15 05:03 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/15 03:26 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 23:56 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 23:46 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 20:22 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 19:11 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 17:43 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 16:21 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 14:08 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 12:17 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 09:18 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/14 07:59 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 05:04 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 04:26 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in bio_first_folio
2024/01/14 03:16 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 01:50 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/14 00:44 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in bio_first_folio
2024/01/12 07:52 upstream 22d29f1112c8 dda5a988 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in bio_first_folio
2024/01/18 01:59 upstream 1b1934dbbdcf 915053c7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in bio_first_folio
2024/01/16 22:23 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in bio_first_folio
2024/01/15 18:12 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in bio_first_folio
2024/01/15 15:23 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in bio_first_folio
2024/01/15 11:25 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in bio_first_folio
2024/01/15 07:02 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in bio_first_folio
2024/01/18 08:12 upstream 1b1934dbbdcf 915053c7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in bio_first_folio
2024/01/16 22:42 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in bio_first_folio
2024/01/16 00:25 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in bio_first_folio
2024/01/12 14:38 upstream 70d201a40823 f6fa7c28 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in bio_first_folio
2024/01/12 09:37 linux-next 8d04a7e2ee3f dda5a988 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_first_folio
* Struck through repros no longer work on HEAD.