syzbot


general protection fault in delayed_uprobe_remove
Status: fixed on 2019/03/22 19:32
Reported-by: syzbot+eab6e18f95a9fe69005e@syzkaller.appspotmail.com
Fix commit: 1aed58e67a6e Uprobes: Fix kernel oops with delayed_uprobe_remove()
First crash: 1301d, last: 1298d

Cause bisection: introduced by (bisect log) :
commit a6ca88b241d5e929e6e60b12ad8cd288f0ffa256
Author: Song Liu <songliubraving@fb.com>
Date: Tue Oct 2 05:36:36 2018 +0000

  trace_uprobe: support reference counter in fd-based uprobe

Crash: KASAN: use-after-free Read in delayed_uprobe_remove (log)
Repro: C syz .config

Sample crash report:
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 21962 Comm: syz-executor753 Not tainted 4.19.0-next-20181102+ #104
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:delayed_uprobe_remove+0x6f/0x140 kernel/events/uprobes.c:339
Code: 00 00 00 48 81 fb c0 f8 5f 89 4c 8b 23 49 bd 00 00 00 00 00 fc ff df 75 2f e9 98 00 00 00 e8 78 1d e5 ff 4c 89 e0 48 c1 e8 03 <42> 80 3c 28 00 0f 85 91 00 00 00 49 81 fc c0 f8 5f 89 49 8b 04 24
RSP: 0018:ffff8801cc56f178 EFLAGS: 00010a02
RAX: 1bd5a00000000020 RBX: ffff8801c1fece00 RCX: 1ffff1003b2001f4
RDX: 0000000000000000 RSI: ffffffff819a4af8 RDI: ffff8801c1fece18
RBP: ffff8801cc56f1a0 R08: ffff8801d9000fa0 R09: 0000000000000006
R10: 0000000000000000 R11: ffff8801d9000700 R12: dead000000000100
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8801bb484ec0
FS:  00007fcaad5a4700(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fcaad5a3e78 CR3: 00000001d392f000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 uprobe_clear_state+0xbe/0x390 kernel/events/uprobes.c:1510
 __mmput kernel/fork.c:1041 [inline]
 mmput+0x1bc/0x610 kernel/fork.c:1066
 exit_mm kernel/exit.c:545 [inline]
 do_exit+0xe74/0x26d0 kernel/exit.c:854
 do_group_exit+0x177/0x440 kernel/exit.c:970
 get_signal+0x8a8/0x1970 kernel/signal.c:2517
 do_signal+0x9c/0x21c0 arch/x86/kernel/signal.c:816
 exit_to_usermode_loop+0x2e5/0x380 arch/x86/entry/common.c:162
 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
 do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4469c9
Code: e8 dc e6 ff ff 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 4b 07 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fcaad5a3db8 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 00000000006dcc38 RCX: 00000000004469c9
RDX: 00000000004469c9 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00000000006dcc30 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dcc3c
R13: 00007ffc9cc8172f R14: 00007fcaad5a49c0 R15: 00000000006dcd2c
Modules linked in:
---[ end trace b0de3a2925ef8954 ]---
RIP: 0010:delayed_uprobe_remove+0x6f/0x140 kernel/events/uprobes.c:339
Code: 00 00 00 48 81 fb c0 f8 5f 89 4c 8b 23 49 bd 00 00 00 00 00 fc ff df 75 2f e9 98 00 00 00 e8 78 1d e5 ff 4c 89 e0 48 c1 e8 03 <42> 80 3c 28 00 0f 85 91 00 00 00 49 81 fc c0 f8 5f 89 49 8b 04 24
RSP: 0018:ffff8801cc56f178 EFLAGS: 00010a02
RAX: 1bd5a00000000020 RBX: ffff8801c1fece00 RCX: 1ffff1003b2001f4
RDX: 0000000000000000 RSI: ffffffff819a4af8 RDI: ffff8801c1fece18
RBP: ffff8801cc56f1a0 R08: ffff8801d9000fa0 R09: 0000000000000006
R10: 0000000000000000 R11: ffff8801d9000700 R12: dead000000000100
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8801bb484ec0
FS:  00007fcaad5a4700(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000154c000 CR3: 00000001d4590000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-linux-next-kasan-gce-root 2018/11/03 19:15 linux-next 25e9471b6a27 8bd6bd63 .config log report syz C
ci-upstream-kasan-gce-smack-root 2018/11/01 09:53 upstream 5b7449810ae6 1f38e9ae .config log report syz