syzbot


general protection fault in autofs_fill_super

Status: fixed on 2024/01/20 21:18
Subsystems: autofs
[Documentation on labels]
Reported-by: syzbot+662f87a8ef490f45fa64@syzkaller.appspotmail.com
Fix commit: 66917f85db60 autofs: add: new_inode check in autofs_fill_super()
First crash: 106d, last: 94d
Cause bisection: introduced by (bisect log) :
commit e6ec453bd0f03a60a80f00f95ae2eaa260faa3c2
Author: Ian Kent <raven@themaw.net>
Date: Fri Sep 22 04:12:14 2023 +0000

  autofs: convert autofs to use the new mount api

Crash: BUG: unable to handle kernel NULL pointer dereference in autofs_fill_super (log)
Repro: syz .config
  
Discussions (5)
Title Replies (including bot) Last reply
[PATCH v2] autofs: add: new_inode check in autofs_fill_super() 3 (3) 2023/11/20 14:01
[PATCH] autofs: add: new_inode check in autofs_fill_super() 4 (4) 2023/11/19 10:23
[syzbot] [autofs?] general protection fault in autofs_fill_super 0 (2) 2023/11/16 09:51
[PATCH] autofs: fix null deref in autofs_fill_super 9 (9) 2023/11/15 01:06
Re: [syzbot] [PATCH] Test np in autofs_fill_super 0 (1) 2023/11/14 02:17
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/11/14 02:17 23m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 4bbdb725a36b OK log

Sample crash report:
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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:00007ffde39d7ea8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fc8ed19bf80 RCX: 00007fc8ed07cae9
RDX: 0000000020000180 RSI: 00000000200001c0 RDI: 0000000000000000
RBP: 00007ffde39d7f00 R08: 0000000020000400 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00000000000009fb R14: 00007fc8ed19bf80 R15: 00007fc8ed19bf80
 </TASK>
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: 5098 Comm: syz-executor.0 Not tainted 6.7.0-rc1-syzkaller-00213-g791c8ab095f7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:autofs_fill_super+0x47d/0xb50 fs/autofs/inode.c:334
Code: 03 a0 dc 9f 8b 4d 8d 67 04 48 8b 14 24 48 89 d0 48 c1 e8 03 42 0f b6 04 30 84 c0 0f 85 58 03 00 00 8b 1a 4c 89 e0 48 c1 e8 03 <42> 0f b6 04 30 84 c0 4c 89 f5 0f 85 61 03 00 00 41 89 5f 04 4d 8d
RSP: 0018:ffffc90003ef7c90 EFLAGS: 00010247
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88801d135940
RDX: ffff8880212e2f80 RSI: ffffffff8bbdf360 RDI: ffffffff8bbdf320
RBP: ffff88801c3ad780 R08: 00000000ffffffff R09: 1ffffffff1b4556a
R10: dffffc0000000000 R11: fffffbfff1b4556b R12: 0000000000000004
R13: ffff88801c3ad700 R14: dffffc0000000000 R15: 0000000000000000
FS:  00005555556f6480(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc8ed0ffd00 CR3: 0000000027082000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 vfs_get_super fs/super.c:1338 [inline]
 get_tree_nodev+0xb4/0x140 fs/super.c:1357
 vfs_get_tree+0x8c/0x2a0 fs/super.c:1771
 do_new_mount+0x28f/0xae0 fs/namespace.c:3337
 do_mount fs/namespace.c:3677 [inline]
 __do_sys_mount fs/namespace.c:3886 [inline]
 __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3863
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7fc8ed07cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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:00007ffde39d7ea8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fc8ed19bf80 RCX: 00007fc8ed07cae9
RDX: 0000000020000180 RSI: 00000000200001c0 RDI: 0000000000000000
RBP: 00007ffde39d7f00 R08: 0000000020000400 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00000000000009fb R14: 00007fc8ed19bf80 R15: 00007fc8ed19bf80
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:autofs_fill_super+0x47d/0xb50 fs/autofs/inode.c:334
Code: 03 a0 dc 9f 8b 4d 8d 67 04 48 8b 14 24 48 89 d0 48 c1 e8 03 42 0f b6 04 30 84 c0 0f 85 58 03 00 00 8b 1a 4c 89 e0 48 c1 e8 03 <42> 0f b6 04 30 84 c0 4c 89 f5 0f 85 61 03 00 00 41 89 5f 04 4d 8d
RSP: 0018:ffffc90003ef7c90 EFLAGS: 00010247
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88801d135940
RDX: ffff8880212e2f80 RSI: ffffffff8bbdf360 RDI: ffffffff8bbdf320
RBP: ffff88801c3ad780 R08: 00000000ffffffff R09: 1ffffffff1b4556a
R10: dffffc0000000000 R11: fffffbfff1b4556b R12: 0000000000000004
R13: ffff88801c3ad700 R14: dffffc0000000000 R15: 0000000000000000
FS:  00005555556f6480(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc8ed0ffd00 CR3: 0000000027082000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	28 00                	sub    %al,(%rax)
   2:	00 00                	add    %al,(%rax)
   4:	75 05                	jne    0xb
   6:	48 83 c4 28          	add    $0x28,%rsp
   a:	c3                   	ret
   b:	e8 e1 20 00 00       	call   0x20f1
  10:	90                   	nop
  11:	48 89 f8             	mov    %rdi,%rax
  14:	48 89 f7             	mov    %rsi,%rdi
  17:	48 89 d6             	mov    %rdx,%rsi
  1a:	48 89 ca             	mov    %rcx,%rdx
  1d:	4d 89 c2             	mov    %r8,%r10
  20:	4d 89 c8             	mov    %r9,%r8
  23:	4c 8b 4c 24 08       	mov    0x8(%rsp),%r9
  28:	0f 05                	syscall
* 2a:	48 3d 01 f0 ff ff    	cmp    $0xfffffffffffff001,%rax <-- trapping instruction
  30:	73 01                	jae    0x33
  32:	c3                   	ret
  33:	48 c7 c1 b0 ff ff ff 	mov    $0xffffffffffffffb0,%rcx
  3a:	f7 d8                	neg    %eax
  3c:	64 89 01             	mov    %eax,%fs:(%rcx)
  3f:	48                   	rex.W

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/18 08:48 upstream 791c8ab095f7 cb976f63 .config strace log report syz [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in autofs_fill_super
2023/11/10 01:22 upstream 4bbdb725a36b 56230772 .config strace log report syz [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in autofs_fill_super
2023/11/19 18:49 upstream 037266a5f723 cb976f63 .config console log report syz [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in autofs_fill_super
2023/11/22 13:29 upstream c2d5304e6c64 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in autofs_fill_super
2023/11/18 08:29 upstream 791c8ab095f7 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in autofs_fill_super
2023/11/10 01:01 upstream 4bbdb725a36b 56230772 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in autofs_fill_super
2023/11/19 18:32 upstream 037266a5f723 cb976f63 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in autofs_fill_super
* Struck through repros no longer work on HEAD.