general protection fault in __lock_acquire (2)

21 views
Skip to first unread message

syzbot

unread,
Nov 2, 2017, 6:55:03 AM11/2/17
to da...@davemloft.net, jon....@ericsson.com, linux-...@vger.kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com, tipc-di...@lists.sourceforge.net, ying...@windriver.com
Hello,

syzkaller hit the following crash on
fa8785e862ef644f742558f1a8c91eca6f3f0004
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.




R10: 0000000020869000 R11: 0000000000000246 R12: 00000000004a96f0
R13: 0000000000000000 R14: 00007fe1d40269c8 R15: 00007fe1d4026b38
Subscriber rejected, no memory
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 3 PID: 16314 Comm: syz-executor6 Not tainted 4.14.0-rc7-next-20171102+
#9
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
task: ffff88003d54a000 task.stack: ffff880038f70000
RIP: 0010:__lock_acquire+0xdac/0x4770 kernel/locking/lockdep.c:3378
RSP: 0018:ffff880038f77328 EFLAGS: 00010002
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffffffff85ecb380
RBP: ffff880038f77830 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff8744cca0 R12: ffff88003d54a000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000020
FS: 00007fe1d4027700(0000) GS:ffff88006df00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fbbb18db000 CR3: 000000006a863000 CR4: 00000000000026e0
Call Trace:
lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:173
spin_lock_bh include/linux/spinlock.h:319 [inline]
tipc_subscrb_subscrp_delete+0x8f/0x480 net/tipc/subscr.c:201
tipc_subscrb_delete net/tipc/subscr.c:238 [inline]
tipc_subscrb_release_cb+0x17/0x30 net/tipc/subscr.c:316
tipc_close_conn+0x171/0x270 net/tipc/server.c:204
tipc_topsrv_kern_subscr+0x724/0x810 net/tipc/server.c:514
tipc_group_create+0x702/0x9c0 net/tipc/group.c:184
tipc_sk_join net/tipc/socket.c:2747 [inline]
tipc_setsockopt+0x249/0xc10 net/tipc/socket.c:2861
SYSC_setsockopt net/socket.c:1851 [inline]
SyS_setsockopt+0x189/0x360 net/socket.c:1830
entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x447c89
RSP: 002b:00007fe1d4026bd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007fe1d40276cc RCX: 0000000000447c89
RDX: 0000000000000087 RSI: 000000000000010f RDI: 0000000000000013
RBP: 0000000000000086 R08: 0000000000000010 R09: 0000000000000000
R10: 0000000020869000 R11: 0000000000000246 R12: 00000000004a96f0
R13: 0000000000000000 R14: 00007fe1d40269c8 R15: 00007fe1d4026b38
Code: e9 03 f3 48 ab 48 81 c4 e0 04 00 00 44 89 f0 5b 41 5c 41 5d 41 5e 41
5f 5d c3 4c 89 fa 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00
0f 85 bf 33 00 00 49 81 3f 80 87 87 86 41 be 00 00
RIP: __lock_acquire+0xdac/0x4770 kernel/locking/lockdep.c:3378 RSP:
ffff880038f77328
---[ end trace 61ded41cffc497c5 ]---
Kernel panic - not syncing: Fatal exception in interrupt
Dumping ftrace buffer:
(ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.
Please credit me with: Reported-by: syzbot <syzk...@googlegroups.com>

syzbot will keep track of this bug report.
Once a fix for this bug is committed, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line.
config.txt
raw.log

syzbot

unread,
Dec 2, 2017, 3:41:02 AM12/2/17
to da...@davemloft.net, jon....@ericsson.com, linux-...@vger.kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com, tipc-di...@lists.sourceforge.net, ying...@windriver.com
syzkaller has found reproducer for the following crash on
a0651c7fa2c088a605f63792279859608ed7f2c8
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.

syzkaller reproducer is attached. See https://goo.gl/kgGztJ
for information about syzkaller reproducers


R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Subscriber rejected, no memory
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 3092 Comm: syz-executor0 Not tainted 4.15.0-rc1+ #114
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: 00000000b922df06 task.stack: 00000000f204d590
RIP: 0010:__lock_acquire+0xd55/0x47f0 kernel/locking/lockdep.c:3378
RSP: 0018:ffff8801cbba7350 EFLAGS: 00010002
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffffffff85ecb440
RBP: ffff8801cbba76d8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff87489d60 R12: ffff8801cc82a100
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000020
FS: 0000000000000000(0000) GS:ffff8801db500000(0063) knlGS:0000000008cd8900
CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 000000009bc20000 CR3: 00000001cb859000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:175
spin_lock_bh include/linux/spinlock.h:320 [inline]
tipc_subscrb_subscrp_delete+0x8f/0x470 net/tipc/subscr.c:201
tipc_subscrb_delete net/tipc/subscr.c:238 [inline]
tipc_subscrb_release_cb+0x17/0x30 net/tipc/subscr.c:316
tipc_close_conn+0x171/0x270 net/tipc/server.c:204
tipc_topsrv_kern_subscr+0x724/0x810 net/tipc/server.c:514
tipc_group_create+0x702/0x9c0 net/tipc/group.c:184
tipc_sk_join net/tipc/socket.c:2747 [inline]
tipc_setsockopt+0x249/0xc10 net/tipc/socket.c:2861
C_SYSC_setsockopt net/compat.c:406 [inline]
compat_SyS_setsockopt+0x2e7/0x410 net/compat.c:386
do_syscall_32_irqs_on arch/x86/entry/common.c:327 [inline]
do_fast_syscall_32+0x3ee/0xf9d arch/x86/entry/common.c:389
entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:125
RIP: 0023:0xf7fd8c79
RSP: 002b:00000000ffe3ea6c EFLAGS: 00000296 ORIG_RAX: 000000000000016e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000000010f
RDX: 0000000000000087 RSI: 00000000206fb000 RDI: 0000000000000010
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Code: e9 03 f3 48 ab 48 81 c4 60 03 00 00 44 89 f8 5b 41 5c 41 5d 41 5e 41
5f 5d c3 4c 89 fa 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00
0f 85 cf 38 00 00 49 81 3f 00 58 8b 86 41 be 00 00
RIP: __lock_acquire+0xd55/0x47f0 kernel/locking/lockdep.c:3378 RSP:
ffff8801cbba7350
---[ end trace 1ff020b845084a89 ]---

config.txt
raw.log
repro.txt

syzbot

unread,
Dec 3, 2017, 7:33:01 PM12/3/17
to da...@davemloft.net, jon....@ericsson.com, linux-...@vger.kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com, tipc-di...@lists.sourceforge.net, ying...@windriver.com
syzkaller has found reproducer for the following crash on
fb7516d42478ebc8e2f00efb76ef96f7b68fd8d3
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.
C reproducer is attached
syzkaller reproducer is attached. See https://goo.gl/kgGztJ
for information about syzkaller reproducers


R13: 00000000004023a0 R14: 0000000000000000 R15: 0000000000000000
Subscriber rejected, no memory
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 0 PID: 3085 Comm: syzkaller064164 Not tainted 4.15.0-rc1+ #137
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: 00000000c24413a5 task.stack: 000000005e8160b5
RIP: 0010:__lock_acquire+0xd55/0x47f0 kernel/locking/lockdep.c:3378
RSP: 0018:ffff8801cb5474a8 EFLAGS: 00010002
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffffffff85ecb400
RBP: ffff8801cb547830 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff87489d60 R12: ffff8801cd2980c0
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000020
FS: 00000000014ee880(0000) GS:ffff8801db400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffee2426e40 CR3: 00000001cb85a000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:175
spin_lock_bh include/linux/spinlock.h:320 [inline]
tipc_subscrb_subscrp_delete+0x8f/0x470 net/tipc/subscr.c:201
tipc_subscrb_delete net/tipc/subscr.c:238 [inline]
tipc_subscrb_release_cb+0x17/0x30 net/tipc/subscr.c:316
tipc_close_conn+0x171/0x270 net/tipc/server.c:204
tipc_topsrv_kern_subscr+0x724/0x810 net/tipc/server.c:514
tipc_group_create+0x702/0x9c0 net/tipc/group.c:184
tipc_sk_join net/tipc/socket.c:2747 [inline]
tipc_setsockopt+0x249/0xc10 net/tipc/socket.c:2861
SYSC_setsockopt net/socket.c:1851 [inline]
SyS_setsockopt+0x189/0x360 net/socket.c:1830
entry_SYSCALL_64_fastpath+0x1f/0x96
RIP: 0033:0x444dd9
RSP: 002b:00007fffe5997f78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000444dd9
RDX: 0000000000000087 RSI: 000000000000010f RDI: 0000000000000004
RBP: 0000000000000006 R08: 000000000000001c R09: 0000006f00000034
R10: 0000000020265000 R11: 0000000000000246 R12: 0000000000402310
R13: 00000000004023a0 R14: 0000000000000000 R15: 0000000000000000
Code: e9 03 f3 48 ab 48 81 c4 60 03 00 00 44 89 f8 5b 41 5c 41 5d 41 5e 41
5f 5d c3 4c 89 fa 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00
0f 85 cf 38 00 00 49 81 3f 00 58 8b 86 41 be 00 00
RIP: __lock_acquire+0xd55/0x47f0 kernel/locking/lockdep.c:3378 RSP:
ffff8801cb5474a8
---[ end trace 1d79d73eb824586d ]---

config.txt
raw.log
repro.txt
repro.c

Cong Wang

unread,
Dec 3, 2017, 9:27:03 PM12/3/17
to syzbot, David Miller, Jon Maloy, LKML, Linux Kernel Network Developers, syzkall...@googlegroups.com, tipc-di...@lists.sourceforge.net, Ying Xue
On Sun, Dec 3, 2017 at 4:33 PM, syzbot
<bot+b345a2c15a15db1262...@syzkaller.appspotmail.com>
wrote:
Looks like we simply need to check against NULL:

diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 251065dfd8df..2402a019b8ec 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -235,6 +235,8 @@ static struct tipc_subscriber
*tipc_subscrb_create(int conid)

static void tipc_subscrb_delete(struct tipc_subscriber *subscriber)
{
+ if (!subscriber)
+ return;
tipc_subscrb_subscrp_delete(subscriber, NULL);
tipc_subscrb_put(subscriber);
}

Eric Biggers

unread,
Jan 26, 2018, 8:23:29 PM1/26/18
to syzbot, da...@davemloft.net, jon....@ericsson.com, linux-...@vger.kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com, tipc-di...@lists.sourceforge.net, ying...@windriver.com
No longer occurring, seems to have been fixed by:

#syz fix: tipc: fix a null pointer deref on error path
Reply all
Reply to author
Forward
0 new messages