WARNING: refcount bug in l2tp_session_create

6 views
Skip to first unread message

syzbot

unread,
Jun 19, 2019, 2:54:05 AM6/19/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: e861d067 Linux 4.14.127
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=178406c6a00000
kernel config: https://syzkaller.appspot.com/x/.config?x=811cd47e9cb8f2d1
dashboard link: https://syzkaller.appspot.com/bug?extid=46a11eae4fa1615d9e50
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+46a11e...@syzkaller.appspotmail.com

RDS: rds_bind could not find a transport for 172.20.20.187, load rds_tcp or
rds_rdma?
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0
sclass=netlink_xfrm_socket pig=22057 comm=syz-executor.0
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0
sclass=netlink_xfrm_socket pig=22057 comm=syz-executor.0
refcount_t: increment on 0; use-after-free.
------------[ cut here ]------------
WARNING: CPU: 1 PID: 22048 at lib/refcount.c:153 refcount_inc
lib/refcount.c:153 [inline]
WARNING: CPU: 1 PID: 22048 at lib/refcount.c:153
refcount_inc.cold+0x18/0x1f lib/refcount.c:151
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0
sclass=netlink_xfrm_socket pig=22057 comm=syz-executor.0
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 22048 Comm: syz-executor.3 Not tainted 4.14.127 #21
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/0x426 kernel/panic.c:182
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0
sclass=netlink_xfrm_socket pig=22057 comm=syz-executor.0
__warn.cold+0x2f/0x36 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:960
RIP: 0010:refcount_inc lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc.cold+0x18/0x1f lib/refcount.c:151
RSP: 0018:ffff888068437b70 EFLAGS: 00010286
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0
sclass=netlink_xfrm_socket pig=22057 comm=syz-executor.0
RAX: 000000000000002b RBX: ffff888068020248 RCX: 0000000000000000
RDX: 0000000000008149 RSI: ffffffff814afdb5 RDI: ffffed100d086f64
RBP: ffff888068437b78 R08: 000000000000002b R09: ffff8880980c8e70
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88809e582180
R13: 0000000000000000 R14: ffff88809bfd0360 R15: ffff88809bfd0340
sock_hold include/net/sock.h:619 [inline]
l2tp_session_add_to_tunnel net/l2tp/l2tp_core.c:368 [inline]
l2tp_session_create+0x118b/0x1600 net/l2tp/l2tp_core.c:1846
pppol2tp_connect+0x11bf/0x18b0 net/l2tp/l2tp_ppp.c:721
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0
sclass=netlink_xfrm_socket pig=22057 comm=syz-executor.0
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0
sclass=netlink_xfrm_socket pig=22057 comm=syz-executor.0
SYSC_connect+0x1f6/0x2d0 net/socket.c:1655
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0
sclass=netlink_xfrm_socket pig=22057 comm=syz-executor.0
SyS_connect+0x24/0x30 net/socket.c:1636
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4592c9
RSP: 002b:00007f2c1eeb1c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0
sclass=netlink_xfrm_socket pig=22057 comm=syz-executor.0
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004592c9
RDX: 000000000000002e RSI: 0000000020000040 RDI: 0000000000000006
RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2c1eeb26d4
R13: 00000000004bf7cf R14: 00000000004d0f68 R15: 00000000ffffffff
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,
Jul 19, 2019, 3:55:06 PM7/19/19
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: aea8526e Linux 4.14.133
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1757ed48600000
kernel config: https://syzkaller.appspot.com/x/.config?x=5dfccef5a159766b
dashboard link: https://syzkaller.appspot.com/bug?extid=46a11eae4fa1615d9e50
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1524dad0600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11ee698fa00000

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

audit: type=1400 audit(1563565886.597:36): avc: denied { map } for
pid=7124 comm="syz-executor296" path="/root/syz-executor296693542"
dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
refcount_t: increment on 0; use-after-free.
------------[ cut here ]------------
WARNING: CPU: 0 PID: 7126 at lib/refcount.c:153 refcount_inc
/lib/refcount.c:153 [inline]
WARNING: CPU: 0 PID: 7126 at lib/refcount.c:153 refcount_inc.cold+0x18/0x1f
/lib/refcount.c:151
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 7126 Comm: syz-executor296 Not tainted 4.14.133 #28
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/0x426 /kernel/panic.c:182
__warn.cold+0x2f/0x36 /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:960
RIP: 0010:refcount_inc /lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc.cold+0x18/0x1f /lib/refcount.c:151
RSP: 0018:ffff8880974ffb70 EFLAGS: 00010286
RAX: 000000000000002b RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff866d0e00 RDI: ffffed1012e9ff64
RBP: ffff8880974ffb78 R08: 000000000000002b R09: ffff8880850e6f08
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88808b63a900
R13: 0000000000000002 R14: ffff888092c23a60 R15: ffff888092c23a40
sock_hold /./include/net/sock.h:619 [inline]
l2tp_session_add_to_tunnel /net/l2tp/l2tp_core.c:374 [inline]
l2tp_session_create+0xb49/0x1600 /net/l2tp/l2tp_core.c:1846
pppol2tp_connect+0x11bf/0x18b0 /net/l2tp/l2tp_ppp.c:721
SYSC_connect+0x1f6/0x2d0 /net/socket.c:1655
SyS_connect+0x24/0x30 /net/socket.c:1636
do_syscall_64+0x1e8/0x640 /arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4412d9
RSP: 002b:00007ffc1b98e998 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004412d9
RDX: 0000000000000026 RSI: 0000000020000180 RDI: 0000000000000004
RBP: 000000000000f82b R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000402100
R13: 0000000000402190 R14: 0000000000000000 R15: 0000000000000000
Reply all
Reply to author
Forward
0 new messages