syzbot


general protection fault in percpu_ref_exit

Status: fixed on 2020/11/16 12:12
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+fd15ff734dace9e16437@syzkaller.appspotmail.com
Fix commit: 7ea6bf2e6c40 percpu_ref: don't refer to ref->data if it isn't allocated
First crash: 1349d, last: 1345d
Cause bisection: introduced by (bisect log) :
commit 2b0d3d3e4fcfb19d10f9a82910b8f0f05c56ee3e
Author: Ming Lei <ming.lei@redhat.com>
Date: Thu Oct 1 15:48:41 2020 +0000

  percpu_ref: reduce memory footprint of percpu_ref in fast path

Crash: BUG: unable to handle kernel NULL pointer dereference in __percpu_ref_exit (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] percpu_ref: don't refer to ref->data if it isn't allocated 3 (3) 2020/10/09 18:32
general protection fault in percpu_ref_exit 2 (4) 2020/10/09 04:05

Sample crash report:
RDX: 0000000000000001 RSI: 0000000020000140 RDI: 000000000000f501
RBP: 00000000006dbc20 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c
R13: 00007ffe36a84a0f R14: 00007f51c77e59c0 R15: 0000000000000000
general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
CPU: 1 PID: 6924 Comm: syz-executor821 Not tainted 5.9.0-rc8-next-20201007-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__percpu_ref_exit lib/percpu-refcount.c:112 [inline]
RIP: 0010:percpu_ref_exit+0x7f/0x210 lib/percpu-refcount.c:133
Code: e5 fc 48 89 ee e8 01 42 b9 fd 48 85 ed 74 60 e8 77 45 b9 fd 49 8d 7c 24 10 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 26 01 00 00 49 83 7c 24 10 00 0f 85 01 01 00 00
RSP: 0018:ffffc900054b7de0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff88802feb1658 RCX: ffffffff83bc130f
RDX: 0000000000000002 RSI: ffffffff83bc1319 RDI: 0000000000000010
RBP: 0000607f51875180 R08: 0000000000000001 R09: ffff88802feb1807
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88802feb1660 R14: ffff88802feb1800 R15: ffff88802feb1670
FS:  00007f51c77e5700(0000) GS:ffff8880ae500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000140 CR3: 0000000012424000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 ioctx_alloc+0x2d2/0x1d60 fs/aio.c:804
 __do_sys_io_setup fs/aio.c:1326 [inline]
 __se_sys_io_setup fs/aio.c:1309 [inline]
 __x64_sys_io_setup+0xe9/0x230 fs/aio.c:1309
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x446769
Code: e8 bc b5 02 00 48 83 c4 18 c3 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 0f 83 ab 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f51c77e4db8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ce
RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446769
RDX: 0000000000000001 RSI: 0000000020000140 RDI: 000000000000f501
RBP: 00000000006dbc20 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c
R13: 00007ffe36a84a0f R14: 00007f51c77e59c0 R15: 0000000000000000
Modules linked in:
---[ end trace 000c19ea8a5922ba ]---
RIP: 0010:__percpu_ref_exit lib/percpu-refcount.c:112 [inline]
RIP: 0010:percpu_ref_exit+0x7f/0x210 lib/percpu-refcount.c:133
Code: e5 fc 48 89 ee e8 01 42 b9 fd 48 85 ed 74 60 e8 77 45 b9 fd 49 8d 7c 24 10 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 26 01 00 00 49 83 7c 24 10 00 0f 85 01 01 00 00
RSP: 0018:ffffc900054b7de0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff88802feb1658 RCX: ffffffff83bc130f
RDX: 0000000000000002 RSI: ffffffff83bc1319 RDI: 0000000000000010
RBP: 0000607f51875180 R08: 0000000000000001 R09: ffff88802feb1807
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88802feb1660 R14: ffff88802feb1800 R15: ffff88802feb1670
FS:  00007f51c77e5700(0000) GS:ffff8880ae500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000140 CR3: 0000000012424000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/10/08 11:18 linux-next 8b787da7ba8c 1880b4a9 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/10/12 09:39 linux-next d67bc7812221 4a77ae0b .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/10/08 10:57 linux-next 8b787da7ba8c 1880b4a9 .config console log report info ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.