BUG: unable to handle kernel NULL pointer dereference in l2tp_session_free

13 views
Skip to first unread message

syzbot

unread,
Dec 27, 2019, 9:04:07 AM12/27/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: e1f7d50a Linux 4.14.160
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=161c9ab9e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=46599517442ad9fb
dashboard link: https://syzkaller.appspot.com/bug?extid=9ea85809e818c6933f7b
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+9ea858...@syzkaller.appspotmail.com

BUG: unable to handle kernel NULL pointer dereference at 0000000000000080
kobject: 'rfkill9' (ffff88804bf44e68): kobject_add_internal:
parent: 'phy7', set: 'devices'
IP: refcount_dec_and_test arch/x86/include/asm/refcount.h:75 [inline]
IP: sock_put include/net/sock.h:1652 [inline]
IP: l2tp_session_free+0x120/0x210 net/l2tp/l2tp_core.c:1709
PGD 97b51067 P4D 97b51067 PUD 92b59067 PMD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
PM: Basic memory bitmaps created
Modules linked in:
CPU: 1 PID: 11471 Comm: syz-executor.1 Not tainted 4.14.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
kobject: 'rfkill9' (ffff88804bf44e68): kobject_uevent_env
task: ffff8880426b2000 task.stack: ffff8880987d8000
RIP: 0010:refcount_dec_and_test arch/x86/include/asm/refcount.h:75 [inline]
RIP: 0010:sock_put include/net/sock.h:1652 [inline]
RIP: 0010:l2tp_session_free+0x120/0x210 net/l2tp/l2tp_core.c:1709
RSP: 0018:ffff8880987dfc58 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff88809687a280 RCX: 0000000000000000
RDX: 1ffff11012d0f481 RSI: ffff8880426b2880 RDI: ffff88809687a408
RBP: ffff8880987dfc78 R08: ffff8880426b2000 R09: ffff8880426b28a0
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880a4b7ba40
R13: ffff8880a4b7ba50 R14: 0000000000000000 R15: 0000000000000000
FS: 0000000001a32940(0000) GS:ffff8880aed00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000080 CR3: 000000004c102000 CR4: 00000000001426e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
kobject: 'rfkill9' (ffff88804bf44e68): fill_kobj_path: path
= '/devices/virtual/mac80211_hwsim/hwsim7/ieee80211/phy7/rfkill9'
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:300 [inline]
pppol2tp_session_destruct+0xd8/0x110 net/l2tp/l2tp_ppp.c:460
__sk_destruct+0x4f/0x650 net/core/sock.c:1556
sk_destruct+0xa4/0xd0 net/core/sock.c:1596
PM: Basic memory bitmaps freed
__sk_free+0x54/0x230 net/core/sock.c:1604
sk_free+0x35/0x40 net/core/sock.c:1615
sock_put include/net/sock.h:1653 [inline]
pppol2tp_release+0x265/0x310 net/l2tp/l2tp_ppp.c:501
__sock_release+0xce/0x2b0 net/socket.c:602
ieee80211 phy7: Selected rate control algorithm 'minstrel_ht'
sock_close+0x1b/0x30 net/socket.c:1139
__fput+0x275/0x7a0 fs/file_table.c:210
____fput+0x16/0x20 fs/file_table.c:244
kobject: 'net' (ffff888089cb1680): kobject_add_internal: parent: 'hwsim7',
set: '(null)'
task_work_run+0x114/0x190 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x1da/0x220 arch/x86/entry/common.c:164
kobject: 'wlan0' (ffff88804d9e9c30): kobject_add_internal: parent: 'net',
set: 'devices'
prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
do_syscall_64+0x4bc/0x640 arch/x86/entry/common.c:297
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4144b1
kobject: 'wlan0' (ffff88804d9e9c30): kobject_uevent_env
RSP: 002b:00007ffd24567840 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00000000004144b1
RDX: 0000000000000000 RSI: 0000000000000081 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000761588 R09: ffffffffffffffff
R10: 00007ffd24567910 R11: 0000000000000293 R12: 000000000075bf20
R13: 0000000000000004 R14: 0000000000761590 R15: 000000000075bf2c
Code: 78 fb 48 8d bb 88 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48
c1 ea 03 80 3c 02 00 0f 85 d9 00 00 00 4c 8b b3 88 01 00 00 <f0> 41 ff 8e
kobject: 'wlan0' (ffff88804d9e9c30): fill_kobj_path: path
= '/devices/virtual/mac80211_hwsim/hwsim7/net/wlan0'
80 00 00 00 0f 88 8b cc 7d 00 74 74 e8 4b a2 78 fb
RIP: refcount_dec_and_test arch/x86/include/asm/refcount.h:75 [inline] RSP:
ffff8880987dfc58
RIP: sock_put include/net/sock.h:1652 [inline] RSP: ffff8880987dfc58
RIP: l2tp_session_free+0x120/0x210 net/l2tp/l2tp_core.c:1709 RSP:
ffff8880987dfc58
CR2: 0000000000000080
---[ end trace a33c094adb86b951 ]---
kobject: 'loop5' (ffff8880a41d96e0): kobject_uevent_env


---
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,
Mar 21, 2020, 5:15:13 AM3/21/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: 01364dad Linux 4.14.174
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13afa91de00000
kernel config: https://syzkaller.appspot.com/x/.config?x=664dd71881ab2b2d
dashboard link: https://syzkaller.appspot.com/bug?extid=9ea85809e818c6933f7b
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16719373e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1099cc23e00000

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

audit: type=1400 audit(1584781951.932:36): avc: denied { map } for pid=7523 comm="syz-executor775" path="/root/syz-executor775765992" dev="sda1" ino=16484 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
BUG: unable to handle kernel NULL pointer dereference at 0000000000000080
IP: refcount_dec_and_test arch/x86/include/asm/refcount.h:75 [inline]
IP: sock_put include/net/sock.h:1657 [inline]
IP: l2tp_session_free+0x113/0x200 net/l2tp/l2tp_core.c:1714
PGD 0 P4D 0
Oops: 0002 [#1] PREEMPT SMP KASAN
Modules linked in:
CPU: 0 PID: 7525 Comm: syz-executor775 Not tainted 4.14.174-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
task: ffff8880a946c180 task.stack: ffff888088d88000
RIP: 0010:refcount_dec_and_test arch/x86/include/asm/refcount.h:75 [inline]
RIP: 0010:sock_put include/net/sock.h:1657 [inline]
RIP: 0010:l2tp_session_free+0x113/0x200 net/l2tp/l2tp_core.c:1714
RSP: 0018:ffff888088d8fbc0 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff8880a67842c0 RCX: 0000000000000000
RDX: 1ffff11014cf0889 RSI: ffff8880a946ca00 RDI: ffff8880a6784448
RBP: ffff88809903dac0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88809903dad0
R13: 0000000000000000 R14: 0000000000000000 R15: ffff88809b4a4290
FS: 00000000017a9880(0000) GS:ffff8880aea00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000080 CR3: 0000000007c6a000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:300 [inline]
pppol2tp_session_destruct+0xcd/0x110 net/l2tp/l2tp_ppp.c:460
__sk_destruct+0x49/0x640 net/core/sock.c:1556
sk_destruct+0x97/0xc0 net/core/sock.c:1596
__sk_free+0x4c/0x220 net/core/sock.c:1604
sk_free+0x2b/0x40 net/core/sock.c:1615
sock_put include/net/sock.h:1658 [inline]
pppol2tp_release+0x247/0x2f0 net/l2tp/l2tp_ppp.c:501
__sock_release+0xcd/0x2b0 net/socket.c:602
sock_close+0x15/0x20 net/socket.c:1139
__fput+0x25f/0x790 fs/file_table.c:210
task_work_run+0x113/0x190 kernel/task_work.c:113
exit_task_work include/linux/task_work.h:22 [inline]
do_exit+0x9f2/0x2b00 kernel/exit.c:858
do_group_exit+0x100/0x310 kernel/exit.c:955
SYSC_exit_group kernel/exit.c:966 [inline]
SyS_exit_group+0x19/0x20 kernel/exit.c:964
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x43ff48
RSP: 002b:00007fff68d6a498 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043ff48
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004bf7d0 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 0000000020000040 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d1180 R14: 0000000000000000 R15: 0000000000000000
Code: 97 fb 48 8d bb 88 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 d2 00 00 00 4c 8b ab 88 01 00 00 <f0> 41 ff 8d 80 00 00 00 0f 88 24 80 7b 00 74 70 e8 b8 d9 97 fb
RIP: refcount_dec_and_test arch/x86/include/asm/refcount.h:75 [inline] RSP: ffff888088d8fbc0
RIP: sock_put include/net/sock.h:1657 [inline] RSP: ffff888088d8fbc0
RIP: l2tp_session_free+0x113/0x200 net/l2tp/l2tp_core.c:1714 RSP: ffff888088d8fbc0
CR2: 0000000000000080
---[ end trace d8b0b59e1be263bf ]---

Reply all
Reply to author
Forward
0 new messages