syzbot


WARNING: refcount bug in put_watch

Status: closed as invalid on 2020/03/07 20:09
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+f4c16a389966647e346e@syzkaller.appspotmail.com
First crash: 1604d, last: 1542d
Cause bisection: introduced by (bisect log) [merge commit]:
commit 02c62bfcbd1c78a788e163291ca054b3ec9740b3
Author: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed Dec 4 23:32:03 2019 +0000

  Merge remote-tracking branch 'keys/keys-next'

Crash: WARNING: refcount bug in put_watch (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
WARNING: refcount bug in put_watch 0 (1) 2019/12/05 22:00

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 9576 at lib/refcount.c:28 refcount_warn_saturate+0x1dc/0x1f0 lib/refcount.c:28
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 9576 Comm: syz-executor192 Not tainted 5.5.0-rc5-next-20200109-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 panic+0x2e3/0x75c kernel/panic.c:221
 __warn.cold+0x2f/0x3e kernel/panic.c:582
 report_bug+0x289/0x300 lib/bug.c:195
 fixup_bug arch/x86/kernel/traps.c:176 [inline]
 fixup_bug arch/x86/kernel/traps.c:171 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:269
 do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:288
 invalid_op+0x23/0x30 arch/x86/entry/entry_64.S:1027
RIP: 0010:refcount_warn_saturate+0x1dc/0x1f0 lib/refcount.c:28
Code: e9 d8 fe ff ff 48 89 df e8 e1 a6 13 fe e9 85 fe ff ff e8 57 bd d5 fd 48 c7 c7 00 43 91 88 c6 05 3f dd ff 06 01 e8 d3 43 a6 fd <0f> 0b e9 ac fe ff ff 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 55 48
RSP: 0018:ffffc900065dfbf0 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff815e68c6 RDI: fffff52000cbbf70
RBP: ffffc900065dfc00 R08: ffff8880a2bd6600 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000003
R13: ffff88809ffd19d8 R14: ffff88809ffd1980 R15: ffffffff8a244fe0
 refcount_sub_and_test include/linux/refcount.h:261 [inline]
 refcount_dec_and_test include/linux/refcount.h:281 [inline]
 kref_put include/linux/kref.h:64 [inline]
 put_watch+0xa2/0xb0 drivers/misc/watch_queue.c:633
 watch_queue_clear drivers/misc/watch_queue.c:826 [inline]
 watch_queue_release+0x34b/0xc40 drivers/misc/watch_queue.c:842
 __fput+0x2ff/0x890 fs/file_table.c:280
 ____fput+0x16/0x20 fs/file_table.c:313
 task_work_run+0x145/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xbcb/0x2f70 kernel/exit.c:801
 do_group_exit+0x135/0x360 kernel/exit.c:899
 __do_sys_exit_group kernel/exit.c:910 [inline]
 __se_sys_exit_group kernel/exit.c:908 [inline]
 __x64_sys_exit_group+0x44/0x50 kernel/exit.c:908
 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x43edb8
Code: Bad RIP value.
RSP: 002b:00007fffd28673f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043edb8
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004be5c8 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d0180 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (62):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/01/09 15:55 linux-next 85cff1ab6432 ddc3e859 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2019/12/20 02:44 linux-next 9f8535c5f75f 36650b4b .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2019/12/18 00:20 linux-next fca4fe890ea0 a6bc9c88 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2019/12/05 21:59 linux-next 282ffdf30a3e 4fb74474 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/02/05 10:28 linux-next 2747d5fdab78 93e5e335 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/05 07:14 linux-next 2747d5fdab78 93e5e335 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/04 06:13 linux-next 2747d5fdab78 93e5e335 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/31 02:26 linux-next 2747d5fdab78 5ed23f9a .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/13 05:38 linux-next 6c09d7dbb7d3 53faa9fe .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/12 13:53 linux-next 6c09d7dbb7d3 31290a45 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/12 12:51 linux-next 6c09d7dbb7d3 31290a45 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/12 09:06 linux-next 6c09d7dbb7d3 4c04afaa .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/12 01:14 linux-next 6c09d7dbb7d3 4c04afaa .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/11 08:35 linux-next 6c09d7dbb7d3 4de4e9f0 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/10 22:58 linux-next 6c09d7dbb7d3 4de4e9f0 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/07 13:12 linux-next 264673852033 1bcd407e .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/07 03:16 linux-next 9eb1b48ca4ce 53430d97 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/31 14:38 linux-next 7ddd09fc4b74 25a0186e .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/30 09:20 linux-next 7ddd09fc4b74 af6b8ef8 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/30 07:07 linux-next 7ddd09fc4b74 af6b8ef8 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/29 13:46 linux-next 7ddd09fc4b74 af6b8ef8 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/28 00:48 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/27 22:00 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/27 05:36 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/27 04:12 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/27 03:09 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/26 15:30 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/26 04:44 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/26 04:09 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/26 03:59 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/26 01:31 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/25 22:39 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/25 16:19 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/25 07:36 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/24 15:04 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/24 10:20 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/24 07:19 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/24 07:08 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/23 10:26 linux-next 7ddd09fc4b74 8b967267 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/22 05:46 linux-next 7ddd09fc4b74 bc586918 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/21 22:42 linux-next 7ddd09fc4b74 bc586918 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/20 02:23 linux-next 9f8535c5f75f 36650b4b .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/19 03:57 linux-next b9c5ef25038d 79b211f7 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/18 18:22 linux-next b9c5ef25038d f2fe0772 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/17 22:11 linux-next fca4fe890ea0 a6bc9c88 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/17 05:27 linux-next fca4fe890ea0 d13d7958 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/16 10:40 linux-next 32b8acf85223 eef6e580 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/16 07:17 linux-next 32b8acf85223 eef6e580 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/16 01:50 linux-next 32b8acf85223 eef6e580 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/15 20:15 linux-next 32b8acf85223 eef6e580 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/15 08:24 linux-next 32b8acf85223 eef6e580 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/13 13:22 linux-next 78adcacd4edb 08003f64 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/13 00:58 linux-next 78adcacd4edb 08003f64 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/12 10:48 linux-next 78adcacd4edb d973f528 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/08 01:57 linux-next 558c2bf52f61 1508f453 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/06 15:57 linux-next 838333c80c4f 98b4ef2d .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/06 00:37 linux-next 282ffdf30a3e 4fb74474 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/05 21:39 linux-next 282ffdf30a3e 4fb74474 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/04 11:58 linux-next c7c32c43e831 0ecb9746 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.