Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2023 23:01:03 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 821f1352112e - stable/13 - sctp: use a consistent view of the send parameters
Message-ID:  <202302012301.311N13B5028834@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=821f1352112e0af022ffb7cefc1c5fb81b1574be

commit 821f1352112e0af022ffb7cefc1c5fb81b1574be
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2022-05-28 17:35:58 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302012301.311N13B5028834>