From nobody Sun Feb 20 14:36:37 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BD17D19D108F; Sun, 20 Feb 2022 14:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K1p0P4zQPz3Ljx; Sun, 20 Feb 2022 14:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645367797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z+i1vS5OAq72nS8y7khjYlZ4iGc4m1l4F+w4hVFwXO0=; b=GNIyw0m0f3V5f5AjTU9ITskGnjSOVGaAS/Kfejbn+y4BwXA4wP+oulg4xJMP7a86p47rLx ECsv7zOMQthwq+G/HyfA30qY5tsbHbjyUjnK88LvOhHxnFMPbwvrUTicSOd7pl6ZU3UP/R RsV+jB7i6tL5zhpCaDp3PzzcKA/Im6oTxiVBKIdEpDm4ayL0uspcdjbsIMDuwPgnmYqjAU +IkjvP+JqAMfHdFnin8p6Cfv8hVD0+D2w2rOwUiTkdKbxXBbsY7Asg+LubKaduKdwv3B6b N9QKB0Xb6BJP+OGFpWRdGNIh5IirjNmtAIROJJ7kZ8KiBvNuvqRincCwkLG3GQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B4BD1E22A; Sun, 20 Feb 2022 14:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21KEab6D021816; Sun, 20 Feb 2022 14:36:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21KEabJB021815; Sun, 20 Feb 2022 14:36:37 GMT (envelope-from git) Date: Sun, 20 Feb 2022 14:36:37 GMT Message-Id: <202202201436.21KEabJB021815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e255f0c9fbd2 - main - sctp: make sure new locking requirements are satisfied. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e255f0c9fbd2e1b27f57459d3af18fa19166969d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645367797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z+i1vS5OAq72nS8y7khjYlZ4iGc4m1l4F+w4hVFwXO0=; b=CFnOVvEyXY97DViZFJJG1PllsAC2czgfUSNA51pFfrRWj2qupb88sBE3MPV2gHMLLX0PvU i+iUMm0XiFkhmWN8c/K8XE5+nuXKr6FIn1TAu3P8Jyz+edbAYspHkIiNYL/n8mmd6LJzlb eQAe75OhpaHvuPTHssQf8CapqywF47L1IyaH8sVrNvvBCfvYKHZHvU+mI3mlyznwACHWD+ n0htRGzR4e6kd3co5xUCvbB7lO33G8n5+cST+luaHikBB+FIH8Be8wrVCNtGBAgbc3Pmy2 MXpBSwWZne2UJYgCzxp6J2LKhZlVEk68049W6qk1yhR6O/6eKJKe/pji6wwrJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645367797; a=rsa-sha256; cv=none; b=hv3QU3uVwImLOXtoAFZ3mWFliZ4ifu9qNKVhBpj4uLWRPYsjtWeaO58KEnk9rsjzFXhVTi /GsLf+ISHIAqqOEkTXjCXszyy2P9QsMpdjBeZBf897BtsXwxnY7MHHll97aN2KxzrstNU/ FABbO5Q7NLAma5p9Luf/KOD6thfxwzw/TehyltXYaR3MGspLaGb9Tq2dcY8Wurqz9qWXTR gTXbrCzPTqQUQq+qOjrkeTdI02x9X5cxairaEtRlQRUWz+lIZTf7baw8cRn9Pox+1wu5Z9 Vr/AyR/YZhqGrR9aj6+vC2eLOOXOitJ9yrLIgoVZKABOAuTkI8UoBw6SJF8nbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e255f0c9fbd2e1b27f57459d3af18fa19166969d commit e255f0c9fbd2e1b27f57459d3af18fa19166969d Author: Michael Tuexen AuthorDate: 2022-02-20 14:31:53 +0000 Commit: Michael Tuexen CommitDate: 2022-02-20 14:36:26 +0000 sctp: make sure new locking requirements are satisfied. Reported by: syzbot+cd3c1dd64861b8c200bd@syzkaller.appspotmail.com MFC after: 3 days --- sys/netinet/sctp_output.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 86cf2ed75e90..43804b161cda 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -13321,6 +13321,10 @@ skip_preblock: sp->processing = 0; } SCTP_TCB_SEND_UNLOCK(stcb); + if (!hold_tcblock) { + SCTP_TCB_LOCK(stcb); + hold_tcblock = true; + } goto skip_out_eof; } /* What about the INIT, send it maybe */ @@ -13513,8 +13517,8 @@ skip_preblock: if (error != 0) { goto out; } -dataless_eof: +dataless_eof: KASSERT(stcb != NULL, ("stcb is NULL")); KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); @@ -13602,6 +13606,7 @@ dataless_eof: } } } + skip_out_eof: KASSERT(stcb != NULL, ("stcb is NULL")); KASSERT(hold_tcblock, ("hold_tcblock is false"));