WARNING: bad unlock balance in gtp_encap_enable_socket

8 views
Skip to first unread message

syzbot

unread,
Jan 5, 2020, 4:02:09 PM1/5/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 3d40d711 Linux 4.19.93
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=110f76e1e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=f02ca1f135b0c3c5
dashboard link: https://syzkaller.appspot.com/bug?extid=acda86714ad556cdf3cd
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17213751e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=146faec6e00000

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

audit: type=1400 audit(1578257929.121:36): avc: denied { map } for
pid=8087 comm="syz-executor516" path="/root/syz-executor516459032"
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
=====================================
WARNING: bad unlock balance detected!
4.19.93-syzkaller #0 Not tainted
-------------------------------------
syz-executor516/8090 is trying to release lock (sk_lock-AF_INET6) at:
[<ffffffff84749c6f>] gtp_encap_enable_socket+0x13f/0x350
drivers/net/gtp.c:835
but there are no more locks to release!

other info that might help us debug this:
2 locks held by syz-executor516/8090:
#0: 000000000ddd2905 (rtnl_mutex){+.+.}, at: rtnl_lock
net/core/rtnetlink.c:77 [inline]
#0: 000000000ddd2905 (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x40a/0xb00
net/core/rtnetlink.c:4765
#1: 000000001c1d287d (slock-AF_INET6){+...}, at: spin_lock_bh
include/linux/spinlock.h:334 [inline]
#1: 000000001c1d287d (slock-AF_INET6){+...}, at: release_sock+0x20/0x1c0
net/core/sock.c:2853

stack backtrace:
CPU: 0 PID: 8090 Comm: syz-executor516 Not tainted 4.19.93-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
print_unlock_imbalance_bug kernel/locking/lockdep.c:3464 [inline]
print_unlock_imbalance_bug.cold+0x114/0x123 kernel/locking/lockdep.c:3441
__lock_release kernel/locking/lockdep.c:3674 [inline]
lock_release+0x6cd/0xa30 kernel/locking/lockdep.c:3922
sock_release_ownership include/net/sock.h:1471 [inline]
release_sock+0x181/0x1c0 net/core/sock.c:2863
gtp_encap_enable_socket+0x13f/0x350 drivers/net/gtp.c:835
gtp_encap_enable drivers/net/gtp.c:857 [inline]
gtp_newlink+0x9b7/0xc10 drivers/net/gtp.c:670
rtnl_newlink+0x1042/0x1600 net/core/rtnetlink.c:3132
rtnetlink_rcv_msg+0x463/0xb00 net/core/rtnetlink.c:4768
netlink_rcv_skb+0x17d/0x460 net/netlink/af_netlink.c:2454
rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:4786
netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
netlink_unicast+0x53a/0x730 net/netlink/af_netlink.c:1343
netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1908
sock_sendmsg_nosec net/socket.c:622 [inline]
sock_sendmsg+0xd7/0x130 net/socket.c:632
___sys_sendmsg+0x803/0x920 net/socket.c:2115
__sys_sendmsg+0x105/0x1d0 net/socket.c:2153
__do_sys_sendmsg net/socket.c:2162 [inline]
__se_sys_sendmsg net/socket.c:2160 [inline]
__x64_sys_sendmsg+0x78/0xb0 net/socket.c:2160
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x446c39
Code: e8 5c b3 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 0b 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fb2a66ebdb8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000006dbc38 RCX: 0000000000446c39
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003
RBP: 00000000006dbc30 R08: 0000000000000004 R09: 0000000000000000
R10: 0000000000000008 R11: 0000000000000246 R12: 00000000006dbc3c
R13: 00007ffe46b1e6ff R14: 00007fb2a66ec9c0 R15: 20c49ba5e353f7cf


---
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 can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Jan 6, 2020, 6:31:11 AM1/6/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 84f5ad46 Linux 4.14.162
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=179dddc1e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=67bcc84091a71c98
dashboard link: https://syzkaller.appspot.com/bug?extid=aeb8f1daf63e840e3da8
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=139365fee00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10713751e00000

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

audit: type=1400 audit(1578310052.917:36): avc: denied { map } for
pid=7091 comm="syz-executor204" path="/root/syz-executor204034520"
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
=====================================
WARNING: bad unlock balance detected!
4.14.162-syzkaller #0 Not tainted
-------------------------------------
syz-executor204/7111 is trying to release lock (sk_lock-AF_INET6) at:
[<ffffffff83f7423c>] gtp_encap_enable_socket+0x10c/0x360
drivers/net/gtp.c:833
but there are no more locks to release!

other info that might help us debug this:
2 locks held by syz-executor204/7111:
#0: (rtnl_mutex){+.+.}, at: [<ffffffff8523c0b9>] rtnl_lock
net/core/rtnetlink.c:72 [inline]
#0: (rtnl_mutex){+.+.}, at: [<ffffffff8523c0b9>]
rtnetlink_rcv_msg+0x339/0xb70 net/core/rtnetlink.c:4301
#1: (slock-AF_INET6){+...}, at: [<ffffffff8519b3e0>] spin_lock_bh
include/linux/spinlock.h:322 [inline]
#1: (slock-AF_INET6){+...}, at: [<ffffffff8519b3e0>]
release_sock+0x20/0x1b0 net/core/sock.c:2777

stack backtrace:
CPU: 1 PID: 7111 Comm: syz-executor204 Not tainted 4.14.162-syzkaller #0
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+0x142/0x197 lib/dump_stack.c:58
print_unlock_imbalance_bug kernel/locking/lockdep.c:3548 [inline]
print_unlock_imbalance_bug.cold+0x114/0x123 kernel/locking/lockdep.c:3525
__lock_release kernel/locking/lockdep.c:3765 [inline]
lock_release+0x616/0x940 kernel/locking/lockdep.c:4013
sock_release_ownership include/net/sock.h:1430 [inline]
release_sock+0x175/0x1b0 net/core/sock.c:2787
gtp_encap_enable_socket+0x10c/0x360 drivers/net/gtp.c:833
gtp_encap_enable drivers/net/gtp.c:855 [inline]
gtp_newlink+0x99f/0xc50 drivers/net/gtp.c:670
rtnl_newlink+0xecb/0x1700 net/core/rtnetlink.c:2719
rtnetlink_rcv_msg+0x3da/0xb70 net/core/rtnetlink.c:4306
netlink_rcv_skb+0x14f/0x3c0 net/netlink/af_netlink.c:2432
rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:4318
netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline]
netlink_unicast+0x44d/0x650 net/netlink/af_netlink.c:1312
netlink_sendmsg+0x7c4/0xc60 net/netlink/af_netlink.c:1877
sock_sendmsg_nosec net/socket.c:646 [inline]
sock_sendmsg+0xce/0x110 net/socket.c:656
___sys_sendmsg+0x70a/0x840 net/socket.c:2062
__sys_sendmsg+0xb9/0x140 net/socket.c:2096
SYSC_sendmsg net/socket.c:2107 [inline]
SyS_sendmsg+0x2d/0x50 net/socket.c:2103
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x446ce9
RSP: 002b:00007fa109c79db8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000006dbc38 RCX: 0000000000446ce9
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003
RBP: 00000000006dbc30 R08: 0000000000000004 R09: 0000000000000000
R10: 0000000000000008 R11: 0000000000000246 R12: 00000000006dbc3c
R13: 00007ffd6eefd73f R14: 00007fa109c7a9c0 R15: 000000000000002d

syzbot

unread,
Feb 7, 2020, 6:37:02 AM2/7/20
to syzkaller...@googlegroups.com
syzbot suspects this bug was fixed by commit:

commit 776a81a024e73e809af4d965ed397405062d4515
Author: Eric Dumazet <edum...@google.com>
Date: Mon Jan 6 14:45:37 2020 +0000

gtp: fix bad unlock balance in gtp_encap_enable_socket

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14e5dc0de00000
start commit: 3d40d711 Linux 4.19.93
git tree: linux-4.19.y
If the result looks correct, please mark the bug fixed by replying with:

#syz fix: gtp: fix bad unlock balance in gtp_encap_enable_socket

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Feb 8, 2020, 1:27:02 AM2/8/20
to syzkaller...@googlegroups.com
syzbot suspects this bug was fixed by commit:

commit 887b0296a905f8d5cc090ca08d309918fc24bf24
Author: Eric Dumazet <edum...@google.com>
Date: Mon Jan 6 14:45:37 2020 +0000

gtp: fix bad unlock balance in gtp_encap_enable_socket

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=142f8301e00000
start commit: 84f5ad46 Linux 4.14.162
git tree: linux-4.14.y
Reply all
Reply to author
Forward
0 new messages