From nobody Wed Feb 1 23:01:03 2023 X-Original-To: dev-commits-src-branches@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 4P6cpm0mN9z3cH89; Wed, 1 Feb 2023 23:01:04 +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 4P6cpm0Lbmz3FtD; Wed, 1 Feb 2023 23:01:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675292464; 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=634J0eV463uIXjLUqyQZXOt1KdFQrZk7I0I33T7I1ts=; b=nuOJHsT5LvqYOHdnfwLA8Sfl+7CW2DkoBL4EVkqCJih9Ei1If4ClElVB+UsjEKju4KgLch PGFCJ3OM8/O51g+PtP4odp0e9X8Lq5fQKxL26/B+3VLcAR6ppAD0S4dogXfa1AvQAfIJiW kQ/70ZGbcf340WDfVJ+bTaHMup7WobVyHywV6taWyDuRX8vbku/QRLBKu2hndCHhRlVok7 J4htADkSmVSBX5/IKvoAskumytruDGUHp7FRAapk+Y121ixEIKFIudjOqyGmBy8fv87KVm ERHf4+tPmKRGZPmDFsLdRk7YDoZVhUn20ovCRpra64mAC+jY8k0vZvDSMVM8mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675292464; 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=634J0eV463uIXjLUqyQZXOt1KdFQrZk7I0I33T7I1ts=; b=Py2ZiMBMVFa2yF7iQVnKCbSCus4KFXNUg5LwDUpFA5MpihHoInhqU/VRfuYH/GTqOBAwtR V4UyKymGaaEFiY+cOZPjc7krcCS7n6ObJk/N3C4AJXzjF3Z0zSKV6i1fSzPFDamNqRF/Bm L3MGrvpEior8LvIFLNiJaVRZD2QfisGSGVqZ3VxJmDYSASdLMGifZJJefwIOWIBnRdH1me IqjEFsekIUSnCxt5F5AUhWzZlBzbPhZsw45IMCsW1gv0/2Itf2YTfGdfGN3NCJkynfA/A4 /boUAqkkxOXmvvbaxKPD+RZhbjE94Dewvgcp99aaIq5DGNN1Y8PtuanLYRwQ0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675292464; a=rsa-sha256; cv=none; b=nwK2bL9+oR82nbmFMp6ID5ab7jvXup8Nyds5s1CHEjxGPcV4xoHik29SIeOC5tqImcDgED 8W55EZPRcafcPdfLF82add98nNAQdAaTfD9QJFbaUk4Rpq4pXLMqRuW4yg3cDfAB+/raP9 BAKZTmb6aErpW1Vxp6HC2jRPRr73zrqOrPzemg8zMBHz1VYgz9cVnyqm4b/asmSVD0HSFG jSqxXlPqIDwewGR0JeWb7qpL5QnZ2DsZafTNQrPy32vSbVIw7WkvRR45VL+kqeFCcPqwiK RuVBwa2P7I7ZBWsVowqo0icP3vnx1ZYIA1rvo28io/Yv97ydaCab2XolSjvosA== 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 4P6cpl6W7rzX1t; Wed, 1 Feb 2023 23:01:03 +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 311N13xH028835; Wed, 1 Feb 2023 23:01:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 311N13B5028834; Wed, 1 Feb 2023 23:01:03 GMT (envelope-from git) Date: Wed, 1 Feb 2023 23:01:03 GMT Message-Id: <202302012301.311N13B5028834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 821f1352112e - stable/13 - sctp: use a consistent view of the send parameters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 821f1352112e0af022ffb7cefc1c5fb81b1574be Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=821f1352112e0af022ffb7cefc1c5fb81b1574be commit 821f1352112e0af022ffb7cefc1c5fb81b1574be Author: Michael Tuexen AuthorDate: 2022-05-28 17:35:58 +0000 Commit: Michael Tuexen CommitDate: 2023-02-01 23:00:40 +0000 sctp: use a consistent view of the send parameters Reported by: syzbot+e26628a755f78bacff16@syzkaller.appspotmail.com (cherry picked from commit 2646cd085850f047eb17c7df53823b1d48deca82) --- sys/netinet/sctp_output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 7c0c953c7504..7695784aafff 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -12416,6 +12416,7 @@ sctp_lower_sosend(struct socket *so, struct thread *p ) { + struct sctp_nonpad_sndrcvinfo sndrcvninfo; struct epoch_tracker et; ssize_t sndlen = 0, max_len, local_add_more; int error; @@ -12721,7 +12722,9 @@ sctp_lower_sosend(struct socket *so, atomic_add_int(&asoc->refcnt, 1); free_cnt_applied = true; if (srcv == NULL) { - srcv = (struct sctp_sndrcvinfo *)&asoc->def_send; + /* Use a local copy to have a consistent view. */ + sndrcvninfo = asoc->def_send; + srcv = (struct sctp_sndrcvinfo *)&sndrcvninfo; sinfo_flags = srcv->sinfo_flags; if (flags & MSG_EOR) { sinfo_flags |= SCTP_EOR;