From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 02:28:04 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7864355F; Sun, 14 Sep 2014 02:28:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63F827E5; Sun, 14 Sep 2014 02:28:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E2S4j8002890; Sun, 14 Sep 2014 02:28:04 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E2S4Ot002889; Sun, 14 Sep 2014 02:28:04 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201409140228.s8E2S4Ot002889@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sun, 14 Sep 2014 02:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271564 - user/jmmv/autotest/node X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 02:28:04 -0000 Author: jmmv Date: Sun Sep 14 02:28:03 2014 New Revision: 271564 URL: http://svnweb.freebsd.org/changeset/base/271564 Log: Cope with kyua-0.10 Explicitly tell "kyua test" where to store the results database and copy the generated file out of the VM. Modified: user/jmmv/autotest/node/iterate.sh Modified: user/jmmv/autotest/node/iterate.sh ============================================================================== --- user/jmmv/autotest/node/iterate.sh Sun Sep 14 01:57:22 2014 (r271563) +++ user/jmmv/autotest/node/iterate.sh Sun Sep 14 02:28:03 2014 (r271564) @@ -227,7 +227,7 @@ EOF setenv PATH "/usr/local/bin:/usr/local/sbin:\${PATH}" cd /usr/tests -kyua test +kyua test --results-file=\${HOME}/results.db shutdown -p now EOF @@ -292,13 +292,13 @@ autotest_publish() { local mddev="$(mdconfig -a -t vnode -f "${image}")" mount -o ro "/dev/${mddev}p3" "${chrootdir}/vmimage/mnt" mkdir -p "${datadir}" - cp "${chrootdir}/vmimage/mnt/root/.kyua/store.db" "${datadir}/store.db" + cp "${chrootdir}/vmimage/mnt/root/results.db" "${datadir}/results.db" umount "${chrootdir}/vmimage/mnt" mdconfig -d -u "${mddev}" shtk_process_run /usr/local/bin/kyua report-html \ --output="${datadir}/results" \ - --store="${datadir}/store.db" \ + --results-file="${datadir}/results.db" \ --results-filter= } From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 02:29:23 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD46064E; Sun, 14 Sep 2014 02:29:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDA1D7EE; Sun, 14 Sep 2014 02:29:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E2TMuE003098; Sun, 14 Sep 2014 02:29:22 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E2TLDw003086; Sun, 14 Sep 2014 02:29:21 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201409140229.s8E2TLDw003086@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sun, 14 Sep 2014 02:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271565 - in user/jmmv/autotest/node/configs: kyua1 kyua2 kyua3 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 02:29:23 -0000 Author: jmmv Date: Sun Sep 14 02:29:21 2014 New Revision: 271565 URL: http://svnweb.freebsd.org/changeset/base/271565 Log: Increase the test suite timeout to 3 hours. The current 1 hour limit became too short and was being overrun. Modified: user/jmmv/autotest/node/configs/kyua1/head.conf user/jmmv/autotest/node/configs/kyua2/head.conf user/jmmv/autotest/node/configs/kyua2/stable-10.conf user/jmmv/autotest/node/configs/kyua3/head.conf user/jmmv/autotest/node/configs/kyua3/stable-10.conf Modified: user/jmmv/autotest/node/configs/kyua1/head.conf ============================================================================== --- user/jmmv/autotest/node/configs/kyua1/head.conf Sun Sep 14 02:28:03 2014 (r271564) +++ user/jmmv/autotest/node/configs/kyua1/head.conf Sun Sep 14 02:29:21 2014 (r271565) @@ -13,7 +13,7 @@ MKVARS="NO_CLEAN=yes WITH_TESTS=yes" TARGET=amd64 TARGET_ARCH=amd64 -TESTS_TIMEOUT=3600 +TESTS_TIMEOUT=$((3600 * 3)) PACKAGES= # Required by sys/netinet/fibs_test:arpresolve_checks_interface_fib. Modified: user/jmmv/autotest/node/configs/kyua2/head.conf ============================================================================== --- user/jmmv/autotest/node/configs/kyua2/head.conf Sun Sep 14 02:28:03 2014 (r271564) +++ user/jmmv/autotest/node/configs/kyua2/head.conf Sun Sep 14 02:29:21 2014 (r271565) @@ -13,7 +13,7 @@ MKVARS="WITH_TESTS=yes" TARGET=i386 TARGET_ARCH=i386 -TESTS_TIMEOUT=3600 +TESTS_TIMEOUT=$((3600 * 3)) PACKAGES= # Required by sys/netinet/fibs_test:arpresolve_checks_interface_fib. Modified: user/jmmv/autotest/node/configs/kyua2/stable-10.conf ============================================================================== --- user/jmmv/autotest/node/configs/kyua2/stable-10.conf Sun Sep 14 02:28:03 2014 (r271564) +++ user/jmmv/autotest/node/configs/kyua2/stable-10.conf Sun Sep 14 02:29:21 2014 (r271565) @@ -13,7 +13,7 @@ MKVARS="WITH_TESTS=yes" TARGET=i386 TARGET_ARCH=i386 -TESTS_TIMEOUT=3600 +TESTS_TIMEOUT=$((3600 * 3)) PACKAGES= # Required by sys/netinet/fibs_test:arpresolve_checks_interface_fib. Modified: user/jmmv/autotest/node/configs/kyua3/head.conf ============================================================================== --- user/jmmv/autotest/node/configs/kyua3/head.conf Sun Sep 14 02:28:03 2014 (r271564) +++ user/jmmv/autotest/node/configs/kyua3/head.conf Sun Sep 14 02:29:21 2014 (r271565) @@ -13,7 +13,7 @@ MKVARS="WITH_TESTS=yes" TARGET=amd64 TARGET_ARCH=amd64 -TESTS_TIMEOUT=3600 +TESTS_TIMEOUT=$((3600 * 3)) PACKAGES= # Required by sys/netinet/fibs_test:arpresolve_checks_interface_fib. Modified: user/jmmv/autotest/node/configs/kyua3/stable-10.conf ============================================================================== --- user/jmmv/autotest/node/configs/kyua3/stable-10.conf Sun Sep 14 02:28:03 2014 (r271564) +++ user/jmmv/autotest/node/configs/kyua3/stable-10.conf Sun Sep 14 02:29:21 2014 (r271565) @@ -13,7 +13,7 @@ MKVARS="WITH_TESTS=yes" TARGET=amd64 TARGET_ARCH=amd64 -TESTS_TIMEOUT=3600 +TESTS_TIMEOUT=$((3600 * 3)) PACKAGES= # Required by sys/netinet/fibs_test:arpresolve_checks_interface_fib. From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 02:31:16 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD3BC75F; Sun, 14 Sep 2014 02:31:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8B0B885; Sun, 14 Sep 2014 02:31:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E2VGGY004484; Sun, 14 Sep 2014 02:31:16 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E2VGnj004482; Sun, 14 Sep 2014 02:31:16 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201409140231.s8E2VGnj004482@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sun, 14 Sep 2014 02:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271566 - in user/jmmv/autotest/node/configs: kyua2 kyua3 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 02:31:16 -0000 Author: jmmv Date: Sun Sep 14 02:31:15 2014 New Revision: 271566 URL: http://svnweb.freebsd.org/changeset/base/271566 Log: Push r271565 to kyua2 and kyua3. Tested (pre-commit) on kyua1 and confirmed working. Modified: user/jmmv/autotest/node/configs/kyua2/host.conf user/jmmv/autotest/node/configs/kyua3/host.conf Modified: user/jmmv/autotest/node/configs/kyua2/host.conf ============================================================================== --- user/jmmv/autotest/node/configs/kyua2/host.conf Sun Sep 14 02:29:21 2014 (r271565) +++ user/jmmv/autotest/node/configs/kyua2/host.conf Sun Sep 14 02:31:15 2014 (r271566) @@ -6,7 +6,7 @@ # AUTOTEST_SVNROOT="svn://svn.freebsd.org/base/user/jmmv" -AUTOTEST_REVISION="r264005" +AUTOTEST_REVISION="r271565" SHTK_REMOTE="https://github.com/jmmv/shtk/" SHTK_REVISION="shtk-1.5" Modified: user/jmmv/autotest/node/configs/kyua3/host.conf ============================================================================== --- user/jmmv/autotest/node/configs/kyua3/host.conf Sun Sep 14 02:29:21 2014 (r271565) +++ user/jmmv/autotest/node/configs/kyua3/host.conf Sun Sep 14 02:31:15 2014 (r271566) @@ -6,7 +6,7 @@ # AUTOTEST_SVNROOT="svn://svn.freebsd.org/base/user/jmmv" -AUTOTEST_REVISION="r264005" +AUTOTEST_REVISION="r271565" SHTK_REMOTE="https://github.com/jmmv/shtk/" SHTK_REVISION="shtk-1.5" From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 09:04:03 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F23966DE; Sun, 14 Sep 2014 09:04:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C47D0AA0; Sun, 14 Sep 2014 09:04:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E942EN086528; Sun, 14 Sep 2014 09:04:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E942L6086525; Sun, 14 Sep 2014 09:04:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409140904.s8E942L6086525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 14 Sep 2014 09:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271572 - in user/ngie/add-pjdfstest/contrib/pjdfstest: . tests X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 09:04:03 -0000 Author: ngie Date: Sun Sep 14 09:04:02 2014 New Revision: 271572 URL: http://svnweb.freebsd.org/changeset/base/271572 Log: Revert r271376; we will provide a canned conf file instead which will be in tests/sys/pjdfstest Added: user/ngie/add-pjdfstest/contrib/pjdfstest/tests/conf - copied unchanged from r271375, user/ngie/add-pjdfstest/contrib/pjdfstest/tests/conf Deleted: user/ngie/add-pjdfstest/contrib/pjdfstest/FREEBSD-Xlist Modified: user/ngie/add-pjdfstest/contrib/pjdfstest/FREEBSD-upgrade Modified: user/ngie/add-pjdfstest/contrib/pjdfstest/FREEBSD-upgrade ============================================================================== --- user/ngie/add-pjdfstest/contrib/pjdfstest/FREEBSD-upgrade Sun Sep 14 08:35:44 2014 (r271571) +++ user/ngie/add-pjdfstest/contrib/pjdfstest/FREEBSD-upgrade Sun Sep 14 09:04:02 2014 (r271572) @@ -18,7 +18,6 @@ To merge the vendor branch into head do cd .../base/head/contrib/pjdfstest svn merge --accept=postpone \ svn+ssh://svn.freebsd.org/base/vendor/pjdfstest/dist . - svn remove --force $(cat FREEBSD-Xlist) and resolve any conflicts that may arise at this point. Copied: user/ngie/add-pjdfstest/contrib/pjdfstest/tests/conf (from r271375, user/ngie/add-pjdfstest/contrib/pjdfstest/tests/conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ngie/add-pjdfstest/contrib/pjdfstest/tests/conf Sun Sep 14 09:04:02 2014 (r271572, copy of r271375, user/ngie/add-pjdfstest/contrib/pjdfstest/tests/conf) @@ -0,0 +1,36 @@ +# $FreeBSD: head/tools/regression/pjdfstest/tests/conf 211354 2010-08-15 21:29:03Z pjd $ +# pjdfstest configuration file + +# Supported operating systems: FreeBSD, Darwin, SunOS, Linux +os=`uname` + +case "${os}" in +FreeBSD|Darwin) + GREP=grep + #fs=`df -T . | tail -1 | awk '{print $2}'` + pattern="`df . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`" + fs=`mount | ${GREP} -E "^${pattern}" | awk -F '[(,]' '{print toupper($2)}'` + ;; +Solaris|SunOS) + GREP=ggrep + pattern=`df -Pk . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'` + fs=`mount -v | ${GREP} -E "^${pattern}" | awk '{print $5}' | \ + tr -s '[:lower:]' '[:upper:]'` + ;; +Linux) + GREP=grep + fs=`df -PT . | tail -1 | awk '{print toupper($2)}'` + ;; +*) + echo "Unsupported operating system ${os}." >/dev/stderr + exit 1 + ;; +esac + +# If we cannot figure out file system type, define it here. +#fs="UFS" + +if [ -z "${fs}" ]; then + echo "Cannot figure out file system type, define it by hand." >/dev/stderr + exit 1 +fi From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 09:06:35 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E86127DE; Sun, 14 Sep 2014 09:06:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D407FAB2; Sun, 14 Sep 2014 09:06:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E96ZAa086918; Sun, 14 Sep 2014 09:06:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E96Zdp086917; Sun, 14 Sep 2014 09:06:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409140906.s8E96Zdp086917@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 14 Sep 2014 09:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271573 - user/ngie/add-pjdfstest/contrib/pjdfstest X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 09:06:36 -0000 Author: ngie Date: Sun Sep 14 09:06:35 2014 New Revision: 271573 URL: http://svnweb.freebsd.org/changeset/base/271573 Log: Revert r271374; the compiler now seems to be warning about the opposite behavior... strange Modified: user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c Modified: user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c ============================================================================== --- user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c Sun Sep 14 09:04:02 2014 (r271572) +++ user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c Sun Sep 14 09:06:35 2014 (r271573) @@ -1007,7 +1007,7 @@ set_gids(char *gids) assert(gidset != NULL); for (i = 0, g = strtok(gids, ","); g != NULL; g = strtok(NULL, ","), i++) { - if (i >= (int)ngroups) { + if (i >= ngroups) { fprintf(stderr, "too many gids\n"); exit(1); } From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 09:09:49 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2D968D7; Sun, 14 Sep 2014 09:09:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EBFBAC2; Sun, 14 Sep 2014 09:09:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E99nO3087446; Sun, 14 Sep 2014 09:09:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E99ncV087445; Sun, 14 Sep 2014 09:09:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409140909.s8E99ncV087445@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 14 Sep 2014 09:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271574 - user/ngie/add-pjdfstest/contrib/pjdfstest X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 09:09:49 -0000 Author: ngie Date: Sun Sep 14 09:09:49 2014 New Revision: 271574 URL: http://svnweb.freebsd.org/changeset/base/271574 Log: Redo r271374 by using the right typecast for comparing i and ngroups Modified: user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c Modified: user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c ============================================================================== --- user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c Sun Sep 14 09:06:35 2014 (r271573) +++ user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c Sun Sep 14 09:09:49 2014 (r271574) @@ -1007,7 +1007,7 @@ set_gids(char *gids) assert(gidset != NULL); for (i = 0, g = strtok(gids, ","); g != NULL; g = strtok(NULL, ","), i++) { - if (i >= ngroups) { + if (i >= (unsigned)ngroups) { fprintf(stderr, "too many gids\n"); exit(1); } From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 09:46:28 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFCDDA5E; Sun, 14 Sep 2014 09:46:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB6D3E2C; Sun, 14 Sep 2014 09:46:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E9kS7N006170; Sun, 14 Sep 2014 09:46:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E9kSLX006169; Sun, 14 Sep 2014 09:46:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409140946.s8E9kSLX006169@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 14 Sep 2014 09:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271580 - user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 09:46:29 -0000 Author: ngie Date: Sun Sep 14 09:46:28 2014 New Revision: 271580 URL: http://svnweb.freebsd.org/changeset/base/271580 Log: Use FILES instead of SCRIPTS, and install a symlink to "tests" to mock the structure that the code expects to exist Modified: user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/Makefile Modified: user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/Makefile ============================================================================== --- user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/Makefile Sun Sep 14 09:30:09 2014 (r271579) +++ user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/Makefile Sun Sep 14 09:46:28 2014 (r271580) @@ -1,11 +1,16 @@ -.PATH: ${.CURDIR:H:H:H:H}/contrib/pjdfstest/tests +PJDFSTEST_SRCDIR= ${.CURDIR:H:H:H:H}/contrib/pjdfstest TESTSDIR= ${TESTSBASE}/sys/pjdfstest -SCRIPTSDIR= ${TESTSDIR} -SCRIPTS= conf -SCRIPTS+= misc.sh -SCRIPTSNAME_misc.sh= misc.sh +.PATH: ${.CURDIR} ${PJDFSTEST_SRCDIR}/tests + +FILESDIR= ${TESTSDIR} +FILES= conf +FILES+= misc.sh + +afterinstall: install-tests-symlink +install-tests-symlink: .PHONY + ${INSTALL_SYMLINK} . ${DESTDIR}${TESTSDIR}/tests KYUAFILE= no From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 09:56:29 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6AF7BFA; Sun, 14 Sep 2014 09:56:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2242EDB; Sun, 14 Sep 2014 09:56:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E9uT45010750; Sun, 14 Sep 2014 09:56:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E9uTlY010749; Sun, 14 Sep 2014 09:56:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409140956.s8E9uTlY010749@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 14 Sep 2014 09:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271581 - user/ngie/add-pjdfstest/contrib/pjdfstest/tests/ftruncate X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 09:56:30 -0000 Author: ngie Date: Sun Sep 14 09:56:29 2014 New Revision: 271581 URL: http://svnweb.freebsd.org/changeset/base/271581 Log: Fix the number of tests in the testplan Submitted by: Casey Peel Sponsored by: EMC / Isilon Storage Division Modified: user/ngie/add-pjdfstest/contrib/pjdfstest/tests/ftruncate/00.t Modified: user/ngie/add-pjdfstest/contrib/pjdfstest/tests/ftruncate/00.t ============================================================================== --- user/ngie/add-pjdfstest/contrib/pjdfstest/tests/ftruncate/00.t Sun Sep 14 09:46:28 2014 (r271580) +++ user/ngie/add-pjdfstest/contrib/pjdfstest/tests/ftruncate/00.t Sun Sep 14 09:56:29 2014 (r271581) @@ -6,7 +6,7 @@ desc="ftruncate descrease/increase file dir=`dirname $0` . ${dir}/../misc.sh -echo "1..21" +echo "1..26" n0=`namegen` n1=`namegen` From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 10:06:10 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08560F6B; Sun, 14 Sep 2014 10:06:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E829192; Sun, 14 Sep 2014 10:06:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EA69cN015566; Sun, 14 Sep 2014 10:06:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EA69HL015565; Sun, 14 Sep 2014 10:06:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409141006.s8EA69HL015565@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 14 Sep 2014 10:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271583 - user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 10:06:10 -0000 Author: ngie Date: Sun Sep 14 10:06:09 2014 New Revision: 271583 URL: http://svnweb.freebsd.org/changeset/base/271583 Log: Add ${os} to complete the canned conf file Modified: user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/conf Modified: user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/conf ============================================================================== --- user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/conf Sun Sep 14 09:57:57 2014 (r271582) +++ user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/conf Sun Sep 14 10:06:09 2014 (r271583) @@ -3,3 +3,4 @@ GREP=grep mountpoint=$(df . | tail -1 | awk '{print $6}') fs=$(mount -p | awk '$2 == "'$mountpoint'" { print toupper($3) }') +os=FreeBSD From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 10:06:58 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2BE010F; Sun, 14 Sep 2014 10:06:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEB8BB8; Sun, 14 Sep 2014 10:06:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EA6v0J015691; Sun, 14 Sep 2014 10:06:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EA6vXi015689; Sun, 14 Sep 2014 10:06:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409141006.s8EA6vXi015689@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 14 Sep 2014 10:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271584 - in user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests: ftruncate unlink X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 10:06:58 -0000 Author: ngie Date: Sun Sep 14 10:06:57 2014 New Revision: 271584 URL: http://svnweb.freebsd.org/changeset/base/271584 Log: Fix install path Modified: user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/ftruncate/Makefile user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/unlink/Makefile Modified: user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/ftruncate/Makefile ============================================================================== --- user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/ftruncate/Makefile Sun Sep 14 10:06:09 2014 (r271583) +++ user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/ftruncate/Makefile Sun Sep 14 10:06:57 2014 (r271584) @@ -1,4 +1,4 @@ -TESTSDIR= ${TESTSBASE}/sys/pjdfstest/chown +TESTSDIR= ${TESTSBASE}/sys/pjdfstest/ftruncate SCRIPTSDIR= ${TESTSDIR} Modified: user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/unlink/Makefile ============================================================================== --- user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/unlink/Makefile Sun Sep 14 10:06:09 2014 (r271583) +++ user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/unlink/Makefile Sun Sep 14 10:06:57 2014 (r271584) @@ -1,4 +1,4 @@ -TESTSDIR= ${TESTSBASE}/sys/pjdfstest/chflags +TESTSDIR= ${TESTSBASE}/sys/pjdfstest/unlink SCRIPTSDIR= ${TESTSDIR} From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 10:07:12 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE765210; Sun, 14 Sep 2014 10:07:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAB9ED0; Sun, 14 Sep 2014 10:07:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EA7CjL015792; Sun, 14 Sep 2014 10:07:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EA7C4p015791; Sun, 14 Sep 2014 10:07:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409141007.s8EA7C4p015791@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 14 Sep 2014 10:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271585 - user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/chflags X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 10:07:13 -0000 Author: ngie Date: Sun Sep 14 10:07:12 2014 New Revision: 271585 URL: http://svnweb.freebsd.org/changeset/base/271585 Log: Remove empty .PATH directive Modified: user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/chflags/Makefile Modified: user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/chflags/Makefile ============================================================================== --- user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/chflags/Makefile Sun Sep 14 10:06:57 2014 (r271584) +++ user/ngie/add-pjdfstest/tests/sys/pjdfstest/tests/chflags/Makefile Sun Sep 14 10:07:12 2014 (r271585) @@ -1,5 +1,3 @@ -.PATH: - TESTSDIR= ${TESTSBASE}/sys/pjdfstest/chflags SCRIPTSDIR= ${TESTSDIR} From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 11:21:27 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18869679; Sun, 14 Sep 2014 11:21:27 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id CEF74AE5; Sun, 14 Sep 2014 11:21:26 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 82A171045E36; Sun, 14 Sep 2014 21:21:16 +1000 (EST) Date: Sun, 14 Sep 2014 21:21:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper Subject: Re: svn commit: r271574 - user/ngie/add-pjdfstest/contrib/pjdfstest In-Reply-To: <201409140909.s8E99ncV087445@svn.freebsd.org> Message-ID: <20140914200428.P1559@besplex.bde.org> References: <201409140909.s8E99ncV087445@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=LRTG6vsd6QsA:10 a=5LnWPWDnWWAA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=gmWSS0ejdzLk3m-1I9IA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 11:21:27 -0000 On Sun, 14 Sep 2014, Garrett Cooper wrote: > Log: > Redo r271374 by using the right typecast for comparing i and ngroups It is still quite broken (more broken than without the cast, since the cast breaks the warning). > Modified: user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c > ============================================================================== > --- user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c Sun Sep 14 09:06:35 2014 (r271573) > +++ user/ngie/add-pjdfstest/contrib/pjdfstest/pjdfstest.c Sun Sep 14 09:09:49 2014 (r271574) > @@ -1007,7 +1007,7 @@ set_gids(char *gids) > assert(gidset != NULL); > for (i = 0, g = strtok(gids, ","); g != NULL; > g = strtok(NULL, ","), i++) { > - if (i >= ngroups) { > + if (i >= (unsigned)ngroups) { ngroups has type long. In the unlikely event that it larger than UINT_MAX, the cast breaks its value, giving an actual bug where there was none before. The previous bug was to cast it to int. This breaks its value in the unlikely event that it is larger than INT_MAX, but didn't break the warning since i is bogusly unsigned so there was still a sign mismatch. There are many nearby type errors. Many have already occurred: % static void % set_gids(char *gids) % { % gid_t *gidset; gid_t is typedefed and is fairly opaque, so it is difficult to work with. This is not really a bug (design error). However, it is a bug (foot shooting) to use anything except int for counters of gids. % long ngroups; long is needed to hold the result of sysconf(). This is a bug (design error). long is usually unnecessary. It is insufficent in general. Ints work for most things, but in general intmax_t, uintmax_t or long double is needed. The API should have used int so as not to make the usual case harder. % char *g, *endp; % unsigned i; Type error (foot shooting). Types that are not int are hard to work with. % % ngroups = sysconf(_SC_NGROUPS_MAX); % assert(ngroups > 0); This is correct to match the APIs so far. The value must be assigned to a long before it is checked. The error handling is unportable. Oops, this isn't correct. The error return value is -1. That really can't happen. It is much more likely that a value of 0 is returned. This can happen for old versions of POSIX. In current versions of POSIX, it can't happen. But since this program doesn't support it and it checks for another case that can't happen, it should check for both cases. ngroups should be assigned to a variable with a more usable type (i.e., int) at this point, after checking that it fits. This variable should be spelled ngroups and the long variable should be spelled something else. % gidset = malloc(sizeof(*gidset) * ngroups); This overflows if ngroups is very large. The check that it fits in an int can be strengthend to check that this doesn't overflow. % assert(gidset != NULL); malloc() can't fail, especially if malloc() is broken and doesn't respect RLIMIT_DATA. Its failure is about as likely sysconf() returning -1, or overflow in the above. The handling of this error when it is detected it is worse than a null pointer trap. If ngroups is 0, then a sucessful malloc() might return NULL. This is detected as failure. POSIX gives an example with similar code except for no error checking at all. It also adds 1 to the result returned by sysconf(). This can overflow too, in theory. I'm not sure what this addition is for. It would handle the case where sysconf() returns 0 without much extra code, by preventing passing 0 to malloc() and getting an ambiguous NULL return for that. There are some complications involving whether the normal gid is counted in the supplementary gids. The extra 1 may be for counting it. FreeBSD used to have lots of off by 1 errors related to this. Not adding 1 here might be unportable to POSIX systems that don't handle the gid count like FreeBSD does now. See ps/fmt.c:shquot() for the complications needed to use sysconf() correctly for {ARG_MAX}. I'd like to have a library function to hide some of these complications. IIRC, I asked for {NGROUPS} calculations to use a specialized wrapper. {NGROUPS} is used more often than {ARG_MAX}. Only the error handling for this is difficult. abort() isn't enough for a library function. It might be enough for an ngroups() function to return 0 or 1 on error and for callers to ignore the error possibility (arrange to fail safe and act as if there are no groups on error). An ngroups_alloc() function could allocate the storage. % for (i = 0, g = strtok(gids, ","); g != NULL; % g = strtok(NULL, ","), i++) { % if (i >= ngroups) { Foot-shooting from i being unsigned begins here. unsigned i is neither necessary or sufficient to reach long ngroups. This was detected indirectly as a sign mismatch. If i were int, then the error wouldn't be detected. 'i' would still be unable to reach ngroups if ngroups were preposterously large and long is larger than int. % fprintf(stderr, "too many gids\n"); % exit(1); % } % gidset[i] = strtol(g, &endp, 0); Unsigned types are valid array indexes, but I don't like them for that. They are neither necessary or sufficient in general. Differences between pointers into arrays have type ptrdiff_t. This is signed, and indexes should be no different (except there is no requirement for ptrdiff_t to actually work; it may be 16 bits on 64-bit systems). On 32-bit systems, unsigned is larger than necessary for a general index, but on 64-bit systems it is smaller than necessary. Here even a 16-bit int i is large enough, since we assume that ngroups is not preposterously large. % if (*endp != '\0' && !isspace((unsigned char)*endp)) { % fprintf(stderr, "invalid gid '%s' - number expected\n", % g); % exit(1); % } % } % if (setgroups(i, gidset) < 0) { % fprintf(stderr, "cannot change groups: %s\n", strerror(errno)); % exit(1); % } Type error. setgroups() hasn't been poisoned by typedefs. It still takes an int count. If i is actually large enough to need to be unsigned, then it stops working when it overflows to a negative value here. % if (setegid(gidset[0]) < 0) { % fprintf(stderr, "cannot change effective gid: %s\n", % strerror(errno)); % exit(1); % } % free(gidset); % } 'int i' is often poisoned to 'unsigned i' or 'size_t i' to break warnings about comparison of i with size_t variables where the size_t variables often have small values. That doesn't apply in this function. The program just does consistent foot shooting using 'unsigned i;'. Except, 'unsigned i;' is a style bug. The program uses the verbose style 'unsigned int i;' everywhere else. It doesn't use the concise KNF 'u_int i;' anywhere. Bruce From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 19:10:09 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EEE7CDF; Sun, 14 Sep 2014 19:10:09 +0000 (UTC) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27712ABA; Sun, 14 Sep 2014 19:10:09 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id hz1so4903211pad.21 for ; Sun, 14 Sep 2014 12:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=9bzKWSV8W+WipK4a1Z3d0odenEQR3+BXRatiaVaJ0nI=; b=qtdde+jtJKzdMD0imSPdrfpdknSjaj5iWY5ztyDupH2frlR/MMnhLbYFEgPheMq9Ze NMPUW8oOvSydQ6NTphA/aCe4qxjm/kehAT8NsvG3zh3DdSdDnHO07sKqQ9RllsY1f31X cgVt27aK2TcjKccjDBll5T3yStlf+qaBz7mxhfBl3pj608eJ4vSKtbwQcooXbZQ5PKD4 RBypSnicoU1A+JN+yBpMvFgzPyFfZ/Hw10wjVd7LpnA8eoiE3zg9YZ8QL0imIDMR3SN+ 0ivVhhqhUlvB7ElR9isRcW0LVbY0EoY2vL3wFUdASMiJOwWCvQMSDUKov8AnHjPHi1Wi 6yJQ== X-Received: by 10.68.252.168 with SMTP id zt8mr33170155pbc.14.1410721808704; Sun, 14 Sep 2014 12:10:08 -0700 (PDT) Received: from [192.168.20.11] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id pp2sm9361420pbc.66.2014.09.14.12.10.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Sep 2014 12:10:07 -0700 (PDT) References: <201409140909.s8E99ncV087445@svn.freebsd.org> <20140914200428.P1559@besplex.bde.org> Mime-Version: 1.0 (1.0) In-Reply-To: <20140914200428.P1559@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <916E2311-C6BF-423E-A149-3F1853584020@gmail.com> X-Mailer: iPhone Mail (11D257) From: Garrett Cooper Subject: Re: svn commit: r271574 - user/ngie/add-pjdfstest/contrib/pjdfstest Date: Sun, 14 Sep 2014 12:10:06 -0700 To: Bruce Evans Cc: "src-committers@freebsd.org" , Garrett Cooper , "svn-src-user@freebsd.org" X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 19:10:09 -0000 > On Sep 14, 2014, at 4:21, Bruce Evans wrote: >=20 >> On Sun, 14 Sep 2014, Garrett Cooper wrote: >>=20 >> Log: >> Redo r271374 by using the right typecast for comparing i and ngroups >=20 > It is still quite broken (more broken than without the cast, since the > cast breaks the warning). Hi Bruce, I completely agree with your concerns. Since this is "contrib" code I wa= nted to make the smallest set of changes to make things compile, then push f= or the proper fix upstream. As an aside, is u_int completely portable; I personally prefer the longe= r forms of non-fixed width types, e.g. unsigned int, but that's my personal p= reference. Thank you! -Garrett= From owner-svn-src-user@FreeBSD.ORG Sun Sep 14 22:12:53 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B708EA74; Sun, 14 Sep 2014 22:12:53 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 76EF4D88; Sun, 14 Sep 2014 22:12:53 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 11889425150; Mon, 15 Sep 2014 07:54:54 +1000 (EST) Date: Mon, 15 Sep 2014 07:54:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper Subject: Re: svn commit: r271574 - user/ngie/add-pjdfstest/contrib/pjdfstest In-Reply-To: <916E2311-C6BF-423E-A149-3F1853584020@gmail.com> Message-ID: <20140915074551.B6416@besplex.bde.org> References: <201409140909.s8E99ncV087445@svn.freebsd.org> <20140914200428.P1559@besplex.bde.org> <916E2311-C6BF-423E-A149-3F1853584020@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=AOuw8Gd4 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=LRTG6vsd6QsA:10 a=5LnWPWDnWWAA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=4FDT9k0moJQWhJTbUroA:9 a=CjuIK1q_8ugA:10 Cc: "src-committers@freebsd.org" , Garrett Cooper , Bruce Evans , "svn-src-user@freebsd.org" X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 22:12:53 -0000 On Sun, 14 Sep 2014, Garrett Cooper wrote: > >> On Sep 14, 2014, at 4:21, Bruce Evans wrote: >> >>> On Sun, 14 Sep 2014, Garrett Cooper wrote: >>> >>> Log: >>> Redo r271374 by using the right typecast for comparing i and ngroups >> >> It is still quite broken (more broken than without the cast, since the >> cast breaks the warning). > I completely agree with your concerns. Since this is "contrib" code I wanted to make the smallest set of changes to make things compile, then push for the proper fix upstream. OK. > As an aside, is u_int completely portable; I personally prefer the longer forms of non-fixed width types, e.g. unsigned int, but that's my personal preference. It is unportable. It shouldn't be used at all in contrib'ed code, but I thought that pjd worked here :-). I think BSD is a BSDism, but using it is even more natural now than uintN_t is standard (except that matches the SysVism uint better). Bruce Bruce From owner-svn-src-user@FreeBSD.ORG Mon Sep 15 13:59:37 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58B27ED4; Mon, 15 Sep 2014 13:59:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42859678; Mon, 15 Sep 2014 13:59:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FDxbfk005051; Mon, 15 Sep 2014 13:59:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FDxbVo005048; Mon, 15 Sep 2014 13:59:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409151359.s8FDxbVo005048@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Sep 2014 13:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271625 - in user/cperciva/freebsd-update-build/patches: 10.0-RELEASE 8.4-RELEASE 9.1-RELEASE 9.2-RELEASE 9.3-RELEASE X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 13:59:37 -0000 Author: delphij Date: Mon Sep 15 13:59:36 2014 New Revision: 271625 URL: http://svnweb.freebsd.org/changeset/base/271625 Log: Patches for previous patch batch. Added: user/cperciva/freebsd-update-build/patches/10.0-RELEASE/8-SA-14:18.openssl user/cperciva/freebsd-update-build/patches/8.4-RELEASE/15-SA-14:18.openssl user/cperciva/freebsd-update-build/patches/9.1-RELEASE/18-SA-14:18.openssl user/cperciva/freebsd-update-build/patches/9.2-RELEASE/11-SA-14:18.openssl user/cperciva/freebsd-update-build/patches/9.3-RELEASE/ user/cperciva/freebsd-update-build/patches/9.3-RELEASE/1-SA-14:18.openssl Added: user/cperciva/freebsd-update-build/patches/10.0-RELEASE/8-SA-14:18.openssl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/patches/10.0-RELEASE/8-SA-14:18.openssl Mon Sep 15 13:59:36 2014 (r271625) @@ -0,0 +1,726 @@ +Index: crypto/openssl/crypto/asn1/a_object.c +=================================================================== +--- crypto/openssl/crypto/asn1/a_object.c (revision 270128) ++++ crypto/openssl/crypto/asn1/a_object.c (working copy) +@@ -283,6 +283,7 @@ err: + ASN1err(ASN1_F_D2I_ASN1_OBJECT,i); + return(NULL); + } ++ + ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, + long len) + { +@@ -289,12 +290,23 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, cons + ASN1_OBJECT *ret=NULL; + const unsigned char *p; + unsigned char *data; +- int i; +- /* Sanity check OID encoding: can't have leading 0x80 in +- * subidentifiers, see: X.690 8.19.2 ++ int i, length; ++ ++ /* Sanity check OID encoding. ++ * Need at least one content octet. ++ * MSB must be clear in the last octet. ++ * can't have leading 0x80 in subidentifiers, see: X.690 8.19.2 + */ +- for (i = 0, p = *pp; i < len; i++, p++) ++ if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL || ++ p[len - 1] & 0x80) + { ++ ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING); ++ return NULL; ++ } ++ /* Now 0 < len <= INT_MAX, so the cast is safe. */ ++ length = (int)len; ++ for (i = 0; i < length; i++, p++) ++ { + if (*p == 0x80 && (!i || !(p[-1] & 0x80))) + { + ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING); +@@ -316,23 +328,23 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, cons + data = (unsigned char *)ret->data; + ret->data = NULL; + /* once detached we can change it */ +- if ((data == NULL) || (ret->length < len)) ++ if ((data == NULL) || (ret->length < length)) + { + ret->length=0; + if (data != NULL) OPENSSL_free(data); +- data=(unsigned char *)OPENSSL_malloc(len ? (int)len : 1); ++ data=(unsigned char *)OPENSSL_malloc(length); + if (data == NULL) + { i=ERR_R_MALLOC_FAILURE; goto err; } + ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; + } +- memcpy(data,p,(int)len); ++ memcpy(data,p,length); + /* reattach data to object, after which it remains const */ + ret->data =data; +- ret->length=(int)len; ++ ret->length=length; + ret->sn=NULL; + ret->ln=NULL; + /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */ +- p+=len; ++ p+=length; + + if (a != NULL) (*a)=ret; + *pp=p; +Index: crypto/openssl/crypto/objects/obj_dat.c +=================================================================== +--- crypto/openssl/crypto/objects/obj_dat.c (revision 270128) ++++ crypto/openssl/crypto/objects/obj_dat.c (working copy) +@@ -471,12 +471,13 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1 + const unsigned char *p; + char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2]; + +- if ((a == NULL) || (a->data == NULL)) { +- buf[0]='\0'; ++ /* Ensure that, at every state, |buf| is NUL-terminated. */ ++ if (buf && buf_len > 0) ++ buf[0] = '\0'; ++ ++ if ((a == NULL) || (a->data == NULL)) + return(0); +- } + +- + if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef) + { + const char *s; +@@ -554,9 +555,10 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1 + i=(int)(l/40); + l-=(long)(i*40); + } +- if (buf && (buf_len > 0)) ++ if (buf && (buf_len > 1)) + { + *buf++ = i + '0'; ++ *buf = '\0'; + buf_len--; + } + n++; +@@ -571,9 +573,10 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1 + i = strlen(bndec); + if (buf) + { +- if (buf_len > 0) ++ if (buf_len > 1) + { + *buf++ = '.'; ++ *buf = '\0'; + buf_len--; + } + BUF_strlcpy(buf,bndec,buf_len); +@@ -807,4 +810,3 @@ err: + OPENSSL_free(buf); + return(ok); + } +- +Index: crypto/openssl/crypto/srp/srp_lib.c +=================================================================== +--- crypto/openssl/crypto/srp/srp_lib.c (revision 270128) ++++ crypto/openssl/crypto/srp/srp_lib.c (working copy) +@@ -85,6 +85,9 @@ static BIGNUM *srp_Calc_k(BIGNUM *N, BIGNUM *g) + int longg ; + int longN = BN_num_bytes(N); + ++ if (BN_ucmp(g, N) >= 0) ++ return NULL; ++ + if ((tmp = OPENSSL_malloc(longN)) == NULL) + return NULL; + BN_bn2bin(N,tmp) ; +@@ -117,6 +120,9 @@ BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N + if ((A == NULL) ||(B == NULL) || (N == NULL)) + return NULL; + ++ if (BN_ucmp(A, N) >= 0 || BN_ucmp(B, N) >= 0) ++ return NULL; ++ + longN= BN_num_bytes(N); + + if ((cAB = OPENSSL_malloc(2*longN)) == NULL) +Index: crypto/openssl/ssl/d1_both.c +=================================================================== +--- crypto/openssl/ssl/d1_both.c (revision 270128) ++++ crypto/openssl/ssl/d1_both.c (working copy) +@@ -586,30 +586,33 @@ dtls1_retrieve_buffered_fragment(SSL *s, long max, + return 0; + } + ++/* dtls1_max_handshake_message_len returns the maximum number of bytes ++ * permitted in a DTLS handshake message for |s|. The minimum is 16KB, but may ++ * be greater if the maximum certificate list size requires it. */ ++static unsigned long dtls1_max_handshake_message_len(const SSL *s) ++ { ++ unsigned long max_len = DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH; ++ if (max_len < (unsigned long)s->max_cert_list) ++ return s->max_cert_list; ++ return max_len; ++ } + + static int +-dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok) ++dtls1_reassemble_fragment(SSL *s, const struct hm_header_st* msg_hdr, int *ok) + { + hm_fragment *frag = NULL; + pitem *item = NULL; + int i = -1, is_complete; + unsigned char seq64be[8]; +- unsigned long frag_len = msg_hdr->frag_len, max_len; ++ unsigned long frag_len = msg_hdr->frag_len; + +- if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len) ++ if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len || ++ msg_hdr->msg_len > dtls1_max_handshake_message_len(s)) + goto err; + +- /* Determine maximum allowed message size. Depends on (user set) +- * maximum certificate length, but 16k is minimum. +- */ +- if (DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH < s->max_cert_list) +- max_len = s->max_cert_list; +- else +- max_len = DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH; ++ if (frag_len == 0) ++ return DTLS1_HM_FRAGMENT_RETRY; + +- if ((msg_hdr->frag_off+frag_len) > max_len) +- goto err; +- + /* Try to find item in queue */ + memset(seq64be,0,sizeof(seq64be)); + seq64be[6] = (unsigned char) (msg_hdr->seq>>8); +@@ -638,7 +641,8 @@ static int + + + /* If message is already reassembled, this must be a +- * retransmit and can be dropped. ++ * retransmit and can be dropped. In this case item != NULL and so frag ++ * does not need to be freed. + */ + if (frag->reassembly == NULL) + { +@@ -658,7 +662,9 @@ static int + /* read the body of the fragment (header has already been read */ + i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE, + frag->fragment + msg_hdr->frag_off,frag_len,0); +- if (i<=0 || (unsigned long)i!=frag_len) ++ if ((unsigned long)i!=frag_len) ++ i=-1; ++ if (i<=0) + goto err; + + RSMBLY_BITMASK_MARK(frag->reassembly, (long)msg_hdr->frag_off, +@@ -675,10 +681,6 @@ static int + + if (item == NULL) + { +- memset(seq64be,0,sizeof(seq64be)); +- seq64be[6] = (unsigned char)(msg_hdr->seq>>8); +- seq64be[7] = (unsigned char)(msg_hdr->seq); +- + item = pitem_new(seq64be, frag); + if (item == NULL) + { +@@ -686,14 +688,18 @@ static int + i = -1; + } + +- pqueue_insert(s->d1->buffered_messages, item); ++ item = pqueue_insert(s->d1->buffered_messages, item); ++ /* pqueue_insert fails iff a duplicate item is inserted. ++ * However, |item| cannot be a duplicate. If it were, ++ * |pqueue_find|, above, would have returned it and control ++ * would never have reached this branch. */ ++ OPENSSL_assert(item != NULL); + } + + return DTLS1_HM_FRAGMENT_RETRY; + + err: +- if (frag != NULL) dtls1_hm_fragment_free(frag); +- if (item != NULL) OPENSSL_free(item); ++ if (frag != NULL && item == NULL) dtls1_hm_fragment_free(frag); + *ok = 0; + return i; + } +@@ -700,7 +706,7 @@ err: + + + static int +-dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok) ++dtls1_process_out_of_seq_message(SSL *s, const struct hm_header_st* msg_hdr, int *ok) + { + int i=-1; + hm_fragment *frag = NULL; +@@ -720,7 +726,7 @@ static int + /* If we already have an entry and this one is a fragment, + * don't discard it and rather try to reassemble it. + */ +- if (item != NULL && frag_len < msg_hdr->msg_len) ++ if (item != NULL && frag_len != msg_hdr->msg_len) + item = NULL; + + /* Discard the message if sequence number was already there, is +@@ -745,9 +751,12 @@ static int + } + else + { +- if (frag_len && frag_len < msg_hdr->msg_len) ++ if (frag_len != msg_hdr->msg_len) + return dtls1_reassemble_fragment(s, msg_hdr, ok); + ++ if (frag_len > dtls1_max_handshake_message_len(s)) ++ goto err; ++ + frag = dtls1_hm_fragment_new(frag_len, 0); + if ( frag == NULL) + goto err; +@@ -759,26 +768,31 @@ static int + /* read the body of the fragment (header has already been read */ + i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE, + frag->fragment,frag_len,0); +- if (i<=0 || (unsigned long)i!=frag_len) ++ if ((unsigned long)i!=frag_len) ++ i = -1; ++ if (i<=0) + goto err; + } + +- memset(seq64be,0,sizeof(seq64be)); +- seq64be[6] = (unsigned char)(msg_hdr->seq>>8); +- seq64be[7] = (unsigned char)(msg_hdr->seq); +- + item = pitem_new(seq64be, frag); + if ( item == NULL) + goto err; + +- pqueue_insert(s->d1->buffered_messages, item); ++ item = pqueue_insert(s->d1->buffered_messages, item); ++ /* pqueue_insert fails iff a duplicate item is inserted. ++ * However, |item| cannot be a duplicate. If it were, ++ * |pqueue_find|, above, would have returned it. Then, either ++ * |frag_len| != |msg_hdr->msg_len| in which case |item| is set ++ * to NULL and it will have been processed with ++ * |dtls1_reassemble_fragment|, above, or the record will have ++ * been discarded. */ ++ OPENSSL_assert(item != NULL); + } + + return DTLS1_HM_FRAGMENT_RETRY; + + err: +- if ( frag != NULL) dtls1_hm_fragment_free(frag); +- if ( item != NULL) OPENSSL_free(item); ++ if (frag != NULL && item == NULL) dtls1_hm_fragment_free(frag); + *ok = 0; + return i; + } +Index: crypto/openssl/ssl/d1_clnt.c +=================================================================== +--- crypto/openssl/ssl/d1_clnt.c (revision 270128) ++++ crypto/openssl/ssl/d1_clnt.c (working copy) +@@ -982,6 +982,13 @@ int dtls1_send_client_key_exchange(SSL *s) + RSA *rsa; + unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH]; + ++ if (s->session->sess_cert == NULL) ++ { ++ /* We should always have a server certificate with SSL_kRSA. */ ++ SSLerr(SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ + if (s->session->sess_cert->peer_rsa_tmp != NULL) + rsa=s->session->sess_cert->peer_rsa_tmp; + else +@@ -1172,6 +1179,13 @@ int dtls1_send_client_key_exchange(SSL *s) + { + DH *dh_srvr,*dh_clnt; + ++ if (s->session->sess_cert == NULL) ++ { ++ ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE); ++ SSLerr(SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE); ++ goto err; ++ } ++ + if (s->session->sess_cert->peer_dh_tmp != NULL) + dh_srvr=s->session->sess_cert->peer_dh_tmp; + else +@@ -1231,6 +1245,13 @@ int dtls1_send_client_key_exchange(SSL *s) + int ecdh_clnt_cert = 0; + int field_size = 0; + ++ if (s->session->sess_cert == NULL) ++ { ++ ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE); ++ SSLerr(SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE); ++ goto err; ++ } ++ + /* Did we send out the client's + * ECDH share for use in premaster + * computation as part of client certificate? +@@ -1706,5 +1727,3 @@ int dtls1_send_client_certificate(SSL *s) + /* SSL3_ST_CW_CERT_D */ + return(dtls1_do_write(s,SSL3_RT_HANDSHAKE)); + } +- +- +Index: crypto/openssl/ssl/s23_srvr.c +=================================================================== +--- crypto/openssl/ssl/s23_srvr.c (revision 270128) ++++ crypto/openssl/ssl/s23_srvr.c (working copy) +@@ -348,16 +348,12 @@ int ssl23_get_client_hello(SSL *s) + * Client Hello message, this would be difficult, and we'd have + * to read more records to find out. + * No known SSL 3.0 client fragments ClientHello like this, +- * so we simply assume TLS 1.0 to avoid protocol version downgrade +- * attacks. */ ++ * so we simply reject such connections to avoid ++ * protocol version downgrade attacks. */ + if (p[3] == 0 && p[4] < 6) + { +-#if 0 + SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_RECORD_TOO_SMALL); + goto err; +-#else +- v[1] = TLS1_VERSION_MINOR; +-#endif + } + /* if major version number > 3 set minor to a value + * which will use the highest version 3 we support. +@@ -364,7 +360,7 @@ int ssl23_get_client_hello(SSL *s) + * If TLS 2.0 ever appears we will need to revise + * this.... + */ +- else if (p[9] > SSL3_VERSION_MAJOR) ++ if (p[9] > SSL3_VERSION_MAJOR) + v[1]=0xff; + else + v[1]=p[10]; /* minor version according to client_version */ +@@ -444,6 +440,18 @@ int ssl23_get_client_hello(SSL *s) + v[0] = p[3]; /* == SSL3_VERSION_MAJOR */ + v[1] = p[4]; + ++ /* An SSLv3/TLSv1 backwards-compatible CLIENT-HELLO in an SSLv2 ++ * header is sent directly on the wire, not wrapped as a TLS ++ * record. It's format is: ++ * Byte Content ++ * 0-1 msg_length ++ * 2 msg_type ++ * 3-4 version ++ * 5-6 cipher_spec_length ++ * 7-8 session_id_length ++ * 9-10 challenge_length ++ * ... ... ++ */ + n=((p[0]&0x7f)<<8)|p[1]; + if (n > (1024*4)) + { +@@ -450,8 +458,16 @@ int ssl23_get_client_hello(SSL *s) + SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_RECORD_TOO_LARGE); + goto err; + } ++ if (n < 9) ++ { ++ SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_RECORD_LENGTH_MISMATCH); ++ goto err; ++ } + + j=ssl23_read_bytes(s,n+2); ++ /* We previously read 11 bytes, so if j > 0, we must have ++ * j == n+2 == s->packet_length. We have at least 11 valid ++ * packet bytes. */ + if (j <= 0) return(j); + + ssl3_finish_mac(s, s->packet+2, s->packet_length-2); +Index: crypto/openssl/ssl/s3_clnt.c +=================================================================== +--- crypto/openssl/ssl/s3_clnt.c (revision 270128) ++++ crypto/openssl/ssl/s3_clnt.c (working copy) +@@ -953,6 +953,15 @@ int ssl3_get_server_hello(SSL *s) + SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_WRONG_CIPHER_RETURNED); + goto f_err; + } ++#ifndef OPENSSL_NO_SRP ++ if (((c->algorithm_mkey & SSL_kSRP) || (c->algorithm_auth & SSL_aSRP)) && ++ !(s->srp_ctx.srp_Mask & SSL_kSRP)) ++ { ++ al=SSL_AD_ILLEGAL_PARAMETER; ++ SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_WRONG_CIPHER_RETURNED); ++ goto f_err; ++ } ++#endif /* OPENSSL_NO_SRP */ + p+=ssl_put_cipher_by_char(s,NULL,NULL); + + sk=ssl_get_ciphers_by_id(s); +@@ -1459,6 +1468,12 @@ int ssl3_get_key_exchange(SSL *s) + p+=i; + n-=param_len; + ++ if (!srp_verify_server_param(s, &al)) ++ { ++ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_BAD_SRP_PARAMETERS); ++ goto f_err; ++ } ++ + /* We must check if there is a certificate */ + #ifndef OPENSSL_NO_RSA + if (alg_a & SSL_aRSA) +@@ -2252,6 +2267,13 @@ int ssl3_send_client_key_exchange(SSL *s) + RSA *rsa; + unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH]; + ++ if (s->session->sess_cert == NULL) ++ { ++ /* We should always have a server certificate with SSL_kRSA. */ ++ SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ + if (s->session->sess_cert->peer_rsa_tmp != NULL) + rsa=s->session->sess_cert->peer_rsa_tmp; + else +Index: crypto/openssl/ssl/s3_lib.c +=================================================================== +--- crypto/openssl/ssl/s3_lib.c (revision 270128) ++++ crypto/openssl/ssl/s3_lib.c (working copy) +@@ -2426,7 +2426,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ + TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA, + TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA, + SSL_kSRP, +- SSL_aNULL, ++ SSL_aSRP, + SSL_3DES, + SSL_SHA1, + SSL_TLSV1, +@@ -2474,7 +2474,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ + TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA, + TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA, + SSL_kSRP, +- SSL_aNULL, ++ SSL_aSRP, + SSL_AES128, + SSL_SHA1, + SSL_TLSV1, +@@ -2522,7 +2522,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ + TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA, + TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA, + SSL_kSRP, +- SSL_aNULL, ++ SSL_aSRP, + SSL_AES256, + SSL_SHA1, + SSL_TLSV1, +Index: crypto/openssl/ssl/s3_srvr.c +=================================================================== +--- crypto/openssl/ssl/s3_srvr.c (revision 270128) ++++ crypto/openssl/ssl/s3_srvr.c (working copy) +@@ -2798,6 +2798,13 @@ int ssl3_get_client_key_exchange(SSL *s) + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,ERR_R_BN_LIB); + goto err; + } ++ if (BN_ucmp(s->srp_ctx.A, s->srp_ctx.N) >= 0 ++ || BN_is_zero(s->srp_ctx.A)) ++ { ++ al=SSL_AD_ILLEGAL_PARAMETER; ++ SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_SRP_PARAMETERS); ++ goto f_err; ++ } + if (s->session->srp_username != NULL) + OPENSSL_free(s->session->srp_username); + s->session->srp_username = BUF_strdup(s->srp_ctx.login); +Index: crypto/openssl/ssl/ssl.h +=================================================================== +--- crypto/openssl/ssl/ssl.h (revision 270128) ++++ crypto/openssl/ssl/ssl.h (working copy) +@@ -264,6 +264,7 @@ extern "C" { + #define SSL_TXT_aGOST94 "aGOST94" + #define SSL_TXT_aGOST01 "aGOST01" + #define SSL_TXT_aGOST "aGOST" ++#define SSL_TXT_aSRP "aSRP" + + #define SSL_TXT_DSS "DSS" + #define SSL_TXT_DH "DH" +@@ -2309,6 +2310,7 @@ void ERR_load_SSL_strings(void); + #define SSL_R_BAD_SRP_B_LENGTH 348 + #define SSL_R_BAD_SRP_G_LENGTH 349 + #define SSL_R_BAD_SRP_N_LENGTH 350 ++#define SSL_R_BAD_SRP_PARAMETERS 371 + #define SSL_R_BAD_SRP_S_LENGTH 351 + #define SSL_R_BAD_SRTP_MKI_VALUE 352 + #define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353 +Index: crypto/openssl/ssl/ssl_ciph.c +=================================================================== +--- crypto/openssl/ssl/ssl_ciph.c (revision 270128) ++++ crypto/openssl/ssl/ssl_ciph.c (working copy) +@@ -270,6 +270,7 @@ static const SSL_CIPHER cipher_aliases[]={ + {0,SSL_TXT_aGOST94,0,0,SSL_aGOST94,0,0,0,0,0,0,0}, + {0,SSL_TXT_aGOST01,0,0,SSL_aGOST01,0,0,0,0,0,0,0}, + {0,SSL_TXT_aGOST,0,0,SSL_aGOST94|SSL_aGOST01,0,0,0,0,0,0,0}, ++ {0,SSL_TXT_aSRP,0, 0,SSL_aSRP, 0,0,0,0,0,0,0}, + + /* aliases combining key exchange and server authentication */ + {0,SSL_TXT_EDH,0, SSL_kEDH,~SSL_aNULL,0,0,0,0,0,0,0}, +@@ -1628,6 +1629,9 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cip + case SSL_aPSK: + au="PSK"; + break; ++ case SSL_aSRP: ++ au="SRP"; ++ break; + default: + au="unknown"; + break; +Index: crypto/openssl/ssl/ssl_err.c +=================================================================== +--- crypto/openssl/ssl/ssl_err.c (revision 270128) ++++ crypto/openssl/ssl/ssl_err.c (working copy) +@@ -329,6 +329,7 @@ static ERR_STRING_DATA SSL_str_reasons[]= + {ERR_REASON(SSL_R_BAD_SRP_B_LENGTH) ,"bad srp b length"}, + {ERR_REASON(SSL_R_BAD_SRP_G_LENGTH) ,"bad srp g length"}, + {ERR_REASON(SSL_R_BAD_SRP_N_LENGTH) ,"bad srp n length"}, ++{ERR_REASON(SSL_R_BAD_SRP_PARAMETERS) ,"bad srp parameters"}, + {ERR_REASON(SSL_R_BAD_SRP_S_LENGTH) ,"bad srp s length"}, + {ERR_REASON(SSL_R_BAD_SRTP_MKI_VALUE) ,"bad srtp mki value"}, + {ERR_REASON(SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST),"bad srtp protection profile list"}, +Index: crypto/openssl/ssl/ssl_lib.c +=================================================================== +--- crypto/openssl/ssl/ssl_lib.c (revision 270128) ++++ crypto/openssl/ssl/ssl_lib.c (working copy) +@@ -1402,6 +1402,11 @@ int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_C + s->psk_client_callback == NULL) + continue; + #endif /* OPENSSL_NO_PSK */ ++#ifndef OPENSSL_NO_SRP ++ if (((c->algorithm_mkey & SSL_kSRP) || (c->algorithm_auth & SSL_aSRP)) && ++ !(s->srp_ctx.srp_Mask & SSL_kSRP)) ++ continue; ++#endif /* OPENSSL_NO_SRP */ + j = put_cb ? put_cb(c,p) : ssl_put_cipher_by_char(s,c,p); + p+=j; + } +Index: crypto/openssl/ssl/ssl_locl.h +=================================================================== +--- crypto/openssl/ssl/ssl_locl.h (revision 270128) ++++ crypto/openssl/ssl/ssl_locl.h (working copy) +@@ -311,6 +311,7 @@ + #define SSL_aPSK 0x00000080L /* PSK auth */ + #define SSL_aGOST94 0x00000100L /* GOST R 34.10-94 signature auth */ + #define SSL_aGOST01 0x00000200L /* GOST R 34.10-2001 signature auth */ ++#define SSL_aSRP 0x00000400L /* SRP auth */ + + + /* Bits for algorithm_enc (symmetric encryption) */ +@@ -1173,4 +1174,6 @@ void tls_fips_digest_extra( + const EVP_CIPHER_CTX *cipher_ctx, EVP_MD_CTX *mac_ctx, + const unsigned char *data, size_t data_len, size_t orig_len); + ++int srp_verify_server_param(SSL *s, int *al); ++ + #endif +Index: crypto/openssl/ssl/t1_lib.c +=================================================================== +--- crypto/openssl/ssl/t1_lib.c (revision 270128) ++++ crypto/openssl/ssl/t1_lib.c (working copy) +@@ -1446,15 +1446,18 @@ int ssl_parse_serverhello_tlsext(SSL *s, unsigned + *al = TLS1_AD_DECODE_ERROR; + return 0; + } +- s->session->tlsext_ecpointformatlist_length = 0; +- if (s->session->tlsext_ecpointformatlist != NULL) OPENSSL_free(s->session->tlsext_ecpointformatlist); +- if ((s->session->tlsext_ecpointformatlist = OPENSSL_malloc(ecpointformatlist_length)) == NULL) ++ if (!s->hit) + { +- *al = TLS1_AD_INTERNAL_ERROR; +- return 0; ++ s->session->tlsext_ecpointformatlist_length = 0; ++ if (s->session->tlsext_ecpointformatlist != NULL) OPENSSL_free(s->session->tlsext_ecpointformatlist); ++ if ((s->session->tlsext_ecpointformatlist = OPENSSL_malloc(ecpointformatlist_length)) == NULL) ++ { ++ *al = TLS1_AD_INTERNAL_ERROR; ++ return 0; ++ } ++ s->session->tlsext_ecpointformatlist_length = ecpointformatlist_length; ++ memcpy(s->session->tlsext_ecpointformatlist, sdata, ecpointformatlist_length); + } +- s->session->tlsext_ecpointformatlist_length = ecpointformatlist_length; +- memcpy(s->session->tlsext_ecpointformatlist, sdata, ecpointformatlist_length); + #if 0 + fprintf(stderr,"ssl_parse_serverhello_tlsext s->session->tlsext_ecpointformatlist "); + sdata = s->session->tlsext_ecpointformatlist; +Index: crypto/openssl/ssl/tls_srp.c +=================================================================== +--- crypto/openssl/ssl/tls_srp.c (revision 270128) ++++ crypto/openssl/ssl/tls_srp.c (working copy) +@@ -408,17 +408,47 @@ err: + return ret; + } + ++int srp_verify_server_param(SSL *s, int *al) ++ { ++ SRP_CTX *srp = &s->srp_ctx; ++ /* Sanity check parameters: we can quickly check B % N == 0 ++ * by checking B != 0 since B < N ++ */ ++ if (BN_ucmp(srp->g, srp->N) >=0 || BN_ucmp(srp->B, srp->N) >= 0 ++ || BN_is_zero(srp->B)) ++ { ++ *al = SSL3_AD_ILLEGAL_PARAMETER; ++ return 0; ++ } ++ ++ if (BN_num_bits(srp->N) < srp->strength) ++ { ++ *al = TLS1_AD_INSUFFICIENT_SECURITY; ++ return 0; ++ } ++ ++ if (srp->SRP_verify_param_callback) ++ { ++ if (srp->SRP_verify_param_callback(s, srp->SRP_cb_arg) <= 0) ++ { ++ *al = TLS1_AD_INSUFFICIENT_SECURITY; ++ return 0; ++ } ++ } ++ else if(!SRP_check_known_gN_param(srp->g, srp->N)) ++ { ++ *al = TLS1_AD_INSUFFICIENT_SECURITY; ++ return 0; ++ } ++ ++ return 1; ++ } ++ ++ + int SRP_Calc_A_param(SSL *s) + { + unsigned char rnd[SSL_MAX_MASTER_KEY_LENGTH]; + +- if (BN_num_bits(s->srp_ctx.N) < s->srp_ctx.strength) +- return -1; +- +- if (s->srp_ctx.SRP_verify_param_callback ==NULL && +- !SRP_check_known_gN_param(s->srp_ctx.g,s->srp_ctx.N)) +- return -1 ; +- + RAND_bytes(rnd, sizeof(rnd)); + s->srp_ctx.a = BN_bin2bn(rnd, sizeof(rnd), s->srp_ctx.a); + OPENSSL_cleanse(rnd, sizeof(rnd)); +@@ -426,10 +456,6 @@ int SRP_Calc_A_param(SSL *s) + if (!(s->srp_ctx.A = SRP_Calc_A(s->srp_ctx.a,s->srp_ctx.N,s->srp_ctx.g))) + return -1; + +- /* We can have a callback to verify SRP param!! */ +- if (s->srp_ctx.SRP_verify_param_callback !=NULL) +- return s->srp_ctx.SRP_verify_param_callback(s,s->srp_ctx.SRP_cb_arg); +- + return 1; + } + Added: user/cperciva/freebsd-update-build/patches/8.4-RELEASE/15-SA-14:18.openssl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/patches/8.4-RELEASE/15-SA-14:18.openssl Mon Sep 15 13:59:36 2014 (r271625) @@ -0,0 +1,401 @@ +Index: crypto/openssl/crypto/asn1/a_object.c +=================================================================== +--- crypto/openssl/crypto/asn1/a_object.c (revision 270128) ++++ crypto/openssl/crypto/asn1/a_object.c (working copy) +@@ -285,17 +285,29 @@ err: + ASN1_OBJECT_free(ret); + return(NULL); + } ++ + ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, + long len) + { + ASN1_OBJECT *ret=NULL; + const unsigned char *p; +- int i; +- /* Sanity check OID encoding: can't have leading 0x80 in +- * subidentifiers, see: X.690 8.19.2 ++ int i, length; ++ ++ /* Sanity check OID encoding. ++ * Need at least one content octet. ++ * MSB must be clear in the last octet. ++ * can't have leading 0x80 in subidentifiers, see: X.690 8.19.2 + */ +- for (i = 0, p = *pp; i < len; i++, p++) ++ if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL || ++ p[len - 1] & 0x80) + { ++ ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING); ++ return NULL; ++ } ++ /* Now 0 < len <= INT_MAX, so the cast is safe. */ ++ length = (int)len; ++ for (i = 0; i < length; i++, p++) ++ { + if (*p == 0x80 && (!i || !(p[-1] & 0x80))) + { + ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING); +@@ -313,20 +325,20 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, cons + else ret=(*a); + + p= *pp; +- if ((ret->data == NULL) || (ret->length < len)) ++ if ((ret->data == NULL) || (ret->length < length)) + { + if (ret->data != NULL) OPENSSL_free(ret->data); +- ret->data=(unsigned char *)OPENSSL_malloc(len ? (int)len : 1); ++ ret->data=(unsigned char *)OPENSSL_malloc(length); + ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; + if (ret->data == NULL) + { i=ERR_R_MALLOC_FAILURE; goto err; } + } +- memcpy(ret->data,p,(int)len); +- ret->length=(int)len; ++ memcpy(ret->data,p,length); ++ ret->length=length; + ret->sn=NULL; + ret->ln=NULL; + /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */ +- p+=len; ++ p+=length; + + if (a != NULL) (*a)=ret; + *pp=p; +Index: crypto/openssl/crypto/objects/obj_dat.c +=================================================================== +--- crypto/openssl/crypto/objects/obj_dat.c (revision 270128) ++++ crypto/openssl/crypto/objects/obj_dat.c (working copy) +@@ -444,12 +444,13 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1 + unsigned char *p; + char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2]; + +- if ((a == NULL) || (a->data == NULL)) { +- buf[0]='\0'; ++ /* Ensure that, at every state, |buf| is NUL-terminated. */ ++ if (buf && buf_len > 0) ++ buf[0] = '\0'; ++ ++ if ((a == NULL) || (a->data == NULL)) + return(0); +- } + +- + if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef) + { + const char *s; +@@ -527,9 +528,10 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1 + i=(int)(l/40); + l-=(long)(i*40); + } +- if (buf && (buf_len > 0)) ++ if (buf && (buf_len > 1)) + { + *buf++ = i + '0'; ++ *buf = '\0'; + buf_len--; + } + n++; +@@ -544,9 +546,10 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1 + i = strlen(bndec); + if (buf) + { +- if (buf_len > 0) ++ if (buf_len > 1) + { + *buf++ = '.'; ++ *buf = '\0'; + buf_len--; + } + BUF_strlcpy(buf,bndec,buf_len); +@@ -786,4 +789,3 @@ err: + OPENSSL_free(buf); + return(ok); + } +- +Index: crypto/openssl/ssl/d1_both.c +=================================================================== +--- crypto/openssl/ssl/d1_both.c (revision 270128) ++++ crypto/openssl/ssl/d1_both.c (working copy) +@@ -580,30 +580,33 @@ dtls1_retrieve_buffered_fragment(SSL *s, long max, + return 0; + } + ++/* dtls1_max_handshake_message_len returns the maximum number of bytes ++ * permitted in a DTLS handshake message for |s|. The minimum is 16KB, but may ++ * be greater if the maximum certificate list size requires it. */ ++static unsigned long dtls1_max_handshake_message_len(const SSL *s) ++ { ++ unsigned long max_len = DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH; ++ if (max_len < (unsigned long)s->max_cert_list) ++ return s->max_cert_list; ++ return max_len; ++ } + + static int +-dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok) ++dtls1_reassemble_fragment(SSL *s, const struct hm_header_st* msg_hdr, int *ok) + { + hm_fragment *frag = NULL; + pitem *item = NULL; + int i = -1, is_complete; + PQ_64BIT seq64; +- unsigned long frag_len = msg_hdr->frag_len, max_len; ++ unsigned long frag_len = msg_hdr->frag_len; + +- if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len) ++ if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len || ++ msg_hdr->msg_len > dtls1_max_handshake_message_len(s)) + goto err; + +- /* Determine maximum allowed message size. Depends on (user set) +- * maximum certificate length, but 16k is minimum. +- */ +- if (DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH < s->max_cert_list) +- max_len = s->max_cert_list; +- else +- max_len = DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH; ++ if (frag_len == 0) ++ return DTLS1_HM_FRAGMENT_RETRY; + +- if ((msg_hdr->frag_off+frag_len) > max_len) +- goto err; +- + /* Try to find item in queue */ + pq_64bit_init(&seq64); + pq_64bit_assign_word(&seq64, msg_hdr->seq); +@@ -632,7 +635,8 @@ static int + + + /* If message is already reassembled, this must be a +- * retransmit and can be dropped. ++ * retransmit and can be dropped. In this case item != NULL and so frag ++ * does not need to be freed. + */ + if (frag->reassembly == NULL) + { +@@ -652,7 +656,9 @@ static int + /* read the body of the fragment (header has already been read */ + i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE, + frag->fragment + msg_hdr->frag_off,frag_len,0); +- if (i<=0 || (unsigned long)i!=frag_len) ++ if ((unsigned long)i!=frag_len) ++ i=-1; ++ if (i<=0) + goto err; + + RSMBLY_BITMASK_MARK(frag->reassembly, (long)msg_hdr->frag_off, +@@ -680,14 +686,18 @@ static int + i = -1; + } + +- pqueue_insert(s->d1->buffered_messages, item); ++ item = pqueue_insert(s->d1->buffered_messages, item); ++ /* pqueue_insert fails iff a duplicate item is inserted. ++ * However, |item| cannot be a duplicate. If it were, ++ * |pqueue_find|, above, would have returned it and control ++ * would never have reached this branch. */ ++ OPENSSL_assert(item != NULL); + } + + return DTLS1_HM_FRAGMENT_RETRY; + + err: +- if (frag != NULL) dtls1_hm_fragment_free(frag); +- if (item != NULL) OPENSSL_free(item); ++ if (frag != NULL && item == NULL) dtls1_hm_fragment_free(frag); + *ok = 0; + return i; + } +@@ -694,7 +704,7 @@ err: + + + static int +-dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok) ++dtls1_process_out_of_seq_message(SSL *s, const struct hm_header_st* msg_hdr, int *ok) + { + int i=-1; + hm_fragment *frag = NULL; +@@ -714,7 +724,7 @@ static int + /* If we already have an entry and this one is a fragment, + * don't discard it and rather try to reassemble it. + */ +- if (item != NULL && frag_len < msg_hdr->msg_len) ++ if (item != NULL && frag_len != msg_hdr->msg_len) + item = NULL; + + /* Discard the message if sequence number was already there, is +@@ -739,9 +749,12 @@ static int + } + else + { +- if (frag_len && frag_len < msg_hdr->msg_len) ++ if (frag_len != msg_hdr->msg_len) + return dtls1_reassemble_fragment(s, msg_hdr, ok); + ++ if (frag_len > dtls1_max_handshake_message_len(s)) ++ goto err; ++ + frag = dtls1_hm_fragment_new(frag_len, 0); + if ( frag == NULL) + goto err; +@@ -753,7 +766,9 @@ static int + /* read the body of the fragment (header has already been read) */ + i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE, + frag->fragment,frag_len,0); +- if (i<=0 || (unsigned long)i!=frag_len) ++ if ((unsigned long)i!=frag_len) ++ i = -1; ++ if (i<=0) + goto err; + } + +@@ -765,14 +780,21 @@ static int + if ( item == NULL) + goto err; + +- pqueue_insert(s->d1->buffered_messages, item); ++ item = pqueue_insert(s->d1->buffered_messages, item); ++ /* pqueue_insert fails iff a duplicate item is inserted. ++ * However, |item| cannot be a duplicate. If it were, ++ * |pqueue_find|, above, would have returned it. Then, either ++ * |frag_len| != |msg_hdr->msg_len| in which case |item| is set ++ * to NULL and it will have been processed with ++ * |dtls1_reassemble_fragment|, above, or the record will have ++ * been discarded. */ ++ OPENSSL_assert(item != NULL); + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Mon Sep 15 18:41:51 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94C735B1; Mon, 15 Sep 2014 18:41:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67EE3D82; Mon, 15 Sep 2014 18:41:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FIfpuH042622; Mon, 15 Sep 2014 18:41:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FIfp7c042620; Mon, 15 Sep 2014 18:41:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409151841.s8FIfp7c042620@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 15 Sep 2014 18:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271639 - in user/ngie/add-pjdfstest: lib/libc/sys sys/kern X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 18:41:51 -0000 Author: ngie Date: Mon Sep 15 18:41:50 2014 New Revision: 271639 URL: http://svnweb.freebsd.org/changeset/base/271639 Log: Validate the mode argument in access, eaccess, and faccessat for optional POSIX compliance and to improve compatibility with Linux and NetBSD The issue was identified with lib/libc/sys/t_access:access_inval from NetBSD Update the manpage accordingly PR: 181155 Reviewed by: jilles (code), jmmv (code), wblock (manpage), wollman (code) MFC after: 4 weeks Phabric: D678 (code), D786 (manpage) Sponsored by: EMC / Isilon Storage Division Modified: user/ngie/add-pjdfstest/lib/libc/sys/access.2 user/ngie/add-pjdfstest/sys/kern/vfs_syscalls.c Modified: user/ngie/add-pjdfstest/lib/libc/sys/access.2 ============================================================================== --- user/ngie/add-pjdfstest/lib/libc/sys/access.2 Mon Sep 15 18:09:30 2014 (r271638) +++ user/ngie/add-pjdfstest/lib/libc/sys/access.2 Mon Sep 15 18:41:50 2014 (r271639) @@ -133,8 +133,16 @@ and .Sh RETURN VALUES .Rv -std .Sh ERRORS -Access to the file is denied if: +.Fn access , +.Fn eaccess , +or +.Fn faccessat +will fail if: .Bl -tag -width Er +.It Bq Er EINVAL +The value of the +.Fa mode +argument is invalid. .It Bq Er ENOTDIR A component of the path prefix is not a directory. .It Bq Er ENAMETOOLONG Modified: user/ngie/add-pjdfstest/sys/kern/vfs_syscalls.c ============================================================================== --- user/ngie/add-pjdfstest/sys/kern/vfs_syscalls.c Mon Sep 15 18:09:30 2014 (r271638) +++ user/ngie/add-pjdfstest/sys/kern/vfs_syscalls.c Mon Sep 15 18:41:50 2014 (r271639) @@ -2055,6 +2055,9 @@ kern_accessat(struct thread *td, int fd, cap_rights_t rights; int error; + if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0) + return (EINVAL); + /* * Create and modify a temporary credential instead of one that * is potentially shared. From owner-svn-src-user@FreeBSD.ORG Mon Sep 15 18:43:57 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E37627F3; Mon, 15 Sep 2014 18:43:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF5F8DA7; Mon, 15 Sep 2014 18:43:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FIhvwo043080; Mon, 15 Sep 2014 18:43:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FIhvDk043079; Mon, 15 Sep 2014 18:43:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409151843.s8FIhvDk043079@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 15 Sep 2014 18:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271640 - user/ngie/add-pjdfstest/lib/libc/sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 18:43:58 -0000 Author: ngie Date: Mon Sep 15 18:43:57 2014 New Revision: 271640 URL: http://svnweb.freebsd.org/changeset/base/271640 Log: Bump .Dd for the content change done in r271639 PR: 181155 Sponsored by: EMC / Isilon Storage Division Modified: user/ngie/add-pjdfstest/lib/libc/sys/access.2 Modified: user/ngie/add-pjdfstest/lib/libc/sys/access.2 ============================================================================== --- user/ngie/add-pjdfstest/lib/libc/sys/access.2 Mon Sep 15 18:41:50 2014 (r271639) +++ user/ngie/add-pjdfstest/lib/libc/sys/access.2 Mon Sep 15 18:43:57 2014 (r271640) @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd September 15, 2014 .Dt ACCESS 2 .Os .Sh NAME From owner-svn-src-user@FreeBSD.ORG Mon Sep 15 19:07:27 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6087BDF4; Mon, 15 Sep 2014 19:07:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3177DFB7; Mon, 15 Sep 2014 19:07:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FJ7RT7053017; Mon, 15 Sep 2014 19:07:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FJ7PvE053008; Mon, 15 Sep 2014 19:07:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409151907.s8FJ7PvE053008@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 15 Sep 2014 19:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271642 - in user/ngie/checkdpadd-fixes/usr.bin/svn: svn svnadmin svndumpfilter svnlook svnmucc svnrdump svnserve svnsync svnversion X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 19:07:27 -0000 Author: ngie Date: Mon Sep 15 19:07:24 2014 New Revision: 271642 URL: http://svnweb.freebsd.org/changeset/base/271642 Log: Commit draft make checkdpadd fixes for usr.bin/svn/... Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svn/Makefile user/ngie/checkdpadd-fixes/usr.bin/svn/svnadmin/Makefile user/ngie/checkdpadd-fixes/usr.bin/svn/svndumpfilter/Makefile user/ngie/checkdpadd-fixes/usr.bin/svn/svnlook/Makefile user/ngie/checkdpadd-fixes/usr.bin/svn/svnmucc/Makefile user/ngie/checkdpadd-fixes/usr.bin/svn/svnrdump/Makefile user/ngie/checkdpadd-fixes/usr.bin/svn/svnserve/Makefile user/ngie/checkdpadd-fixes/usr.bin/svn/svnsync/Makefile user/ngie/checkdpadd-fixes/usr.bin/svn/svnversion/Makefile Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svn/Makefile ============================================================================== --- user/ngie/checkdpadd-fixes/usr.bin/svn/svn/Makefile Mon Sep 15 18:46:02 2014 (r271641) +++ user/ngie/checkdpadd-fixes/usr.bin/svn/svn/Makefile Mon Sep 15 19:07:24 2014 (r271642) @@ -24,25 +24,19 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -lbsdxml \ - -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt -lmagic -lcrypto -lssl -lpthread +LDFLAGS= -L${LIBSVN_CLIENTDIR} -L${LIBSVN_WCDIR} -L${LIBSVN_RADIR} \ + -L${LIBSVN_RA_LOCALDIR} -L${LIBSVN_RA_SVNDIR} -L${LIBSVN_RA_SERFDIR} \ + -L${LIBSVN_REPOSDIR} -L${LIBSVN_FSDIR} -L${LIBSVN_FS_FSDIR} \ + -L${LIBSVN_FS_UTILDIR} -L${LIBSVN_DELTADIR} -L${LIBSVN_DIFFDIR} \ + -L${LIBSVN_SUBRDIR} -L${LIBSERFDIR} -L${LIBAPR_UTILDIR} \ + -L${LIBAPRDIR} -L${LIBSQLITEDIR} \ + +LDADD= -lsvn_client -lsvn_wc -lsvn_ra -lsvn_ra_local \ + -lsvn_ra_svn -lsvn_ra_serf -lsvn_repos \ + -lsvn_fs -lsvn_fs_fs -lsvn_fs_util -lsvn_delta \ + -lsvn_diff -lsvn_subr -lserf -lapr-util \ + -lbsdxml -lapr -lsqlite3 -lz -lcrypt -lmagic \ + -lcrypto -lssl -lpthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \ ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} ${LIBSVN_REPOS} \ Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svnadmin/Makefile ============================================================================== --- user/ngie/checkdpadd-fixes/usr.bin/svn/svnadmin/Makefile Mon Sep 15 18:46:02 2014 (r271641) +++ user/ngie/checkdpadd-fixes/usr.bin/svn/svnadmin/Makefile Mon Sep 15 19:07:24 2014 (r271642) @@ -18,17 +18,12 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -lbsdxml \ - -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt +LDFLAGS= -L${LIBSVN_REPOSDIR} -L${LIBSVN_FSDIR} -L${LIBSVN_FS_FSDIR} \ + -L${LIBSVN_FS_UTILDIR} -L${LIBSVN_DELTADIR} -L${LIBSVN_SUBRDIR} \ + -L${LIBAPR_UTILDIR} -L${LIBAPRDIR} -L${LIBSQLITEDIR} \ + +LDADD= -lsvn_repos -lsvn_fs -lsvn_fs_fs -lsvn_fs_util -lsvn_delta \ + -lsvn_subr -lapr-util -lbsdxml -lapr -lsqlite3 -lz -lcrypt \ DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_SUBR} ${LIBAPR_UTIL} \ Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svndumpfilter/Makefile ============================================================================== --- user/ngie/checkdpadd-fixes/usr.bin/svn/svndumpfilter/Makefile Mon Sep 15 18:46:02 2014 (r271641) +++ user/ngie/checkdpadd-fixes/usr.bin/svn/svndumpfilter/Makefile Mon Sep 15 19:07:24 2014 (r271642) @@ -18,17 +18,12 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -lbsdxml \ - -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt +LDFLAGS=-L${LIBSVN_REPOSDIR} -L${LIBSVN_FSDIR} -L${LIBSVN_FS_FSDIR} \ + -L${LIBSVN_FS_UTILDIR} -L${LIBSVN_DELTADIR} -L${LIBSVN_SUBRDIR} \ + -L${LIBAPR_UTILDIR} -L${LIBAPRDIR} -L${LIBSQLITEDIR} + +LDADD= -lsvn_repos -lsvn_fs -lsvn_fs_fs -lsvn_fs_util -lsvn_delta -lsvn_subr \ + -lapr-util -lbsdxml -lapr -lsqlite3 -lz -lcrypt DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_SUBR} ${LIBAPR_UTIL} \ Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svnlook/Makefile ============================================================================== --- user/ngie/checkdpadd-fixes/usr.bin/svn/svnlook/Makefile Mon Sep 15 18:46:02 2014 (r271641) +++ user/ngie/checkdpadd-fixes/usr.bin/svn/svnlook/Makefile Mon Sep 15 19:07:24 2014 (r271642) @@ -18,18 +18,13 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -lbsdxml \ - -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt +LDFLAGS=-L${LIBSVN_REPOSDIR} -L${LIBSVN_FSDIR} -L${LIBSVN_FS_FSDIR} \ + -L${LIBSVN_FS_UTILDIR} -L${LIBSVN_DELTADIR} -L${LIBSVN_DIFFDIR} \ + -L${LIBSVN_SUBRDIR} -L${LIBAPR_UTILDIR} -L${LIBAPRDIR} \ + -L${LIBSQLITEDIR} + +LDADD= -lsvn_repos -lsvn_fs -lsvn_fs_fs -lsvn_fs_util -lsvn_delta -lsvn_diff \ + -lsvn_subr -lapr-util -lbsdxml -lapr -lsqlite3 -lz -lcrypt DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_DIFF} ${LIBSVN_SUBR} ${LIBAPR_UTIL} \ Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svnmucc/Makefile ============================================================================== --- user/ngie/checkdpadd-fixes/usr.bin/svn/svnmucc/Makefile Mon Sep 15 18:46:02 2014 (r271641) +++ user/ngie/checkdpadd-fixes/usr.bin/svn/svnmucc/Makefile Mon Sep 15 19:07:24 2014 (r271642) @@ -18,23 +18,16 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -lbsdxml \ - -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt -lmagic -lcrypto -lssl -lpthread +LDFLAGS=-L${LIBSVN_CLIENTDIR} -L${LIBSVN_RADIR} -L${LIBSVN_RA_LOCALDIR} \ + -L${LIBSVN_RA_SVNDIR} -L${LIBSVN_RA_SERFDIR} -L${LIBSVN_REPOSDIR} \ + -L${LIBSVN_FSDIR} -L${LIBSVN_FS_FSDIR} -L${LIBSVN_FS_UTILDIR} \ + -L${LIBSVN_DELTADIR} -L${LIBSVN_SUBRDIR} -L${LIBSERFDIR} \ + -L${LIBAPR_UTILDIR} -L${LIBAPRDIR} -L${LIBSQLITEDIR} + +LDADD= -lsvn_client -lsvn_ra -lsvn_ra_local -lsvn_ra_svn -lsvn_ra_serf \ + -lsvn_repos -lsvn_fs -lsvn_fs_fs -lsvn_fs_util -lsvn_delta -lsvn_subr \ + -lserf -lapr-util -lbsdxml -lapr -lsqlite3 -lz -lcrypt -lmagic \ + -lcrypto -lssl -lpthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} \ ${LIBSVN_RA_SERF} ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} \ Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svnrdump/Makefile ============================================================================== --- user/ngie/checkdpadd-fixes/usr.bin/svn/svnrdump/Makefile Mon Sep 15 18:46:02 2014 (r271641) +++ user/ngie/checkdpadd-fixes/usr.bin/svn/svnrdump/Makefile Mon Sep 15 19:07:24 2014 (r271642) @@ -18,25 +18,17 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -lbsdxml \ - -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt -lmagic -lcrypto -lssl -lpthread +LDFLAGS=-L${LIBSVN_CLIENTDIR} -L${LIBSVN_WCDIR} -L${LIBSVN_RADIR} \ + -L${LIBSVN_RA_LOCALDIR} -L${LIBSVN_RA_SVNDIR} -L${LIBSVN_RA_SERFDIR} \ + -L${LIBSVN_REPOSDIR} -L${LIBSVN_FSDIR} -L${LIBSVN_FS_FSDIR} \ + -L${LIBSVN_FS_UTILDIR} -L${LIBSVN_DELTADIR} -L${LIBSVN_DIFFDIR} \ + -L${LIBSVN_SUBRDIR} -L${LIBSERFDIR} -L${LIBAPR_UTILDIR} \ + -L${LIBAPRDIR} -L${LIBSQLITEDIR} + +LDADD= -lsvn_client -lsvn_wc -lsvn_ra -lsvn_ra_local -lsvn_ra_svn \ + -lsvn_ra_serf -lsvn_repos -lsvn_fs -lsvn_fs_fs -lsvn_fs_util \ + -lsvn_delta -lsvn_diff -lsvn_subr -lserf -lapr-util -lbsdxml \ + -lapr -lsqlite3 -lz -lcrypt -lmagic -lcrypto -lssl -lpthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \ ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} ${LIBSVN_REPOS} \ Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svnserve/Makefile ============================================================================== --- user/ngie/checkdpadd-fixes/usr.bin/svn/svnserve/Makefile Mon Sep 15 18:46:02 2014 (r271641) +++ user/ngie/checkdpadd-fixes/usr.bin/svn/svnserve/Makefile Mon Sep 15 19:07:24 2014 (r271642) @@ -18,22 +18,16 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -lbsdxml \ - -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt -lmagic -lcrypto -lssl -lpthread +LDFLAGS=-L${LIBSVN_RADIR} -L${LIBSVN_RA_LOCALDIR} -L${LIBSVN_RA_SVNDIR} \ + -L${LIBSVN_RA_SERFDIR} -L${LIBSVN_REPOSDIR} -L${LIBSVN_FSDIR} \ + -L${LIBSVN_FS_FSDIR} -L${LIBSVN_FS_UTILDIR} -L${LIBSVN_DELTADIR} \ + -L${LIBSVN_SUBRDIR} -L${LIBSERFDIR} -L${LIBAPR_UTILDIR} \ + -L${LIBAPRDIR} -L${LIBSQLITEDIR} + +LDADD= -lsvn_ra -lsvn_ra_local -lsvn_ra_svn -lsvn_ra_serf -lsvn_repos \ + -lsvn_fs -lsvn_fs_fs -lsvn_fs_util -lsvn_delta -lsvn_subr -lserf \ + -lapr-util -lbsdxml -lapr -lsqlite3 -lz -lcrypt -lmagic -lcrypto \ + -lssl -lpthread DPADD= ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} \ ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svnsync/Makefile ============================================================================== --- user/ngie/checkdpadd-fixes/usr.bin/svn/svnsync/Makefile Mon Sep 15 18:46:02 2014 (r271641) +++ user/ngie/checkdpadd-fixes/usr.bin/svn/svnsync/Makefile Mon Sep 15 19:07:24 2014 (r271642) @@ -18,22 +18,16 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -lbsdxml \ - -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt -lmagic -lcrypto -lssl -lpthread +LDFLAGS=-L${LIBSVN_RADIR} -L${LIBSVN_RA_LOCALDIR} -L${LIBSVN_RA_SVNDIR} \ + -L${LIBSVN_RA_SERFDIR} -L${LIBSVN_REPOSDIR} -L${LIBSVN_FSDIR} \ + -L${LIBSVN_FS_FSDIR} -L${LIBSVN_FS_UTILDIR} -L${LIBSVN_DELTADIR} \ + -L${LIBSVN_SUBRDIR} -L${LIBSERFDIR} -L${LIBAPR_UTILDIR} \ + -L${LIBAPRDIR} -L${LIBSQLITEDIR} + +LDADD= -lsvn_ra -lsvn_ra_local -lsvn_ra_svn -lsvn_ra_serf -lsvn_repos \ + -lsvn_fs -lsvn_fs_fs -lsvn_fs_util -lsvn_delta -lsvn_subr -lserf \ + -lapr-util -lbsdxml -lapr -lsqlite3 -lz -lcrypt -lmagic -lcrypto \ + -lssl -lpthread DPADD= ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} \ ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: user/ngie/checkdpadd-fixes/usr.bin/svn/svnversion/Makefile ============================================================================== --- user/ngie/checkdpadd-fixes/usr.bin/svn/svnversion/Makefile Mon Sep 15 18:46:02 2014 (r271641) +++ user/ngie/checkdpadd-fixes/usr.bin/svn/svnversion/Makefile Mon Sep 15 19:07:24 2014 (r271642) @@ -18,15 +18,12 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -lbsdxml \ - -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt +LDFLAGS=-L${LIBSVN_WCDIR} -L${LIBSVN_DELTADIR} -L${LIBSVN_DIFFDIR} \ + -L${LIBSVN_SUBRDIR} -L${LIBAPR_UTILDIR} -L${LIBAPRDIR} \ + -L${LIBSQLITEDIR} + +LDADD= -lsvn_wc -lsvn_delta -lsvn_diff -lsvn_subr -lserf -lapr-util -lbsdxml \ + -lapr -lsqlite3 -lz -lcrypt DPADD= ${LIBSVN_WC} ${LIBSVN_DELTA} ${LIBSVN_DIFF} ${LIBSVN_SUBR} \ ${LIBSERF} ${LIBAPR_UTIL} ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} \ From owner-svn-src-user@FreeBSD.ORG Mon Sep 15 23:43:04 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39545FBD; Mon, 15 Sep 2014 23:43:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1991A1DC; Mon, 15 Sep 2014 23:43:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FNh3nn083431; Mon, 15 Sep 2014 23:43:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FNh1Tb083412; Mon, 15 Sep 2014 23:43:01 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201409152343.s8FNh1Tb083412@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 15 Sep 2014 23:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271652 - in user/ae/inet6: sys/net sys/netinet sys/netinet6 sys/netipsec tools/tools/ipv6sasdebug X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 23:43:04 -0000 Author: ae Date: Mon Sep 15 23:43:01 2014 New Revision: 271652 URL: http://svnweb.freebsd.org/changeset/base/271652 Log: Fix build after merge. Modified: user/ae/inet6/sys/net/rtsock.c user/ae/inet6/sys/netinet/sctp_asconf.c user/ae/inet6/sys/netinet/sctp_output.c user/ae/inet6/sys/netinet/sctp_pcb.c user/ae/inet6/sys/netinet/sctp_sysctl.c user/ae/inet6/sys/netinet/sctp_usrreq.c user/ae/inet6/sys/netinet/sctputil.c user/ae/inet6/sys/netinet6/in6_src.c user/ae/inet6/sys/netipsec/xform_ipip.c user/ae/inet6/tools/tools/ipv6sasdebug/stub.h Modified: user/ae/inet6/sys/net/rtsock.c ============================================================================== --- user/ae/inet6/sys/net/rtsock.c Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/sys/net/rtsock.c Mon Sep 15 23:43:01 2014 (r271652) @@ -515,6 +515,7 @@ static int in6_rt_handle_lla(struct rt_msghdr **ortm, struct rt_addrinfo *info) { struct sockaddr_dl sdl; + struct walkarg w; struct sockaddr_in6 *sin6; struct rt_msghdr *rtm = *ortm; struct llentry *lle; @@ -551,7 +552,7 @@ in6_rt_handle_lla(struct rt_msghdr **ort rtm->rtm_flags |= RTF_STATIC; rtm->rtm_rmx.rmx_expire = 0; } else - rtm->rtm_rmx.rmx_expire = lle->la_expire; + rtm->rtm_rmx.rmx_expire = lle->la_expire; /* XXX */ LLE_RUNLOCK(lle); } else info->rti_info[RTAX_GATEWAY] = ifp->if_addr->ifa_addr; @@ -559,16 +560,18 @@ in6_rt_handle_lla(struct rt_msghdr **ort rtm->rtm_index = ifp->if_index; if (rtm->rtm_addrs & (RTA_IFA | RTA_IFP)) info->rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr; - i = rt_msg2(rtm->rtm_type, info, NULL, NULL); + rtsock_msg_buffer(rtm->rtm_type, info, NULL, &i); if (i > rtm->rtm_msglen) { - R_Malloc(rtm, struct rt_msghdr *, i); + rtm = malloc(i, M_TEMP, M_NOWAIT); if (rtm == NULL) return (ENOBUFS); bcopy(*ortm, rtm, i); - Free(*ortm); + free(*ortm, M_TEMP); *ortm = rtm; } - rt_msg2(rtm->rtm_type, info, (caddr_t)rtm, NULL); + w.w_tmem = (caddr_t)rtm; + w.w_tmemsize = i; + rtsock_msg_buffer(rtm->rtm_type, info, &w, &i); rtm->rtm_addrs = info->rti_addrs; return (0); } @@ -582,6 +585,7 @@ route_output(struct mbuf *m, struct sock struct rtentry *rt = NULL; struct radix_node_head *rnh; struct rt_addrinfo info; + struct sockaddr_storage ss; int alloc_len = 0, len, error = 0, fibnum; struct ifnet *ifp = NULL; union sockaddr_union saun; @@ -1110,7 +1114,7 @@ rtsock_msg_buffer(int type, struct rt_ad { caddr_t cp = NULL; struct rt_msghdr *rtm = NULL; - int len, i, second_time = 0; + int len, i, buflen = 0; switch (type) { Modified: user/ae/inet6/sys/netinet/sctp_asconf.c ============================================================================== --- user/ae/inet6/sys/netinet/sctp_asconf.c Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/sys/netinet/sctp_asconf.c Mon Sep 15 23:43:01 2014 (r271652) @@ -1884,7 +1884,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * #ifdef INET6 case AF_INET6: if (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &ifa->address.sin6.sin6_addr) != 0) { + &ifa->address.sin6) != 0) { return; } break; @@ -2121,7 +2121,7 @@ sctp_asconf_iterator_stcb(struct sctp_in continue; } if (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { continue; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { @@ -2509,7 +2509,7 @@ sctp_find_valid_localaddr(struct sctp_tc continue; } if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { continue; } if (stcb->asoc.scope.local_scope == 0 && @@ -3129,7 +3129,7 @@ sctp_check_address_list_all(struct sctp_ case AF_INET6: sin6 = &sctp_ifa->address.sin6; if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { continue; } if ((local_scope == 0) && @@ -3433,7 +3433,7 @@ sctp_asconf_send_nat_state_update(struct case AF_INET6: to6 = &sctp_ifap->address.sin6; if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, - &to6->sin6_addr) != 0) { + to6) != 0) { continue; } if (IN6_IS_ADDR_LOOPBACK(&to6->sin6_addr)) { Modified: user/ae/inet6/sys/netinet/sctp_output.c ============================================================================== --- user/ae/inet6/sys/netinet/sctp_output.c Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/sys/netinet/sctp_output.c Mon Sep 15 23:43:01 2014 (r271652) @@ -2072,7 +2072,7 @@ sctp_add_addresses_to_i_ia(struct sctp_i #ifdef INET6 if ((sctp_ifap->address.sa.sa_family == AF_INET6) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sctp_ifap->address.sin6.sin6_addr) != 0)) { + &sctp_ifap->address.sin6) != 0)) { continue; } #endif @@ -2115,7 +2115,7 @@ skip_count: #ifdef INET6 if ((sctp_ifap->address.sa.sa_family == AF_INET6) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sctp_ifap->address.sin6.sin6_addr) != 0)) { + &sctp_ifap->address.sin6) != 0)) { continue; } #endif @@ -2493,7 +2493,7 @@ sctp_choose_boundspecific_inp(struct sct #ifdef INET6 if ((sctp_ifa->address.sa.sa_family == AF_INET6) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sctp_ifa->address.sin6.sin6_addr) != 0)) { + &sctp_ifa->address.sin6) != 0)) { continue; } #endif @@ -2630,7 +2630,7 @@ sctp_choose_boundspecific_stcb(struct sc #ifdef INET6 if ((sctp_ifa->address.sa.sa_family == AF_INET6) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sctp_ifa->address.sin6.sin6_addr) != 0)) { + &sctp_ifa->address.sin6) != 0)) { continue; } #endif @@ -2664,7 +2664,7 @@ sctp_choose_boundspecific_stcb(struct sc #ifdef INET6 if ((sctp_ifa->address.sa.sa_family == AF_INET6) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sctp_ifa->address.sin6.sin6_addr) != 0)) { + &sctp_ifa->address.sin6) != 0)) { continue; } #endif @@ -2804,7 +2804,7 @@ sctp_select_nth_preferred_addr_from_ifn_ #ifdef INET6 if ((ifa->address.sa.sa_family == AF_INET6) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &ifa->address.sin6.sin6_addr) != 0)) { + &ifa->address.sin6) != 0)) { continue; } #endif @@ -2915,7 +2915,7 @@ sctp_count_num_preferred_boundall(struct if ((ifa->address.sa.sa_family == AF_INET6) && (stcb != NULL) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &ifa->address.sin6.sin6_addr) != 0)) { + &ifa->address.sin6) != 0)) { continue; } #endif @@ -3125,7 +3125,7 @@ again_with_private_addresses_allowed: #ifdef INET6 if ((sctp_ifa->address.sa.sa_family == AF_INET6) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sctp_ifa->address.sin6.sin6_addr) != 0)) { + &sctp_ifa->address.sin6) != 0)) { SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jailed\n"); continue; } @@ -3190,7 +3190,7 @@ plan_d: #ifdef INET6 if ((sctp_ifa->address.sa.sa_family == AF_INET6) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sctp_ifa->address.sin6.sin6_addr) != 0)) { + &sctp_ifa->address.sin6) != 0)) { continue; } #endif @@ -3254,7 +3254,7 @@ out: #ifdef INET6 if ((sctp_ifa->address.sa.sa_family == AF_INET6) && (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sctp_ifa->address.sin6.sin6_addr) != 0)) { + &sctp_ifa->address.sin6) != 0)) { continue; } #endif Modified: user/ae/inet6/sys/netinet/sctp_pcb.c ============================================================================== --- user/ae/inet6/sys/netinet/sctp_pcb.c Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/sys/netinet/sctp_pcb.c Mon Sep 15 23:43:01 2014 (r271652) @@ -920,7 +920,7 @@ sctp_does_stcb_own_this_addr(struct sctp sin6 = &sctp_ifa->address.sin6; rsin6 = (struct sockaddr_in6 *)to; if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { continue; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { @@ -1092,7 +1092,7 @@ sctp_tcb_special_locate(struct sctp_inpc sin6 = (struct sockaddr_in6 *)to; if (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { SCTP_INP_RUNLOCK(inp); continue; } @@ -1701,7 +1701,7 @@ sctp_endpoint_probe(struct sockaddr *nam continue; } if (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { SCTP_INP_RUNLOCK(inp); continue; } Modified: user/ae/inet6/sys/netinet/sctp_sysctl.c ============================================================================== --- user/ae/inet6/sys/netinet/sctp_sysctl.c Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/sys/netinet/sctp_sysctl.c Mon Sep 15 23:43:01 2014 (r271652) @@ -275,7 +275,7 @@ sctp_sysctl_copy_out_local_addresses(str if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) continue; if (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { continue; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { Modified: user/ae/inet6/sys/netinet/sctp_usrreq.c ============================================================================== --- user/ae/inet6/sys/netinet/sctp_usrreq.c Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/sys/netinet/sctp_usrreq.c Mon Sep 15 23:43:01 2014 (r271652) @@ -1243,7 +1243,7 @@ sctp_fill_up_addresses_vrf(struct sctp_i continue; } if (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { continue; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { @@ -5526,7 +5526,7 @@ sctp_setopt(struct socket *so, int optna sin6 = (struct sockaddr_in6 *)&sspp->sspp_addr; if (prison_check_ip6(inp->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; goto out_of_it; Modified: user/ae/inet6/sys/netinet/sctputil.c ============================================================================== --- user/ae/inet6/sys/netinet/sctputil.c Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/sys/netinet/sctputil.c Mon Sep 15 23:43:01 2014 (r271652) @@ -6743,7 +6743,7 @@ sctp_local_addr_count(struct sctp_tcb *s continue; } if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, - &sin6->sin6_addr) != 0) { + sin6) != 0) { continue; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { Modified: user/ae/inet6/sys/netinet6/in6_src.c ============================================================================== --- user/ae/inet6/sys/netinet6/in6_src.c Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/sys/netinet6/in6_src.c Mon Sep 15 23:43:01 2014 (r271652) @@ -169,9 +169,11 @@ struct dstaddr_props { #define REPLACE(r) { rule = r; goto replace; } #define NEXT(r) { rule = r; goto next; } -#ifndef IPV6SASDEBUG + +#ifndef IPV6_SASDEBUG #define IPV6SASDEBUG(fmt, ...) #else +#define IPV6SASDEBUG(fmt, ...) printf("%s: " fmt "\n", __func__, ##__VA_ARGS__) static char *srcrule_str[IP6S_RULESMAX] = { "Rule 0: first candidate", "Rule 1: prefer same address", @@ -197,7 +199,7 @@ srcaddrcmp(struct srcaddr_choice *c, str struct dstaddr_props *dst, struct ucred *cred, struct ip6_pktopts *opts) { -#if defined(IPV6SASDEBUG) +#ifdef IPV6_SASDEBUG char buf[INET6_ADDRSTRLEN]; #endif int srcscope, rule, label, prefer_tempaddr, prefixlen; @@ -496,7 +498,7 @@ in6_selectsrc(struct sockaddr_in6 *dst, struct inpcb *inp, struct route_in6 *ro, struct ucred *cred, struct ifnet **ifpp, struct in6_addr *srcp) { -#if defined(IPV6SASDEBUG) +#ifdef IPV6_SASDEBUG char buf[INET6_ADDRSTRLEN]; #endif struct route_in6 ro6; Modified: user/ae/inet6/sys/netipsec/xform_ipip.c ============================================================================== --- user/ae/inet6/sys/netipsec/xform_ipip.c Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/sys/netipsec/xform_ipip.c Mon Sep 15 23:43:01 2014 (r271652) @@ -487,7 +487,7 @@ ipip_output( ip6o->ip6_src = saidx->src.sin6.sin6_addr; /* Fix payload length */ - ip6o->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6)); + ip6o->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6o)); switch (tp) { #ifdef INET Modified: user/ae/inet6/tools/tools/ipv6sasdebug/stub.h ============================================================================== --- user/ae/inet6/tools/tools/ipv6sasdebug/stub.h Mon Sep 15 23:21:57 2014 (r271651) +++ user/ae/inet6/tools/tools/ipv6sasdebug/stub.h Mon Sep 15 23:43:01 2014 (r271652) @@ -161,7 +161,7 @@ struct in6_addrpolicy { struct ucred { }; -#define IPV6SASDEBUG(fmt, ...) printf("%s: " fmt "\n", __func__, ##__VA_ARGS__) +#define IPV6_SASDEBUG #define KASSERT(exp, msg) #define RO_RTFREE(ro) #define RTFREE(rt) From owner-svn-src-user@FreeBSD.ORG Thu Sep 18 14:16:15 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8075EE45; Thu, 18 Sep 2014 14:16:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 609BCB7D; Thu, 18 Sep 2014 14:16:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEGFOa060112; Thu, 18 Sep 2014 14:16:15 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEGFAi060110; Thu, 18 Sep 2014 14:16:15 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201409181416.s8IEGFAi060110@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Thu, 18 Sep 2014 14:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271765 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 14:16:15 -0000 Author: pho Date: Thu Sep 18 14:16:14 2014 New Revision: 271765 URL: http://svnweb.freebsd.org/changeset/base/271765 Log: Two mmap(2) regression tests added. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/mmap10.sh (contents, props changed) user/pho/stress2/misc/mmap11.sh (contents, props changed) Added: user/pho/stress2/misc/mmap10.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mmap10.sh Thu Sep 18 14:16:14 2014 (r271765) @@ -0,0 +1,268 @@ +#!/bin/sh + +# +# Copyright (c) 2014 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# "panic: vm_page_dirty: page is invalid!" seen. +# http://people.freebsd.org/~pho/stress/log/mmap10.txt +# No problems seen after r271681. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > mmap10.c +cc -o mmap10 -Wall -Wextra -O2 -g mmap10.c -lpthread || exit 1 +rm -f mmap10.c + +daemon sh -c "(cd $here/../testcases/swap; ./swap -t 2m -i 20 -k)" +rnd=`od -An -N1 -t u1 /dev/random | sed 's/ //g'` +sleep $((rnd % 10)) +for i in `jot 2`; do + /tmp/mmap10 +done +killall -q swap + +rm -f /tmp/mmap10 /tmp/mmap10.core +exit 0 +EOF +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOOPS 2 +#define N (128 * 1024 / (int)sizeof(u_int32_t)) +#define PARALLEL 50 + +void *p; +u_int32_t r[N]; + +unsigned long +makearg(void) +{ + unsigned long val; + unsigned int i; + + val = arc4random(); + i = arc4random() % 100; + if (i < 20) + val = val & 0xff; + if (i >= 20 && i < 40) + val = val & 0xffff; + if (i >= 40 && i < 60) + val = (unsigned long)(r) | (val & 0xffff); +#if defined(__LP64__) + if (i >= 60) { + val = (val << 32) | arc4random(); + if (i > 80) + val = val & 0x00007fffffffffffUL; + } +#endif + + return(val); +} + +void * +makeptr(void) +{ + unsigned long val; + + if (p != MAP_FAILED && p != NULL) + val = (unsigned long)p + arc4random(); + else + val = makearg(); + val = trunc_page(val); + + return ((void *)val); +} + +void * +tmmap(void *arg __unused) +{ + size_t len; + int i, fd; + + pthread_set_name_np(pthread_self(), __func__); + len = 1LL * 1024 * 1024 * 1024; + + for (i = 0; i < 100; i++) { + if ((fd = open("/dev/zero", O_CREAT | O_TRUNC | O_RDWR, + 0622)) == -1) + err(1,"open()"); + + if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, + fd, 0)) != MAP_FAILED) { + usleep(100); + munmap(p, len); + } + + if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_ANON, + -1, 0)) != MAP_FAILED) { + usleep(100); + munmap(p, len); + } + close(fd); + } + + return (NULL); +} + +void * +tmlock(void *arg __unused) +{ + size_t len; + int i, n; + + pthread_set_name_np(pthread_self(), __func__); + n = 0; + for (i = 0; i < 200; i++) { + len = trunc_page(makearg()); + if (mlock(makeptr(), len) == 0) + n++; + len = trunc_page(makearg()); + if (arc4random() % 100 < 50) + if (munlock(makeptr(), len) == 0) + n++; + } + if (n < 10) + fprintf(stderr, "Note: tmlock() only succeeded %d times.\n", + n); + + return (NULL); +} + +void * +tmprotect(void *arg __unused) +{ + size_t len; + const void *addr; + int i, n, prot; + + pthread_set_name_np(pthread_self(), __func__); + n = 0; + for (i = 0; i < 200; i++) { + addr = makeptr(); + len = trunc_page(makearg()); + prot = makearg(); + if (mprotect(addr, len, prot) == 0) + n++; + usleep(1000); + } + if (n < 10) + fprintf(stderr, "Note: tmprotect() only succeeded %d times.\n", + n); + + return (NULL); +} + +void * +tmlockall(void *arg __unused) +{ + int flags, i, n; + + pthread_set_name_np(pthread_self(), __func__); + n = 0; + for (i = 0; i < 200; i++) { + flags = makearg(); + if (mlockall(flags) == 0) + n++; + usleep(100); + munlockall(); + usleep(1000); + } + if (n < 10) + fprintf(stderr, "Note: tmlockall() only succeeded %d times.\n", + n); + + return (NULL); +} + +void +test(void) +{ + pthread_t tid[4]; + int i, rc; + + if ((rc = pthread_create(&tid[0], NULL, tmmap, NULL)) != 0) + errc(1, rc, "tmmap()"); + if ((rc = pthread_create(&tid[1], NULL, tmlock, NULL)) != 0) + errc(1, rc, "tmlock()"); + if ((rc = pthread_create(&tid[2], NULL, tmprotect, NULL)) != 0) + errc(1, rc, "tmprotect()"); + if ((rc = pthread_create(&tid[3], NULL, tmlockall, NULL)) != 0) + errc(1, rc, "tmlockall()"); + + for (i = 0; i < 100; i++) { + if (fork() == 0) { + usleep(10000); + _exit(0); + } + wait(NULL); + } + + for (i = 0; i < 4; i++) + if ((rc = pthread_join(tid[i], NULL)) != 0) + errc(1, rc, "pthread_join(%d)", i); + _exit(0); +} + +int +main(void) +{ + int i, j; + + for (i = 0; i < N; i++) + r[i] = arc4random(); + + for (i = 0; i < LOOPS; i++) { + for (j = 0; j < PARALLEL; j++) { + if (fork() == 0) + test(); + } + + for (j = 0; j < PARALLEL; j++) + wait(NULL); + } + + return (0); +} Added: user/pho/stress2/misc/mmap11.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mmap11.sh Thu Sep 18 14:16:14 2014 (r271765) @@ -0,0 +1,294 @@ +#!/bin/sh + +# +# Copyright (c) 2014 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Copy of mmap10.sh with msync() added. +# "panic: vm_map_protect: inaccessible wired map entry" seen: +# http://people.freebsd.org/~pho/stress/log/mmap11.txt +# No problems seen after r271681. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > mmap11.c +cc -o mmap11 -Wall -Wextra -O2 -g mmap11.c -lpthread || exit 1 +rm -f mmap11.c + +daemon sh -c "(cd $here/../testcases/swap; ./swap -t 2m -i 20 -k)" +rnd=`od -An -N1 -t u1 /dev/random | sed 's/ //g'` +sleep $((rnd % 10)) +for i in `jot 2`; do + /tmp/mmap11 +done +killall -q swap + +rm -f /tmp/mmap11 /tmp/mmap11.core +exit 0 +EOF +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOOPS 2 +#define N (128 * 1024 / (int)sizeof(u_int32_t)) +#define PARALLEL 50 + +void *p; +u_int32_t r[N]; + +unsigned long +makearg(void) +{ + unsigned long val; + unsigned int i; + + val = arc4random(); + i = arc4random() % 100; + if (i < 20) + val = val & 0xff; + if (i >= 20 && i < 40) + val = val & 0xffff; + if (i >= 40 && i < 60) + val = (unsigned long)(r) | (val & 0xffff); +#if defined(__LP64__) + if (i >= 60) { + val = (val << 32) | arc4random(); + if (i > 80) + val = val & 0x00007fffffffffffUL; + } +#endif + + return(val); +} + +void * +makeptr(void) +{ + unsigned long val; + + if (p != MAP_FAILED && p != NULL) + val = (unsigned long)p + arc4random(); + else + val = makearg(); + val = trunc_page(val); + + return ((void *)val); +} + +void * +tmmap(void *arg __unused) +{ + size_t len; + int i, fd; + + pthread_set_name_np(pthread_self(), __func__); + len = 1LL * 1024 * 1024 * 1024; + + for (i = 0; i < 100; i++) { + if ((fd = open("/dev/zero", O_CREAT | O_TRUNC | O_RDWR, + 0622)) == -1) + err(1,"open()"); + + if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, + fd, 0)) != MAP_FAILED) { + usleep(100); + munmap(p, len); + } + + if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_ANON, + -1, 0)) != MAP_FAILED) { + usleep(100); + munmap(p, len); + } + close(fd); + } + + return (NULL); +} + +void * +tmlock(void *arg __unused) +{ + size_t len; + int i, n; + + pthread_set_name_np(pthread_self(), __func__); + n = 0; + for (i = 0; i < 200; i++) { + len = trunc_page(makearg()); + if (mlock(makeptr(), len) == 0) + n++; + len = trunc_page(makearg()); + if (arc4random() % 100 < 50) + if (munlock(makeptr(), len) == 0) + n++; + } + if (n < 10) + fprintf(stderr, "Note: tmlock() only succeeded %d times.\n", + n); + + return (NULL); +} + +void * +tmprotect(void *arg __unused) +{ + size_t len; + const void *addr; + int i, n, prot; + + pthread_set_name_np(pthread_self(), __func__); + n = 0; + for (i = 0; i < 200; i++) { + addr = makeptr(); + len = trunc_page(makearg()); + prot = makearg(); + if (mprotect(addr, len, prot) == 0) + n++; + usleep(1000); + } + if (n < 10) + fprintf(stderr, "Note: tmprotect() only succeeded %d times.\n", + n); + return (NULL); +} + +void * +tmlockall(void *arg __unused) +{ + int flags, i, n; + + pthread_set_name_np(pthread_self(), __func__); + n = 0; + for (i = 0; i < 200; i++) { + flags = makearg(); + if (mlockall(flags) == 0) + n++; + usleep(100); + munlockall(); + usleep(1000); + } + if (n < 10) + fprintf(stderr, "Note: tmlockall() only succeeded %d times.\n", + n); + + return (NULL); +} + +void * +tmsync(void *arg __unused) +{ + size_t len; + void *addr; + int flags, i, n; + + pthread_set_name_np(pthread_self(), __func__); + n = 0; + for (i = 0; i < 200; i++) { + addr = makeptr(); + len = trunc_page(makearg()); + flags = makearg(); + if (msync(addr, len, flags) == 0) + n++; + usleep(2000); + } + if (n < 10) + fprintf(stderr, "Note: tmsync() only succeeded %d times.\n", + n); + + return (NULL); +} + +void +test(void) +{ + pthread_t tid[5]; + int i, rc; + + if ((rc = pthread_create(&tid[0], NULL, tmmap, NULL)) != 0) + errc(1, rc, "tmmap()"); + if ((rc = pthread_create(&tid[1], NULL, tmlock, NULL)) != 0) + errc(1, rc, "tmlock()"); + if ((rc = pthread_create(&tid[2], NULL, tmprotect, NULL)) != 0) + errc(1, rc, "tmprotect()"); + if ((rc = pthread_create(&tid[3], NULL, tmlockall, NULL)) != 0) + errc(1, rc, "tmlockall()"); + if ((rc = pthread_create(&tid[3], NULL, tmsync, NULL)) != 0) + errc(1, rc, "tmlockall()"); + + for (i = 0; i < 100; i++) { + if (fork() == 0) { + usleep(10000); + _exit(0); + } + wait(NULL); + } + + for (i = 0; i < 5; i++) + if ((rc = pthread_join(tid[i], NULL)) != 0) + errc(1, rc, "pthread_join(%d)", i); + _exit(0); +} + +int +main(void) +{ + int i, j; + + for (i = 0; i < N; i++) + r[i] = arc4random(); + + for (i = 0; i < LOOPS; i++) { + for (j = 0; j < PARALLEL; j++) { + if (fork() == 0) + test(); + } + + for (j = 0; j < PARALLEL; j++) + wait(NULL); + } + + return (0); +} From owner-svn-src-user@FreeBSD.ORG Thu Sep 18 15:26:13 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DA0210A; Thu, 18 Sep 2014 15:26:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 399057C8; Thu, 18 Sep 2014 15:26:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IFQDM2098281; Thu, 18 Sep 2014 15:26:13 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IFQDxF098280; Thu, 18 Sep 2014 15:26:13 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409181526.s8IFQDxF098280@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 18 Sep 2014 15:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271780 - user/gjb/thermite X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 15:26:13 -0000 Author: gjb Date: Thu Sep 18 15:26:12 2014 New Revision: 271780 URL: http://svnweb.freebsd.org/changeset/base/271780 Log: Defer running mk-vmimage.sh until after all normal (i.e., ISOs) bits are built. This eliminates a significant delay between the completion of the amd64 ISO creation and the start of the i386 build (more than one hour). Sponsored by: The FreeBSD Foundation Modified: user/gjb/thermite/thermite.sh Modified: user/gjb/thermite/thermite.sh ============================================================================== --- user/gjb/thermite/thermite.sh Thu Sep 18 15:10:22 2014 (r271779) +++ user/gjb/thermite/thermite.sh Thu Sep 18 15:26:12 2014 (r271780) @@ -250,11 +250,8 @@ build_release() { send_logmail ${logdir}/${_build}.log ${_build} - # Short circuit to skip vm image creation for non-x86 architectures. - # Also recreate the memstick.img for i386 while here. + # Recreate the memstick.img for i386 while here. case ${arch} in - amd64) - ;; i386) /bin/sh ${scriptdir}/remake-memstick.sh \ -c ${_conf} >> ${logdir}/${_build}.log @@ -263,6 +260,23 @@ build_release() { return 0 ;; esac + send_logmail ${logdir}/${_build}.log ${_build} + unset _build _conf +} + +build_vmimage() { + _build="${rev}-${arch}-${kernel}-${type}" + _conf="${scriptdir}/${_build}.conf" + source_config || return 0 + + case ${arch} in + amd64|i386) + # continue + ;; + *) + return 0 + ;; + esac case ${kernel} in GENERIC) info "Building vm image: ${_build}" @@ -386,6 +400,7 @@ main() { runall build_chroots runall install_chroots runall build_release + runall build_vmimage } main "$@"