WARNING: refcount bug in put_pid_ns

7 views
Skip to first unread message

syzbot

unread,
Apr 18, 2019, 3:22:07 AM4/18/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 58b454eb Linux 4.14.112
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17fbbdd3200000
kernel config: https://syzkaller.appspot.com/x/.config?x=8b0e7ab7678533ab
dashboard link: https://syzkaller.appspot.com/bug?extid=3436af5e4ae1032aa9da
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+3436af...@syzkaller.appspotmail.com

refcount_t: underflow; use-after-free.
------------[ cut here ]------------
WARNING: CPU: 1 PID: 12734 at lib/refcount.c:187 refcount_sub_and_test
lib/refcount.c:187 [inline]
WARNING: CPU: 1 PID: 12734 at lib/refcount.c:187
refcount_sub_and_test.cold+0x18/0x22 lib/refcount.c:177
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 12734 Comm: syz-executor.2 Not tainted 4.14.112 #2
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x138/0x19c lib/dump_stack.c:53
panic+0x1f2/0x438 kernel/panic.c:182
__warn.cold+0x2f/0x34 kernel/panic.c:546
report_bug+0x216/0x254 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:177 [inline]
fixup_bug arch/x86/kernel/traps.c:172 [inline]
do_error_trap+0x1bb/0x310 arch/x86/kernel/traps.c:295
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:314
invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:944
RIP: 0010:refcount_sub_and_test lib/refcount.c:187 [inline]
RIP: 0010:refcount_sub_and_test.cold+0x18/0x22 lib/refcount.c:177
RSP: 0018:ffff888075d17af8 EFLAGS: 00010286
RAX: 0000000000000026 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000040000 RSI: ffffffff814b29c5 RDI: ffffed100eba2f55
RBP: ffff888075d17b20 R08: 0000000000000026 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88807cc192f0
R13: 0000000000000001 R14: 00000000ffffffff R15: 0000802122001ffa
refcount_dec_and_test+0x1b/0x20 lib/refcount.c:212
kref_put include/linux/kref.h:69 [inline]
put_pid_ns+0x55/0x110 kernel/pid_namespace.c:203
free_nsproxy+0x103/0x200 kernel/nsproxy.c:182
switch_task_namespaces+0x98/0xb0 kernel/nsproxy.c:229
exit_task_namespaces+0x18/0x20 kernel/nsproxy.c:234
copy_process.part.0+0x3b4d/0x6950 kernel/fork.c:1961
copy_process kernel/fork.c:1570 [inline]
_do_fork+0x19e/0xce0 kernel/fork.c:2058
SYSC_clone kernel/fork.c:2168 [inline]
SyS_clone+0x37/0x50 kernel/fork.c:2162
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x458c29
RSP: 002b:00007f19fefd9c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007f19fefd9c90 RCX: 0000000000458c29
RDX: 9999999999999999 RSI: 0000000000000000 RDI: 0000802122001ffa
RBP: 000000000073bf00 R08: ffffffffffffffff R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f19fefda6d4
R13: 00000000004befd3 R14: 00000000004d0020 R15: 0000000000000004
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Apr 18, 2019, 3:37:06 AM4/18/19
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: 58b454eb Linux 4.14.112
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15773667200000
kernel config: https://syzkaller.appspot.com/x/.config?x=8b0e7ab7678533ab
dashboard link: https://syzkaller.appspot.com/bug?extid=3436af5e4ae1032aa9da
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12693787200000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=119ec3fd200000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+3436af...@syzkaller.appspotmail.com

RBP: 00007ffe3104f1e0 R08: 00000000ffffffff R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000000
refcount_t: underflow; use-after-free.
------------[ cut here ]------------
WARNING: CPU: 0 PID: 7227 at lib/refcount.c:187 refcount_sub_and_test
lib/refcount.c:187 [inline]
WARNING: CPU: 0 PID: 7227 at lib/refcount.c:187
refcount_sub_and_test.cold+0x18/0x22 lib/refcount.c:177
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 7227 Comm: syz-executor944 Not tainted 4.14.112 #2
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x138/0x19c lib/dump_stack.c:53
panic+0x1f2/0x438 kernel/panic.c:182
__warn.cold+0x2f/0x34 kernel/panic.c:546
report_bug+0x216/0x254 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:177 [inline]
fixup_bug arch/x86/kernel/traps.c:172 [inline]
do_error_trap+0x1bb/0x310 arch/x86/kernel/traps.c:295
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:314
invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:944
RIP: 0010:refcount_sub_and_test lib/refcount.c:187 [inline]
RIP: 0010:refcount_sub_and_test.cold+0x18/0x22 lib/refcount.c:177
RSP: 0018:ffff8880a8857af8 EFLAGS: 00010286
RAX: 0000000000000026 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff866d0860 RDI: ffffed101510af55
RBP: ffff8880a8857b20 R08: 0000000000000026 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff888089d414f0
R13: 0000000000000001 R14: 00000000ffffffff R15: 0000802122001ffa
refcount_dec_and_test+0x1b/0x20 lib/refcount.c:212
kref_put include/linux/kref.h:69 [inline]
put_pid_ns+0x55/0x110 kernel/pid_namespace.c:203
free_nsproxy+0x103/0x200 kernel/nsproxy.c:182
switch_task_namespaces+0x98/0xb0 kernel/nsproxy.c:229
exit_task_namespaces+0x18/0x20 kernel/nsproxy.c:234
copy_process.part.0+0x3b4d/0x6950 kernel/fork.c:1961
copy_process kernel/fork.c:1570 [inline]
_do_fork+0x19e/0xce0 kernel/fork.c:2058
SYSC_clone kernel/fork.c:2168 [inline]
SyS_clone+0x37/0x50 kernel/fork.c:2162
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x441129
RSP: 002b:00007ffe3104f1c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441129
RDX: 9999999999999999 RSI: 0000000000000000 RDI: 0000802122001ffa
RBP: 00007ffe3104f1e0 R08: 00000000ffffffff R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000000
Reply all
Reply to author
Forward
0 new messages