From owner-svn-src-stable-7@FreeBSD.ORG Mon Feb 18 22:03:06 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3A5B0827; Mon, 18 Feb 2013 22:03:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 219F59EB; Mon, 18 Feb 2013 22:03:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IM35Nm035307; Mon, 18 Feb 2013 22:03:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IM35a6035306; Mon, 18 Feb 2013 22:03:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302182203.r1IM35a6035306@svn.freebsd.org> From: Dimitry Andric Date: Mon, 18 Feb 2013 22:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246950 - in stable: 7/usr.bin/mail 8/usr.bin/mail 9/usr.bin/mail X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2013 22:03:06 -0000 Author: dim Date: Mon Feb 18 22:03:04 2013 New Revision: 246950 URL: http://svnweb.freebsd.org/changeset/base/246950 Log: MFC r246860: Fix undefined behaviour in usr.bin/mail/util.c. Reported by: deeptech71@gmail.com Modified: stable/7/usr.bin/mail/aux.c Directory Properties: stable/7/usr.bin/mail/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.bin/mail/util.c stable/9/usr.bin/mail/util.c Directory Properties: stable/8/usr.bin/mail/ (props changed) stable/9/usr.bin/mail/ (props changed) Modified: stable/7/usr.bin/mail/aux.c ============================================================================== --- stable/7/usr.bin/mail/aux.c Mon Feb 18 20:21:26 2013 (r246949) +++ stable/7/usr.bin/mail/aux.c Mon Feb 18 22:03:04 2013 (r246950) @@ -257,8 +257,8 @@ istrncpy(dest, src, dsize) { strlcpy(dest, src, dsize); - while (*dest) - *dest++ = tolower((unsigned char)*dest); + for (; *dest; dest++) + *dest = tolower((unsigned char)*dest); } /* From owner-svn-src-stable-7@FreeBSD.ORG Tue Feb 19 07:50:12 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5AEA6DC0; Tue, 19 Feb 2013 07:50:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 41CDF21A; Tue, 19 Feb 2013 07:50:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J7oCJo012579; Tue, 19 Feb 2013 07:50:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J7oCHL012578; Tue, 19 Feb 2013 07:50:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302190750.r1J7oCHL012578@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Feb 2013 07:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246980 - in stable: 7/contrib/opie 8/contrib/opie 9/contrib/opie X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 07:50:12 -0000 Author: dim Date: Tue Feb 19 07:50:10 2013 New Revision: 246980 URL: http://svnweb.freebsd.org/changeset/base/246980 Log: MFC r246873: In contrib/opie/opiekey.c, use the correct length to zero the secret. Found by: clang ToT Reviewed by: delphij Modified: stable/7/contrib/opie/opiekey.c Directory Properties: stable/7/contrib/opie/ (props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/opie/opiekey.c stable/9/contrib/opie/opiekey.c Directory Properties: stable/8/contrib/opie/ (props changed) stable/9/contrib/opie/ (props changed) Modified: stable/7/contrib/opie/opiekey.c ============================================================================== --- stable/7/contrib/opie/opiekey.c Tue Feb 19 06:42:12 2013 (r246979) +++ stable/7/contrib/opie/opiekey.c Tue Feb 19 07:50:10 2013 (r246980) @@ -109,19 +109,19 @@ static void getsecret FUNCTION((secret, if (!opiereadpass(verify, OPIE_SECRET_MAX, 0)) { fprintf(stderr, "Error reading %ssecret pass phrase!\n", promptextra); memset(verify, 0, sizeof(verify)); - memset(secret, 0, sizeof(secret)); + memset(secret, 0, OPIE_SECRET_MAX + 1); exit(1); } if (verify[0] && strcmp(verify, secret)) { fprintf(stderr, "They don't match. Try again.\n"); memset(verify, 0, sizeof(verify)); - memset(secret, 0, sizeof(secret)); + memset(secret, 0, OPIE_SECRET_MAX + 1); exit(1); } memset(verify, 0, sizeof(verify)); } if (!(flags & 2) && !aflag && opiepasscheck(secret)) { - memset(secret, 0, sizeof(secret)); + memset(secret, 0, OPIE_SECRET_MAX + 1); fprintf(stderr, "Secret pass phrases must be between %d and %d characters long.\n", OPIE_SECRET_MIN, OPIE_SECRET_MAX); exit(1); }; From owner-svn-src-stable-7@FreeBSD.ORG Tue Feb 19 07:55:55 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1F59A2D1; Tue, 19 Feb 2013 07:55:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 109EF253; Tue, 19 Feb 2013 07:55:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J7tsZv014960; Tue, 19 Feb 2013 07:55:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J7tsHd014958; Tue, 19 Feb 2013 07:55:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302190755.r1J7tsHd014958@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Feb 2013 07:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246981 - in stable: 7/contrib/nvi/ex 7/contrib/nvi/vi 8/contrib/nvi/ex 8/contrib/nvi/vi 9/contrib/nvi/ex 9/contrib/nvi/vi X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 07:55:55 -0000 Author: dim Date: Tue Feb 19 07:55:53 2013 New Revision: 246981 URL: http://svnweb.freebsd.org/changeset/base/246981 Log: MFC r246874: Fix two instances of undefined behaviour in contrib/nvi. Found by: clang ToT Obtained from: NetBSD Reviewed by: jh Modified: stable/7/contrib/nvi/ex/ex_txt.c stable/7/contrib/nvi/vi/v_txt.c Directory Properties: stable/7/contrib/nvi/ (props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/nvi/ex/ex_txt.c stable/8/contrib/nvi/vi/v_txt.c stable/9/contrib/nvi/ex/ex_txt.c stable/9/contrib/nvi/vi/v_txt.c Directory Properties: stable/8/contrib/nvi/ (props changed) stable/9/contrib/nvi/ (props changed) Modified: stable/7/contrib/nvi/ex/ex_txt.c ============================================================================== --- stable/7/contrib/nvi/ex/ex_txt.c Tue Feb 19 07:50:10 2013 (r246980) +++ stable/7/contrib/nvi/ex/ex_txt.c Tue Feb 19 07:55:53 2013 (r246981) @@ -398,8 +398,8 @@ txt_dent(sp, tp) ++scno; /* Get the previous shiftwidth column. */ - cno = scno; - scno -= --scno % sw; + cno = scno--; + scno -= scno % sw; /* * Since we don't know what comes before the character(s) being Modified: stable/7/contrib/nvi/vi/v_txt.c ============================================================================== --- stable/7/contrib/nvi/vi/v_txt.c Tue Feb 19 07:50:10 2013 (r246980) +++ stable/7/contrib/nvi/vi/v_txt.c Tue Feb 19 07:55:53 2013 (r246981) @@ -1956,8 +1956,10 @@ txt_dent(sp, tp, isindent) target = current; if (isindent) target += COL_OFF(target, sw); - else - target -= --target % sw; + else { + --target; + target -= target % sw; + } /* * The AI characters will be turned into overwrite characters if the From owner-svn-src-stable-7@FreeBSD.ORG Tue Feb 19 08:07:13 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 584D18A3; Tue, 19 Feb 2013 08:07:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4508A2D9; Tue, 19 Feb 2013 08:07:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J87DwO018556; Tue, 19 Feb 2013 08:07:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J87Du5018555; Tue, 19 Feb 2013 08:07:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302190807.r1J87Du5018555@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Feb 2013 08:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246982 - in stable: 7/contrib/wpa_supplicant 8/contrib/wpa/src/crypto 9/contrib/wpa/src/crypto X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 08:07:13 -0000 Author: dim Date: Tue Feb 19 08:07:11 2013 New Revision: 246982 URL: http://svnweb.freebsd.org/changeset/base/246982 Log: MFC r246875: Import change 40eebf235370b6fe6353784ccf01ab92eed062a5 from upstream wpa: From: Jouni Malinen Date: Fri, 15 Jul 2011 13:42:06 +0300 Subject: [PATCH] MD5: Fix clearing of temporary stack memory to use correct length sizeof of the structure instead of the pointer was supposed to be used here. Fix this to clear the full structure at the end of MD5Final(). Found by: clang ToT Reviewed by: rpaulo Modified: stable/7/contrib/wpa_supplicant/md5.c Directory Properties: stable/7/contrib/wpa_supplicant/ (props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/wpa/src/crypto/md5.c stable/9/contrib/wpa/src/crypto/md5-internal.c Directory Properties: stable/8/contrib/wpa/ (props changed) stable/9/contrib/wpa/ (props changed) Modified: stable/7/contrib/wpa_supplicant/md5.c ============================================================================== --- stable/7/contrib/wpa_supplicant/md5.c Tue Feb 19 07:55:53 2013 (r246981) +++ stable/7/contrib/wpa_supplicant/md5.c Tue Feb 19 08:07:11 2013 (r246982) @@ -287,7 +287,7 @@ void MD5Final(unsigned char digest[16], MD5Transform(ctx->buf, (u32 *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); os_memcpy(digest, ctx->buf, 16); - os_memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + os_memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Feb 19 16:40:39 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3EB2543C; Tue, 19 Feb 2013 16:40:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 187DC2CA; Tue, 19 Feb 2013 16:40:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JGec4D078261; Tue, 19 Feb 2013 16:40:38 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JGecKY078260; Tue, 19 Feb 2013 16:40:38 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201302191640.r1JGecKY078260@svn.freebsd.org> From: Mark Johnston Date: Tue, 19 Feb 2013 16:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246999 - stable/7/sys/netinet X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 16:40:39 -0000 Author: markj Date: Tue Feb 19 16:40:38 2013 New Revision: 246999 URL: http://svnweb.freebsd.org/changeset/base/246999 Log: MFC r239672 (by rrs): This small change takes care of a race condition that can occur when both sides close at the same time. If that occurs, without this fix the connection enters FIN1 on both sides and they will forever send FIN|ACK at each other until the connection times out. This is because we stopped processing the FIN|ACK and thus did not advance the sequence and so never ACK'd each others FIN. This fix adjusts it so we *do* process the FIN properly and the race goes away ;-) Approved by: rrs Approved by: emaste (co-mentor) Modified: stable/7/sys/netinet/tcp_input.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Tue Feb 19 16:40:16 2013 (r246998) +++ stable/7/sys/netinet/tcp_input.c Tue Feb 19 16:40:38 2013 (r246999) @@ -1803,6 +1803,16 @@ tcp_do_segment(struct mbuf *m, struct tc } } else tp->snd_cwnd += tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); goto drop; } else if (tp->t_dupacks == tcprexmtthresh) { @@ -1846,6 +1856,16 @@ tcp_do_segment(struct mbuf *m, struct tc } tp->snd_nxt = th->th_ack; tp->snd_cwnd = tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); KASSERT(tp->snd_limited <= 2, ("%s: tp->snd_limited too big", @@ -1871,6 +1891,16 @@ tcp_do_segment(struct mbuf *m, struct tc (tp->snd_nxt - tp->snd_una) + (tp->t_dupacks - tp->snd_limited) * tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { From owner-svn-src-stable-7@FreeBSD.ORG Thu Feb 21 22:48:26 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 76EAC301; Thu, 21 Feb 2013 22:48:26 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 68AE425B; Thu, 21 Feb 2013 22:48:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LMmPqD003704; Thu, 21 Feb 2013 22:48:25 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LMmPnM003703; Thu, 21 Feb 2013 22:48:25 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201302212248.r1LMmPnM003703@svn.freebsd.org> From: Gregory Neil Shapiro Date: Thu, 21 Feb 2013 22:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r247143 - stable/7/contrib/sendmail/src X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 22:48:26 -0000 Author: gshapiro Date: Thu Feb 21 22:48:25 2013 New Revision: 247143 URL: http://svnweb.freebsd.org/changeset/base/247143 Log: MFC: Merge sendmail 8.14.6 errata issue Modified: stable/7/contrib/sendmail/src/milter.c Directory Properties: stable/7/contrib/sendmail/ (props changed) Modified: stable/7/contrib/sendmail/src/milter.c ============================================================================== --- stable/7/contrib/sendmail/src/milter.c Thu Feb 21 22:46:26 2013 (r247142) +++ stable/7/contrib/sendmail/src/milter.c Thu Feb 21 22:48:25 2013 (r247143) @@ -4048,7 +4048,7 @@ milter_helo(helo, e, state) } response = milter_command(SMFIC_HELO, helo, strlen(helo) + 1, - SMFIM_EOH, e, state, "helo", false); + SMFIM_HELO, e, state, "helo", false); milter_per_connection_check(e); return response; }