From owner-svn-src-all@freebsd.org Mon Jul 15 22:55:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 454EAC603D for ; Mon, 15 Jul 2019 22:55:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc2a.google.com (mail-yw1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60C568435D for ; Mon, 15 Jul 2019 22:55:42 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc2a.google.com with SMTP id n205so7926196ywb.10 for ; Mon, 15 Jul 2019 15:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OPkJ5w6XSfl7Uhs+PsGKvgY0dSujsgGmEucTQaNIaRs=; b=E3jXZte6aJe2qygnWhf4zJldeoCewb2dwzrtqw8ex84B8lq5ZjPJeY7f1p2qBgOR2Y uBAU46k1zPZNS95JKL6huvwxDPOcY2pHi1gyvA5dI3IThoWih+nLT2AWuNubwWl/2JG5 S4aFx7qRr2DZECApmwwKhevpqFpznUWD+h2ASbK2rRY32I5Jh/VZ3NdkXf7mcKvU6uOm JjW7zg6f0nY82dfdXNcMjOj25xIpc5kJodnjWpfkWX+Wd3u9KJt5fKe5cboBVurT7V8P ZyvYrrOn5pOY1x7FsC9iVuBOpv+SKlHOirDepkP6Up5PdTpViuJuvJJcN8xHyXhnEtU3 oBhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OPkJ5w6XSfl7Uhs+PsGKvgY0dSujsgGmEucTQaNIaRs=; b=Xmr6wwTPnp/+FHabRE7DR6fMZ6YIBYrSoBCCC3Qye6N9J9hILpogq5HyA8SS7yx555 d85fuk/jxyESKoSgNX8M/WMbjoniAdEG+KHfERJHOl7iK+LsULkjlWFx7rlejJyB8lLY fCwNsLAQO2EZ3ikhHaJbYjweFlC5m+xAlbd6+nOBPJiZteADjEaaxuNAdm5ha3WeUwON rIk2jNq9yavsyLFd3zAxGGsALu4j0PbBxH0vYeO18FSdZwHRhlO7EirTBZVvbXB3ePzW QxTO+/ERYG7dLTRSCmXTuK4IOKgumXjxPm2Pxvf8+wthEHusE1UOeTiDKTZ6QOhKu5rz CG8g== X-Gm-Message-State: APjAAAWxh3QhpOJ/DKKHBxKWCa94UWv/lAtFySO9a7zhUOGyhfqrTiSV AKyIDKhNBvWatRIfsTYBPBa0Sr+tq535USjFuoUzZw== X-Google-Smtp-Source: APXvYqwKp/ZFx4ElYQfTEgAjFduLEhjpYwai9fMn/yxCFVnTRNPPk/ovJ5K2speZiYo3ASDIi8JFhRUx+ext/v2WoLM= X-Received: by 2002:a81:ad12:: with SMTP id l18mr15102886ywh.377.1563231341563; Mon, 15 Jul 2019 15:55:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5b:586:0:0:0:0:0 with HTTP; Mon, 15 Jul 2019 15:55:40 -0700 (PDT) In-Reply-To: <201907151454.x6FEs4g7020630@repo.freebsd.org> References: <201907151454.x6FEs4g7020630@repo.freebsd.org> From: Oliver Pinter Date: Tue, 16 Jul 2019 00:55:40 +0200 Message-ID: Subject: Re: svn commit: r349999 - head/sys/netinet To: Michael Tuexen Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 60C568435D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=E3jXZte6; spf=pass (mx1.freebsd.org: domain of oliver.pinter@hardenedbsd.org designates 2607:f8b0:4864:20::c2a as permitted sender) smtp.mailfrom=oliver.pinter@hardenedbsd.org X-Spamd-Result: default: False [-6.00 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[a.2.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.79)[-0.793,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-2.80)[ip: (-8.33), ipnet: 2607:f8b0::/32(-3.17), asn: 15169(-2.45), country: US(-0.06)] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 22:55:43 -0000 On Monday, July 15, 2019, Michael Tuexen wrote: > Author: tuexen > Date: Mon Jul 15 14:54:04 2019 > New Revision: 349999 > URL: https://svnweb.freebsd.org/changeset/base/349999 > > Log: > Add support for MSG_EOR and MSG_EOF in sendmsg() for SCTP. > > This is an FreeBSD extension, not covered by Posix. > > This issue was found by running syzkaller. Aren't there syzkaller ids for these findings? > > MFC after: 1 week > > Modified: > head/sys/netinet/sctp_output.c > > Modified: head/sys/netinet/sctp_output.c > ============================================================ > ================== > --- head/sys/netinet/sctp_output.c Mon Jul 15 14:52:52 2019 > (r349998) > +++ head/sys/netinet/sctp_output.c Mon Jul 15 14:54:04 2019 > (r349999) > @@ -12652,6 +12652,12 @@ sctp_lower_sosend(struct socket *so, > sinfo_flags = inp->def_send.sinfo_flags; > sinfo_assoc_id = inp->def_send.sinfo_assoc_id; > } > + if (flags & MSG_EOR) { > + sinfo_flags |= SCTP_EOR; > + } > + if (flags & MSG_EOF) { > + sinfo_flags |= SCTP_EOF; > + } > if (sinfo_flags & SCTP_SENDALL) { > /* its a sendall */ > error = sctp_sendall(inp, uio, top, srcv); > @@ -12819,9 +12825,17 @@ sctp_lower_sosend(struct socket *so, > } > } else > asoc = &stcb->asoc; > - if (srcv == NULL) > + if (srcv == NULL) { > srcv = (struct sctp_sndrcvinfo *)&asoc->def_send; > - if (srcv->sinfo_flags & SCTP_ADDR_OVER) { > + sinfo_flags = srcv->sinfo_flags; > + if (flags & MSG_EOR) { > + sinfo_flags |= SCTP_EOR; > + } > + if (flags & MSG_EOF) { > + sinfo_flags |= SCTP_EOF; > + } > + } > + if (sinfo_flags & SCTP_ADDR_OVER) { > if (addr) > net = sctp_findnet(stcb, addr); > else > @@ -12928,7 +12942,7 @@ sctp_lower_sosend(struct socket *so, > (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || > (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || > (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { > - if (srcv->sinfo_flags & SCTP_ABORT) { > + if (sinfo_flags & SCTP_ABORT) { > ; > } else { > SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, > SCTP_FROM_SCTP_OUTPUT, ECONNRESET); > @@ -12941,7 +12955,7 @@ sctp_lower_sosend(struct socket *so, > p->td_ru.ru_msgsnd++; > } > /* Are we aborting? */ > - if (srcv->sinfo_flags & SCTP_ABORT) { > + if (sinfo_flags & SCTP_ABORT) { > struct mbuf *mm; > ssize_t tot_demand, tot_out = 0, max_out; > > @@ -13145,7 +13159,7 @@ skip_preblock: > * case NOTE: uio will be null when top/mbuf is passed > */ > if (sndlen == 0) { > - if (srcv->sinfo_flags & SCTP_EOF) { > + if (sinfo_flags & SCTP_EOF) { > got_all_of_the_send = 1; > goto dataless_eof; > } else { > @@ -13194,7 +13208,7 @@ skip_preblock: > } > sctp_snd_sb_alloc(stcb, sp->length); > atomic_add_int(&asoc->stream_queue_cnt, 1); > - if (srcv->sinfo_flags & SCTP_UNORDERED) { > + if (sinfo_flags & SCTP_UNORDERED) { > SCTP_STAT_INCR(sctps_sends_with_unord); > } > TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); > @@ -13269,15 +13283,15 @@ skip_preblock: > sctp_snd_sb_alloc(stcb, sndout); > atomic_add_int(&sp->length, sndout); > len += sndout; > - if (srcv->sinfo_flags & > SCTP_SACK_IMMEDIATELY) { > + if (sinfo_flags & SCTP_SACK_IMMEDIATELY) { > sp->sinfo_flags |= > SCTP_SACK_IMMEDIATELY; > } > > /* Did we reach EOR? */ > if ((uio->uio_resid == 0) && > ((user_marks_eor == 0) || > - (srcv->sinfo_flags & SCTP_EOF) || > - (user_marks_eor && (srcv->sinfo_flags > & SCTP_EOR)))) { > + (sinfo_flags & SCTP_EOF) || > + (user_marks_eor && (sinfo_flags & > SCTP_EOR)))) { > sp->msg_is_complete = 1; > } else { > sp->msg_is_complete = 0; > @@ -13479,7 +13493,7 @@ skip_preblock: > /* We send in a 0, since we do NOT have any locks */ > error = sctp_msg_append(stcb, net, top, srcv, 0); > top = NULL; > - if (srcv->sinfo_flags & SCTP_EOF) { > + if (sinfo_flags & SCTP_EOF) { > /* > * This should only happen for Panda for the mbuf > * send case, which does NOT yet support EEOR mode. > @@ -13494,7 +13508,7 @@ skip_preblock: > } > dataless_eof: > /* EOF thing ? */ > - if ((srcv->sinfo_flags & SCTP_EOF) && > + if ((sinfo_flags & SCTP_EOF) && > (got_all_of_the_send == 1)) { > SCTP_STAT_INCR(sctps_sends_with_eof); > error = 0; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >