syzbot


general protection fault in exfat_get_dentry_cached

Status: upstream: reported C repro on 2024/12/03 18:30
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+8f8fe64a30c50b289a18@syzkaller.appspotmail.com
First crash: 21d, last: 9d15h
Cause bisection: introduced by (bisect log) :
commit 8a3f5711ad74db9881b289a6e34d7f3b700df720
Author: Yuezhang Mo <Yuezhang.Mo@sony.com>
Date: Thu Sep 12 08:57:06 2024 +0000

  exfat: reduce FAT chain traversal

Crash: BUG: unable to handle kernel NULL pointer dereference in exfat_init_ext_entry (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] exfat: bail out on -EIO in exfat_find_empty_entry() 2 (2) 2024/12/16 23:36
[syzbot] [exfat?] general protection fault in exfat_get_dentry_cached 0 (5) 2024/12/13 14:13
Last patch testing requests (2)
Created Duration User Patch Repo Result
2024/12/13 14:13 29m dmantipov@yandex.ru patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f932fb9b40749d1c9a539d89bb3e288c077aafe5 OK log
2024/12/13 08:17 21m dmantipov@yandex.ru patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f932fb9b40749d1c9a539d89bb3e288c077aafe5 OK log

Sample crash report:
syz-executor248: attempt to access beyond end of device
loop0: rw=524288, sector=165, nr_sectors = 1 limit=64
syz-executor248: attempt to access beyond end of device
loop0: rw=524288, sector=166, nr_sectors = 1 limit=64
syz-executor248: attempt to access beyond end of device
loop0: rw=524288, sector=167, nr_sectors = 1 limit=64
syz-executor248: attempt to access beyond end of device
loop0: rw=0, sector=161, nr_sectors = 1 limit=64
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
CPU: 0 UID: 0 PID: 5825 Comm: syz-executor248 Not tainted 6.13.0-rc2-syzkaller-00031-gf92f4749861b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:exfat_get_dentry_cached+0x11a/0x1b0 fs/exfat/dir.c:727
Code: df 48 89 da 48 c1 ea 03 80 3c 02 00 0f 85 9d 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 1b 48 8d 7b 28 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75 61 49 8d 7d 18 48 8b 43 28 48 ba 00 00 00 00 00 fc
RSP: 0018:ffffc900032df378 EFLAGS: 00010216
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000009
RDX: 0000000000000005 RSI: ffffffff82705916 RDI: 0000000000000028
RBP: 0000000000000200 R08: 0000000000000001 R09: 000000000000001f
R10: 0000000000000009 R11: 0000000000000003 R12: ffffc900032df4a0
R13: ffff8880350f6000 R14: 0000000000000009 R15: 0000000000000010
FS:  00007f9512b986c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ea395f6818 CR3: 000000007542e000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 exfat_init_ext_entry+0x1b6/0x3b0 fs/exfat/dir.c:498
 exfat_add_entry+0x321/0x7a0 fs/exfat/namei.c:517
 exfat_create+0x1cf/0x5c0 fs/exfat/namei.c:565
 lookup_open.isra.0+0x1177/0x14c0 fs/namei.c:3649
 open_last_lookups fs/namei.c:3748 [inline]
 path_openat+0x904/0x2d60 fs/namei.c:3984
 do_filp_open+0x20c/0x470 fs/namei.c:4014
 do_sys_openat2+0x17a/0x1e0 fs/open.c:1402
 do_sys_open fs/open.c:1417 [inline]
 __do_sys_creat fs/open.c:1495 [inline]
 __se_sys_creat fs/open.c:1489 [inline]
 __x64_sys_creat+0xcd/0x120 fs/open.c:1489
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9512c02be9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f9512b98168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f9512c8c6d8 RCX: 00007f9512c02be9
RDX: 00007f9512bdc606 RSI: 0000000000000000 RDI: 0000000020000e00
RBP: 00007f9512c8c6d0 R08: 00007ffe09e1cab7 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9512c8c6dc
R13: 000000000000006e R14: 00007ffe09e1c9d0 R15: 00007ffe09e1cab8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:exfat_get_dentry_cached+0x11a/0x1b0 fs/exfat/dir.c:727
Code: df 48 89 da 48 c1 ea 03 80 3c 02 00 0f 85 9d 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 1b 48 8d 7b 28 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75 61 49 8d 7d 18 48 8b 43 28 48 ba 00 00 00 00 00 fc
RSP: 0018:ffffc900032df378 EFLAGS: 00010216
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000009
RDX: 0000000000000005 RSI: ffffffff82705916 RDI: 0000000000000028
RBP: 0000000000000200 R08: 0000000000000001 R09: 000000000000001f
R10: 0000000000000009 R11: 0000000000000003 R12: ffffc900032df4a0
R13: ffff8880350f6000 R14: 0000000000000009 R15: 0000000000000010
FS:  00007f9512b986c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ea395f6818 CR3: 000000007542e000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	48 89 da             	mov    %rbx,%rdx
   3:	48 c1 ea 03          	shr    $0x3,%rdx
   7:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   b:	0f 85 9d 00 00 00    	jne    0xae
  11:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  18:	fc ff df
  1b:	48 8b 1b             	mov    (%rbx),%rbx
  1e:	48 8d 7b 28          	lea    0x28(%rbx),%rdi
  22:	48 89 fa             	mov    %rdi,%rdx
  25:	48 c1 ea 03          	shr    $0x3,%rdx
* 29:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2d:	75 61                	jne    0x90
  2f:	49 8d 7d 18          	lea    0x18(%r13),%rdi
  33:	48 8b 43 28          	mov    0x28(%rbx),%rax
  37:	48                   	rex.W
  38:	ba 00 00 00 00       	mov    $0x0,%edx
  3d:	00 fc                	add    %bh,%ah

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/11 22:55 upstream f92f4749861b ff949d25 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/12/11 22:23 upstream f92f4749861b ff949d25 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/12/11 22:16 upstream f92f4749861b ff949d25 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/12/02 10:27 upstream 40384c840ea1 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/12/02 10:27 upstream 40384c840ea1 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/11/30 05:37 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/11/30 05:36 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/11/30 05:36 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/11/30 05:31 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/11/30 05:30 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/11/30 05:30 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/11/30 05:28 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/11/30 05:28 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
2024/11/30 05:27 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in exfat_get_dentry_cached
* Struck through repros no longer work on HEAD.