From nobody Sat May 28 17:37:25 2022 X-Original-To: dev-commits-src-main@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 294291B428C8; Sat, 28 May 2022 17:37:26 +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 4L9TQG0dl4z3tVm; Sat, 28 May 2022 17:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653759446; 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=urDkUdlrELrOLrwcYZTNydZBnabQIIyP8TnCX6UwBxY=; b=cyU2JriEDLPq/vyZdW1NgG/dA/sxWeh9Nqqb73WVt46t04Z2TEYjP4GmJp9j11n22gb/Qx MZuIGJ6jx2UENTT9QEPLIGxI4daj41t4MKLf/e3Z/yFmFjciOb9NZhLEyFgIg8FWqcXgQr EjC75zw5djl9lVv3Yvca57nFobiL0G+iBEWNEmJw3ZgWMXonpb5R5ns/Iv66mwxhbXMx3D RsXZnEJzAmtw6YWU6twy6EsCiE5eyD4AWZ8x5pf9E7y0NdEF2hHHU6ElsY7dJRUN14CesS 869QxWJKH2eg175xwYlxCPlUJvvaDru7UQuNu4HL23g3ES0Bu/g5ezWqHd78oQ== 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 EA81D12F77; Sat, 28 May 2022 17:37:25 +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 24SHbP9b031121; Sat, 28 May 2022 17:37:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24SHbPbM031120; Sat, 28 May 2022 17:37:25 GMT (envelope-from git) Date: Sat, 28 May 2022 17:37:25 GMT Message-Id: <202205281737.24SHbPbM031120@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: 2646cd085850 - main - sctp: use a consistent view of the send parameters List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 2646cd085850f047eb17c7df53823b1d48deca82 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653759446; 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=urDkUdlrELrOLrwcYZTNydZBnabQIIyP8TnCX6UwBxY=; b=yHmhqSoyiCEVJxcqIwBzltCGuBzUQ+281rTiGieudqhHfsSIVqsmM0Vt6pmkhJT3TvVD81 sDmBa/3VbhpZN6zdxmt7KV8k2h1XmUCZ5auqXihvoScCP5D9dkEEznYw6PIOf1bAc7h7jt FH0gooQdmbAzJbuEdQTdnu0NWmD90yWNt+QddMTeBQ4W7MzFuPD67uAg7TkUWSsK2OXPDM JvWseiOdG7RXvOBv1MFD1UlJViLKTxqsok/xF0609vR9asHYJJYkUood9OEFr0vuEaTlCE aH+D+wFSvant0/nMnh6V14d+o1ICuXxnLtTLJPJPtoKIZoZGnDZLd47cd/s3IA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653759446; a=rsa-sha256; cv=none; b=xuM8lnrEf5/8cLU6VnphsOe6Y08lxa1+L8dX2sBh594HgcsS5ymJ2t+zOAk3DespwLPoyS dc6Dzw5BDbdZfFSHaCHoq+wfJ3pF1ZdZVN1wvbjUbuzLxJr78IUq3d3Y6hz6qKCCO/HowZ OJBUXlWFrU9o2DUS9nMexKcyjypdxU2NQ5WD2yfLJijSWbQ4YFW+/YWkgCKQekYIWSxKKH U3zUMvRZWW7WMl4sUAKiBqIH/7AjtS9cBB9TuEA9w9RQTWhUAPDcaKr5HyNZTBQQSk4TYh HRUiIDpcRQHQ4J+rzDO8RnHOHlegkfCqEtMpoztJH7BmswZyuwd7hIUbrd8Vzw== 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=2646cd085850f047eb17c7df53823b1d48deca82 commit 2646cd085850f047eb17c7df53823b1d48deca82 Author: Michael Tuexen AuthorDate: 2022-05-28 17:35:58 +0000 Commit: Michael Tuexen CommitDate: 2022-05-28 17:35:58 +0000 sctp: use a consistent view of the send parameters Reported by: syzbot+e26628a755f78bacff16@syzkaller.appspotmail.com MFC after: 3 days --- 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 c012618ca181..dfeed2dec563 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -12418,6 +12418,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; @@ -12723,7 +12724,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;