Author: tuexen
Date: Sat Mar 23 22:46:29 2019
New Revision: 345460
URL: https://svnweb.freebsd.org/changeset/base/345460

Log:
  Limit the number of bytes which can be queued for SCTP sockets.
  This is joint work with rrs@.
  Reported by:          syzbot+307f167f9bc214f09...@syzkaller.appspotmail.com
  MFC after:            1 week

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c      Sat Mar 23 22:44:11 2019        
(r345459)
+++ head/sys/netinet/sctp_output.c      Sat Mar 23 22:46:29 2019        
(r345460)
@@ -13026,12 +13026,7 @@ sctp_lower_sosend(struct socket *so,
        /* Calculate the maximum we can send */
        inqueue_bytes = stcb->asoc.total_output_queue_size - 
(stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb));
        if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) {
-               if (non_blocking) {
-                       /* we already checked for non-blocking above. */
-                       max_len = sndlen;
-               } else {
-                       max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes;
-               }
+               max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes;
        } else {
                max_len = 0;
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to