syzbot


general protection fault in ovl_real_file_path

Status: upstream: reported C repro on 2024/10/14 08:58
Subsystems: overlayfs
[Documentation on labels]
Reported-by: syzbot+aaf95b6e8fc9d906d8a7@syzkaller.appspotmail.com
First crash: 5d15h, last: 3d02h
Cause bisection: introduced by (bisect log) :
commit 181d71062eef699385d92b92f8ad3cbf03e61267
Author: Amir Goldstein <amir73il@gmail.com>
Date: Mon Oct 7 13:22:29 2024 +0000

  ovl: allocate a container struct ovl_file for ovl private context

Crash: BUG: unable to handle kernel NULL pointer dereference in ovl_real_fdget (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [overlayfs?] general protection fault in ovl_real_file_path 1 (3) 2024/10/14 15:59
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/10/14 15:35 22m amir73il@gmail.com https://github.com/amir73il/linux ovl_real_file OK log

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f]
CPU: 1 UID: 0 PID: 5235 Comm: syz-executor410 Not tainted 6.12.0-rc2-next-20241011-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:file_inode include/linux/fs.h:1124 [inline]
RIP: 0010:ovl_is_real_file fs/overlayfs/file.c:100 [inline]
RIP: 0010:ovl_real_file_path+0xa5/0x2e0 fs/overlayfs/file.c:118
Code: 03 4d 89 f7 42 80 3c 30 00 74 08 4c 89 ef e8 22 1e e0 fe 4c 89 64 24 10 49 8b 45 00 49 89 c4 4c 8d 70 68 4c 89 f0 48 c1 e8 03 <42> 80 3c 38 00 74 08 4c 89 f7 e8 fc 1d e0 fe 49 8b 1e 48 83 c5 68
RSP: 0018:ffffc90002dcfb28 EFLAGS: 00010202
RAX: 000000000000000d RBX: 1ffff920005b9f79 RCX: ffff88801efa5a00
RDX: 0000000000000000 RSI: ffffc90002dcfbc0 RDI: ffff888031c9bc00
RBP: ffff88807eb938f8 R08: ffffffff831d82d9 R09: 0000000000000000
R10: ffffc90002dcfae0 R11: fffff520005b9f5e R12: 0000000000000000
R13: ffff888078c80000 R14: 0000000000000068 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001740 CR3: 000000000e736000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 ovl_real_file+0x186/0x210 fs/overlayfs/file.c:176
 ovl_flush+0x22/0x140 fs/overlayfs/file.c:620
 filp_flush+0xb7/0x160 fs/open.c:1527
 filp_close+0x1e/0x40 fs/open.c:1540
 close_files fs/file.c:508 [inline]
 put_files_struct+0x198/0x310 fs/file.c:523
 do_exit+0xa10/0x28e0 kernel/exit.c:933
 do_group_exit+0x207/0x2c0 kernel/exit.c:1087
 __do_sys_exit_group kernel/exit.c:1098 [inline]
 __se_sys_exit_group kernel/exit.c:1096 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1096
 x64_sys_call+0x2634/0x2640 arch/x86/include/generated/asm/syscalls_64.h:232
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fbb4c5e7739
Code: Unable to access opcode bytes at 0x7fbb4c5e770f.
RSP: 002b:00007fff9c70aac8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbb4c5e7739
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 00007fbb4c662290 R08: ffffffffffffffb8 R09: 00007fbb4c5b5e50
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fbb4c662290
R13: 0000000000000000 R14: 00007fbb4c662ce0 R15: 00007fbb4c5b62a0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:file_inode include/linux/fs.h:1124 [inline]
RIP: 0010:ovl_is_real_file fs/overlayfs/file.c:100 [inline]
RIP: 0010:ovl_real_file_path+0xa5/0x2e0 fs/overlayfs/file.c:118
Code: 03 4d 89 f7 42 80 3c 30 00 74 08 4c 89 ef e8 22 1e e0 fe 4c 89 64 24 10 49 8b 45 00 49 89 c4 4c 8d 70 68 4c 89 f0 48 c1 e8 03 <42> 80 3c 38 00 74 08 4c 89 f7 e8 fc 1d e0 fe 49 8b 1e 48 83 c5 68
RSP: 0018:ffffc90002dcfb28 EFLAGS: 00010202
RAX: 000000000000000d RBX: 1ffff920005b9f79 RCX: ffff88801efa5a00
RDX: 0000000000000000 RSI: ffffc90002dcfbc0 RDI: ffff888031c9bc00
RBP: ffff88807eb938f8 R08: ffffffff831d82d9 R09: 0000000000000000
R10: ffffc90002dcfae0 R11: fffff520005b9f5e R12: 0000000000000000
R13: ffff888078c80000 R14: 0000000000000068 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001740 CR3: 000000000e736000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	03 4d 89             	add    -0x77(%rbp),%ecx
   3:	f7 42 80 3c 30 00 74 	testl  $0x7400303c,-0x80(%rdx)
   a:	08 4c 89 ef          	or     %cl,-0x11(%rcx,%rcx,4)
   e:	e8 22 1e e0 fe       	call   0xfee01e35
  13:	4c 89 64 24 10       	mov    %r12,0x10(%rsp)
  18:	49 8b 45 00          	mov    0x0(%r13),%rax
  1c:	49 89 c4             	mov    %rax,%r12
  1f:	4c 8d 70 68          	lea    0x68(%rax),%r14
  23:	4c 89 f0             	mov    %r14,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	4c 89 f7             	mov    %r14,%rdi
  34:	e8 fc 1d e0 fe       	call   0xfee01e35
  39:	49 8b 1e             	mov    (%r14),%rbx
  3c:	48 83 c5 68          	add    $0x68,%rbp

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/12 21:19 linux-next d61a00525464 084d8178 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/12 20:47 linux-next d61a00525464 084d8178 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 22:20 linux-next 0cca97bf2364 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 22:18 linux-next 0cca97bf2364 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 21:28 linux-next 0cca97bf2364 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 21:24 linux-next 0cca97bf2364 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 15:55 linux-next 0cca97bf2364 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 15:54 linux-next 0cca97bf2364 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 15:35 linux-next 0cca97bf2364 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 15:35 linux-next 0cca97bf2364 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 09:00 linux-next 0cca97bf2364 0278d004 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 09:00 linux-next 0cca97bf2364 0278d004 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 08:47 linux-next 0cca97bf2364 0278d004 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
2024/10/10 08:46 linux-next 0cca97bf2364 0278d004 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ovl_real_file_path
* Struck through repros no longer work on HEAD.