naota       14/05/08 05:24:55

  Added:                freebsd-sources-9.1-tcp.patch
  Log:
  Add a patch for CVE-2014-3000. #509170
  
  (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 
F8551514)

Revision  Changes    Path
1.1                  
sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-tcp.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-tcp.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-tcp.patch?rev=1.1&content-type=text/plain

Index: freebsd-sources-9.1-tcp.patch
===================================================================
Index: sys/netinet/tcp_reass.c
===================================================================
--- sys/netinet/tcp_reass.c     (revision 264836)
+++ sys/netinet/tcp_reass.c     (working copy)
@@ -211,7 +211,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int
         * Investigate why and re-evaluate the below limit after the behaviour
         * is understood.
         */
-       if (th->th_seq != tp->rcv_nxt &&
+       if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) &&
            tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) {
                V_tcp_reass_overflows++;
                TCPSTAT_INC(tcps_rcvmemdrop);
@@ -234,7 +234,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int
         */
        te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT);
        if (te == NULL) {
-               if (th->th_seq != tp->rcv_nxt) {
+               if (th->th_seq != tp->rcv_nxt || 
!TCPS_HAVEESTABLISHED(tp->t_state)) {
                        TCPSTAT_INC(tcps_rcvmemdrop);
                        m_freem(m);
                        *tlenp = 0;
@@ -282,7 +282,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int
                                TCPSTAT_INC(tcps_rcvduppack);
                                TCPSTAT_ADD(tcps_rcvdupbyte, *tlenp);
                                m_freem(m);
-                               uma_zfree(V_tcp_reass_zone, te);
+                               if (te != &tqs)
+                                       uma_zfree(V_tcp_reass_zone, te);
                                tp->t_segqlen--;
                                /*
                                 * Try to present any queued data




Reply via email to