syzbot


general protection fault in sctp_stream_free (2)

Status: fixed on 2020/02/14 01:19
Subsystems: sctp
[Documentation on labels]
Reported-by: syzbot+9a1bc632e78a1a98488b@syzkaller.appspotmail.com
Fix commit: 61d5d4062876 sctp: fix err handling of stream initialization
First crash: 1646d, last: 1635d
Cause bisection: introduced by (bisect log) :
commit 951c6db954a1adefab492f6da805decacabbd1a7
Author: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Tue Dec 17 01:01:16 2019 +0000

  sctp: fix memleak on err handling of stream initialization

Crash: general protection fault in sctp_stream_free (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH 5.4 000/191] 5.4.8-stable review 215 (215) 2020/01/06 09:03
[PATCH net] sctp: fix err handling of stream initialization 5 (5) 2019/12/25 00:08
general protection fault in sctp_stream_free (2) 2 (3) 2019/12/20 16:05
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in sctp_stream_free sctp 17 2379d 2420d 4/27 fixed on 2018/01/31 00:24

Sample crash report:
RBP: 0000000000000004 R08: 0000000000000008 R09: 00007ffc57730031
R10: 0000000020000040 R11: 0000000000000246 R12: 0000000000401f20
R13: 0000000000401fb0 R14: 0000000000000000 R15: 0000000000000000
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 9129 Comm: syz-executor521 Not tainted 5.5.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:sctp_stream_free+0xe4/0x180 net/sctp/stream.c:183
Code: 07 48 89 d1 48 69 d2 aa 00 00 00 48 c1 e1 0c 48 29 d0 48 8d 04 40 48 8d 34 c1 e8 57 24 54 fc 48 8d 78 08 48 89 fa 48 c1 ea 03 <42> 80 3c 32 00 75 6f 48 8b 78 08 e8 1c 4c 77 fa 41 0f b6 45 00 84
RSP: 0018:ffffc90001e17770 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff838f50f6
RDX: 0000000000000001 RSI: ffffffff838f5170 RDI: 0000000000000008
RBP: ffffc90001e177a8 R08: ffff888094206000 R09: fffffbfff16599c2
R10: fffffbfff16599c1 R11: ffffffff8b2cce0f R12: ffff8880a70126e8
R13: ffffed1014e024df R14: dffffc0000000000 R15: ffff8880a70120a8
FS:  0000000000f03880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000100 CR3: 000000000986d000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 sctp_association_free+0x235/0x7e0 net/sctp/associola.c:350
 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:934 [inline]
 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1322 [inline]
 sctp_side_effects net/sctp/sm_sideeffect.c:1189 [inline]
 sctp_do_sm+0x3a6a/0x5190 net/sctp/sm_sideeffect.c:1160
 sctp_primitive_ABORT+0xa0/0xd0 net/sctp/primitive.c:104
 sctp_close+0x259/0x960 net/sctp/socket.c:1513
 inet_release+0xed/0x200 net/ipv4/af_inet.c:427
 __sock_release+0xce/0x280 net/socket.c:592
 sock_close+0x1e/0x30 net/socket.c:1270
 __fput+0x2ff/0x890 fs/file_table.c:280
 ____fput+0x16/0x20 fs/file_table.c:313
 task_work_run+0x145/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x8e7/0x2ef0 kernel/exit.c:797
 do_group_exit+0x135/0x360 kernel/exit.c:895
 __do_sys_exit_group kernel/exit.c:906 [inline]
 __se_sys_exit_group kernel/exit.c:904 [inline]
 __x64_sys_exit_group+0x44/0x50 kernel/exit.c:904
 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x43f2f8
Code: Bad RIP value.
RSP: 002b:00007ffc5773ea88 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043f2f8
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004bf0c8 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 0000000020000040 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d1180 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 0df255c71a71b566 ]---
RIP: 0010:sctp_stream_free+0xe4/0x180 net/sctp/stream.c:183
Code: 07 48 89 d1 48 69 d2 aa 00 00 00 48 c1 e1 0c 48 29 d0 48 8d 04 40 48 8d 34 c1 e8 57 24 54 fc 48 8d 78 08 48 89 fa 48 c1 ea 03 <42> 80 3c 32 00 75 6f 48 8b 78 08 e8 1c 4c 77 fa 41 0f b6 45 00 84
RSP: 0018:ffffc90001e17770 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff838f50f6
RDX: 0000000000000001 RSI: ffffffff838f5170 RDI: 0000000000000008
RBP: ffffc90001e177a8 R08: ffff888094206000 R09: fffffbfff16599c2
R10: fffffbfff16599c1 R11: ffffffff8b2cce0f R12: ffff8880a70126e8
R13: ffffed1014e024df R14: dffffc0000000000 R15: ffff8880a70120a8
FS:  0000000000f03880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000043f2ce CR3: 000000000986d000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (25):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/12/19 22:05 net-old 6fa9a115fe7c 36650b4b .config console log report syz C ci-upstream-net-this-kasan-gce
2019/12/30 21:45 upstream fd6988496e79 af6b8ef8 .config console log report ci-upstream-kasan-gce-root
2019/12/29 03:07 upstream bf8d1cd43865 af6b8ef8 .config console log report ci-upstream-kasan-gce
2019/12/25 19:46 upstream 46cf053efec6 be5c2c81 .config console log report ci-upstream-kasan-gce-root
2019/12/24 16:12 upstream 46cf053efec6 be5c2c81 .config console log report ci-upstream-kasan-gce-selinux-root
2019/12/24 16:01 upstream 46cf053efec6 be5c2c81 .config console log report ci-upstream-kasan-gce-selinux-root
2019/12/24 12:17 upstream 46cf053efec6 be5c2c81 .config console log report ci-upstream-kasan-gce
2019/12/24 05:26 upstream 46cf053efec6 be5c2c81 .config console log report ci-upstream-kasan-gce-selinux-root
2019/12/24 16:02 upstream 46cf053efec6 be5c2c81 .config console log report ci-upstream-kasan-gce-386
2019/12/24 06:37 upstream 46cf053efec6 be5c2c81 .config console log report ci-upstream-kasan-gce-386
2019/12/24 06:36 net-old c60174717544 be5c2c81 .config console log report ci-upstream-net-this-kasan-gce
2019/12/23 18:11 net-old c60174717544 be5c2c81 .config console log report ci-upstream-net-this-kasan-gce
2019/12/19 21:40 net-old 6fa9a115fe7c 36650b4b .config console log report ci-upstream-net-this-kasan-gce
2019/12/30 01:53 net-next-old 1a1fda57b400 af6b8ef8 .config console log report ci-upstream-net-kasan-gce
2019/12/27 20:00 net-next-old 1f4f16fa19f4 be5c2c81 .config console log report ci-upstream-net-kasan-gce
2019/12/26 17:08 net-next-old 9f6cff995e98 be5c2c81 .config console log report ci-upstream-net-kasan-gce
2019/12/26 08:51 net-next-old 9f6cff995e98 be5c2c81 .config console log report ci-upstream-net-kasan-gce
2019/12/25 21:08 net-next-old af7797785d61 be5c2c81 .config console log report ci-upstream-net-kasan-gce
2019/12/25 17:44 net-next-old af7797785d61 be5c2c81 .config console log report ci-upstream-net-kasan-gce
2019/12/25 10:30 net-next-old ac80010fc94e be5c2c81 .config console log report ci-upstream-net-kasan-gce
2019/12/24 05:27 net-next-old ac80010fc94e be5c2c81 .config console log report ci-upstream-net-kasan-gce
2019/12/23 16:58 net-next-old ac80010fc94e be5c2c81 .config console log report ci-upstream-net-kasan-gce
2019/12/25 19:47 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/24 16:19 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/12/24 12:24 linux-next 7ddd09fc4b74 be5c2c81 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.