[v6.1] WARNING: refcount bug in inet_csk_listen_stop

0 views
Skip to first unread message

syzbot

unread,
Dec 18, 2023, 4:20:29 PM12/18/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ba6f5fb46511 Linux 6.1.68
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13d5573ee80000
kernel config: https://syzkaller.appspot.com/x/.config?x=74c3cb1ec76f718a
dashboard link: https://syzkaller.appspot.com/bug?extid=73d8b1fcd3283eb75a65
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/690153148e4f/disk-ba6f5fb4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/dd3bc851bb89/vmlinux-ba6f5fb4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7a7980f86ece/bzImage-ba6f5fb4.xz

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

------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 1 PID: 21130 at lib/refcount.c:25 refcount_warn_saturate+0x132/0x1a0 lib/refcount.c:25
Modules linked in:
CPU: 1 PID: 21130 Comm: syz-executor.5 Not tainted 6.1.68-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:refcount_warn_saturate+0x132/0x1a0 lib/refcount.c:25
Code: 0a 01 48 c7 c7 20 bb 3c 8b e8 2a ed 1a fd 0f 0b eb a9 e8 e1 00 53 fd c6 05 9d b8 27 0a 01 48 c7 c7 80 bb 3c 8b e8 0e ed 1a fd <0f> 0b eb 8d e8 c5 00 53 fd c6 05 82 b8 27 0a 01 48 c7 c7 e0 bb 3c
RSP: 0018:ffffc9000ce5fa88 EFLAGS: 00010246
RAX: 4e8eeb0c897ef900 RBX: 0000000000000002 RCX: ffff888012758000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000002 R08: ffffffff81527dae R09: fffff520019cbeb1
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88807aa0e000 R14: ffff88814b273fc0 R15: ffff8880284b81e0
FS: 0000555555a04480(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b32f28000 CR3: 000000002859d000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__refcount_inc include/linux/refcount.h:250 [inline]
refcount_inc include/linux/refcount.h:267 [inline]
sock_hold include/net/sock.h:773 [inline]
inet_csk_listen_stop+0x88b/0xae0 net/ipv4/inet_connection_sock.c:1391
mptcp_check_listen_stop+0x19d/0x2a0 net/mptcp/protocol.c:3010
__mptcp_close+0xaf/0x960 net/mptcp/protocol.c:3024
mptcp_close+0x26/0x120 net/mptcp/protocol.c:3089
inet_release+0x174/0x1f0 net/ipv4/af_inet.c:429
__sock_release net/socket.c:652 [inline]
sock_close+0xcd/0x230 net/socket.c:1387
__fput+0x3b7/0x890 fs/file_table.c:320
task_work_run+0x246/0x300 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:87
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fd1c287ba9a
Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24
RSP: 002b:00007ffd801c3c30 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00007fd1c287ba9a
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007fd1c299d980 R08: 0000001b33520000 R09: 000000000000018d
R10: 00000000818e5f6a R11: 0000000000000293 R12: 0000000000152133
R13: ffffffffffffffff R14: 00007fd1c2400000 R15: 0000000000151df2
</TASK>


---
This report 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 issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages