Hello,
syzbot found the following crash on:
HEAD commit: c63ee293 Linux 4.19.85
git tree: linux-4.19.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=168a638ce00000
kernel config:
https://syzkaller.appspot.com/x/.config?x=cbfad1c8058581ad
dashboard link:
https://syzkaller.appspot.com/bug?extid=59dc1aa392e0d829104b
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=11c8436ae00000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=15f2958ce00000
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by:
syzbot+59dc1a...@syzkaller.appspotmail.com
audit: type=1400 audit(1574429880.357:35): avc: denied { map } for
pid=7746 comm="bash" path="/bin/bash" dev="sda1" ino=1457
scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1
audit: type=1400 audit(1574429887.077:36): avc: denied { map } for
pid=7758 comm="syz-executor818" path="/root/syz-executor818180628"
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
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 7758 at lib/refcount.c:187
refcount_sub_and_test_checked lib/refcount.c:187 [inline]
WARNING: CPU: 1 PID: 7758 at lib/refcount.c:187
refcount_sub_and_test_checked+0x1c5/0x1f0 lib/refcount.c:177
Kernel panic - not syncing: panic_on_warn set ...
CPU: 1 PID: 7758 Comm: syz-executor818 Not tainted 4.19.85-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
panic+0x26a/0x50e kernel/panic.c:186
__warn.cold+0x20/0x53 kernel/panic.c:541
report_bug+0x263/0x2b0 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:178 [inline]
fixup_bug arch/x86/kernel/traps.c:173 [inline]
do_error_trap+0x204/0x360 arch/x86/kernel/traps.c:296
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1037
RIP: 0010:refcount_sub_and_test_checked lib/refcount.c:187 [inline]
RIP: 0010:refcount_sub_and_test_checked+0x1c5/0x1f0 lib/refcount.c:177
Code: 1d 99 37 14 06 31 ff 89 de e8 d7 af 47 fe 84 db 75 1a e8 8e ae 47 fe
48 c7 c7 80 2c 82 87 c6 05 79 37 14 06 01 e8 d9 2c 1b fe <0f> 0b 45 31 e4
eb 90 e8 6f ae 47 fe e9 ce fe ff ff 48 89 df e8 12
RSP: 0018:ffff88809e6e7550 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff815595d6 RDI: ffffed1013cdce9c
RBP: ffff88809e6e75e0 R08: ffff88809fca4540 R09: ffffed1015d23ee3
R10: ffffed1015d23ee2 R11: ffff8880ae91f717 R12: 00000000ffffff01
R13: 0000000000008001 R14: 1ffff11013cdceab R15: ffff88809e6e75b8
sock_wfree+0xb6/0x180 net/core/sock.c:1819
sctp_wfree+0x395/0x960 net/sctp/socket.c:8467
skb_release_head_state+0x15d/0x2d0 net/core/skbuff.c:616
skb_release_all+0x16/0x60 net/core/skbuff.c:629
__kfree_skb net/core/skbuff.c:645 [inline]
consume_skb net/core/skbuff.c:705 [inline]
consume_skb+0xe2/0x380 net/core/skbuff.c:699
sctp_chunk_destroy net/sctp/sm_make_chunk.c:1467 [inline]
sctp_chunk_put+0x192/0x280 net/sctp/sm_make_chunk.c:1494
sctp_chunk_free+0x56/0x70 net/sctp/sm_make_chunk.c:1481
__sctp_outq_teardown+0x1d0/0xc60 net/sctp/outqueue.c:234
sctp_outq_free+0x16/0x20 net/sctp/outqueue.c:291
sctp_association_free+0x208/0x79a net/sctp/associola.c:360
sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline]
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1332 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline]
sctp_do_sm+0x3a73/0x5190 net/sctp/sm_sideeffect.c:1170
sctp_primitive_ABORT+0xa0/0xd0 net/sctp/primitive.c:119
sctp_close+0x259/0x860 net/sctp/socket.c:1558
inet_release+0xff/0x1e0 net/ipv4/af_inet.c:428
__sock_release+0xce/0x2a0 net/socket.c:579
sock_close+0x1b/0x30 net/socket.c:1140
__fput+0x2dd/0x8b0 fs/file_table.c:278
____fput+0x16/0x20 fs/file_table.c:309
task_work_run+0x145/0x1c0 kernel/task_work.c:113
exit_task_work include/linux/task_work.h:22 [inline]
do_exit+0x994/0x2fa0 kernel/exit.c:876
do_group_exit+0x135/0x370 kernel/exit.c:979
__do_sys_exit_group kernel/exit.c:990 [inline]
__se_sys_exit_group kernel/exit.c:988 [inline]
__x64_sys_exit_group+0x44/0x50 kernel/exit.c:988
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x43f268
Code: Bad RIP value.
RSP: 002b:00007ffe2bf71e18 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043f268
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004bea68 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 000000002059aff8 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d01a0 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches