From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 06:14:51 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60AC0233; Sun, 12 Oct 2014 06:14: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 4C62CB31; Sun, 12 Oct 2014 06:14: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 s9C6Epv4047135; Sun, 12 Oct 2014 06:14:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9C6EpCT047134; Sun, 12 Oct 2014 06:14:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410120614.s9C6EpCT047134@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 12 Oct 2014 06:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272977 - stable/10/sys/cam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 06:14:51 -0000 Author: mav Date: Sun Oct 12 06:14:50 2014 New Revision: 272977 URL: https://svnweb.freebsd.org/changeset/base/272977 Log: Use proper variable when looping through periphs with CAM_PERIPH_FREE. PR: 194256 Submitted by: Scott M. Ferris Sponsored by: EMC/Isilon Storage Division Modified: stable/10/sys/cam/cam_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Sun Oct 12 02:42:36 2014 (r272976) +++ stable/10/sys/cam/cam_xpt.c Sun Oct 12 06:14:50 2014 (r272977) @@ -2199,7 +2199,7 @@ xptperiphtraverse(struct cam_ed *device, next_periph = SLIST_NEXT(periph, periph_links); while (next_periph != NULL && (next_periph->flags & CAM_PERIPH_FREE) != 0) - next_periph = SLIST_NEXT(periph, periph_links); + next_periph = SLIST_NEXT(next_periph, periph_links); if (next_periph) next_periph->refcount++; mtx_unlock(&bus->eb_mtx); @@ -2273,7 +2273,7 @@ xptpdperiphtraverse(struct periph_driver next_periph = TAILQ_NEXT(periph, unit_links); while (next_periph != NULL && (next_periph->flags & CAM_PERIPH_FREE) != 0) - next_periph = TAILQ_NEXT(periph, unit_links); + next_periph = TAILQ_NEXT(next_periph, unit_links); if (next_periph) next_periph->refcount++; xpt_unlock_buses(); From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 16:46:04 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36443B29; Sun, 12 Oct 2014 16:46: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 21FF7C5F; Sun, 12 Oct 2014 16:46: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 s9CGk3iX048267; Sun, 12 Oct 2014 16:46:03 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CGk3H4048266; Sun, 12 Oct 2014 16:46:03 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121646.s9CGk3H4048266@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 16:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272985 - stable/10/contrib/ipfilter/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 16:46:04 -0000 Author: cy Date: Sun Oct 12 16:46:03 2014 New Revision: 272985 URL: https://svnweb.freebsd.org/changeset/base/272985 Log: MFC r271970 ipv6 address for test.hosts.dots in wrong byte order. Obtained from: ipfilter CVS repo (r1.11), netbsd CVS repo (r1.5) Modified: stable/10/contrib/ipfilter/lib/gethost.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/lib/gethost.c ============================================================================== --- stable/10/contrib/ipfilter/lib/gethost.c Sun Oct 12 15:49:52 2014 (r272984) +++ stable/10/contrib/ipfilter/lib/gethost.c Sun Oct 12 16:46:03 2014 (r272985) @@ -25,10 +25,10 @@ int gethost(family, name, hostp) } #ifdef USE_INET6 if (family == AF_INET6) { - hostp->i6[0] = 0xfe80aa55; - hostp->i6[1] = 0x12345678; - hostp->i6[2] = 0x5a5aa5a5; - hostp->i6[3] = 0xfedcba98; + hostp->i6[0] = htonl(0xfe80aa55); + hostp->i6[1] = htonl(0x12345678); + hostp->i6[2] = htonl(0x5a5aa5a5); + hostp->i6[3] = htonl(0xfedcba98); } #endif return 0; From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 16:48:23 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EE50D5B; Sun, 12 Oct 2014 16:48:23 +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 0B3ABC75; Sun, 12 Oct 2014 16:48:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CGmM5s048758; Sun, 12 Oct 2014 16:48:22 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CGmMZP048757; Sun, 12 Oct 2014 16:48:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121648.s9CGmMZP048757@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 16:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272986 - stable/10/contrib/ipfilter/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 16:48:23 -0000 Author: cy Date: Sun Oct 12 16:48:22 2014 New Revision: 272986 URL: https://svnweb.freebsd.org/changeset/base/272986 Log: MFC r271971 Fix ipfilter bug #553 gethost needs to zero entire IP address structure. Obtained from: ipfilter CVS repo (r1.11) Modified: stable/10/contrib/ipfilter/lib/gethost.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/lib/gethost.c ============================================================================== --- stable/10/contrib/ipfilter/lib/gethost.c Sun Oct 12 16:46:03 2014 (r272985) +++ stable/10/contrib/ipfilter/lib/gethost.c Sun Oct 12 16:48:22 2014 (r272986) @@ -19,6 +19,7 @@ int gethost(family, name, hostp) struct netent *n; u_32_t addr; + bzero(hostp, sizeof(*hostp)); if (!strcmp(name, "test.host.dots")) { if (family == AF_INET) { hostp->in4.s_addr = htonl(0xfedcba98); From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 16:51:03 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEB28EA5; Sun, 12 Oct 2014 16:51: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 DA329D0D; Sun, 12 Oct 2014 16:51: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 s9CGp2QI049690; Sun, 12 Oct 2014 16:51:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CGp2Rs049689; Sun, 12 Oct 2014 16:51:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121651.s9CGp2Rs049689@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 16:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272987 - stable/10/contrib/ipfilter/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 16:51:03 -0000 Author: cy Date: Sun Oct 12 16:51:02 2014 New Revision: 272987 URL: https://svnweb.freebsd.org/changeset/base/272987 Log: MFC r271972 Fix ipfilter bug #536 ipnat can try to print rule as dstlist incorrectly. Obtained from: ipfilter CVS repo (r1.14), netbsd CVS repo (r1.3) Modified: stable/10/contrib/ipfilter/lib/printnat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/lib/printnat.c ============================================================================== --- stable/10/contrib/ipfilter/lib/printnat.c Sun Oct 12 16:48:22 2014 (r272986) +++ stable/10/contrib/ipfilter/lib/printnat.c Sun Oct 12 16:51:02 2014 (r272987) @@ -153,7 +153,8 @@ printnat(np, opts) } else if (np->in_redir & NAT_REWRITE) { PRINTF(" -> src "); - if (np->in_nsrc.na_type == IPLT_DSTLIST) { + if (np->in_nsrc.na_atype == FRI_LOOKUP && + np->in_nsrc.na_type == IPLT_DSTLIST) { PRINTF("dstlist/"); if (np->in_nsrc.na_subtype == 0) PRINTF("%d", np->in_nsrc.na_num); @@ -174,7 +175,8 @@ printnat(np, opts) } } PRINTF(" dst "); - if (np->in_ndst.na_type == IPLT_DSTLIST) { + if (np->in_ndst.na_atype == FRI_LOOKUP && + np->in_ndst.na_type == IPLT_DSTLIST) { PRINTF("dstlist/"); if (np->in_ndst.na_subtype == 0) PRINTF("%d", np->in_nsrc.na_num); From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 16:55:27 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A93A1EC; Sun, 12 Oct 2014 16:55: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 9523BD3A; Sun, 12 Oct 2014 16:55: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 s9CGtROU053203; Sun, 12 Oct 2014 16:55:27 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CGtR1d053202; Sun, 12 Oct 2014 16:55:27 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121655.s9CGtR1d053202@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 16:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272988 - stable/10/contrib/ipfilter/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 16:55:27 -0000 Author: cy Date: Sun Oct 12 16:55:26 2014 New Revision: 272988 URL: https://svnweb.freebsd.org/changeset/base/272988 Log: MFC r271974 ipfilter bug #551 ipf.conf address structure not properly zero filled. Obtained from: ipfilter CVS repo (r1.37), netbsd CVS repo (r1.3) Modified: stable/10/contrib/ipfilter/tools/ipf_y.y Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/tools/ipf_y.y ============================================================================== --- stable/10/contrib/ipfilter/tools/ipf_y.y Sun Oct 12 16:51:02 2014 (r272987) +++ stable/10/contrib/ipfilter/tools/ipf_y.y Sun Oct 12 16:55:26 2014 (r272988) @@ -1020,12 +1020,13 @@ addr: pool '/' YY_NUMBER { pooled = 1; yyexpectaddr = 0; } ; -ipaddr: IPFY_ANY { bzero(&($$), sizeof($$)); +ipaddr: IPFY_ANY { memset(&($$), 0, sizeof($$)); $$.type = FRI_NORMAL; $$.ifpos = -1; yyexpectaddr = 0; } - | hostname { $$.a = $1.adr; + | hostname { memset(&($$), 0, sizeof($$)); + $$.a = $1.adr; $$.f = $1.f; if ($1.f == AF_INET6) fill6bits(128, $$.m.i6); @@ -1038,7 +1039,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof | hostname { yyresetdict(); } maskspace { yysetdict(maskwords); yyexpectaddr = 2; } - ipmask { ntomask($1.f, $5, $$.m.i6); + ipmask { memset(&($$), 0, sizeof($$)); + ntomask($1.f, $5, $$.m.i6); $$.a = $1.adr; $$.a.i6[0] &= $$.m.i6[0]; $$.a.i6[1] &= $$.m.i6[1]; @@ -1060,7 +1062,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof yyresetdict(); yyexpectaddr = 0; } - | '(' YY_STR ')' { $$.type = FRI_DYNAMIC; + | '(' YY_STR ')' { memset(&($$), 0, sizeof($$)); + $$.type = FRI_DYNAMIC; ifpflag = FRI_DYNAMIC; $$.ifpos = addname(&fr, $2); $$.lif = 0; @@ -1068,7 +1071,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof | '(' YY_STR ')' '/' { ifpflag = FRI_DYNAMIC; yysetdict(maskwords); } maskopts - { $$.type = ifpflag; + { memset(&($$), 0, sizeof($$)); + $$.type = ifpflag; $$.ifpos = addname(&fr, $2); $$.lif = 0; if (frc->fr_family == AF_UNSPEC) @@ -1083,7 +1087,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof | '(' YY_STR ':' YY_NUMBER ')' '/' { ifpflag = FRI_DYNAMIC; yysetdict(maskwords); } maskopts - { $$.type = ifpflag; + { memset(&($$), 0, sizeof($$)); + $$.type = ifpflag; $$.ifpos = addname(&fr, $2); $$.lif = $4; if (frc->fr_family == AF_UNSPEC) @@ -1142,30 +1147,35 @@ maskopts: ; hostname: - ipv4 { $$.adr.in4 = $1; + ipv4 { memset(&($$), 0, sizeof($$)); + $$.adr.in4 = $1; if (frc->fr_family == AF_INET6) YYERROR; $$.f = AF_INET; yyexpectaddr = 2; } - | YY_NUMBER { if (frc->fr_family == AF_INET6) + | YY_NUMBER { memset(&($$), 0, sizeof($$)); + if (frc->fr_family == AF_INET6) YYERROR; $$.adr.in4_addr = $1; $$.f = AF_INET; yyexpectaddr = 2; } - | YY_HEX { if (frc->fr_family == AF_INET6) + | YY_HEX { memset(&($$), 0, sizeof($$)); + if (frc->fr_family == AF_INET6) YYERROR; $$.adr.in4_addr = $1; $$.f = AF_INET; yyexpectaddr = 2; } - | YY_STR { if (lookuphost($1, &$$.adr) == 0) + | YY_STR { memset(&($$), 0, sizeof($$)); + if (lookuphost($1, &$$.adr) == 0) $$.f = AF_INET; free($1); yyexpectaddr = 2; } - | YY_IPV6 { if (frc->fr_family == AF_INET) + | YY_IPV6 { memset(&($$), 0, sizeof($$)); + if (frc->fr_family == AF_INET) YYERROR; $$.adr = $1; $$.f = AF_INET6; From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 16:58:46 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B860E27F; Sun, 12 Oct 2014 16:58:46 +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 A2571D5C; Sun, 12 Oct 2014 16:58:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CGwkMm053667; Sun, 12 Oct 2014 16:58:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CGwkPQ053666; Sun, 12 Oct 2014 16:58:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121658.s9CGwkPQ053666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 16:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272989 - stable/10/contrib/ipfilter/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 16:58:46 -0000 Author: cy Date: Sun Oct 12 16:58:45 2014 New Revision: 272989 URL: https://svnweb.freebsd.org/changeset/base/272989 Log: MFC r271977 3561691 gethost never returns an ipv6 address Obtained from: ipfilter CVS repo (r1.34), netbsd CVS repo (r1.4) Modified: stable/10/contrib/ipfilter/tools/ipnat_y.y Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/tools/ipnat_y.y ============================================================================== --- stable/10/contrib/ipfilter/tools/ipnat_y.y Sun Oct 12 16:55:26 2014 (r272988) +++ stable/10/contrib/ipfilter/tools/ipnat_y.y Sun Oct 12 16:58:45 2014 (r272989) @@ -1164,17 +1164,19 @@ hexnumber: hostname: YY_STR { i6addr_t addr; + int family; +#ifdef USE_INET6 + if (nat->in_v[0] == 6) + family = AF_INET6; + else +#endif + family = AF_INET; bzero(&$$, sizeof($$)); - if (gethost(AF_INET, $1, - &addr) == 0) { - $$.a = addr; - $$.f = AF_INET; - } else - if (gethost(AF_INET6, $1, + $$.f = family; + if (gethost(family, $1, &addr) == 0) { $$.a = addr; - $$.f = AF_INET6; } else { FPRINTF(stderr, "Unknown host '%s'\n", From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:03:48 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8102B401; Sun, 12 Oct 2014 17:03:48 +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 62416E0D; Sun, 12 Oct 2014 17:03:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CH3mAD057888; Sun, 12 Oct 2014 17:03:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CH3mnt057887; Sun, 12 Oct 2014 17:03:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121703.s9CH3mnt057887@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 17:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272990 - stable/10/contrib/ipfilter/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:03:48 -0000 Author: cy Date: Sun Oct 12 17:03:47 2014 New Revision: 272990 URL: https://svnweb.freebsd.org/changeset/base/272990 Log: MFC r271978 ipfilter bug #552 destination port not zero after parsing nat rule. Obtained from: netbsd CVS repo (r1.4), ipfilter CVS repo (r1.38) Modified: stable/10/contrib/ipfilter/tools/ipnat_y.y Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/tools/ipnat_y.y ============================================================================== --- stable/10/contrib/ipfilter/tools/ipnat_y.y Sun Oct 12 16:58:45 2014 (r272989) +++ stable/10/contrib/ipfilter/tools/ipnat_y.y Sun Oct 12 17:03:47 2014 (r272990) @@ -871,9 +871,9 @@ mapport: } free($2); if ($3.p1 < 0 || $3.p1 > 65535) - yyerror("invalid ICMP Id number"); + yyerror("invalid 1st ICMP Id number"); if ($3.p2 < 0 || $3.p2 > 65535) - yyerror("invalid ICMP Id number"); + yyerror("invalid 2nd ICMP Id number"); if (strcmp($2, "ipv6-icmp") == 0) { nat->in_pr[0] = IPPROTO_ICMPV6; nat->in_pr[1] = IPPROTO_ICMPV6; @@ -1058,7 +1058,7 @@ hash: IPNY_HASH { if (!(nat->in_flags ; portstuff: - compare portspec { $$.pc = $1; $$.p1 = $2; } + compare portspec { $$.pc = $1; $$.p1 = $2; $$.p2 = 0; } | portspec range portspec { $$.pc = $2; $$.p1 = $1; $$.p2 = $3; } ; @@ -1151,7 +1151,7 @@ proto: YY_NUMBER { $$ = $1; | YY_STR { $$ = getproto($1); free($1); if ($$ == -1) - yyerror("unknwon protocol"); + yyerror("unknown protocol"); if ($$ != IPPROTO_TCP && $$ != IPPROTO_UDP) suggest_port = 0; @@ -1172,7 +1172,8 @@ hostname: else #endif family = AF_INET; - bzero(&$$, sizeof($$)); + memset(&($$), 0, sizeof($$)); + memset(&addr, 0, sizeof(addr)); $$.f = family; if (gethost(family, $1, &addr) == 0) { @@ -1184,17 +1185,17 @@ hostname: } free($1); } - | YY_NUMBER { bzero(&$$, sizeof($$)); + | YY_NUMBER { memset(&($$), 0, sizeof($$)); $$.a.in4.s_addr = htonl($1); if ($$.a.in4.s_addr != 0) $$.f = AF_INET; } | ipv4 { $$ = $1; } - | YY_IPV6 { bzero(&$$, sizeof($$)); + | YY_IPV6 { memset(&($$), 0, sizeof($$)); $$.a = $1; $$.f = AF_INET6; } - | YY_NUMBER YY_IPV6 { bzero(&$$, sizeof($$)); + | YY_NUMBER YY_IPV6 { memset(&($$), 0, sizeof($$)); $$.a = $2; $$.f = AF_INET6; } @@ -1429,6 +1430,9 @@ setnatproto(p) nat->in_flags |= IPN_UDP; nat->in_flags &= ~IPN_TCP; break; +#ifdef USE_INET6 + case IPPROTO_ICMPV6 : +#endif case IPPROTO_ICMP : nat->in_flags &= ~IPN_TCPUDP; if (!(nat->in_flags & IPN_ICMPQUERY) && @@ -1508,7 +1512,7 @@ ipnat_addrule(fd, ioctlfunc, ptr) printnat(ipn, opts); if (opts & OPT_DEBUG) - binprint(ipn, sizeof(*ipn)); + binprint(ipn, ipn->in_size); if ((opts & OPT_ZERORULEST) != 0) { if ((*ioctlfunc)(fd, add, (void *)&obj) == -1) { From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:08:45 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CFBB883; Sun, 12 Oct 2014 17:08:45 +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 28976E59; Sun, 12 Oct 2014 17:08:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CH8jPJ058786; Sun, 12 Oct 2014 17:08:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CH8jqw058785; Sun, 12 Oct 2014 17:08:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121708.s9CH8jqw058785@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 17:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272992 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:08:45 -0000 Author: cy Date: Sun Oct 12 17:08:44 2014 New Revision: 272992 URL: https://svnweb.freebsd.org/changeset/base/272992 Log: MFC r271980 Check for NULL before de-refencing; in particular sel is assigned to NULL, in the default case, and then couple of lines down we do sel-> Obtained from: NetBSD CVS repo (r1.5) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c Sun Oct 12 17:07:15 2014 (r272991) +++ stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c Sun Oct 12 17:08:44 2014 (r272992) @@ -1134,7 +1134,7 @@ ipf_dstlist_select(fin, d) int family; int x; - if (d->ipld_dests == NULL || *d->ipld_dests == NULL) + if (d == NULL || d->ipld_dests == NULL || *d->ipld_dests == NULL) return NULL; family = fin->fin_family; @@ -1222,7 +1222,7 @@ ipf_dstlist_select(fin, d) break; } - if (sel->ipfd_dest.fd_addr.adf_family != family) + if (sel && sel->ipfd_dest.fd_addr.adf_family != family) sel = NULL; d->ipld_selected = sel; From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:10:45 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 527FBA02; Sun, 12 Oct 2014 17:10:45 +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 33861EF1; Sun, 12 Oct 2014 17:10:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CHAjBK062639; Sun, 12 Oct 2014 17:10:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHAjG1062637; Sun, 12 Oct 2014 17:10:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121710.s9CHAjG1062637@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 17:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272993 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:10:45 -0000 Author: cy Date: Sun Oct 12 17:10:44 2014 New Revision: 272993 URL: https://svnweb.freebsd.org/changeset/base/272993 Log: MFC r272052 ipfilter bug #558 add in some missing frag table function comments. Obtained from: ipfilter CVS repo (r1.36) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_frag.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_frag.c Sun Oct 12 17:08:44 2014 (r272992) +++ stable/10/sys/contrib/ipfilter/netinet/ip_frag.c Sun Oct 12 17:10:44 2014 (r272993) @@ -930,7 +930,8 @@ ipf_frag_known(fin, passp) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_natforget */ /* Returns: Nil */ -/* Parameters: ptr(I) - pointer to data structure */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* ptr(I) - pointer to data structure */ /* */ /* Search through all of the fragment cache entries for NAT and wherever a */ /* pointer is found to match ptr, reset it to NULL. */ @@ -954,7 +955,8 @@ ipf_frag_natforget(softc, ptr) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_delete */ /* Returns: Nil */ -/* Parameters: fra(I) - pointer to fragment structure to delete */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* fra(I) - pointer to fragment structure to delete */ /* tail(IO) - pointer to the pointer to the tail of the frag */ /* list */ /* */ @@ -991,7 +993,10 @@ ipf_frag_delete(softc, fra, tail) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_free */ /* Returns: Nil */ +/* Parameters: softf(I) - pointer to fragment context information */ +/* fra(I) - pointer to fragment structure to free */ /* */ +/* Free up a fragment cache entry and bump relevent statistics. */ /* ------------------------------------------------------------------------ */ static void ipf_frag_free(softf, fra) @@ -1007,7 +1012,7 @@ ipf_frag_free(softf, fra) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_clear */ /* Returns: Nil */ -/* Parameters: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ /* */ /* Free memory in use by fragment state information kept. Do the normal */ /* fragment state stuff first and then the NAT-fragment table. */ @@ -1048,7 +1053,7 @@ ipf_frag_clear(softc) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_expire */ /* Returns: Nil */ -/* Parameters: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ /* */ /* Expire entries in the fragment cache table that have been there too long */ /* ------------------------------------------------------------------------ */ @@ -1120,6 +1125,13 @@ ipf_frag_expire(softc) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_pkt_next */ +/* Returns: int - 0 == success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* token(I) - pointer to token information for this caller */ +/* itp(I) - pointer to generic iterator from caller */ +/* */ +/* This function is used to step through the fragment cache list used for */ +/* filter rules. The hard work is done by the more generic ipf_frag_next. */ /* ------------------------------------------------------------------------ */ int ipf_frag_pkt_next(softc, token, itp) @@ -1140,6 +1152,13 @@ ipf_frag_pkt_next(softc, token, itp) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_nat_next */ +/* Returns: int - 0 == success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* token(I) - pointer to token information for this caller */ +/* itp(I) - pointer to generic iterator from caller */ +/* */ +/* This function is used to step through the fragment cache list used for */ +/* NAT. The hard work is done by the more generic ipf_frag_next. */ /* ------------------------------------------------------------------------ */ int ipf_frag_nat_next(softc, token, itp) @@ -1160,7 +1179,8 @@ ipf_frag_nat_next(softc, token, itp) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_next */ /* Returns: int - 0 == success, else error */ -/* Parameters: token(I) - pointer to token information for this caller */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* token(I) - pointer to token information for this caller */ /* itp(I) - pointer to generic iterator from caller */ /* top(I) - top of the fragment list */ /* lock(I) - fragment cache lock */ @@ -1239,7 +1259,11 @@ ipf_frag_next(softc, token, itp, top /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_pkt_deref */ /* Returns: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* data(I) - pointer to frag cache pointer */ /* */ +/* This function is the external interface for dropping a reference to a */ +/* fragment cache entry used by filter rules. */ /* ------------------------------------------------------------------------ */ void ipf_frag_pkt_deref(softc, data) @@ -1261,7 +1285,11 @@ ipf_frag_pkt_deref(softc, data) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_nat_deref */ /* Returns: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* data(I) - pointer to frag cache pointer */ /* */ +/* This function is the external interface for dropping a reference to a */ +/* fragment cache entry used by NAT table entries. */ /* ------------------------------------------------------------------------ */ void ipf_frag_nat_deref(softc, data) From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:13:15 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A13ABA9; Sun, 12 Oct 2014 17:13: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 862A6F0D; Sun, 12 Oct 2014 17:13: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 s9CHDF9C063065; Sun, 12 Oct 2014 17:13:15 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHDFsF063064; Sun, 12 Oct 2014 17:13:15 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121713.s9CHDFsF063064@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 17:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272994 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:13:15 -0000 Author: cy Date: Sun Oct 12 17:13:14 2014 New Revision: 272994 URL: https://svnweb.freebsd.org/changeset/base/272994 Log: MFC r272551 ipfiler bug #550 filter rule list corrupted with inserted rules Obtained from: ipfilter CVS repo (r1.128); NetBSD CVS repo (r1.15) Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/fil.c Sun Oct 12 17:10:44 2014 (r272993) +++ stable/10/sys/contrib/ipfilter/netinet/fil.c Sun Oct 12 17:13:14 2014 (r272994) @@ -4496,7 +4496,15 @@ frrequest(softc, unit, req, data, set, m fp = f; f = NULL; + fp->fr_next = NULL; fp->fr_dnext = NULL; + fp->fr_pnext = NULL; + fp->fr_pdnext = NULL; + fp->fr_grp = NULL; + fp->fr_grphead = NULL; + fp->fr_icmpgrp = NULL; + fp->fr_isc = (void *)-1; + fp->fr_ptr = NULL; fp->fr_ref = 0; fp->fr_flags |= FR_COPIED; } else { @@ -5000,7 +5008,9 @@ frrequest(softc, unit, req, data, set, m if (f->fr_collect > fp->fr_collect) break; ftail = &f->fr_next; + fprev = ftail; } + ftail = fprev; f = NULL; ptr = NULL; } else if (req == (ioctlcmd_t)SIOCINAFR || @@ -5091,6 +5101,8 @@ frrequest(softc, unit, req, data, set, m fp->fr_ref = 1; fp->fr_pnext = ftail; fp->fr_next = *ftail; + if (fp->fr_next != NULL) + fp->fr_next->fr_pnext = &fp->fr_next; *ftail = fp; if (addrem == 0) ipf_fixskip(ftail, fp, 1); From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:15:21 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 405D3D14; Sun, 12 Oct 2014 17:15:21 +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 218FBF1B; Sun, 12 Oct 2014 17:15:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CHFLgS063430; Sun, 12 Oct 2014 17:15:21 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHFKXE063428; Sun, 12 Oct 2014 17:15:20 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121715.s9CHFKXE063428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 17:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272995 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:15:21 -0000 Author: cy Date: Sun Oct 12 17:15:20 2014 New Revision: 272995 URL: https://svnweb.freebsd.org/changeset/base/272995 Log: MFC r272552 ipfilter bug #554 Determining why a ipf rule matches is hard -- replace ipfilter rule compare with new ipf_rule_compare() function. Obtained from: ipfilter CVS rep (r1.129) Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/fil.c Sun Oct 12 17:13:14 2014 (r272994) +++ stable/10/sys/contrib/ipfilter/netinet/fil.c Sun Oct 12 17:15:20 2014 (r272995) @@ -4436,6 +4436,39 @@ ipf_matchicmpqueryreply(v, ic, icmp, rev /* ------------------------------------------------------------------------ */ +/* Function: ipf_rule_compare */ +/* Parameters: fr1(I) - first rule structure to compare */ +/* fr2(I) - second rule structure to compare */ +/* Returns: int - 0 == rules are the same, else mismatch */ +/* */ +/* Compare two rules and return 0 if they match or a number indicating */ +/* which of the individual checks failed. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) +{ + if (fr1->fr_cksum != fr2->fr_cksum) + return 1; + if (fr1->fr_size != fr2->fr_size) + return 2; + if (fr1->fr_dsize != fr2->fr_dsize) + return 3; + if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, + fr1->fr_size - offsetof(struct frentry, fr_func)) != 0) + return 4; + if (fr1->fr_data && !fr2->fr_data) + return 5; + if (!fr1->fr_data && fr2->fr_data) + return 6; + if (fr1->fr_data) { + if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize)) + return 7; + } + return 0; +} + + +/* ------------------------------------------------------------------------ */ /* Function: frrequest */ /* Returns: int - 0 == success, > 0 == errno value */ /* Parameters: unit(I) - device for which this is for */ @@ -4928,17 +4961,7 @@ frrequest(softc, unit, req, data, set, m } for (; (f = *ftail) != NULL; ftail = &f->fr_next) { - DT2(rule_cmp, frentry_t *, fp, frentry_t *, f); - if ((fp->fr_cksum != f->fr_cksum) || - (fp->fr_size != f->fr_size) || - (f->fr_dsize != fp->fr_dsize)) - continue; - if (bcmp((char *)&f->fr_func, (char *)&fp->fr_func, - fp->fr_size - offsetof(struct frentry, fr_func)) != 0) - continue; - if ((!ptr && !f->fr_data) || - (ptr && f->fr_data && - !bcmp((char *)ptr, (char *)f->fr_data, f->fr_dsize))) + if (ipf_rule_compare(fp, f) == 0) break; } From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:17:20 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B1A2E71; Sun, 12 Oct 2014 17:17:20 +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 4743EF2F; Sun, 12 Oct 2014 17:17:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CHHKES063730; Sun, 12 Oct 2014 17:17:20 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHHKOS063729; Sun, 12 Oct 2014 17:17:20 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121717.s9CHHKOS063729@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 17:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272996 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:17:20 -0000 Author: cy Date: Sun Oct 12 17:17:19 2014 New Revision: 272996 URL: https://svnweb.freebsd.org/changeset/base/272996 Log: MFC r272553 ipfilter bug #538 ipf_p_dns_del should return void Obtained from: ipfilter cvs repo (r1.8) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_dns_pxy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_dns_pxy.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_dns_pxy.c Sun Oct 12 17:15:20 2014 (r272995) +++ stable/10/sys/contrib/ipfilter/netinet/ip_dns_pxy.c Sun Oct 12 17:17:19 2014 (r272996) @@ -29,7 +29,7 @@ typedef struct ipf_dns_softc_s { int ipf_p_dns_allow_query __P((ipf_dns_softc_t *, dnsinfo_t *)); int ipf_p_dns_ctl __P((ipf_main_softc_t *, void *, ap_ctl_t *)); -int ipf_p_dns_del __P((ipf_main_softc_t *, ap_session_t *)); +void ipf_p_dns_del __P((ipf_main_softc_t *, ap_session_t *)); int ipf_p_dns_get_name __P((ipf_dns_softc_t *, char *, int, char *, int)); int ipf_p_dns_inout __P((void *, fr_info_t *, ap_session_t *, nat_t *)); int ipf_p_dns_match __P((fr_info_t *, ap_session_t *, nat_t *)); @@ -214,7 +214,7 @@ ipf_p_dns_new(arg, fin, aps, nat) /* ARGSUSED */ -int +void ipf_p_dns_del(softc, aps) ipf_main_softc_t *softc; ap_session_t *aps; @@ -227,7 +227,6 @@ ipf_p_dns_del(softc, aps) KFREES(aps->aps_data, aps->aps_psiz); aps->aps_data = NULL; aps->aps_psiz = 0; - return 0; } From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:19:12 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D75AFE8; Sun, 12 Oct 2014 17:19: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 29043F46; Sun, 12 Oct 2014 17:19: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 s9CHJCAk064023; Sun, 12 Oct 2014 17:19:12 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHJC4G064022; Sun, 12 Oct 2014 17:19:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121719.s9CHJC4G064022@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 17:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272997 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:19:12 -0000 Author: cy Date: Sun Oct 12 17:19:11 2014 New Revision: 272997 URL: https://svnweb.freebsd.org/changeset/base/272997 Log: MFC r272554 ipfilter bug #534 destination list hashing not endian neutral Obtained from: ipfilter CVS repo (r1.26), NetBSD CVS repo (r1.8) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c Sun Oct 12 17:17:19 2014 (r272996) +++ stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c Sun Oct 12 17:19:11 2014 (r272997) @@ -1193,7 +1193,7 @@ ipf_dstlist_select(fin, d) MD5Update(&ctx, (u_char *)&fin->fin_dst6, sizeof(fin->fin_dst6)); MD5Final((u_char *)hash, &ctx); - x = hash[0] % d->ipld_nodes; + x = ntohl(hash[0]) % d->ipld_nodes; sel = d->ipld_dests[x]; break; @@ -1203,7 +1203,7 @@ ipf_dstlist_select(fin, d) MD5Update(&ctx, (u_char *)&fin->fin_src6, sizeof(fin->fin_src6)); MD5Final((u_char *)hash, &ctx); - x = hash[0] % d->ipld_nodes; + x = ntohl(hash[0]) % d->ipld_nodes; sel = d->ipld_dests[x]; break; @@ -1213,7 +1213,7 @@ ipf_dstlist_select(fin, d) MD5Update(&ctx, (u_char *)&fin->fin_dst6, sizeof(fin->fin_dst6)); MD5Final((u_char *)hash, &ctx); - x = hash[0] % d->ipld_nodes; + x = ntohl(hash[0]) % d->ipld_nodes; sel = d->ipld_dests[x]; break; From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:21:15 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B138D202; Sun, 12 Oct 2014 17:21: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 9D17FF62; Sun, 12 Oct 2014 17:21: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 s9CHLFZr067751; Sun, 12 Oct 2014 17:21:15 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHLFB3067750; Sun, 12 Oct 2014 17:21:15 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121721.s9CHLFB3067750@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 17:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272998 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:21:15 -0000 Author: cy Date: Sun Oct 12 17:21:15 2014 New Revision: 272998 URL: https://svnweb.freebsd.org/changeset/base/272998 Log: MFC r272555 ipfilter bug #537 NAT rules with sticky have incorrect hostmap IP address. This fixes when an IP address mapping is put in the hostmap table for sticky NAT rules, it ends up having the wrong byte order. Obtained from: ipfilter CVS repo (r1.102), NetBSD CVS repo (r1.12) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Sun Oct 12 17:19:11 2014 (r272997) +++ stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Sun Oct 12 17:21:15 2014 (r272998) @@ -2946,10 +2946,11 @@ ipf_nat_newrdr(fin, nat, ni) */ if (np->in_flags & IPN_SPLIT) { in.s_addr = np->in_dnip; + inb.s_addr = htonl(in.s_addr); if ((np->in_flags & (IPN_ROUNDR|IPN_STICKY)) == IPN_STICKY) { hm = ipf_nat_hostmap(softn, NULL, fin->fin_src, - fin->fin_dst, in, (u_32_t)dport); + fin->fin_dst, inb, (u_32_t)dport); if (hm != NULL) { in.s_addr = hm->hm_ndstip.s_addr; move = 0; @@ -3050,13 +3051,14 @@ ipf_nat_newrdr(fin, nat, ni) return -1; } + inb.s_addr = htonl(in.s_addr); nat->nat_ndstaddr = htonl(in.s_addr); nat->nat_odstip = fin->fin_dst; nat->nat_nsrcip = fin->fin_src; nat->nat_osrcip = fin->fin_src; if ((nat->nat_hm == NULL) && ((np->in_flags & IPN_STICKY) != 0)) nat->nat_hm = ipf_nat_hostmap(softn, np, fin->fin_src, - fin->fin_dst, in, (u_32_t)dport); + fin->fin_dst, inb, (u_32_t)dport); if (flags & IPN_TCPUDP) { nat->nat_odport = dport; From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:36:42 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63C603F0; Sun, 12 Oct 2014 17:36:42 +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 4F7E916D; Sun, 12 Oct 2014 17:36:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CHaglO073102; Sun, 12 Oct 2014 17:36:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHagxG073101; Sun, 12 Oct 2014 17:36:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201410121736.s9CHagxG073101@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 12 Oct 2014 17:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272999 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:36:42 -0000 Author: tuexen Date: Sun Oct 12 17:36:41 2014 New Revision: 272999 URL: https://svnweb.freebsd.org/changeset/base/272999 Log: MFC r272571: Remove unused MC_ALIGN macro as suggested by Robert. Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Oct 12 17:21:15 2014 (r272998) +++ stable/10/sys/netinet/sctp_output.c Sun Oct 12 17:36:41 2014 (r272999) @@ -6784,13 +6784,6 @@ sctp_sendall_completes(void *ptr, uint32 SCTP_FREE(ca, SCTP_M_COPYAL); } - -#define MC_ALIGN(m, len) do { \ - SCTP_BUF_RESV_UF(m, ((MCLBYTES - (len)) & ~(sizeof(long) - 1)); \ -} while (0) - - - static struct mbuf * sctp_copy_out_all(struct uio *uio, int len) { From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:39:38 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2224D55C; Sun, 12 Oct 2014 17:39:38 +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 0DC54186; Sun, 12 Oct 2014 17:39:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CHdblW073493; Sun, 12 Oct 2014 17:39:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHdbIP073492; Sun, 12 Oct 2014 17:39:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201410121739.s9CHdbIP073492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 12 Oct 2014 17:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273000 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:39:38 -0000 Author: tuexen Date: Sun Oct 12 17:39:37 2014 New Revision: 273000 URL: https://svnweb.freebsd.org/changeset/base/273000 Log: MFC r272750: Ensure that the number of stream reported in srs_number_streams is consistent with the amount of data provided in the SCTP_RESET_STREAMS socket option. Thanks to Peter Bostroem from Google for drawing my attention to this part of the code. Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Sun Oct 12 17:36:41 2014 (r272999) +++ stable/10/sys/netinet/sctp_usrreq.c Sun Oct 12 17:39:37 2014 (r273000) @@ -4431,6 +4431,12 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_UNLOCK(stcb); break; } + if (sizeof(struct sctp_reset_streams) + + strrst->srs_number_streams * sizeof(uint16_t) > optsize) { + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + break; + } if (stcb->asoc.stream_reset_outstanding) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); error = EALREADY; From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:42:33 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0A8B6F1; Sun, 12 Oct 2014 17:42:33 +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 B265A231; Sun, 12 Oct 2014 17:42:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CHgXHw077297; Sun, 12 Oct 2014 17:42:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHgXcU077295; Sun, 12 Oct 2014 17:42:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201410121742.s9CHgXcU077295@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 12 Oct 2014 17:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273001 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:42:34 -0000 Author: tuexen Date: Sun Oct 12 17:42:32 2014 New Revision: 273001 URL: https://svnweb.freebsd.org/changeset/base/273001 Log: MFC r272751: Ensure that the list of streams sent in a stream reset parameter fits in an mbuf-cluster. Thanks to Peter Bostroem for drawing my attention to this part of the code. Modified: stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_output.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Oct 12 17:39:37 2014 (r273000) +++ stable/10/sys/netinet/sctp_output.c Sun Oct 12 17:42:32 2014 (r273001) @@ -11846,7 +11846,7 @@ sctp_add_an_in_stream(struct sctp_tmit_c int sctp_send_str_reset_req(struct sctp_tcb *stcb, - int number_entries, uint16_t * list, + uint16_t number_entries, uint16_t * list, uint8_t send_out_req, uint8_t send_in_req, uint8_t send_tsn_req, @@ -11879,6 +11879,14 @@ sctp_send_str_reset_req(struct sctp_tcb SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } + if (number_entries > (MCLBYTES - + SCTP_MIN_OVERHEAD - + sizeof(struct sctp_chunkhdr) - + sizeof(struct sctp_stream_reset_out_request)) / + sizeof(uint16_t)) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); + return (ENOMEM); + } sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); Modified: stable/10/sys/netinet/sctp_output.h ============================================================================== --- stable/10/sys/netinet/sctp_output.h Sun Oct 12 17:39:37 2014 (r273000) +++ stable/10/sys/netinet/sctp_output.h Sun Oct 12 17:42:32 2014 (r273001) @@ -181,8 +181,8 @@ sctp_add_stream_reset_result_tsn(struct uint32_t, uint32_t, uint32_t, uint32_t); int -sctp_send_str_reset_req(struct sctp_tcb *, int, uint16_t *, uint8_t, uint8_t, - uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); +sctp_send_str_reset_req(struct sctp_tcb *, uint16_t, uint16_t *, uint8_t, + uint8_t, uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); void sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *, From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 17:45:23 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1F6583E; Sun, 12 Oct 2014 17:45:23 +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 92FD0240; Sun, 12 Oct 2014 17:45:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CHjNWR077767; Sun, 12 Oct 2014 17:45:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CHjNFD077765; Sun, 12 Oct 2014 17:45:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201410121745.s9CHjNFD077765@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 12 Oct 2014 17:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273002 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 17:45:23 -0000 Author: tuexen Date: Sun Oct 12 17:45:22 2014 New Revision: 273002 URL: https://svnweb.freebsd.org/changeset/base/273002 Log: MFC r272841: Ensure that the flags field of sctp_tmit_chunks is initialized. Thanks to Peter Bostroem from Google for reporting the issue. Modified: stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Sun Oct 12 17:42:32 2014 (r273001) +++ stable/10/sys/netinet/sctp_input.c Sun Oct 12 17:45:22 2014 (r273002) @@ -4069,8 +4069,10 @@ __attribute__((noinline)) if (chk == NULL) { return (ret_code); } + chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_STREAM_RESET; chk->rec.chunk_id.can_take_data = 0; + chk->flags = 0; chk->asoc = &stcb->asoc; chk->no_fr_allowed = 0; chk->book_size = chk->send_size = sizeof(struct sctp_chunkhdr); Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Oct 12 17:42:32 2014 (r273001) +++ stable/10/sys/netinet/sctp_output.c Sun Oct 12 17:45:22 2014 (r273002) @@ -8925,16 +8925,11 @@ sctp_queue_op_err(struct sctp_tcb *stcb, return; } chk->send_size = 0; - mat = op_err; - while (mat != NULL) { + for (mat = op_err; mat != NULL; mat = SCTP_BUF_NEXT(mat)) { chk->send_size += SCTP_BUF_LEN(mat); - mat = SCTP_BUF_NEXT(mat); } - chk->rec.chunk_id.id = SCTP_OPERATION_ERROR; - chk->rec.chunk_id.can_take_data = 1; chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; - chk->flags = 0; chk->asoc = &stcb->asoc; chk->data = op_err; chk->whoTo = NULL; @@ -9022,12 +9017,12 @@ sctp_send_cookie_echo(struct mbuf *m, return (-5); } chk->copy_by_ref = 0; - chk->send_size = plen; chk->rec.chunk_id.id = SCTP_COOKIE_ECHO; chk->rec.chunk_id.can_take_data = 0; + chk->flags = CHUNK_FLAGS_FRAGMENT_OK; + chk->send_size = plen; chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; - chk->flags = CHUNK_FLAGS_FRAGMENT_OK; chk->asoc = &stcb->asoc; chk->data = cookie; chk->whoTo = net; @@ -9090,12 +9085,12 @@ sctp_send_heartbeat_ack(struct sctp_tcb return; } chk->copy_by_ref = 0; - chk->send_size = chk_length; chk->rec.chunk_id.id = SCTP_HEARTBEAT_ACK; chk->rec.chunk_id.can_take_data = 1; + chk->flags = 0; + chk->send_size = chk_length; chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; - chk->flags = 0; chk->asoc = &stcb->asoc; chk->data = outchain; chk->whoTo = net; @@ -9127,12 +9122,12 @@ sctp_send_cookie_ack(struct sctp_tcb *st return; } chk->copy_by_ref = 0; - chk->send_size = sizeof(struct sctp_chunkhdr); chk->rec.chunk_id.id = SCTP_COOKIE_ACK; chk->rec.chunk_id.can_take_data = 1; + chk->flags = 0; + chk->send_size = sizeof(struct sctp_chunkhdr); chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; - chk->flags = 0; chk->asoc = &stcb->asoc; chk->data = cookie_ack; if (chk->asoc->last_control_chunk_from != NULL) { @@ -9173,9 +9168,10 @@ sctp_send_shutdown_ack(struct sctp_tcb * return; } chk->copy_by_ref = 0; - chk->send_size = sizeof(struct sctp_chunkhdr); chk->rec.chunk_id.id = SCTP_SHUTDOWN_ACK; chk->rec.chunk_id.can_take_data = 1; + chk->flags = 0; + chk->send_size = sizeof(struct sctp_chunkhdr); chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; chk->flags = 0; @@ -9216,9 +9212,10 @@ sctp_send_shutdown(struct sctp_tcb *stcb return; } chk->copy_by_ref = 0; - chk->send_size = sizeof(struct sctp_shutdown_chunk); chk->rec.chunk_id.id = SCTP_SHUTDOWN; chk->rec.chunk_id.can_take_data = 1; + chk->flags = 0; + chk->send_size = sizeof(struct sctp_shutdown_chunk); chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; chk->flags = 0; @@ -9269,13 +9266,13 @@ sctp_send_asconf(struct sctp_tcb *stcb, return; } chk->copy_by_ref = 0; - chk->data = m_asconf; - chk->send_size = len; chk->rec.chunk_id.id = SCTP_ASCONF; chk->rec.chunk_id.can_take_data = 0; + chk->flags = CHUNK_FLAGS_FRAGMENT_OK; + chk->data = m_asconf; + chk->send_size = len; chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; - chk->flags = CHUNK_FLAGS_FRAGMENT_OK; chk->asoc = &stcb->asoc; chk->whoTo = net; if (chk->whoTo) { @@ -9364,7 +9361,9 @@ sctp_send_asconf_ack(struct sctp_tcb *st return; } chk->copy_by_ref = 0; - + chk->rec.chunk_id.id = SCTP_ASCONF_ACK; + chk->rec.chunk_id.can_take_data = 1; + chk->flags = CHUNK_FLAGS_FRAGMENT_OK; chk->whoTo = net; if (chk->whoTo) { atomic_add_int(&chk->whoTo->ref_count, 1); @@ -9373,11 +9372,8 @@ sctp_send_asconf_ack(struct sctp_tcb *st chk->send_size = 0; /* Get size */ chk->send_size = ack->len; - chk->rec.chunk_id.id = SCTP_ASCONF_ACK; - chk->rec.chunk_id.can_take_data = 1; chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; - chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; /* XXX */ chk->asoc = &stcb->asoc; TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next); @@ -10257,6 +10253,7 @@ send_forward_tsn(struct sctp_tcb *stcb, chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_FORWARD_CUM_TSN; chk->rec.chunk_id.can_take_data = 0; + chk->flags = 0; chk->asoc = asoc; chk->whoTo = NULL; chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); @@ -10490,6 +10487,7 @@ sctp_send_sack(struct sctp_tcb *stcb, in /* Clear our pkt counts */ asoc->data_pkts_seen = 0; + a_chk->flags = 0; a_chk->asoc = asoc; a_chk->snd_count = 0; a_chk->send_size = 0; /* fill in later */ @@ -11267,6 +11265,7 @@ sctp_send_hb(struct sctp_tcb *stcb, stru chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_HEARTBEAT_REQUEST; chk->rec.chunk_id.can_take_data = 1; + chk->flags = 0; chk->asoc = &stcb->asoc; chk->send_size = sizeof(struct sctp_heartbeat_chunk); @@ -11368,10 +11367,11 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb if (chk == NULL) { return; } - chk->copy_by_ref = 0; SCTP_STAT_INCR(sctps_queue_upd_ecne); + chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_ECN_ECHO; chk->rec.chunk_id.can_take_data = 0; + chk->flags = 0; chk->asoc = &stcb->asoc; chk->send_size = sizeof(struct sctp_ecne_chunk); chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_NOWAIT, 1, MT_HEADER); @@ -11431,6 +11431,9 @@ sctp_send_packet_dropped(struct sctp_tcb return; } chk->copy_by_ref = 0; + chk->rec.chunk_id.id = SCTP_PACKET_DROPPED; + chk->rec.chunk_id.can_take_data = 1; + chk->flags = 0; len -= iphlen; chk->send_size = len; /* Validate that we do not have an ABORT in here. */ @@ -11517,8 +11520,6 @@ jump_out: } else { chk->whoTo = NULL; } - chk->rec.chunk_id.id = SCTP_PACKET_DROPPED; - chk->rec.chunk_id.can_take_data = 1; drp->ch.chunk_type = SCTP_PACKET_DROPPED; drp->ch.chunk_length = htons(chk->send_size); spc = SCTP_SB_LIMIT_RCV(stcb->sctp_socket); @@ -11584,6 +11585,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_ECN_CWR; chk->rec.chunk_id.can_take_data = 1; + chk->flags = 0; chk->asoc = &stcb->asoc; chk->send_size = sizeof(struct sctp_cwr_chunk); chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_NOWAIT, 1, MT_HEADER); @@ -11895,6 +11897,7 @@ sctp_send_str_reset_req(struct sctp_tcb chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_STREAM_RESET; chk->rec.chunk_id.can_take_data = 0; + chk->flags = 0; chk->asoc = &stcb->asoc; chk->book_size = sizeof(struct sctp_chunkhdr); chk->send_size = SCTP_SIZE32(chk->book_size); From owner-svn-src-stable-10@FreeBSD.ORG Mon Oct 13 13:50:52 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 921EECD5; Mon, 13 Oct 2014 13:50:52 +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 72B5A6C8; Mon, 13 Oct 2014 13:50:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9DDoq7Z056563; Mon, 13 Oct 2014 13:50:52 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9DDoqI3056352; Mon, 13 Oct 2014 13:50:52 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201410131350.s9DDoqI3056352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Mon, 13 Oct 2014 13:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273036 - stable/10/sys/dev/vt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 13:50:52 -0000 Author: dumbbell Date: Mon Oct 13 13:50:51 2014 New Revision: 273036 URL: https://svnweb.freebsd.org/changeset/base/273036 Log: vt(4): Save/restore keyboard mode & LED states when switching window (MFC of r272416) Add new functions to manipulate these mode & state, instead of calling kbdd_ioctl() everyhere. This fixes at least two bugs: 1. The state of the Scroll Lock LED and the state of scroll mode could be out-of-sync. For instance, if one enables scroll mode on window #1 and switches to window #2, the LED would remain on, but the window wouldn't be in scroll mode. Similarily, when switching between a console and an X.Org session, the LED states could be inconsistent with the real state. 2. When exiting from an X.Org session, the user could be unable to type anything. The workaround was to switch to another console window and come back. Differential Revision: https://reviews.freebsd.org/D821 Reviewed by: ray@ Approved by: ray@ Tested by: kwm@ Modified: stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Mon Oct 13 13:49:28 2014 (r273035) +++ stable/10/sys/dev/vt/vt.h Mon Oct 13 13:50:51 2014 (r273036) @@ -261,6 +261,7 @@ struct vt_window { unsigned int vw_number; /* (c) Window number. */ int vw_kbdmode; /* (?) Keyboard mode. */ int vw_prev_kbdmode;/* (?) Previous mode. */ + int vw_kbdstate; /* (?) Keyboard state. */ int vw_grabbed; /* (?) Grab count. */ char *vw_kbdsq; /* Escape sequence queue*/ unsigned int vw_flags; /* (d) Per-window flags. */ Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Mon Oct 13 13:49:28 2014 (r273035) +++ stable/10/sys/dev/vt/vt_core.c Mon Oct 13 13:50:51 2014 (r273036) @@ -298,6 +298,97 @@ vt_switch_timer(void *arg) } static int +vt_save_kbd_mode(struct vt_window *vw, keyboard_t *kbd) +{ + int mode, ret; + + mode = 0; + ret = kbdd_ioctl(kbd, KDGKBMODE, (caddr_t)&mode); + if (ret == ENOIOCTL) + ret = ENODEV; + if (ret != 0) + return (ret); + + vw->vw_kbdmode = mode; + + return (0); +} + +static int +vt_update_kbd_mode(struct vt_window *vw, keyboard_t *kbd) +{ + int ret; + + ret = kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + if (ret == ENOIOCTL) + ret = ENODEV; + + return (ret); +} + +static int +vt_save_kbd_state(struct vt_window *vw, keyboard_t *kbd) +{ + int state, ret; + + state = 0; + ret = kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state); + if (ret == ENOIOCTL) + ret = ENODEV; + if (ret != 0) + return (ret); + + vw->vw_kbdstate &= ~LOCK_MASK; + vw->vw_kbdstate |= state & LOCK_MASK; + + return (0); +} + +static int +vt_update_kbd_state(struct vt_window *vw, keyboard_t *kbd) +{ + int state, ret; + + state = vw->vw_kbdstate & LOCK_MASK; + ret = kbdd_ioctl(kbd, KDSKBSTATE, (caddr_t)&state); + if (ret == ENOIOCTL) + ret = ENODEV; + + return (ret); +} + +static int +vt_save_kbd_leds(struct vt_window *vw, keyboard_t *kbd) +{ + int leds, ret; + + leds = 0; + ret = kbdd_ioctl(kbd, KDGETLED, (caddr_t)&leds); + if (ret == ENOIOCTL) + ret = ENODEV; + if (ret != 0) + return (ret); + + vw->vw_kbdstate &= ~LED_MASK; + vw->vw_kbdstate |= leds & LED_MASK; + + return (0); +} + +static int +vt_update_kbd_leds(struct vt_window *vw, keyboard_t *kbd) +{ + int leds, ret; + + leds = vw->vw_kbdstate & LED_MASK; + ret = kbdd_ioctl(kbd, KDSETLED, (caddr_t)&leds); + if (ret == ENOIOCTL) + ret = ENODEV; + + return (ret); +} + +static int vt_window_preswitch(struct vt_window *vw, struct vt_window *curvw) { @@ -409,7 +500,11 @@ vt_window_switch(struct vt_window *vw) mtx_lock(&Giant); kbd = kbd_get_keyboard(vd->vd_keyboard); if (kbd != NULL) { - kbdd_ioctl(kbd, KDSKBMODE, (void *)&vw->vw_kbdmode); + if (curvw->vw_kbdmode == K_XLATE) + vt_save_kbd_state(curvw, kbd); + + vt_update_kbd_mode(vw, kbd); + vt_update_kbd_state(vw, kbd); } mtx_unlock(&Giant); DPRINTF(10, "%s(ttyv%d) done\n", __func__, vw->vw_number); @@ -602,7 +697,6 @@ static int vt_processkey(keyboard_t *kbd, struct vt_device *vd, int c) { struct vt_window *vw = vd->vd_curwindow; - int state = 0; #if VT_ALT_TO_ESC_HACK if (c & RELKEY) { @@ -665,10 +759,9 @@ vt_processkey(keyboard_t *kbd, struct vt vt_proc_window_switch(vw); return (0); case SLK: { - - kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state); + vt_save_kbd_state(vw, kbd); VT_LOCK(vd); - if (state & SLKED) { + if (vw->vw_kbdstate & SLKED) { /* Turn scrolling on. */ vw->vw_flags |= VWF_SCROLL; VTBUF_SLCK_ENABLE(&vw->vw_buf); @@ -1201,13 +1294,11 @@ vtterm_cngetc(struct terminal *tm) struct vt_window *vw = tm->tm_softc; struct vt_device *vd = vw->vw_device; keyboard_t *kbd; - int state; u_int c; if (vw->vw_kbdsq && *vw->vw_kbdsq) return (*vw->vw_kbdsq++); - state = 0; /* Make sure the splash screen is not there. */ if (vd->vd_flags & VDF_SPLASH) { /* Remove splash */ @@ -1223,8 +1314,8 @@ vtterm_cngetc(struct terminal *tm) return (-1); /* Force keyboard input mode to K_XLATE */ - c = K_XLATE; - kbdd_ioctl(kbd, KDSKBMODE, (void *)&c); + vw->vw_kbdmode = K_XLATE; + vt_update_kbd_mode(vw, kbd); /* Switch the keyboard to polling to make it work here. */ kbdd_poll(kbd, TRUE); @@ -1243,8 +1334,8 @@ vtterm_cngetc(struct terminal *tm) if (c & SPCLKEY) { switch (c) { case SPCLKEY | SLK: - kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state); - if (state & SLKED) { + vt_save_kbd_state(vw, kbd); + if (vw->vw_kbdstate & SLKED) { /* Turn scrolling on. */ vw->vw_flags |= VWF_SCROLL; VTBUF_SLCK_ENABLE(&vw->vw_buf); @@ -1311,7 +1402,7 @@ vtterm_cngrab(struct terminal *tm) /* We shall always use the keyboard in the XLATE mode here. */ vw->vw_prev_kbdmode = vw->vw_kbdmode; vw->vw_kbdmode = K_XLATE; - (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + vt_update_kbd_mode(vw, kbd); kbdd_poll(kbd, TRUE); } @@ -1336,7 +1427,7 @@ vtterm_cnungrab(struct terminal *tm) kbdd_poll(kbd, FALSE); vw->vw_kbdmode = vw->vw_prev_kbdmode; - (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + vt_update_kbd_mode(vw, kbd); kbdd_disable(kbd); } @@ -1890,12 +1981,8 @@ skip_thunk: case SETFKEY: case KDGKBINFO: case KDGKBTYPE: - case KDSKBSTATE: /* set keyboard state (locks) */ - case KDGKBSTATE: /* get keyboard state (locks) */ case KDGETREPEAT: /* get keyboard repeat & delay rates */ case KDSETREPEAT: /* set keyboard repeat & delay rates (new) */ - case KDSETLED: /* set keyboard LED status */ - case KDGETLED: /* get keyboard LED status */ case KBADDKBD: /* add/remove keyboard to/from mux */ case KBRELKBD: { error = 0; @@ -1915,18 +2002,101 @@ skip_thunk: } return (error); } + case KDGKBSTATE: { /* get keyboard state (locks) */ + error = 0; + + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_save_kbd_state(vw, kbd); + mtx_unlock(&Giant); + + if (error != 0) + return (error); + } + + *(int *)data = vw->vw_kbdstate & LOCK_MASK; + + return (error); + } + case KDSKBSTATE: { /* set keyboard state (locks) */ + int state; + + state = *(int *)data; + if (state & ~LOCK_MASK) + return (EINVAL); + + vw->vw_kbdstate &= ~LOCK_MASK; + vw->vw_kbdstate |= state; + + error = 0; + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_update_kbd_state(vw, kbd); + mtx_unlock(&Giant); + } + + return (error); + } + case KDGETLED: { /* get keyboard LED status */ + error = 0; + + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_save_kbd_leds(vw, kbd); + mtx_unlock(&Giant); + + if (error != 0) + return (error); + } + + *(int *)data = vw->vw_kbdstate & LED_MASK; + + return (error); + } + case KDSETLED: { /* set keyboard LED status */ + int leds; + + leds = *(int *)data; + if (leds & ~LED_MASK) + return (EINVAL); + + vw->vw_kbdstate &= ~LED_MASK; + vw->vw_kbdstate |= leds; + + error = 0; + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_update_kbd_leds(vw, kbd); + mtx_unlock(&Giant); + } + + return (error); + } case KDGKBMODE: { - int mode = -1; + error = 0; - mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) { - kbdd_ioctl(kbd, KDGKBMODE, (void *)&mode); + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_save_kbd_mode(vw, kbd); + mtx_unlock(&Giant); + + if (error != 0) + return (error); } - mtx_unlock(&Giant); - DPRINTF(20, "mode %d, vw_kbdmode %d\n", mode, vw->vw_kbdmode); - *(int *)data = mode; - return (0); + + *(int *)data = vw->vw_kbdmode; + + return (error); } case KDSKBMODE: { int mode; @@ -1937,19 +2107,17 @@ skip_thunk: case K_RAW: case K_CODE: vw->vw_kbdmode = mode; - if (vw == vd->vd_curwindow) { - keyboard_t *kbd; - error = 0; + error = 0; + if (vw == vd->vd_curwindow) { mtx_lock(&Giant); kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) { - error = kbdd_ioctl(kbd, KDSKBMODE, - (void *)&mode); - } + if (kbd != NULL) + error = vt_update_kbd_mode(vw, kbd); mtx_unlock(&Giant); } - return (0); + + return (error); default: return (EINVAL); } @@ -1977,8 +2145,17 @@ skip_thunk: return (0); case CONS_GETINFO: { vid_info_t *vi = (vid_info_t *)data; + if (vi->size != sizeof(struct vid_info)) + return (EINVAL); + + if (vw == vd->vd_curwindow) { + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + vt_save_kbd_state(vw, kbd); + } vi->m_num = vd->vd_curwindow->vw_number + 1; + vi->mk_keylock = vw->vw_kbdstate & LOCK_MASK; /* XXX: other fields! */ return (0); } @@ -2093,13 +2270,14 @@ skip_thunk: (void *)vd, vt_kbdevent, vd); if (i >= 0) { if (vd->vd_keyboard != -1) { + vt_save_kbd_state(vd->vd_curwindow, kbd); kbd_release(kbd, (void *)vd); } kbd = kbd_get_keyboard(i); vd->vd_keyboard = i; - (void)kbdd_ioctl(kbd, KDSKBMODE, - (caddr_t)&vd->vd_curwindow->vw_kbdmode); + vt_update_kbd_mode(vd->vd_curwindow, kbd); + vt_update_kbd_state(vd->vd_curwindow, kbd); } else { error = EPERM; /* XXX */ } @@ -2115,6 +2293,7 @@ skip_thunk: mtx_unlock(&Giant); return (EINVAL); } + vt_save_kbd_state(vd->vd_curwindow, kbd); error = kbd_release(kbd, (void *)vd); if (error == 0) { vd->vd_keyboard = -1; From owner-svn-src-stable-10@FreeBSD.ORG Mon Oct 13 14:40:01 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47FDDE1; Mon, 13 Oct 2014 14:40:01 +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 33AE0C7F; Mon, 13 Oct 2014 14:40:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9DEe1SH079185; Mon, 13 Oct 2014 14:40:01 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9DEe1Hv079184; Mon, 13 Oct 2014 14:40:01 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201410131440.s9DEe1Hv079184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Mon, 13 Oct 2014 14:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273037 - stable/10/sys/dev/vt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 14:40:01 -0000 Author: dumbbell Date: Mon Oct 13 14:40:00 2014 New Revision: 273037 URL: https://svnweb.freebsd.org/changeset/base/273037 Log: vt(4): Don't recalculate buffer size if we don't know screen size (MFC of r272537) When the screen size is unknown, it's set to 0x0. We can't use that as the buffer size, otherwise, functions such as vtbuf_fill() will fail. This fixes a panic on RaspberryPi, where there's no vt(4) backend configured early in boot. PR: 193981 Tested by: danilo@ Modified: stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Mon Oct 13 13:50:51 2014 (r273036) +++ stable/10/sys/dev/vt/vt_core.c Mon Oct 13 14:40:00 2014 (r273037) @@ -1269,7 +1269,8 @@ vtterm_cnprobe(struct terminal *tm, stru * that we have the real viewable size, fix it in the static * buffer. */ - vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); + if (vd->vd_width != 0 && vd->vd_height != 0) + vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); vtbuf_init_early(&vw->vw_buf); vt_winsize(vd, vw->vw_font, &wsz); From owner-svn-src-stable-10@FreeBSD.ORG Mon Oct 13 15:53:02 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 616E0DB5; Mon, 13 Oct 2014 15:53: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 4CDF06A6; Mon, 13 Oct 2014 15:53: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 s9DFr2fM016553; Mon, 13 Oct 2014 15:53:02 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9DFr285016552; Mon, 13 Oct 2014 15:53:02 GMT (envelope-from des@FreeBSD.org) Message-Id: <201410131553.s9DFr285016552@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 13 Oct 2014 15:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273042 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 15:53:02 -0000 Author: des Date: Mon Oct 13 15:53:01 2014 New Revision: 273042 URL: https://svnweb.freebsd.org/changeset/base/273042 Log: MFH (r272173): offer to enable local_unbound after installation Modified: stable/10/usr.sbin/bsdinstall/scripts/services Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/services ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/services Mon Oct 13 15:35:08 2014 (r273041) +++ stable/10/usr.sbin/bsdinstall/scripts/services Mon Oct 13 15:53:01 2014 (r273042) @@ -43,6 +43,7 @@ DAEMONS=$( dialog --backtitle "FreeBSD I --title "System Configuration" --nocancel --separate-output \ --checklist "Choose the services you would like to be started at boot:" \ 0 0 0 \ + local_unbound "Local caching validating resolver" ${local_unbound:-off} \ sshd "Secure shell daemon" ${sshd_enable:-off} \ moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ From owner-svn-src-stable-10@FreeBSD.ORG Mon Oct 13 15:56:49 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2307324B; Mon, 13 Oct 2014 15:56: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 03F4C78E; Mon, 13 Oct 2014 15:56: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 s9DFumNl017273; Mon, 13 Oct 2014 15:56:48 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9DFumRp017271; Mon, 13 Oct 2014 15:56:48 GMT (envelope-from des@FreeBSD.org) Message-Id: <201410131556.s9DFumRp017271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 13 Oct 2014 15:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273043 - in stable/10: lib/libcrypt usr.sbin/pw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 15:56:49 -0000 Author: des Date: Mon Oct 13 15:56:47 2014 New Revision: 273043 URL: https://svnweb.freebsd.org/changeset/base/273043 Log: MFH (r272830): change the hardcoded default back to DES MFH (r272833): remove last vestige of MD5 password hashes Modified: stable/10/lib/libcrypt/crypt.c stable/10/usr.sbin/pw/pw_user.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcrypt/crypt.c ============================================================================== --- stable/10/lib/libcrypt/crypt.c Mon Oct 13 15:53:01 2014 (r273042) +++ stable/10/lib/libcrypt/crypt.c Mon Oct 13 15:56:47 2014 (r273043) @@ -37,24 +37,26 @@ __FBSDID("$FreeBSD$"); #include "crypt.h" /* - * List of supported crypt(3) formats. The first element in the list will - * be the default. + * List of supported crypt(3) formats. + * + * The default algorithm is the last entry in the list (second-to-last + * array element since the last is a sentinel). The reason for placing + * the default last rather than first is that DES needs to be at the + * bottom for the algorithm guessing logic in crypt(3) to work correctly, + * and it needs to be the default for backward compatibility. */ static const struct crypt_format { const char *const name; char *(*const func)(const char *, const char *); const char *const magic; } crypt_formats[] = { - /* default format */ - { "sha512", crypt_sha512, "$6$" }, - - /* other supported formats */ { "md5", crypt_md5, "$1$" }, #ifdef HAS_BLOWFISH { "blf", crypt_blowfish, "$2" }, #endif { "nth", crypt_nthash, "$3$" }, { "sha256", crypt_sha256, "$5$" }, + { "sha512", crypt_sha512, "$6$" }, #ifdef HAS_DES { "des", crypt_des, "_" }, #endif @@ -63,7 +65,8 @@ static const struct crypt_format { { NULL, NULL, NULL } }; -static const struct crypt_format *crypt_format = &crypt_formats[0]; +static const struct crypt_format *crypt_format = + &crypt_formats[(sizeof crypt_formats / sizeof *crypt_formats) - 2]; #define DES_SALT_ALPHABET \ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Mon Oct 13 15:53:01 2014 (r273042) +++ stable/10/usr.sbin/pw/pw_user.c Mon Oct 13 15:56:47 2014 (r273043) @@ -615,7 +615,7 @@ pw_user(struct userconf * cnf, int mode, pwd->pw_dir = pw_homepolicy(cnf, args, pwd->pw_name); pwd->pw_shell = pw_shellpolicy(cnf, args, NULL); lc = login_getpwclass(pwd); - if (lc == NULL || login_setcryptfmt(lc, "md5", NULL) == NULL) + if (lc == NULL || login_setcryptfmt(lc, "sha512", NULL) == NULL) warn("setting crypt(3) format"); login_close(lc); pwd->pw_passwd = pw_password(cnf, args, pwd->pw_name); @@ -690,7 +690,7 @@ pw_user(struct userconf * cnf, int mode, } else { lc = login_getpwclass(pwd); if (lc == NULL || - login_setcryptfmt(lc, "md5", NULL) == NULL) + login_setcryptfmt(lc, "sha512", NULL) == NULL) warn("setting crypt(3) format"); login_close(lc); pwd->pw_passwd = pw_pwcrypt(line); From owner-svn-src-stable-10@FreeBSD.ORG Mon Oct 13 15:58:04 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99A5D62A; Mon, 13 Oct 2014 15:58: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 852F5801; Mon, 13 Oct 2014 15:58: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 s9DFw4u2017498; Mon, 13 Oct 2014 15:58:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9DFw4u4017497; Mon, 13 Oct 2014 15:58:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410131558.s9DFw4u4017497@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Oct 2014 15:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273044 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 15:58:04 -0000 Author: kib Date: Mon Oct 13 15:58:03 2014 New Revision: 273044 URL: https://svnweb.freebsd.org/changeset/base/273044 Log: MFC r272907: Make MAP_NOSYNC handling in the vm_fault() read-locked object path compatible with write-locked path. Modified: stable/10/sys/vm/vm_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Mon Oct 13 15:56:47 2014 (r273043) +++ stable/10/sys/vm/vm_fault.c Mon Oct 13 15:58:03 2014 (r273044) @@ -174,6 +174,70 @@ unlock_and_deallocate(struct faultstate } } +static void +vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_prot_t prot, + vm_prot_t fault_type, int fault_flags, boolean_t set_wd) +{ + boolean_t need_dirty; + + if (((prot & VM_PROT_WRITE) == 0 && + (fault_flags & VM_FAULT_DIRTY) == 0) || + (m->oflags & VPO_UNMANAGED) != 0) + return; + + VM_OBJECT_ASSERT_LOCKED(m->object); + + need_dirty = ((fault_type & VM_PROT_WRITE) != 0 && + (fault_flags & VM_FAULT_CHANGE_WIRING) == 0) || + (fault_flags & VM_FAULT_DIRTY) != 0; + + if (set_wd) + vm_object_set_writeable_dirty(m->object); + else + /* + * If two callers of vm_fault_dirty() with set_wd == + * FALSE, one for the map entry with MAP_ENTRY_NOSYNC + * flag set, other with flag clear, race, it is + * possible for the no-NOSYNC thread to see m->dirty + * != 0 and not clear VPO_NOSYNC. Take vm_page lock + * around manipulation of VPO_NOSYNC and + * vm_page_dirty() call, to avoid the race and keep + * m->oflags consistent. + */ + vm_page_lock(m); + + /* + * If this is a NOSYNC mmap we do not want to set VPO_NOSYNC + * if the page is already dirty to prevent data written with + * the expectation of being synced from not being synced. + * Likewise if this entry does not request NOSYNC then make + * sure the page isn't marked NOSYNC. Applications sharing + * data should use the same flags to avoid ping ponging. + */ + if ((entry->eflags & MAP_ENTRY_NOSYNC) != 0) { + if (m->dirty == 0) { + m->oflags |= VPO_NOSYNC; + } + } else { + m->oflags &= ~VPO_NOSYNC; + } + + /* + * If the fault is a write, we know that this page is being + * written NOW so dirty it explicitly to save on + * pmap_is_modified() calls later. + * + * Also tell the backing pager, if any, that it should remove + * any swap backing since the page is now dirty. + */ + if (need_dirty) + vm_page_dirty(m); + if (!set_wd) + vm_page_unlock(m); + if (need_dirty) + vm_pager_page_unswapped(m); +} + /* * TRYPAGER - used by vm_fault to calculate whether the pager for the * current object *might* contain the page. @@ -321,11 +385,8 @@ RetryFault:; vm_page_hold(m); vm_page_unlock(m); } - if ((fault_type & VM_PROT_WRITE) != 0 && - (m->oflags & VPO_UNMANAGED) == 0) { - vm_page_dirty(m); - vm_pager_page_unswapped(m); - } + vm_fault_dirty(fs.entry, m, prot, fault_type, fault_flags, + FALSE); VM_OBJECT_RUNLOCK(fs.first_object); if (!wired) vm_fault_prefault(&fs, vaddr, 0, 0); @@ -898,42 +959,7 @@ vnode_locked: if (hardfault) fs.entry->next_read = fs.pindex + faultcount - reqpage; - if (((prot & VM_PROT_WRITE) != 0 || - (fault_flags & VM_FAULT_DIRTY) != 0) && - (fs.m->oflags & VPO_UNMANAGED) == 0) { - vm_object_set_writeable_dirty(fs.object); - - /* - * If this is a NOSYNC mmap we do not want to set VPO_NOSYNC - * if the page is already dirty to prevent data written with - * the expectation of being synced from not being synced. - * Likewise if this entry does not request NOSYNC then make - * sure the page isn't marked NOSYNC. Applications sharing - * data should use the same flags to avoid ping ponging. - */ - if (fs.entry->eflags & MAP_ENTRY_NOSYNC) { - if (fs.m->dirty == 0) - fs.m->oflags |= VPO_NOSYNC; - } else { - fs.m->oflags &= ~VPO_NOSYNC; - } - - /* - * If the fault is a write, we know that this page is being - * written NOW so dirty it explicitly to save on - * pmap_is_modified() calls later. - * - * Also tell the backing pager, if any, that it should remove - * any swap backing since the page is now dirty. - */ - if (((fault_type & VM_PROT_WRITE) != 0 && - (fault_flags & VM_FAULT_CHANGE_WIRING) == 0) || - (fault_flags & VM_FAULT_DIRTY) != 0) { - vm_page_dirty(fs.m); - vm_pager_page_unswapped(fs.m); - } - } - + vm_fault_dirty(fs.entry, fs.m, prot, fault_type, fault_flags, TRUE); vm_page_assert_xbusied(fs.m); /* From owner-svn-src-stable-10@FreeBSD.ORG Mon Oct 13 18:46:31 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F0E6B3A; Mon, 13 Oct 2014 18:46:31 +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 3A438E5E; Mon, 13 Oct 2014 18:46:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9DIkVmE002600; Mon, 13 Oct 2014 18:46:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9DIkVFj002599; Mon, 13 Oct 2014 18:46:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410131846.s9DIkVFj002599@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 13 Oct 2014 18:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273057 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 18:46:31 -0000 Author: delphij Date: Mon Oct 13 18:46:30 2014 New Revision: 273057 URL: https://svnweb.freebsd.org/changeset/base/273057 Log: Fix a missed merge introduced in r272883. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Oct 13 16:48:01 2014 (r273056) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Oct 13 18:46:30 2014 (r273057) @@ -3662,7 +3662,6 @@ zfs_ioc_destroy_bookmarks(const char *po if (strncmp(name, poolname, poollen) != 0 || (name[poollen] != '/' && name[poollen] != '#')) return (SET_ERROR(EXDEV)); - (void) zvol_remove_minor(name); } error = dsl_bookmark_destroy(innvl, outnvl); From owner-svn-src-stable-10@FreeBSD.ORG Mon Oct 13 18:53:57 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9194F15; Mon, 13 Oct 2014 18:53: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 D375EF3A; Mon, 13 Oct 2014 18:53: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 s9DIrv8D007006; Mon, 13 Oct 2014 18:53:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9DIrvvA007004; Mon, 13 Oct 2014 18:53:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410131853.s9DIrvvA007004@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 13 Oct 2014 18:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273058 - in stable/10/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 18:53:58 -0000 Author: delphij Date: Mon Oct 13 18:53:56 2014 New Revision: 273058 URL: https://svnweb.freebsd.org/changeset/base/273058 Log: MFC r272502: MFV r272493: Show individual disk capacity when doing zpool list -v. Illumos issue: 5147 zpool list -v should show individual disk capacity Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Oct 13 18:46:30 2014 (r273057) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Oct 13 18:53:56 2014 (r273058) @@ -2857,10 +2857,7 @@ print_pool(zpool_handle_t *zhp, list_cbd right_justify = B_FALSE; if (pl->pl_prop != ZPROP_INVAL) { - if (pl->pl_prop == ZPOOL_PROP_EXPANDSZ && - zpool_get_prop_int(zhp, pl->pl_prop, NULL) == 0) - propstr = "-"; - else if (zpool_get_prop(zhp, pl->pl_prop, property, + if (zpool_get_prop(zhp, pl->pl_prop, property, sizeof (property), NULL, cb->cb_literal) != 0) propstr = "-"; else @@ -2894,21 +2891,37 @@ print_pool(zpool_handle_t *zhp, list_cbd } static void -print_one_column(zpool_prop_t prop, uint64_t value, boolean_t scripted) +print_one_column(zpool_prop_t prop, uint64_t value, boolean_t scripted, + boolean_t valid) { char propval[64]; boolean_t fixed; size_t width = zprop_width(prop, &fixed, ZFS_TYPE_POOL); - - if (prop == ZPOOL_PROP_EXPANDSZ && value == 0) - (void) strlcpy(propval, "-", sizeof (propval)); - else if (prop == ZPOOL_PROP_FRAGMENTATION && value == ZFS_FRAG_INVALID) - (void) strlcpy(propval, "-", sizeof (propval)); - else if (prop == ZPOOL_PROP_FRAGMENTATION) + switch (prop) { + case ZPOOL_PROP_EXPANDSZ: + if (value == 0) + (void) strlcpy(propval, "-", sizeof (propval)); + else + zfs_nicenum(value, propval, sizeof (propval)); + break; + case ZPOOL_PROP_FRAGMENTATION: + if (value == ZFS_FRAG_INVALID) { + (void) strlcpy(propval, "-", sizeof (propval)); + } else { + (void) snprintf(propval, sizeof (propval), "%llu%%", + value); + } + break; + case ZPOOL_PROP_CAPACITY: (void) snprintf(propval, sizeof (propval), "%llu%%", value); - else + break; + default: zfs_nicenum(value, propval, sizeof (propval)); + } + + if (!valid) + (void) strlcpy(propval, "-", sizeof (propval)); if (scripted) (void) printf("\t%s", propval); @@ -2930,6 +2943,9 @@ print_list_stats(zpool_handle_t *zhp, co (uint64_t **)&vs, &c) == 0); if (name != NULL) { + boolean_t toplevel = (vs->vs_space != 0); + uint64_t cap; + if (scripted) (void) printf("\t%s", name); else if (strlen(name) + depth > cb->cb_namewidth) @@ -2938,24 +2954,26 @@ print_list_stats(zpool_handle_t *zhp, co (void) printf("%*s%s%*s", depth, "", name, (int)(cb->cb_namewidth - strlen(name) - depth), ""); - /* only toplevel vdevs have capacity stats */ - if (vs->vs_space == 0) { - if (scripted) - (void) printf("\t-\t-\t-\t-"); - else - (void) printf(" - - - -"); - } else { - print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, - scripted); - print_one_column(ZPOOL_PROP_CAPACITY, vs->vs_alloc, - scripted); - print_one_column(ZPOOL_PROP_FREE, - vs->vs_space - vs->vs_alloc, scripted); - print_one_column(ZPOOL_PROP_FRAGMENTATION, - vs->vs_fragmentation, scripted); - } - print_one_column(ZPOOL_PROP_EXPANDSZ, vs->vs_esize, - scripted); + /* + * Print the properties for the individual vdevs. Some + * properties are only applicable to toplevel vdevs. The + * 'toplevel' boolean value is passed to the print_one_column() + * to indicate that the value is valid. + */ + print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, scripted, + toplevel); + print_one_column(ZPOOL_PROP_ALLOCATED, vs->vs_alloc, scripted, + toplevel); + print_one_column(ZPOOL_PROP_FREE, vs->vs_space - vs->vs_alloc, + scripted, toplevel); + print_one_column(ZPOOL_PROP_EXPANDSZ, vs->vs_esize, scripted, + B_TRUE); + print_one_column(ZPOOL_PROP_FRAGMENTATION, + vs->vs_fragmentation, scripted, + (vs->vs_fragmentation != ZFS_FRAG_INVALID && toplevel)); + cap = (vs->vs_space == 0) ? 0 : + (vs->vs_alloc * 100 / vs->vs_space); + print_one_column(ZPOOL_PROP_CAPACITY, cap, scripted, toplevel); (void) printf("\n"); } @@ -3024,7 +3042,8 @@ list_callback(zpool_handle_t *zhp, void * -H Scripted mode. Don't display headers, and separate properties * by a single tab. * -o List of properties to display. Defaults to - * "name,size,allocated,free,capacity,health,altroot" + * "name,size,allocated,free,expandsize,fragmentation,capacity," + * "dedupratio,health,altroot" * -p Diplay values in parsable (exact) format. * -T Display a timestamp in date(1) or Unix format * @@ -3038,7 +3057,7 @@ zpool_do_list(int argc, char **argv) int ret; list_cbdata_t cb = { 0 }; static char default_props[] = - "name,size,allocated,free,fragmentation,expandsize,capacity," + "name,size,allocated,free,expandsize,fragmentation,capacity," "dedupratio,health,altroot"; char *props = default_props; unsigned long interval = 0, count = 0; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Oct 13 18:46:30 2014 (r273057) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Oct 13 18:53:56 2014 (r273058) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -304,7 +304,6 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo case ZPOOL_PROP_FREE: case ZPOOL_PROP_FREEING: case ZPOOL_PROP_LEAKED: - case ZPOOL_PROP_EXPANDSZ: if (literal) { (void) snprintf(buf, len, "%llu", (u_longlong_t)intval); @@ -312,7 +311,16 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo (void) zfs_nicenum(intval, buf, len); } break; - + case ZPOOL_PROP_EXPANDSZ: + if (intval == 0) { + (void) strlcpy(buf, "-", len); + } else if (literal) { + (void) snprintf(buf, len, "%llu", + (u_longlong_t)intval); + } else { + (void) zfs_nicenum(intval, buf, len); + } + break; case ZPOOL_PROP_CAPACITY: if (literal) { (void) snprintf(buf, len, "%llu", @@ -330,13 +338,11 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo (u_longlong_t)intval); } break; - case ZPOOL_PROP_DEDUPRATIO: (void) snprintf(buf, len, "%llu.%02llux", (u_longlong_t)(intval / 100), (u_longlong_t)(intval % 100)); break; - case ZPOOL_PROP_HEALTH: verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL), ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0); From owner-svn-src-stable-10@FreeBSD.ORG Tue Oct 14 07:52:38 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF9BB6FA; Tue, 14 Oct 2014 07:52:38 +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 804986E7; Tue, 14 Oct 2014 07:52:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9E7qcvh074511; Tue, 14 Oct 2014 07:52:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9E7qcel074509; Tue, 14 Oct 2014 07:52:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410140752.s9E7qcel074509@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 14 Oct 2014 07:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273071 - in stable/10: sbin/iscontrol share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 07:52:38 -0000 Author: trasz Date: Tue Oct 14 07:52:37 2014 New Revision: 273071 URL: https://svnweb.freebsd.org/changeset/base/273071 Log: MFC r272932: Mark iscontrol(8) and iscsi_initiator(4) obsolete. Differential Revision: https://reviews.freebsd.org/D931 Reviewed by: wblock@ Sponsored by: The FreeBSD Foundation Modified: stable/10/sbin/iscontrol/iscontrol.8 stable/10/share/man/man4/iscsi_initiator.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/iscontrol/iscontrol.8 ============================================================================== --- stable/10/sbin/iscontrol/iscontrol.8 Tue Oct 14 07:01:07 2014 (r273070) +++ stable/10/sbin/iscontrol/iscontrol.8 Tue Oct 14 07:52:37 2014 (r273071) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 9, 2010 +.Dd October 9, 2014 .Dt ISCONTROL 8 .Os .Sh NAME @@ -41,6 +41,15 @@ .Op Fl t Ar target .Op Ar variable Ns = Ns Ar value .Sh DESCRIPTION +.Bf -symbolic +This command, along with its kernel counterpart +.Xr iscsi_initiator 4 , +is obsolete. +Users are advised to use +.Xr iscsictl 8 +instead. +.Ef +.Pp Internet SCSI (iSCSI) is a network protocol standard, that allows the use of the SCSI protocol over TCP/IP networks, the Modified: stable/10/share/man/man4/iscsi_initiator.4 ============================================================================== --- stable/10/share/man/man4/iscsi_initiator.4 Tue Oct 14 07:01:07 2014 (r273070) +++ stable/10/share/man/man4/iscsi_initiator.4 Tue Oct 14 07:52:37 2014 (r273071) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2010 +.Dd October 9, 2014 .Dt ISCSI_INITIATOR 4 .Os .Sh NAME @@ -45,6 +45,16 @@ module at boot time, place the following iscsi_initiator_load="YES" .Ed .Sh DESCRIPTION +.Bf -symbolic +This driver, along with its userspace counterpart +.Xr iscontrol 8 , +is obsolete. +Users are advised to use +.Xr iscsi 4 +instead. +.Ef +.Pp + The .Nm implements the kernel side of the Internet SCSI (iSCSI) network From owner-svn-src-stable-10@FreeBSD.ORG Tue Oct 14 12:13:03 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CBB7556; Tue, 14 Oct 2014 12:13:03 +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 4809134A; Tue, 14 Oct 2014 12:13:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9ECD3QR098788; Tue, 14 Oct 2014 12:13:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9ECD2nW098783; Tue, 14 Oct 2014 12:13:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410141213.s9ECD2nW098783@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 14 Oct 2014 12:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273078 - in stable/10: sbin/camcontrol sys/cam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 12:13:03 -0000 Author: mav Date: Tue Oct 14 12:13:01 2014 New Revision: 273078 URL: https://svnweb.freebsd.org/changeset/base/273078 Log: MFC r271588: Update CAM CCB accounting for the new status quo. devq_openings counter lost its meaning after allocation queues has gone. held counter is still meaningful, but problematic to update due to separate locking of CCB allocation and queuing. To fix that replace devq_openings counter with allocated counter. held is now calculated on request as difference between number of allocated, queued and active CCBs. Modified: stable/10/sbin/camcontrol/camcontrol.c stable/10/sys/cam/cam_ccb.h stable/10/sys/cam/cam_queue.c stable/10/sys/cam/cam_queue.h stable/10/sys/cam/cam_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Tue Oct 14 12:04:50 2014 (r273077) +++ stable/10/sbin/camcontrol/camcontrol.c Tue Oct 14 12:13:01 2014 (r273078) @@ -4469,9 +4469,9 @@ tagcontrol(struct cam_device *device, in fprintf(stdout, "%s", pathstr); fprintf(stdout, "dev_active %d\n", ccb->cgds.dev_active); fprintf(stdout, "%s", pathstr); - fprintf(stdout, "devq_openings %d\n", ccb->cgds.devq_openings); + fprintf(stdout, "allocated %d\n", ccb->cgds.allocated); fprintf(stdout, "%s", pathstr); - fprintf(stdout, "devq_queued %d\n", ccb->cgds.devq_queued); + fprintf(stdout, "queued %d\n", ccb->cgds.queued); fprintf(stdout, "%s", pathstr); fprintf(stdout, "held %d\n", ccb->cgds.held); fprintf(stdout, "%s", pathstr); Modified: stable/10/sys/cam/cam_ccb.h ============================================================================== --- stable/10/sys/cam/cam_ccb.h Tue Oct 14 12:04:50 2014 (r273077) +++ stable/10/sys/cam/cam_ccb.h Tue Oct 14 12:13:01 2014 (r273078) @@ -352,8 +352,8 @@ struct ccb_getdevstats { struct ccb_hdr ccb_h; int dev_openings; /* Space left for more work on device*/ int dev_active; /* Transactions running on the device */ - int devq_openings; /* Space left for more queued work */ - int devq_queued; /* Transactions queued to be sent */ + int allocated; /* CCBs allocated for the device */ + int queued; /* CCBs queued to be sent to the device */ int held; /* * CCBs held by peripheral drivers * for this device Modified: stable/10/sys/cam/cam_queue.c ============================================================================== --- stable/10/sys/cam/cam_queue.c Tue Oct 14 12:04:50 2014 (r273077) +++ stable/10/sys/cam/cam_queue.c Tue Oct 14 12:13:01 2014 (r273078) @@ -290,7 +290,6 @@ cam_ccbq_resize(struct cam_ccbq *ccbq, i delta = new_size - (ccbq->dev_active + ccbq->dev_openings); ccbq->total_openings += delta; - ccbq->devq_openings += delta; ccbq->dev_openings += delta; new_size = imax(64, 1 << fls(new_size + new_size / 2)); @@ -308,7 +307,6 @@ cam_ccbq_init(struct cam_ccbq *ccbq, int imax(64, 1 << fls(openings + openings / 2))) != 0) return (1); ccbq->total_openings = openings; - ccbq->devq_openings = openings; ccbq->dev_openings = openings; return (0); } Modified: stable/10/sys/cam/cam_queue.h ============================================================================== --- stable/10/sys/cam/cam_queue.h Tue Oct 14 12:04:50 2014 (r273077) +++ stable/10/sys/cam/cam_queue.h Tue Oct 14 12:13:01 2014 (r273078) @@ -62,10 +62,9 @@ struct cam_ccbq { struct ccb_hdr_tailq queue_extra_head; int queue_extra_entries; int total_openings; - int devq_openings; + int allocated; int dev_openings; int dev_active; - int held; }; struct cam_ed; @@ -188,8 +187,8 @@ cam_ccbq_pending_ccb_count(struct cam_cc static __inline void cam_ccbq_take_opening(struct cam_ccbq *ccbq) { - ccbq->devq_openings--; - ccbq->held++; + + ccbq->allocated++; } static __inline void @@ -198,8 +197,6 @@ cam_ccbq_insert_ccb(struct cam_ccbq *ccb struct ccb_hdr *old_ccb; struct camq *queue = &ccbq->queue; - ccbq->held--; - /* * If queue is already full, try to resize. * If resize fail, push CCB with lowest priority out to the TAILQ. @@ -264,7 +261,7 @@ cam_ccbq_send_ccb(struct cam_ccbq *ccbq, send_ccb->ccb_h.pinfo.index = CAM_ACTIVE_INDEX; ccbq->dev_active++; - ccbq->dev_openings--; + ccbq->dev_openings--; } static __inline void @@ -272,15 +269,14 @@ cam_ccbq_ccb_done(struct cam_ccbq *ccbq, { ccbq->dev_active--; - ccbq->dev_openings++; - ccbq->held++; + ccbq->dev_openings++; } static __inline void cam_ccbq_release_opening(struct cam_ccbq *ccbq) { - ccbq->held--; - ccbq->devq_openings++; + + ccbq->allocated--; } #endif /* _KERNEL */ Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Tue Oct 14 12:04:50 2014 (r273077) +++ stable/10/sys/cam/cam_xpt.c Tue Oct 14 12:13:01 2014 (r273078) @@ -2652,20 +2652,25 @@ call_sim: struct ccb_getdevstats *cgds; struct cam_eb *bus; struct cam_et *tar; + struct cam_devq *devq; cgds = &start_ccb->cgds; bus = path->bus; tar = path->target; + devq = bus->sim->devq; + mtx_lock(&devq->send_mtx); cgds->dev_openings = dev->ccbq.dev_openings; cgds->dev_active = dev->ccbq.dev_active; - cgds->devq_openings = dev->ccbq.devq_openings; - cgds->devq_queued = cam_ccbq_pending_ccb_count(&dev->ccbq); - cgds->held = dev->ccbq.held; + cgds->allocated = dev->ccbq.allocated; + cgds->queued = cam_ccbq_pending_ccb_count(&dev->ccbq); + cgds->held = cgds->allocated - cgds->dev_active - + cgds->queued; cgds->last_reset = tar->last_reset; cgds->maxtags = dev->maxtags; cgds->mintags = dev->mintags; if (timevalcmp(&tar->last_reset, &bus->last_reset, <)) cgds->last_reset = bus->last_reset; + mtx_unlock(&devq->send_mtx); cgds->ccb_h.status = CAM_REQ_CMP; } break; @@ -3008,7 +3013,6 @@ xpt_polled_action(union ccb *start_ccb) * can get it before us while we simulate interrupts. */ mtx_lock(&devq->send_mtx); - dev->ccbq.devq_openings--; dev->ccbq.dev_openings--; while((devq->send_openings <= 0 || dev->ccbq.dev_openings < 0) && (--timeout > 0)) { @@ -3020,7 +3024,6 @@ xpt_polled_action(union ccb *start_ccb) camisr_runqueue(); mtx_lock(&devq->send_mtx); } - dev->ccbq.devq_openings++; dev->ccbq.dev_openings++; mtx_unlock(&devq->send_mtx); From owner-svn-src-stable-10@FreeBSD.ORG Tue Oct 14 12:23:46 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7CAD835; Tue, 14 Oct 2014 12:23:46 +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 D1A66630; Tue, 14 Oct 2014 12:23:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9ECNkan003815; Tue, 14 Oct 2014 12:23:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9ECNjEp003809; Tue, 14 Oct 2014 12:23:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410141223.s9ECNjEp003809@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 14 Oct 2014 12:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273080 - in stable/10: release release/amd64 release/i386 share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 12:23:47 -0000 Author: gjb Date: Tue Oct 14 12:23:44 2014 New Revision: 273080 URL: https://svnweb.freebsd.org/changeset/base/273080 Log: MFC r272414: Merge the following revisions from ^/projects/release-vmimage: r272234, r272236, r272262, r272264, r272269, r272271, r272272, r272277, r272279, r272376, r272380, r272381, r272392, r272234, r272412: r272234: Initial commit to include virtual machine images as part of the FreeBSD release builds. This adds a make(1) environment variable requirement, WITH_VMIMAGES, which triggers the virtual machine image targets when not defined to an empty value. Relevant user-driven variables include: o VMFORMATS: The virtual machine image formats to create. Valid formats are provided by running 'mkimg --formats' o VMSIZE: The size of the resulting virtual machine image. Typical compression is roughly 140Mb, regardless of the target size (10GB, 15GB, 20GB, 40GB sizes have been tested with the same result). o VMBASE: The prefix of the virtual machine disk images. The VMBASE make(1) environment variable is suffixed with each format in VMFORMATS for each individual disk image, as well as '.img' for the source UFS filesystem passed to mkimg(1). This also includes a new script, mk-vmimage.sh, based on how the VM images for 10.0-RELEASE, 9.3-RELEASE, and 10.1-RELEASE were created (mk-vmimage.sh in ^/user/gjb/thermite/). With the order in which the stages need to occur, as well as sanity-checking error cases, it makes much more sense to execute a shell script called from make(1), using env(1) to set specific parameters for the target image than it does to do this in make(1) directly. r272236: Use VMBASE in place of a hard-coded filename in the CLEANFILES list. r272262: Remove a 'set -x' that snuck in during testing. r272264: release/Makefile: Connect the virtual machine image build to the release target if WITH_VMIMAGES is set to a non-empty value. release/release.sh: Add WITH_VMIMAGES to RELEASE_RMAKEFLAGS. release/release.conf.sample: Add commented entries for tuning the release build if the WITH_VMIMAGES make(1) environment variable is set to a non-empty value. r272269: release/Makefile: Include .OBJDIR in DESTDIR in the vm-base target. release/release.sh: Provide the full path to mddev. r272271: Fix UFS label for the root filesystem. r272272: Remove comments left in accidentally while testing, so the VM /etc/fstab is actually created. r272277: Remove the UFS label from the root filesystem since it is added by mkimg(1) as a gpt label, consistent with the fstab(5) entry. r272279: Comment cleanup in panic() message when mkimg(1) does not support the requested disk image format. r272376: Separate release/scripts/mk-vmimage.sh to machine-specific scripts, making it possible to mimic the functionality for non-x86 targets. Move echo output if MAKEFLAGS is empty outside of usage(). Remove TARGET/TARGET_ARCH evaluation. r272380: Avoid using env(1) to set values passed to mk-vmimage.sh, and instead pass the values as arguments to the script, making it easier to run this by hand, without 'make release'. Add usage_vm_base() and usage_vm_image() usage helpers. r272381: After evaluating WITH_VMIMAGES is non-empty, ensure the mk-vmimage.sh script exists before running it. r272392: Add WITH_COMPRESSED_VMIMAGES variable, which when set enables xz(1) compression of the virtual machine images. This is intentionally separate to allow more fine-grained tuning over which images are compressed, especially in cases where compressing 20GB sparse images can take hours. r272412: Document the new 'vm-image' target, and associated release.conf variables. r272413: Remove two stray comments added during the initial iterations of testing, no longer needed. Sponsored by: The FreeBSD Foundation Added: stable/10/release/amd64/mk-vmimage.sh - copied unchanged from r272414, head/release/amd64/mk-vmimage.sh stable/10/release/i386/mk-vmimage.sh - copied unchanged from r272414, head/release/i386/mk-vmimage.sh Modified: stable/10/release/Makefile stable/10/release/release.conf.sample stable/10/release/release.sh stable/10/share/man/man7/release.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Tue Oct 14 12:13:43 2014 (r273079) +++ stable/10/release/Makefile Tue Oct 14 12:23:44 2014 (r273080) @@ -23,6 +23,9 @@ # WITH_DVD: if set, generate dvd1.iso # WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1) # (uncompressed images are not removed) +# WITH_VMIMAGES: if set, build virtual machine images with the release +# WITH_COMPRESSED_VMIMAGES: if set, compress virtual machine disk images +# with xz(1) (extremely time consuming) # TARGET/TARGET_ARCH: architecture of built release # @@ -110,6 +113,11 @@ IMAGES+= uefi-dvd1.iso . endif .endif +VMTARGETS= vm-base vm-image +VMFORMATS?= vhd vmdk qcow2 raw +VMSIZE?= 20G +VMBASE?= vm + CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} .if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) . for I in ${IMAGES} @@ -119,7 +127,16 @@ CLEANFILES+= ${I}.xz .if defined(WITH_DVD) && !empty(WITH_DVD) CLEANFILES+= pkg-stage .endif +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) +CLEANFILES+= ${VMBASE}.img +. for FORMAT in ${VMFORMATS} +CLEANFILES+= ${VMBASE}.${FORMAT} +. endfor +.endif CLEANDIRS= dist ftp release bootonly dvd +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) +CLEANDIRS+= ${VMTARGETS} +.endif beforeclean: chflags -R noschg . .include @@ -297,6 +314,9 @@ ftp: packagesystem release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS} +.endif install: .if defined(DESTDIR) && !empty(DESTDIR) @@ -311,3 +331,44 @@ install: .endfor cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) + mkdir -p ${DESTDIR}/vmimages +. for FORMAT in ${VMFORMATS} + cp -p ${VMBASE}.${FORMAT} \ + ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} +. endfor +. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES) +# This is very time consuming, so defer it after the images are moved to +# the DESTDIR. +. for FORMAT in ${VMFORMATS} + # Don't keep the originals. There is a copy in ${.OBJDIR} if needed. + ${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} +. endfor +. endif + cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \ + ${DESTDIR}/vmimages/CHECKSUM.SHA256 + cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \ + ${DESTDIR}/vmimages/CHECKSUM.MD5 +.endif + +vm-base: +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) +. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) + env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ + ${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE} +. endif +.endif + touch ${.TARGET} + +vm-image: vm-base +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) +. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) +. for FORMAT in ${VMFORMATS} + env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ + ${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT} +. endfor +. endif +.endif + touch ${.TARGET} Copied: stable/10/release/amd64/mk-vmimage.sh (from r272414, head/release/amd64/mk-vmimage.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/amd64/mk-vmimage.sh Tue Oct 14 12:23:44 2014 (r273080, copy of r272414, head/release/amd64/mk-vmimage.sh) @@ -0,0 +1,188 @@ +#!/bin/sh +#- +# Copyright (c) 2014 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Glen Barber under sponsorship +# from the FreeBSD Foundation. +# +# 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. +# +# mk-vmimage.sh: Create virtual machine disk images in various formats. +# +# $FreeBSD$ +# + +PATH="/bin:/usr/bin:/sbin:/usr/sbin" +export PATH + +usage_vm_base() { + echo -n "$(basename ${0}) vm-base " + echo " " + return 0 +} + +usage_vm_image() { + echo -n "$(basename ${0}) vm-image " + echo " " + return 0 +} + +usage() { + echo "Usage:" + echo "$(basename ${0}) [vm-base|vm-image] [...]" + echo + usage_vm_base + echo + usage_vm_image + exit 1 +} + +panic() { + rc="${1}" + shift 1 + msg="${@}" + printf "${msg}\n" + if [ ! -z "${mddev}" ]; then + mdconfig -d -u ${mddev} + fi + # Do not allow one failure case to chain through any remaining image + # builds. + exit 0 +} + +vm_create_baseimage() { + # Creates the UFS root filesystem for the virtual machine disk, + # written to the formatted disk image with mkimg(1). + # + # Arguments: + # vm-base + + VMBASE="${1}" + WORLDDIR="${2}" + DESTDIR="${3}" + VMSIZE="${4}" + + if [ -z "${VMBASE}" -o -z "${WORLDDIR}" -o -z "${DESTDIR}" \ + -o -z "${VMSIZE}" ]; then + usage + fi + + i=0 + mkdir -p ${DESTDIR} + truncate -s ${VMSIZE} ${VMBASE} + mddev=$(mdconfig -f ${VMBASE}) + newfs -j /dev/${mddev} + mount /dev/${mddev} ${DESTDIR} + cd ${WORLDDIR} && \ + make DESTDIR=${DESTDIR} \ + installworld installkernel distribution || \ + panic 1 "\n\nCannot install the base system to ${DESTDIR}." + chroot ${DESTDIR} /usr/bin/newaliases + echo '# Custom /etc/fstab for FreeBSD VM images' \ + > ${DESTDIR}/etc/fstab + echo '/dev/gpt/rootfs / ufs rw 2 2' \ + >> ${DESTDIR}/etc/fstab + echo '/dev/gpt/swapfs none swap sw 0 0' \ + >> ${DESTDIR}/etc/fstab + sync + while ! umount ${DESTDIR}; do + i=$(( $i + 1 )) + if [ $i -ge 10 ]; then + # This should never happen. But, it has happened. + msg="Cannot umount(8) ${DESTDIR}\n" + msg="${msg}Something has gone horribly wrong." + panic 1 "${msg}" + fi + sleep 1 + done + + return 0 +} + +vm_create_vmdisk() { + # Creates the virtual machine disk image from the raw disk image. + # + # Arguments: + # vm-image " + + VMBASE="${1}" + FORMAT="${2}" + VMIMAGE="${3}" + + if [ -z "${VMBASE}" -o -z "${FORMAT}" -o -z "${VMIMAGE}" ]; then + usage + fi + + mkimg_version=$(mkimg --version 2>/dev/null | awk '{print $2}') + + # We need mkimg(1) '--version' output, at minimum, to be able to + # tell what virtual machine disk image formats are available. + # Bail if mkimg(1) reports an empty '--version' value. + if [ -z "${mkimg_version}" ]; then + msg="Cannot determine mkimg(1) version.\n" + msg="${msg}Cannot continue without a known mkimg(1) version." + panic 0 "${msg}" + fi + + if ! mkimg --formats 2>/dev/null | grep -q ${FORMAT}; then + panic 0 "'${FORMAT}' is not supported by this mkimg(1).\n" + fi + + case ${FORMAT} in + vhd) + mkimg_format=vhdf + ;; + *) + mkimg_format=${FORMAT} + ;; + esac + + mkimg -f ${mkimg_format} -s gpt \ + -b /boot/pmbr -p freebsd-boot/bootfs:=/boot/gptboot \ + -p freebsd-swap/swapfs::1G \ + -p freebsd-ufs/rootfs:=${VMBASE} \ + -o ${VMIMAGE} + + return 0 +} + +main() { + cmd="${1}" + shift 1 + + case ${cmd} in + vm-base) + eval vm_create_baseimage "$@" || return 0 + ;; + vm-image) + eval vm_create_vmdisk "$@" || return 0 + ;; + *|\?) + usage + ;; + esac + + return 0 +} + +main "$@" Copied: stable/10/release/i386/mk-vmimage.sh (from r272414, head/release/i386/mk-vmimage.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/i386/mk-vmimage.sh Tue Oct 14 12:23:44 2014 (r273080, copy of r272414, head/release/i386/mk-vmimage.sh) @@ -0,0 +1,188 @@ +#!/bin/sh +#- +# Copyright (c) 2014 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Glen Barber under sponsorship +# from the FreeBSD Foundation. +# +# 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. +# +# mk-vmimage.sh: Create virtual machine disk images in various formats. +# +# $FreeBSD$ +# + +PATH="/bin:/usr/bin:/sbin:/usr/sbin" +export PATH + +usage_vm_base() { + echo -n "$(basename ${0}) vm-base " + echo " " + return 0 +} + +usage_vm_image() { + echo -n "$(basename ${0}) vm-image " + echo " " + return 0 +} + +usage() { + echo "Usage:" + echo "$(basename ${0}) [vm-base|vm-image] [...]" + echo + usage_vm_base + echo + usage_vm_image + exit 1 +} + +panic() { + rc="${1}" + shift 1 + msg="${@}" + printf "${msg}\n" + if [ ! -z "${mddev}" ]; then + mdconfig -d -u ${mddev} + fi + # Do not allow one failure case to chain through any remaining image + # builds. + exit 0 +} + +vm_create_baseimage() { + # Creates the UFS root filesystem for the virtual machine disk, + # written to the formatted disk image with mkimg(1). + # + # Arguments: + # vm-base + + VMBASE="${1}" + WORLDDIR="${2}" + DESTDIR="${3}" + VMSIZE="${4}" + + if [ -z "${VMBASE}" -o -z "${WORLDDIR}" -o -z "${DESTDIR}" \ + -o -z "${VMSIZE}" ]; then + usage + fi + + i=0 + mkdir -p ${DESTDIR} + truncate -s ${VMSIZE} ${VMBASE} + mddev=$(mdconfig -f ${VMBASE}) + newfs -j /dev/${mddev} + mount /dev/${mddev} ${DESTDIR} + cd ${WORLDDIR} && \ + make DESTDIR=${DESTDIR} \ + installworld installkernel distribution || \ + panic 1 "\n\nCannot install the base system to ${DESTDIR}." + chroot ${DESTDIR} /usr/bin/newaliases + echo '# Custom /etc/fstab for FreeBSD VM images' \ + > ${DESTDIR}/etc/fstab + echo '/dev/gpt/rootfs / ufs rw 2 2' \ + >> ${DESTDIR}/etc/fstab + echo '/dev/gpt/swapfs none swap sw 0 0' \ + >> ${DESTDIR}/etc/fstab + sync + while ! umount ${DESTDIR}; do + i=$(( $i + 1 )) + if [ $i -ge 10 ]; then + # This should never happen. But, it has happened. + msg="Cannot umount(8) ${DESTDIR}\n" + msg="${msg}Something has gone horribly wrong." + panic 1 "${msg}" + fi + sleep 1 + done + + return 0 +} + +vm_create_vmdisk() { + # Creates the virtual machine disk image from the raw disk image. + # + # Arguments: + # vm-image " + + VMBASE="${1}" + FORMAT="${2}" + VMIMAGE="${3}" + + if [ -z "${VMBASE}" -o -z "${FORMAT}" -o -z "${VMIMAGE}" ]; then + usage + fi + + mkimg_version=$(mkimg --version 2>/dev/null | awk '{print $2}') + + # We need mkimg(1) '--version' output, at minimum, to be able to + # tell what virtual machine disk image formats are available. + # Bail if mkimg(1) reports an empty '--version' value. + if [ -z "${mkimg_version}" ]; then + msg="Cannot determine mkimg(1) version.\n" + msg="${msg}Cannot continue without a known mkimg(1) version." + panic 0 "${msg}" + fi + + if ! mkimg --formats 2>/dev/null | grep -q ${FORMAT}; then + panic 0 "'${FORMAT}' is not supported by this mkimg(1).\n" + fi + + case ${FORMAT} in + vhd) + mkimg_format=vhdf + ;; + *) + mkimg_format=${FORMAT} + ;; + esac + + mkimg -f ${mkimg_format} -s gpt \ + -b /boot/pmbr -p freebsd-boot/bootfs:=/boot/gptboot \ + -p freebsd-swap/swapfs::1G \ + -p freebsd-ufs/rootfs:=${VMBASE} \ + -o ${VMIMAGE} + + return 0 +} + +main() { + cmd="${1}" + shift 1 + + case ${cmd} in + vm-base) + eval vm_create_baseimage "$@" || return 0 + ;; + vm-image) + eval vm_create_vmdisk "$@" || return 0 + ;; + *|\?) + usage + ;; + esac + + return 0 +} + +main "$@" Modified: stable/10/release/release.conf.sample ============================================================================== --- stable/10/release/release.conf.sample Tue Oct 14 12:13:43 2014 (r273079) +++ stable/10/release/release.conf.sample Tue Oct 14 12:23:44 2014 (r273080) @@ -72,3 +72,24 @@ PORTBRANCH="ports/head@rHEAD" ## as TARGET/TARGET_ARCH. #CHROOT_MAKEENV= +## Set to a non-empty value to build virtual machine images as part of the +## release build. +#WITH_VMIMAGES= + +## Set to a non-empty value to compress virtual machine images with xz(1) +## as part of the release build. +#WITH_COMPRESSED_VMIMAGES= + +## If WITH_VMIMAGES is set to a non-empty value, this is the name of the +## file to use for the installed userland/kernel. +#VMBASE="vm" + +## If WITH_VMIMAGES is set to a non-empty value, this is the size of the +## virtual machine disk filesystem. Valid size values are described in +## the truncate(1) manual page. +#VMSIZE="20G" + +## If WITH_VMIMAGES is set to a non-empty value, this is a list of disk +## image formats to create. Valid values are listed in the mkimg(1) +## manual page, as well as 'mkimg --formats' output. +#VMFORMATS="vhdf vmdk qcow2 raw" Modified: stable/10/release/release.sh ============================================================================== --- stable/10/release/release.sh Tue Oct 14 12:13:43 2014 (r273079) +++ stable/10/release/release.sh Tue Oct 14 12:23:44 2014 (r273080) @@ -85,6 +85,11 @@ NOPORTS= WITH_DVD= WITH_COMPRESSED_IMAGES= +# Set to non-empty value to build virtual machine images as part of +# the release. +WITH_VMIMAGES= +WITH_COMPRESSED_VMIMAGES= + usage() { echo "Usage: $0 [-c release.conf]" exit 1 @@ -168,7 +173,7 @@ CHROOT_DMAKEFLAGS="${CONF_FILES}" RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS} WITH_DVD=${WITH_DVD}" + ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES}" # Force src checkout if configured FORCE_SRC_KEY= @@ -271,4 +276,5 @@ eval chroot ${CHROOTDIR} make -C /usr/sr eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ release eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} + install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ + WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} Modified: stable/10/share/man/man7/release.7 ============================================================================== --- stable/10/share/man/man7/release.7 Tue Oct 14 12:13:43 2014 (r273079) +++ stable/10/share/man/man7/release.7 Tue Oct 14 12:23:44 2014 (r273080) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2014 +.Dd October 2, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -351,6 +351,61 @@ Set to the target directory within to check out .Va ${UBOOTSRC}/${UBOOTBRANCH} . .El +.Sh VIRTUAL MACHINE DISK IMAGES +The following +.Fa release.conf +variables are relevant only to virtual machine disk image builds: +.Bl -tag -width Ev +.It Va WITH_VMIMAGES +Set to a non-null value to build virtual machine disk images as part +of the release build. +.Va WITH_VMIMAGES +may also be specified as an envirionment variable passed to +.Xr make 1 . +.Pp +The option requires +.Xr mkimg 1 +version 20140927 or later. +.It Va WITH_COMPRESSED_VMIMAGES +Set to a non-null value to compress the virtual machine disk images with +.Xr xz 1 +as part of the +.Cm install +.Xr make 1 +target. +Note that compressing virtual machine disk images may take a very long +time on some systems. +.It Va VMBASE +Set to change the name of the resulting virtual machine disk image file. +The default value is +.Va vm . +.It Va VMSIZE +Set to change the size of the virtual machine disk capacity. +The default value is +.Va 20G . +See +.Xr truncate 1 +for valid values. +.Pp +Virtual machine disk images are, by default, created as sparse images. +When +.Va WITH_COMPRESSED_VMIMAGES +is used, the resulting files compressed with +.Xr xz 1 +compress to roughly the same size, regardless of the specified disk image +size. +.It Va VMFORMATS +Set to the target virtual disk image format(s) to create. +By default, the +.Va vhdf , Va vmdk , Va qcow2 , +and +.Va raw +formats are created. +See +.Xr mkimg 1 +for valid format values +.Pq requires version 20140927 or later . +.El .Sh MAKEFILE TARGETS The release makefile .Pq Pa src/release/Makefile @@ -407,6 +462,14 @@ Creates a directory named .Pa ftp containing the distribution files used in network installations and suitable for upload to an FTP mirror. +.It Cm vm-image +Creates virtual machine disk images in various formats. +The +.Cm vm-image +target requires the +.Va WITH_VMIMAGES +.Xr make 1 +envirionment variable to be set to a non-null value. .El .Pp Major subtargets called by targets above: From owner-svn-src-stable-10@FreeBSD.ORG Tue Oct 14 13:03:12 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44ACD7DF; Tue, 14 Oct 2014 13:03: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 2FDF8AA6; Tue, 14 Oct 2014 13:03: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 s9ED3Ci9023135; Tue, 14 Oct 2014 13:03:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9ED3BGv023132; Tue, 14 Oct 2014 13:03:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410141303.s9ED3BGv023132@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 14 Oct 2014 13:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273084 - in stable/10/release/doc: en_US.ISO8859-1/errata share/xml X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 13:03:12 -0000 Author: gjb Date: Tue Oct 14 13:03:11 2014 New Revision: 273084 URL: https://svnweb.freebsd.org/changeset/base/273084 Log: Update the FreeBSD versions in the stable/10 errata documentation to reflect reality. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml stable/10/release/doc/share/xml/release.ent Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Oct 14 12:49:49 2014 (r273083) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Oct 14 13:03:11 2014 (r273084) @@ -10,7 +10,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"> - &os; &release.prev; Errata + &os; &release.current; Errata The &os; Project @@ -31,7 +31,7 @@ - This document lists errata items for &os; &release.prev;, + This document lists errata items for &os; &release.current;, containing significant information discovered after the release or too late in the release cycle to be otherwise included in the release documentation. This information @@ -41,7 +41,7 @@ always be consulted before installing this version of &os;. - This errata document for &os; &release.prev; will be + This errata document for &os; &release.current; will be maintained until the release of &os; &release.next;. Modified: stable/10/release/doc/share/xml/release.ent ============================================================================== --- stable/10/release/doc/share/xml/release.ent Tue Oct 14 12:49:49 2014 (r273083) +++ stable/10/release/doc/share/xml/release.ent Tue Oct 14 13:03:11 2014 (r273084) @@ -6,7 +6,7 @@ - + - + - + - + @@ -35,8 +35,8 @@ - - + + Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8519C936; Tue, 14 Oct 2014 13:06:14 +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 6F175ABF; Tue, 14 Oct 2014 13:06:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9ED6EKZ023607; Tue, 14 Oct 2014 13:06:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9ED6Ewt023606; Tue, 14 Oct 2014 13:06:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410141306.s9ED6Ewt023606@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 14 Oct 2014 13:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273085 - stable/10/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 13:06:14 -0000 Author: gjb Date: Tue Oct 14 13:06:13 2014 New Revision: 273085 URL: https://svnweb.freebsd.org/changeset/base/273085 Log: Clean up the stable/10 errata document now that releng/10.1 has precedence over releng/10.0. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Oct 14 13:03:11 2014 (r273084) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Oct 14 13:06:13 2014 (r273085) @@ -91,148 +91,9 @@ - SA-13:14.openssh - - 19 November 2013 - - OpenSSH AES-GCM memory corruption - vulnerability - - - - SA-14:01.bsnmpd - - 14 January 2014 - - bsnmpd remote denial of service vulnerability - - - - SA-14:02.ntpd - - 14 January 2014 - - ntpd distributed reflection Denial of Service vulnerability - - - - SA-14:03.openssl - - 14 January 2014 - - OpenSSL multiple vulnerabilities - - - - SA-14:04.bind - - 14 January 2014 - - BIND remote denial of service vulnerability - - - - SA-14:05.nfsserver - - 8 April 2014 - - Deadlock in the NFS server - - - - SA-14:06.openssl - - 8 April 2014 - - OpenSSL multiple vulnerabilities - - - - SA-14:07.devfs - 30 April 2014 - Fix devfs rules not applied by default for - jails - - - - SA-14:08.tcp - 30 April 2014 - Fix TCP reassembly - vulnerability - - - - SA-14:09.openssl - 30 April 2014 - Fix OpenSSL use-after-free - vulnerability - - - - SA-14:10.openssl - 15 May 2014 - Fix OpenSSL NULL pointer deference - vulnerability - - - - SA-14:11.sendmail - 3 June 2014 - Fix sendmail improper close-on-exec flag - handling - - - - SA-14:13.pam - 3 June 2014 - Fix incorrect error handling in PAM policy - parser - - - - SA-14:14.openssl - 5 June 2014 - Multiple vulnerabilities - - - - SA-14:15.iconv - 24 June 2014 - NULL pointer dereference and out-of-bounds - array access - - - - SA-14:16.file - 24 June 2014 - Multiple vulnerabilities - - - - SA-14:17.kmem - 8 July 2014 - Kernel memory disclosure in control messages - and SCTP notifications - - - - SA-14:18.openssl - 9 September 2014 - Multiple vulnerabilities - - - - SA-14:19.tcp - 16 September 2014 - Denial of Service in TCP packet - processing. + No advisories. +   +   @@ -271,88 +132,6 @@ boot instability may be present on virtual machines running on other hypervisors, such as Xen or KVM. - - - A bug in Heimdal (an - implementation of Kerberos - authentication in &os; base system) has been fixed. It - could cause an interoperability issue between - Heimdal and the other - implementations including MIT - Kerberos. However, due to this fix, - Heimdal and some applications - which depend on it in the previous &os; releases do not work - with one in &release.prev; in certain cases. Errata Notice - for the supported releases to fix it will be - released. - - - - A bug in &man.killall.1; has been discovered. It - makes killall -INT to deliver - SIGTERM rather than the desired - SIGINT, and may cause blocking - behavior for scripts that uses it, as -I - means interactive. A workaround of this - would be to use -SIGINT instead. - This bug has been fixed on &os;-CURRENT and will be fixed - in &os; &release.current;. - - - - The &man.bxe.4; driver can cause packet corruption when - TSO (TCP Segmentation Offload) feature is enabled. This - feature is enabled by default and can be disabled by using a - parameter of &man.ifconfig.8;. It can - be specified in &man.rc.conf.5; like the following: - - ifconfig_bxe0="DHCP -tso" - - This bug has been fixed on &os; - &release.current;. - - - - Due to a minor incompatibility with &man.pkg.7; version - 1.2.x, &man.bsdconfig.8; will duplicate - the list of available packages for installation. This is - due to the PACKAGESITE environment - variable being set for backwards compatibility with older - versions of &man.pkg.7;. This affects generation of the - available package list only, and does not affect the - behavior when processing packages for installation. - - - - A regression in &man.pw.8; does not remove a user from - groups not specified in the provided group list when the - -G flag is used. This is expected to be - corrected in &os;-CURRENT and &os; &release.current;. - - - - &man.ipfw.8; fwd action can send - packets to the correct interface with a wrong link-layer - address when the route is updated. This bug has been fixed - on &os;-CURRENT and will be fixed in &os; - &release.current;. - - - - The &man.mount.udf.8; utility has a bug which prevents - it from mounting any UDF file system. This has been fixed - in &os;-CURRENT and &os; &release.current;. - - - - Updating LSI firmware on &man.mps.4; controllers with - the sas2flash utility may cause - the system to hang, or may cause the system to panic. This - is fixed in the stable/10 branch with - revisions r262553 and - r262575, and will be included in - &os; 10.1-RELEASE. - From owner-svn-src-stable-10@FreeBSD.ORG Tue Oct 14 16:44:17 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 100A5809; Tue, 14 Oct 2014 16:44:17 +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 EF3D1680; Tue, 14 Oct 2014 16:44: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 s9EGiG3A033986; Tue, 14 Oct 2014 16:44:16 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9EGiG2W033984; Tue, 14 Oct 2014 16:44:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410141644.s9EGiG2W033984@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 14 Oct 2014 16:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273100 - in stable/10/release/doc: en_US.ISO8859-1/errata share/xml X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 16:44:17 -0000 Author: gjb Date: Tue Oct 14 16:44:15 2014 New Revision: 273100 URL: https://svnweb.freebsd.org/changeset/base/273100 Log: Revert r273084: In the stable/ branches, release.prev intentionally points to the previous version, in addition to a number of intentional version mappings for the errata.html page, that this commit breaks. Reported by: hrs Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml stable/10/release/doc/share/xml/release.ent Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Oct 14 16:28:37 2014 (r273099) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Oct 14 16:44:15 2014 (r273100) @@ -10,7 +10,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"> - &os; &release.current; Errata + &os; &release.prev; Errata The &os; Project @@ -31,7 +31,7 @@ - This document lists errata items for &os; &release.current;, + This document lists errata items for &os; &release.prev;, containing significant information discovered after the release or too late in the release cycle to be otherwise included in the release documentation. This information @@ -41,7 +41,7 @@ always be consulted before installing this version of &os;. - This errata document for &os; &release.current; will be + This errata document for &os; &release.prev; will be maintained until the release of &os; &release.next;. Modified: stable/10/release/doc/share/xml/release.ent ============================================================================== --- stable/10/release/doc/share/xml/release.ent Tue Oct 14 16:28:37 2014 (r273099) +++ stable/10/release/doc/share/xml/release.ent Tue Oct 14 16:44:15 2014 (r273100) @@ -6,7 +6,7 @@ - + - + - + - + @@ -35,8 +35,8 @@ - - + + Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F0DD8F9; Tue, 14 Oct 2014 19:21:05 +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 8A6289EF; Tue, 14 Oct 2014 19:21:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9EJL56d009666; Tue, 14 Oct 2014 19:21:05 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9EJL53X009665; Tue, 14 Oct 2014 19:21:05 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201410141921.s9EJL53X009665@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Tue, 14 Oct 2014 19:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273105 - stable/10/sbin/mount X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 19:21:05 -0000 Author: skreuzer (doc,ports committer) Date: Tue Oct 14 19:21:04 2014 New Revision: 273105 URL: https://svnweb.freebsd.org/changeset/base/273105 Log: MFC r269627: Mention tmpfs(5) PR: 192389 Submitted by: yaneurabeya@gmail.com Approved by: hrs (mentor) Modified: stable/10/sbin/mount/mount.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/mount/mount.8 ============================================================================== --- stable/10/sbin/mount/mount.8 Tue Oct 14 19:10:00 2014 (r273104) +++ stable/10/sbin/mount/mount.8 Tue Oct 14 19:21:04 2014 (r273105) @@ -556,6 +556,7 @@ support for a particular file system mig .Xr mount_smbfs 8 , .Xr mount_udf 8 , .Xr mount_unionfs 8 , +.Xr tmpfs 5 , .Xr umount 8 , .Xr zfs 8 , .Xr zpool 8 From owner-svn-src-stable-10@FreeBSD.ORG Tue Oct 14 21:19:25 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B506F605; Tue, 14 Oct 2014 21:19:25 +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 96F0084F; Tue, 14 Oct 2014 21:19:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9ELJPwx064295; Tue, 14 Oct 2014 21:19:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9ELJOuR064290; Tue, 14 Oct 2014 21:19:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410142119.s9ELJOuR064290@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 14 Oct 2014 21:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273109 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 21:19:25 -0000 Author: mjg Date: Tue Oct 14 21:19:23 2014 New Revision: 273109 URL: https://svnweb.freebsd.org/changeset/base/273109 Log: MFC r269023,r272503,r272505,r272523,r272567,r272569,r272574 Prepare fget_unlocked for reading fd table only once. Some capsicum functions accept fdp + fd and lookup fde based on that. Add variants which accept fde. =============================== Add sequence counters with memory barriers. Current implementation is somewhat simplistic and hackish, will be improved later after possible memory barrier overhaul. =============================== Plug capability races. fp and appropriate capability lookups were not atomic, which could result in improper capabilities being checked. This could result either in protection bypass or in a spurious ENOTCAPABLE. Make fp + capability check atomic with the help of sequence counters. =============================== Put and #ifdef _KERNEL around the #include for opt_capsicum.h to hopefully allow the build to finish after r272505. =============================== filedesc: fix up breakage introduced in 272505 Include sequence counter supports incoditionally [1]. This fixes reprted build problems with e.g. nvidia driver due to missing opt_capsicum.h. Replace fishy looking sizeof with offsetof. Make fde_seq the last member in order to simplify calculations. =============================== Keep struct filedescent comments within 80-char limit. =============================== seq_t needs to be visible to userspace Added: stable/10/sys/sys/seq.h - copied, changed from r272503, head/sys/sys/seq.h Modified: stable/10/sys/kern/kern_descrip.c stable/10/sys/kern/sys_capability.c stable/10/sys/sys/capability.h stable/10/sys/sys/filedesc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Tue Oct 14 21:02:33 2014 (r273108) +++ stable/10/sys/kern/kern_descrip.c Tue Oct 14 21:19:23 2014 (r273109) @@ -304,11 +304,18 @@ _fdfree(struct filedesc *fdp, int fd, in struct filedescent *fde; fde = &fdp->fd_ofiles[fd]; +#ifdef CAPABILITIES + if (!last) + seq_write_begin(&fde->fde_seq); +#endif filecaps_free(&fde->fde_caps); if (last) return; - bzero(fde, sizeof(*fde)); + bzero(fde, fde_change_size); fdunused(fdp, fd); +#ifdef CAPABILITIES + seq_write_end(&fde->fde_seq); +#endif } static inline void @@ -899,13 +906,19 @@ do_dup(struct thread *td, int flags, int /* * Duplicate the source descriptor. */ +#ifdef CAPABILITIES + seq_write_begin(&newfde->fde_seq); +#endif filecaps_free(&newfde->fde_caps); - *newfde = *oldfde; + memcpy(newfde, oldfde, fde_change_size); filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps); if ((flags & DUP_CLOEXEC) != 0) newfde->fde_flags = oldfde->fde_flags | UF_EXCLOSE; else newfde->fde_flags = oldfde->fde_flags & ~UF_EXCLOSE; +#ifdef CAPABILITIES + seq_write_end(&newfde->fde_seq); +#endif *retval = new; if (delfp != NULL) { @@ -1804,6 +1817,9 @@ finstall(struct thread *td, struct file } fhold(fp); fde = &fdp->fd_ofiles[*fd]; +#ifdef CAPABILITIES + seq_write_begin(&fde->fde_seq); +#endif fde->fde_file = fp; if ((flags & O_CLOEXEC) != 0) fde->fde_flags |= UF_EXCLOSE; @@ -1811,6 +1827,9 @@ finstall(struct thread *td, struct file filecaps_move(fcaps, &fde->fde_caps); else filecaps_fill(&fde->fde_caps); +#ifdef CAPABILITIES + seq_write_end(&fde->fde_seq); +#endif FILEDESC_XUNLOCK(fdp); return (0); } @@ -2336,9 +2355,13 @@ int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, int needfcntl, struct file **fpp, cap_rights_t *haverightsp) { +#ifdef CAPABILITIES + struct filedescent fde; +#endif struct file *fp; u_int count; #ifdef CAPABILITIES + seq_t seq; cap_rights_t haverights; int error; #endif @@ -2358,17 +2381,27 @@ fget_unlocked(struct filedesc *fdp, int * due to preemption. */ for (;;) { +#ifdef CAPABILITIES + seq = seq_read(fd_seq(fdp, fd)); + fde = fdp->fd_ofiles[fd]; + if (!seq_consistent(fd_seq(fdp, fd), seq)) { + cpu_spinwait(); + continue; + } + fp = fde.fde_file; +#else fp = fdp->fd_ofiles[fd].fde_file; +#endif if (fp == NULL) return (EBADF); #ifdef CAPABILITIES - haverights = *cap_rights(fdp, fd); + haverights = *cap_rights_fde(&fde); if (needrightsp != NULL) { error = cap_check(&haverights, needrightsp); if (error != 0) return (error); if (cap_rights_is_set(needrightsp, CAP_FCNTL)) { - error = cap_fcntl_check(fdp, fd, needfcntl); + error = cap_fcntl_check_fde(&fde, needfcntl); if (error != 0) return (error); } @@ -2383,7 +2416,11 @@ fget_unlocked(struct filedesc *fdp, int */ if (atomic_cmpset_acq_int(&fp->f_count, count, count + 1) != 1) continue; +#ifdef CAPABILITIES + if (seq_consistent_nomb(fd_seq(fdp, fd), seq)) +#else if (fp == fdp->fd_ofiles[fd].fde_file) +#endif break; fdrop(fp, curthread); } @@ -2740,6 +2777,7 @@ int dupfdopen(struct thread *td, struct filedesc *fdp, int dfd, int mode, int openerror, int *indxp) { + struct filedescent *newfde, *oldfde; struct file *fp; int error, indx; @@ -2783,17 +2821,32 @@ dupfdopen(struct thread *td, struct file return (EACCES); } fhold(fp); - fdp->fd_ofiles[indx] = fdp->fd_ofiles[dfd]; - filecaps_copy(&fdp->fd_ofiles[dfd].fde_caps, - &fdp->fd_ofiles[indx].fde_caps); + newfde = &fdp->fd_ofiles[indx]; + oldfde = &fdp->fd_ofiles[dfd]; +#ifdef CAPABILITIES + seq_write_begin(&newfde->fde_seq); +#endif + memcpy(newfde, oldfde, fde_change_size); + filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps); +#ifdef CAPABILITIES + seq_write_end(&newfde->fde_seq); +#endif break; case ENXIO: /* * Steal away the file pointer from dfd and stuff it into indx. */ - fdp->fd_ofiles[indx] = fdp->fd_ofiles[dfd]; - bzero(&fdp->fd_ofiles[dfd], sizeof(fdp->fd_ofiles[dfd])); + newfde = &fdp->fd_ofiles[indx]; + oldfde = &fdp->fd_ofiles[dfd]; +#ifdef CAPABILITIES + seq_write_begin(&newfde->fde_seq); +#endif + memcpy(newfde, oldfde, fde_change_size); + bzero(oldfde, fde_change_size); fdunused(fdp, dfd); +#ifdef CAPABILITIES + seq_write_end(&newfde->fde_seq); +#endif break; } FILEDESC_XUNLOCK(fdp); Modified: stable/10/sys/kern/sys_capability.c ============================================================================== --- stable/10/sys/kern/sys_capability.c Tue Oct 14 21:02:33 2014 (r273108) +++ stable/10/sys/kern/sys_capability.c Tue Oct 14 21:19:23 2014 (r273109) @@ -199,11 +199,19 @@ cap_rights_to_vmprot(cap_rights_t *havep * any other way, as we want to keep all capability permission evaluation in * this one file. */ + +cap_rights_t * +cap_rights_fde(struct filedescent *fde) +{ + + return (&fde->fde_rights); +} + cap_rights_t * cap_rights(struct filedesc *fdp, int fd) { - return (&fdp->fd_ofiles[fd].fde_rights); + return (cap_rights_fde(&fdp->fd_ofiles[fd])); } /* @@ -486,24 +494,31 @@ out: * Test whether a capability grants the given fcntl command. */ int -cap_fcntl_check(struct filedesc *fdp, int fd, int cmd) +cap_fcntl_check_fde(struct filedescent *fde, int cmd) { uint32_t fcntlcap; - KASSERT(fd >= 0 && fd < fdp->fd_nfiles, - ("%s: invalid fd=%d", __func__, fd)); - fcntlcap = (1 << cmd); KASSERT((CAP_FCNTL_ALL & fcntlcap) != 0, ("Unsupported fcntl=%d.", cmd)); - if ((fdp->fd_ofiles[fd].fde_fcntls & fcntlcap) != 0) + if ((fde->fde_fcntls & fcntlcap) != 0) return (0); return (ENOTCAPABLE); } int +cap_fcntl_check(struct filedesc *fdp, int fd, int cmd) +{ + + KASSERT(fd >= 0 && fd < fdp->fd_nfiles, + ("%s: invalid fd=%d", __func__, fd)); + + return (cap_fcntl_check_fde(&fdp->fd_ofiles[fd], cmd)); +} + +int sys_cap_fcntls_limit(struct thread *td, struct cap_fcntls_limit_args *uap) { struct filedesc *fdp; Modified: stable/10/sys/sys/capability.h ============================================================================== --- stable/10/sys/sys/capability.h Tue Oct 14 21:02:33 2014 (r273108) +++ stable/10/sys/sys/capability.h Tue Oct 14 21:19:23 2014 (r273109) @@ -343,6 +343,7 @@ bool cap_rights_contains(const cap_right #define IN_CAPABILITY_MODE(td) ((td->td_ucred->cr_flags & CRED_FLAG_CAPMODE) != 0) struct filedesc; +struct filedescent; /* * Test whether a capability grants the requested rights. @@ -357,9 +358,11 @@ u_char cap_rights_to_vmprot(cap_rights_t * For the purposes of procstat(1) and similar tools, allow kern_descrip.c to * extract the rights from a capability. */ +cap_rights_t *cap_rights_fde(struct filedescent *fde); cap_rights_t *cap_rights(struct filedesc *fdp, int fd); int cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd); +int cap_fcntl_check_fde(struct filedescent *fde, int cmd); int cap_fcntl_check(struct filedesc *fdp, int fd, int cmd); #else /* !_KERNEL */ Modified: stable/10/sys/sys/filedesc.h ============================================================================== --- stable/10/sys/sys/filedesc.h Tue Oct 14 21:02:33 2014 (r273108) +++ stable/10/sys/sys/filedesc.h Tue Oct 14 21:19:23 2014 (r273109) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -50,14 +51,16 @@ struct filecaps { }; struct filedescent { - struct file *fde_file; /* file structure for open file */ - struct filecaps fde_caps; /* per-descriptor rights */ - uint8_t fde_flags; /* per-process open file flags */ + struct file *fde_file; /* file structure for open file */ + struct filecaps fde_caps; /* per-descriptor rights */ + uint8_t fde_flags; /* per-process open file flags */ + seq_t fde_seq; /* keep file and caps in sync */ }; #define fde_rights fde_caps.fc_rights #define fde_fcntls fde_caps.fc_fcntls #define fde_ioctls fde_caps.fc_ioctls #define fde_nioctls fde_caps.fc_nioctls +#define fde_change_size (offsetof(struct filedescent, fde_seq)) /* * This structure is used for the management of descriptors. It may be @@ -82,6 +85,7 @@ struct filedesc { int fd_holdleaderscount; /* block fdfree() for shared close() */ int fd_holdleaderswakeup; /* fdfree() needs wakeup */ }; +#define fd_seq(fdp, fd) (&(fdp)->fd_ofiles[(fd)].fde_seq) /* * Structure to keep track of (process leader, struct fildedesc) tuples. Copied and modified: stable/10/sys/sys/seq.h (from r272503, head/sys/sys/seq.h) ============================================================================== --- head/sys/sys/seq.h Sat Oct 4 08:03:52 2014 (r272503, copy source) +++ stable/10/sys/sys/seq.h Tue Oct 14 21:19:23 2014 (r273109) @@ -29,6 +29,16 @@ #define _SYS_SEQ_H_ #ifdef _KERNEL +#include +#endif +#include + +/* + * seq_t may be included in structs visible to userspace + */ +typedef uint32_t seq_t; + +#ifdef _KERNEL /* * Typical usage: @@ -54,10 +64,7 @@ * foo(lobj); */ -typedef uint32_t seq_t; - /* A hack to get MPASS macro */ -#include #include #include From owner-svn-src-stable-10@FreeBSD.ORG Tue Oct 14 23:16:54 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B7D16ED; Tue, 14 Oct 2014 23:16:54 +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 6CDB97E4; Tue, 14 Oct 2014 23:16:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9ENGsX0021259; Tue, 14 Oct 2014 23:16:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9ENGruW021251; Tue, 14 Oct 2014 23:16:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201410142316.s9ENGruW021251@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 14 Oct 2014 23:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273110 - in stable/10/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 23:16:54 -0000 Author: pfg Date: Tue Oct 14 23:16:52 2014 New Revision: 273110 URL: https://svnweb.freebsd.org/changeset/base/273110 Log: MFC r267851: Continue the crusade towards a dev_clone()-free kernel, removing its usage from dtrace. The dtrace code already uses cdevpriv(9) since FreeBSD 8, so this change is quite harmless. Originally by: davide Reviewed by: markj Deleted: stable/10/sys/cddl/dev/dtrace/dtrace_clone.c Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/10/sys/cddl/dev/dtrace/dtrace_ioctl.c stable/10/sys/cddl/dev/dtrace/dtrace_load.c stable/10/sys/cddl/dev/dtrace/dtrace_unload.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Oct 14 21:19:23 2014 (r273109) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Oct 14 23:16:52 2014 (r273110) @@ -16728,10 +16728,8 @@ dtrace_attach(dev_info_t *devi, ddi_atta #endif #if !defined(sun) -#if __FreeBSD_version >= 800039 static void dtrace_dtr(void *); #endif -#endif /*ARGSUSED*/ static int @@ -16758,27 +16756,7 @@ dtrace_open(struct cdev *dev, int oflags return (ENXIO); #else cred_t *cred_p = NULL; - -#if __FreeBSD_version < 800039 - /* - * The first minor device is the one that is cloned so there is - * nothing more to do here. - */ - if (dev2unit(dev) == 0) - return 0; - - /* - * Devices are cloned, so if the DTrace state has already - * been allocated, that means this device belongs to a - * different client. Each client should open '/dev/dtrace' - * to get a cloned device. - */ - if (dev->si_drv1 != NULL) - return (EBUSY); -#endif - cred_p = dev->si_cred; -#endif /* * If no DTRACE_PRIV_* bits are set in the credential, then the @@ -16786,11 +16764,6 @@ dtrace_open(struct cdev *dev, int oflags */ dtrace_cred2priv(cred_p, &priv, &uid, &zoneid); if (priv == DTRACE_PRIV_NONE) { -#if !defined(sun) -#if __FreeBSD_version < 800039 - /* Destroy the cloned device. */ - destroy_dev(dev); -#endif #endif return (EACCES); @@ -16823,12 +16796,8 @@ dtrace_open(struct cdev *dev, int oflags state = dtrace_state_create(devp, cred_p); #else state = dtrace_state_create(dev); -#if __FreeBSD_version < 800039 - dev->si_drv1 = state; -#else devfs_set_cdevpriv(state, dtrace_dtr); #endif -#endif mutex_exit(&cpu_lock); @@ -16840,12 +16809,6 @@ dtrace_open(struct cdev *dev, int oflags --dtrace_opens; #endif mutex_exit(&dtrace_lock); -#if !defined(sun) -#if __FreeBSD_version < 800039 - /* Destroy the cloned device. */ - destroy_dev(dev); -#endif -#endif return (EAGAIN); } @@ -16858,9 +16821,6 @@ dtrace_open(struct cdev *dev, int oflags #if defined(sun) static int dtrace_close(dev_t dev, int flag, int otyp, cred_t *cred_p) -#elif __FreeBSD_version < 800039 -static int -dtrace_close(struct cdev *dev, int flags, int fmt __unused, struct thread *td) #else static void dtrace_dtr(void *data) @@ -16875,18 +16835,9 @@ dtrace_dtr(void *data) state = ddi_get_soft_state(dtrace_softstate, minor); #else -#if __FreeBSD_version < 800039 - dtrace_state_t *state = dev->si_drv1; - - /* Check if this is not a cloned device. */ - if (dev2unit(dev) == 0) - return (0); -#else dtrace_state_t *state = data; #endif -#endif - mutex_enter(&cpu_lock); mutex_enter(&dtrace_lock); @@ -16903,9 +16854,6 @@ dtrace_dtr(void *data) #if !defined(sun) kmem_free(state, 0); -#if __FreeBSD_version < 800039 - dev->si_drv1 = NULL; -#endif #endif } @@ -16924,12 +16872,7 @@ dtrace_dtr(void *data) mutex_exit(&dtrace_lock); mutex_exit(&cpu_lock); -#if __FreeBSD_version < 800039 - /* Schedule this cloned device to be destroyed. */ - destroy_dev_sched(dev); -#endif - -#if defined(sun) || __FreeBSD_version < 800039 +#if defined(sun) return (0); #endif } @@ -17969,24 +17912,14 @@ static d_ioctl_t dtrace_ioctl; static d_ioctl_t dtrace_ioctl_helper; static void dtrace_load(void *); static int dtrace_unload(void); -#if __FreeBSD_version < 800039 -static void dtrace_clone(void *, struct ucred *, char *, int , struct cdev **); -static struct clonedevs *dtrace_clones; /* Ptr to the array of cloned devices. */ -static eventhandler_tag eh_tag; /* Event handler tag. */ -#else static struct cdev *dtrace_dev; static struct cdev *helper_dev; -#endif void dtrace_invop_init(void); void dtrace_invop_uninit(void); static struct cdevsw dtrace_cdevsw = { .d_version = D_VERSION, -#if __FreeBSD_version < 800039 - .d_flags = D_TRACKCLOSE | D_NEEDMINOR, - .d_close = dtrace_close, -#endif .d_ioctl = dtrace_ioctl, .d_open = dtrace_open, .d_name = "dtrace", @@ -17999,9 +17932,6 @@ static struct cdevsw helper_cdevsw = { }; #include -#if __FreeBSD_version < 800039 -#include -#endif #include #include #include Modified: stable/10/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_ioctl.c Tue Oct 14 21:19:23 2014 (r273109) +++ stable/10/sys/cddl/dev/dtrace/dtrace_ioctl.c Tue Oct 14 23:16:52 2014 (r273110) @@ -78,12 +78,9 @@ static int dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags __unused, struct thread *td) { -#if __FreeBSD_version < 800039 - dtrace_state_t *state = dev->si_drv1; -#else dtrace_state_t *state; devfs_get_cdevpriv((void **) &state); -#endif + int error = 0; if (state == NULL) return (EINVAL); Modified: stable/10/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_load.c Tue Oct 14 21:19:23 2014 (r273109) +++ stable/10/sys/cddl/dev/dtrace/dtrace_load.c Tue Oct 14 23:16:52 2014 (r273110) @@ -158,18 +158,10 @@ dtrace_load(void *dummy) mutex_exit(&cpu_lock); -#if __FreeBSD_version < 800039 - /* Enable device cloning. */ - clone_setup(&dtrace_clones); - - /* Setup device cloning events. */ - eh_tag = EVENTHANDLER_REGISTER(dev_clone, dtrace_clone, 0, 1000); -#else dtrace_dev = make_dev(&dtrace_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "dtrace/dtrace"); helper_dev = make_dev(&helper_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660, "dtrace/helper"); -#endif return; } Modified: stable/10/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_unload.c Tue Oct 14 21:19:23 2014 (r273109) +++ stable/10/sys/cddl/dev/dtrace/dtrace_unload.c Tue Oct 14 23:16:52 2014 (r273110) @@ -28,23 +28,8 @@ dtrace_unload() dtrace_state_t *state; int error = 0; -#if __FreeBSD_version < 800039 - /* - * Check if there is still an event handler callback - * registered. - */ - if (eh_tag != 0) { - /* De-register the device cloning event handler. */ - EVENTHANDLER_DEREGISTER(dev_clone, eh_tag); - eh_tag = 0; - - /* Stop device cloning. */ - clone_cleanup(&dtrace_clones); - } -#else destroy_dev(dtrace_dev); destroy_dev(helper_dev); -#endif mutex_enter(&dtrace_provider_lock); mutex_enter(&dtrace_lock); From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 04:34:08 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B15C9CAF; Wed, 15 Oct 2014 04:34:08 +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 9C7DD960; Wed, 15 Oct 2014 04:34:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9F4Y8Xu082950; Wed, 15 Oct 2014 04:34:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9F4Y8dX082949; Wed, 15 Oct 2014 04:34:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410150434.s9F4Y8dX082949@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 15 Oct 2014 04:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273117 - stable/10/sys/boot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 04:34:08 -0000 Author: ae Date: Wed Oct 15 04:34:07 2014 New Revision: 273117 URL: https://svnweb.freebsd.org/changeset/base/273117 Log: MFC r272749: Fix comment. Modified: stable/10/sys/boot/common/disk.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/disk.h ============================================================================== --- stable/10/sys/boot/common/disk.h Wed Oct 15 04:29:03 2014 (r273116) +++ stable/10/sys/boot/common/disk.h Wed Oct 15 04:34:07 2014 (r273117) @@ -43,12 +43,12 @@ * BSD disklabel partition within an MBR slice: * * d_slice = MBR slice number (typically 1..4) - * d_partition = disklabel partition (typically 0..7) + * d_partition = disklabel partition (typically 0..19) * * BSD disklabel partition on the true dedicated disk: * * d_slice = -1 - * d_partition = disklabel partition (typically 0..7) + * d_partition = disklabel partition (typically 0..19) * * GPT partition: * @@ -71,7 +71,7 @@ * if there are multiple slices/partitions of a given type, the first one * is chosen. * - * The low-level disk device will typically call slice_open() from its open + * The low-level disk device will typically call disk_open() from its open * method to interpret the disk partition tables according to the rules above. * This will initialize d_offset to the block offset of the start of the * selected partition - this offset should be added to the offset passed to From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 08:03:13 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 101E4C3D; Wed, 15 Oct 2014 08:03: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 EFF45EA4; Wed, 15 Oct 2014 08:03: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 s9F83CUU089750; Wed, 15 Oct 2014 08:03:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9F83C2s089748; Wed, 15 Oct 2014 08:03:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410150803.s9F83C2s089748@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 15 Oct 2014 08:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273125 - stable/10/sys/dev/mpr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 08:03:13 -0000 Author: mav Date: Wed Oct 15 08:03:12 2014 New Revision: 273125 URL: https://svnweb.freebsd.org/changeset/base/273125 Log: MFC r272756: Properly report 12Gbps connection rate. Reviewed by: kadesai, slm Modified: stable/10/sys/dev/mpr/mpr_sas.c stable/10/sys/dev/mpr/mpr_table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mpr/mpr_sas.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_sas.c Wed Oct 15 07:35:50 2014 (r273124) +++ stable/10/sys/dev/mpr/mpr_sas.c Wed Oct 15 08:03:12 2014 (r273125) @@ -1045,6 +1045,9 @@ mprsas_action(struct cam_sim *sim, union case 0x0a: sas->bitrate = 600000; break; + case 0x0b: + sas->bitrate = 1200000; + break; default: sas->valid = 0; } Modified: stable/10/sys/dev/mpr/mpr_table.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_table.c Wed Oct 15 07:35:50 2014 (r273124) +++ stable/10/sys/dev/mpr/mpr_table.c Wed Oct 15 08:03:12 2014 (r273125) @@ -118,6 +118,7 @@ struct mpr_table_lookup mpr_linkrate_nam {"1.5Gbps", 0x08}, {"3.0Gbps", 0x09}, {"6.0Gbps", 0x0a}, + {"12.0Gbps", 0x0b}, {NULL, 0}, {"LinkRate Unknown", 0x00} }; From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 10:59:06 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9A028D2; Wed, 15 Oct 2014 10:59:06 +0000 (UTC) Received: from prod2.absolight.net (mx3.absolight.net [IPv6:2a01:678:2:100::25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "plouf.absolight.net", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 85E2A38A; Wed, 15 Oct 2014 10:59:06 +0000 (UTC) Received: from prod2.absolight.net (localhost [127.0.0.1]) by prod2.absolight.net (Postfix) with ESMTP id BB36DBDC2E; Wed, 15 Oct 2014 12:59:03 +0200 (CEST) Received: from gw.in.absolight.net (gw-ecl.in.absolight.net [79.143.241.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gw.in.absolight.net", Issuer "CA Cert Signing Authority" (not verified)) by prod2.absolight.net (Postfix) with ESMTPSA id A3A23BDC25; Wed, 15 Oct 2014 12:59:03 +0200 (CEST) Received: from ogg.in.absolight.net (ogg.in.absolight.net [79.143.241.239]) by gw.in.absolight.net (Postfix) with ESMTP id D739B615E; Wed, 15 Oct 2014 12:59:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ogg.in.absolight.net (Postfix) with ESMTP id DD39E7647710; Wed, 15 Oct 2014 12:59:00 +0200 (CEST) Date: Wed, 15 Oct 2014 12:59:00 +0200 From: Mathieu Arnold To: Hiroki Sato , ache@freebsd.org Subject: Re: svn commit: r270122 - in stable/10: . lib/libopie Message-ID: <1BBAA58D73417DFBCB6DEC65@ogg.in.absolight.net> In-Reply-To: <20141011.000201.1863876266089528066.hrs@allbsd.org> References: <201408180242.s7I2gNaq087095@svn.freebsd.org> <20141010144747.GH19486@ivaldir.etoilebsd.net> <5437F373.1090300@freebsd.org> <20141011.000201.1863876266089528066.hrs@allbsd.org> X-Mailer: Mulberry/4.0.8 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: svn-src-stable@freebsd.org, bapt@FreeBSD.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 10:59:06 -0000 +--On 11 octobre 2014 00:02:01 +0900 Hiroki Sato wrote: | Andrey Chernov wrote | in <5437F373.1090300@freebsd.org>: | | ac> On 10.10.2014 18:47, Baptiste Daroussin wrote: | ac> > On Mon, Aug 18, 2014 at 02:42:23AM +0000, Andrey A. Chernov wrote: | ac> >> Author: ache | ac> >> Date: Mon Aug 18 02:42:23 2014 | ac> >> New Revision: 270122 | ac> >> URL: http://svnweb.freebsd.org/changeset/base/270122 | ac> >> | ac> >> Log: | ac> >> Direct commit to stable/10 reflecting r269961 because the rest | can't be ac> >> merged. | ac> >> | ac> >> Bump version because challenge buffer size changed. | ac> > | ac> > Discovered a bit late but it is forbidden to break the ABI in a | stable branch as ac> > it defeats the way we are providing packages for | users :( | ac> | ac> It is strange that nobody notice that so far. Is there any packages | ac> which builds with libopie? If no, there is no problem. If yes, what | you | | cyrus-sasl uses it. And that is just wha't in the ports tree, companies can have applications with security features that link with libopie and that will be broken when they update from 10.0 to 10.1 because the version they had is gone. -- Mathieu Arnold From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 13:15:58 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A08E843D for ; Wed, 15 Oct 2014 13:15:58 +0000 (UTC) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) (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 20E276BE for ; Wed, 15 Oct 2014 13:15:57 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id pv20so1003883lab.20 for ; Wed, 15 Oct 2014 06:15:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=F/+K9GQYcBD5Z3pIL0WdXpiosgagwsUJ3Y8VRlYbduM=; b=bl7hy0E56MvDrBqpLknn6E2rAV0ssj0Vor0fAWrOIzw+EAR6FxTgF7dozibk4zuqwt qwA3GepkfwTgV1obK0xWlQDse8qIBfK4LdJdkUovvJ5+IP4+SZsn0P6epsujKiLxXVNS H59gZ1WRdIH/s4MWJ1fBFiT2ibcGu9b0xhj52WZYFBD2Mp0KrBvGhMBCvIt095hEzd3m /7fqAypzHsdZyzpbq/7vr+Oh5CyjgTljfkeqI5b2pfdezm0ND7uSJRclSXZXGmYSdbms TElFQFn9anXH3Gj0NdmcKHEenIihmueIMcqqEZ5cJwmAyYeJlnFmuXPdxUEFLJpb05sJ 0qew== X-Gm-Message-State: ALoCoQn/awth34UFECegLoOBCnJTif76HB7+ScZVuFvDJEfurB4ebYFf+AKOIi2eRZhGsg1nqgM3 X-Received: by 10.112.166.1 with SMTP id zc1mr2933921lbb.90.1413378950264; Wed, 15 Oct 2014 06:15:50 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id d9sm6686563lbp.49.2014.10.15.06.15.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Oct 2014 06:15:49 -0700 (PDT) Message-ID: <543E7384.9050606@freebsd.org> Date: Wed, 15 Oct 2014 17:15:48 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Mathieu Arnold , Hiroki Sato Subject: Re: svn commit: r270122 - in stable/10: . lib/libopie References: <201408180242.s7I2gNaq087095@svn.freebsd.org> <20141010144747.GH19486@ivaldir.etoilebsd.net> <5437F373.1090300@freebsd.org> <20141011.000201.1863876266089528066.hrs@allbsd.org> <1BBAA58D73417DFBCB6DEC65@ogg.in.absolight.net> In-Reply-To: <1BBAA58D73417DFBCB6DEC65@ogg.in.absolight.net> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Cc: bapt@FreeBSD.org, src-committers@freebsd.org, re@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 13:15:58 -0000 On 15.10.2014 14:59, Mathieu Arnold wrote: > | cyrus-sasl uses it. > > And that is just wha't in the ports tree, companies can have applications > with security features that link with libopie and that will be broken when > they update from 10.0 to 10.1 because the version they had is gone. > I CCed your opinion to re@ - I am still waiting for their definite answer, yes for -stable backout or no. >From other hand, this change fix security hole and broken functionality for non-default (long) seeds. -- http://ache.vniz.net/ From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 13:36:02 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CDC7988; Wed, 15 Oct 2014 13:36: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 77CD58F8; Wed, 15 Oct 2014 13:36: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 s9FDa2fO046630; Wed, 15 Oct 2014 13:36:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9FDa2Ee046629; Wed, 15 Oct 2014 13:36:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410151336.s9FDa2Ee046629@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Oct 2014 13:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273133 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 13:36:02 -0000 Author: kib Date: Wed Oct 15 13:36:01 2014 New Revision: 273133 URL: https://svnweb.freebsd.org/changeset/base/273133 Log: MFC r272069: Switch the defaults to not split the RLIMIT_STACK-sized initial thread stack into the stacks of the created threads. Add knob LIBPTHREAD_SPLITSTACK_MAIN to restore the older behaviour. Modified: stable/10/lib/libthr/thread/thr_init.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_init.c ============================================================================== --- stable/10/lib/libthr/thread/thr_init.c Wed Oct 15 13:22:33 2014 (r273132) +++ stable/10/lib/libthr/thread/thr_init.c Wed Oct 15 13:36:01 2014 (r273133) @@ -445,7 +445,7 @@ init_private(void) struct rlimit rlim; size_t len; int mib[2]; - char *env; + char *env, *env_bigstack, *env_splitstack; _thr_umutex_init(&_mutex_static_lock); _thr_umutex_init(&_cond_static_lock); @@ -473,8 +473,9 @@ init_private(void) len = sizeof (_usrstack); if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) PANIC("Cannot get kern.usrstack from sysctl"); - env = getenv("LIBPTHREAD_BIGSTACK_MAIN"); - if (env != NULL) { + env_bigstack = getenv("LIBPTHREAD_BIGSTACK_MAIN"); + env_splitstack = getenv("LIBPTHREAD_SPLITSTACK_MAIN"); + if (env_bigstack != NULL || env_splitstack == NULL) { if (getrlimit(RLIMIT_STACK, &rlim) == -1) PANIC("Cannot get stack rlimit"); _thr_stack_initial = rlim.rlim_cur; From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 13:39:01 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A06DB24; Wed, 15 Oct 2014 13:39:01 +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 7A83891E; Wed, 15 Oct 2014 13:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9FDd1ha047038; Wed, 15 Oct 2014 13:39:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9FDd10c047037; Wed, 15 Oct 2014 13:39:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410151339.s9FDd10c047037@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Oct 2014 13:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273134 - stable/10/lib/libthr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 13:39:01 -0000 Author: kib Date: Wed Oct 15 13:39:00 2014 New Revision: 273134 URL: https://svnweb.freebsd.org/changeset/base/273134 Log: MFC r272070: Expand the libthr(3) manpage to document knobs accepted by libthr.so and explain some internal working of the library, neccessary to understand the knobs effects. MFC r272153 (by pluknet): Fix description of mutex acquisition. Modified: stable/10/lib/libthr/libthr.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/libthr.3 ============================================================================== --- stable/10/lib/libthr/libthr.3 Wed Oct 15 13:36:01 2014 (r273133) +++ stable/10/lib/libthr/libthr.3 Wed Oct 15 13:39:00 2014 (r273134) @@ -1,6 +1,11 @@ .\" Copyright (c) 2005 Robert N. M. Watson +.\" Copyright (c) 2014 The FreeBSD Foundation, Inc. .\" All rights reserved. .\" +.\" Part of this documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -24,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2007 +.Dd September 26, 2014 .Dt LIBTHR 3 .Os .Sh NAME @@ -45,8 +50,222 @@ has been optimized for use by applicatio semantics, and can provide significant performance improvements compared to .Lb libkse . +.Pp +The library is tightly integrated with the run-time link editor +.Xr ld-elf.so.1 1 +and +.Lb libc ; +all three components must be built from the same source tree. +Mixing +.Li libc +and +.Nm +libraries from different versions of +.Fx +is not supported. +The run-time linker +.Xr ld-elf.so.1 1 +has some code to ensure backward-compatibility with older versions of +.Nm . +.Pp +The man page documents the quirks and tunables of the +.Nm . +When linking with +.Li -lpthread , +the run-time dependency +.Li libthr.so.3 +is recorded in the produced object. +.Sh MUTEX ACQUISITION +A locked mutex (see +.Xr pthread_mutex_lock 3 ) +is represented by a volatile variable of type +.Dv lwpid_t , +which records the global system identifier of the thread +owning the lock. +.Nm +performs a contested mutex acquisition in three stages, each of which +is more resource-consuming than the previous. +The first two stages are only applied for a mutex of +.Dv PTHREAD_MUTEX_ADAPTIVE_NP +type and +.Dv PTHREAD_PRIO_NONE +protocol (see +.Xr pthread_mutexattr 3 ) . +.Pp +First, on SMP systems, a spin loop +is performed, where the library attempts to acquire the lock by +.Xr atomic 9 +operations. +The loop count is controlled by the +.Ev LIBPTHREAD_SPINLOOPS +environment variable, with a default value of 2000. +.Pp +If the spin loop +was unable to acquire the mutex, a yield loop +is executed, performing the same +.Xr atomic 9 +acquisition attempts as the spin loop, +but each attempt is followed by a yield of the CPU time +of the thread using the +.Xr sched_yield 2 +syscall. +By default, the yield loop +is not executed. +This is controlled by the +.Ev LIBPTHREAD_YIELDLOOPS +environment variable. +.Pp +If both the spin and yield loops +failed to acquire the lock, the thread is taken off the CPU and +put to sleep in the kernel with the +.Xr umtx 2 +syscall. +The kernel wakes up a thread and hands the ownership of the lock to +the woken thread when the lock becomes available. +.Sh THREAD STACKS +Each thread is provided with a private user-mode stack area +used by the C runtime. +The size of the main (initial) thread stack is set by the kernel, and is +controlled by the +.Dv RLIMIT_STACK +process resource limit (see +.Xr getrlimit 2 ) . +.Pp +By default, the main thread's stack size is equal to the value of +.Dv RLIMIT_STACK +for the process. +If the +.Ev LIBPTHREAD_SPLITSTACK_MAIN +environment variable is present in the process environment +(its value does not matter), +the main thread's stack is reduced to 4MB on 64bit architectures, and to +2MB on 32bit architectures, when the threading library is initialized. +The rest of the address space area which has been reserved by the +kernel for the initial process stack is used for non-initial thread stacks +in this case. +The presence of the +.Ev LIBPTHREAD_BIGSTACK_MAIN +environment variable overrides +.Ev LIBPTHREAD_SPLITSTACK_MAIN ; +it is kept for backward-compatibility. +.Pp +The size of stacks for threads created by the process at run-time +with the +.Xr pthread_create 3 +call is controlled by thread attributes: see +.Xr pthread_attr 3 , +in particular, the +.Xr pthread_attr_setstacksize 3 , +.Xr pthread_attr_setguardsize 3 +and +.Xr pthread_attr_setstackaddr 3 +functions. +If no attributes for the thread stack size are specified, the default +non-initial thread stack size is 2MB for 64bit architectures, and 1MB +for 32bit architectures. +.Sh RUN-TIME SETTINGS +The following environment variables are recognized by +.Nm +and adjust the operation of the library at run-time: +.Bl -tag -width LIBPTHREAD_SPLITSTACK_MAIN +.It Ev LIBPTHREAD_BIGSTACK_MAIN +Disables the reduction of the initial thread stack enabled by +.Ev LIBPTHREAD_SPLITSTACK_MAIN . +.It Ev LIBPTHREAD_SPLITSTACK_MAIN +Causes a reduction of the initial thread stack, as described in the +section +.Sx THREAD STACKS . +This was the default behaviour of +.Nm +before +.Fx 11.0 . +.It Ev LIBPTHREAD_SPINLOOPS +The integer value of the variable overrides the default count of +iterations in the +.Li spin loop +of the mutex acquisition. +The default count is 2000, set by the +.Dv MUTEX_ADAPTIVE_SPINS +constant in the +.Nm +sources. +.It Ev LIBPTHREAD_YIELDLOOPS +A non-zero integer value enables the yield loop +in the process of the mutex acquisition. +The value is the count of loop operations. +.It Ev LIBPTHREAD_QUEUE_FIFO +The integer value of the variable specifies how often blocked +threads are inserted at the head of the sleep queue, instead of its tail. +Bigger values reduce the frequency of the FIFO discipline. +The value must be between 0 and 255. +.El +.Sh INTERACTION WITH RUN-TIME LINKER +The +.Nm +library must appear before +.Li libc +in the global order of depended objects. +.Pp +Loading +.Nm +with the +.Xr dlopen 3 +call in the process after the program binary is activated +is not supported, and causes miscellaneous and hard-to-diagnose misbehaviour. +This is due to +.Nm +interposing several important +.Li libc +symbols to provide thread-safe services. +In particular, +.Dv errno +and the locking stubs from +.Li libc +are affected. +This requirement is currently not enforced. +.Pp +If the program loads any modules at run-time, and those modules may require +threading services, the main program binary must be linked with +.Li libpthread , +even if it does not require any services from the library. +.Pp +.Nm +cannot be unloaded; the +.Xr dlclose 3 +function does not perform any action when called with a handle for +.Nm . +One of the reasons is that the interposing of +.Li libc +functions cannot be undone. +.Sh SIGNALS +The implementation also interposes the user-installed +.Xr signal 3 +handlers. +This interposing is done to postpone signal delivery to threads which +entered (libthr-internal) critical sections, where the calling +of the user-provided signal handler is unsafe. +An example of such a situation is owning the internal library lock. +When a signal is delivered while the signal handler cannot be safely +called, the call is postponed and performed until after the exit from +the critical section. +This should be taken into account when interpreting +.Xr ktrace 1 +logs. .Sh SEE ALSO -.Xr pthread 3 +.Xr ktrace 1 , +.Xr ld-elf.so.1 1 , +.Xr getrlimit 2 , +.Xr umtx 2 , +.Xr dlclose 3 , +.Xr dlopen 3 , +.Xr errno 3 , +.Xr getenv 3 , +.Xr libc 3 , +.Xr pthread_attr 3 , +.Xr pthread_attr_setstacksize 3 , +.Xr pthread_create 3 , +.Xr signal 3 , +.Xr atomic 9 .Sh AUTHORS .An -nosplit The From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 14:07:27 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D7AA305; Wed, 15 Oct 2014 14: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 37076C33; Wed, 15 Oct 2014 14: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 s9FE7Rjd060830; Wed, 15 Oct 2014 14:07:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9FE7Pe9060818; Wed, 15 Oct 2014 14:07:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410151407.s9FE7Pe9060818@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Oct 2014 14:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273136 - in stable/10/sys: amd64/amd64 amd64/include dev/drm2/i915 i386/i386 i386/include i386/xen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 14:07:27 -0000 Author: kib Date: Wed Oct 15 14:07:24 2014 New Revision: 273136 URL: https://svnweb.freebsd.org/changeset/base/273136 Log: MFC r272761: Add an argument to the x86 pmap_invalidate_cache_range() to request forced invalidation of the cache range regardless of the presence of self-snoop feature. MFC r272943: MFi386 r272761. Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/amd64/include/pmap.h stable/10/sys/dev/drm2/i915/intel_ringbuffer.c stable/10/sys/i386/i386/pmap.c stable/10/sys/i386/i386/vm_machdep.c stable/10/sys/i386/include/pmap.h stable/10/sys/i386/xen/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Wed Oct 15 13:40:29 2014 (r273135) +++ stable/10/sys/amd64/amd64/pmap.c Wed Oct 15 14:07:24 2014 (r273136) @@ -1710,16 +1710,20 @@ pmap_update_pde(pmap_t pmap, vm_offset_t #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) void -pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) +pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force) { - KASSERT((sva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: sva not page-aligned")); - KASSERT((eva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: eva not page-aligned")); + if (force) { + sva &= ~(vm_offset_t)cpu_clflush_line_size; + } else { + KASSERT((sva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: sva not page-aligned")); + KASSERT((eva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: eva not page-aligned")); + } - if (cpu_feature & CPUID_SS) - ; /* If "Self Snoop" is supported, do nothing. */ + if ((cpu_feature & CPUID_SS) != 0 && !force) + ; /* If "Self Snoop" is supported and allowed, do nothing. */ else if ((cpu_feature & CPUID_CLFSH) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { @@ -6222,7 +6226,7 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_ for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); pmap_invalidate_range(kernel_pmap, va, va + tmpsize); - pmap_invalidate_cache_range(va, va + tmpsize); + pmap_invalidate_cache_range(va, va + tmpsize, FALSE); return ((void *)(va + offset)); } @@ -6558,7 +6562,7 @@ pmap_change_attr_locked(vm_offset_t va, */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - pmap_invalidate_cache_range(base, tmpva); + pmap_invalidate_cache_range(base, tmpva, FALSE); } return (error); } Modified: stable/10/sys/amd64/include/pmap.h ============================================================================== --- stable/10/sys/amd64/include/pmap.h Wed Oct 15 13:40:29 2014 (r273135) +++ stable/10/sys/amd64/include/pmap.h Wed Oct 15 14:07:24 2014 (r273136) @@ -394,7 +394,8 @@ void pmap_invalidate_range(pmap_t, vm_of void pmap_invalidate_all(pmap_t); void pmap_invalidate_cache(void); void pmap_invalidate_cache_pages(vm_page_t *pages, int count); -void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva); +void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, + boolean_t force); void pmap_get_mapping(pmap_t pmap, vm_offset_t va, uint64_t *ptr, int *num); #endif /* _KERNEL */ Modified: stable/10/sys/dev/drm2/i915/intel_ringbuffer.c ============================================================================== --- stable/10/sys/dev/drm2/i915/intel_ringbuffer.c Wed Oct 15 13:40:29 2014 (r273135) +++ stable/10/sys/dev/drm2/i915/intel_ringbuffer.c Wed Oct 15 14:07:24 2014 (r273136) @@ -366,7 +366,7 @@ init_pipe_control(struct intel_ring_buff goto err_unpin; pmap_qenter((uintptr_t)pc->cpu_page, &obj->pages[0], 1); pmap_invalidate_cache_range((vm_offset_t)pc->cpu_page, - (vm_offset_t)pc->cpu_page + PAGE_SIZE); + (vm_offset_t)pc->cpu_page + PAGE_SIZE, FALSE); pc->obj = obj; ring->private = pc; @@ -1014,7 +1014,7 @@ static int init_status_page(struct intel pmap_qenter((vm_offset_t)ring->status_page.page_addr, &obj->pages[0], 1); pmap_invalidate_cache_range((vm_offset_t)ring->status_page.page_addr, - (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE); + (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE, FALSE); ring->status_page.obj = obj; memset(ring->status_page.page_addr, 0, PAGE_SIZE); Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Wed Oct 15 13:40:29 2014 (r273135) +++ stable/10/sys/i386/i386/pmap.c Wed Oct 15 14:07:24 2014 (r273136) @@ -1172,16 +1172,20 @@ pmap_update_pde(pmap_t pmap, vm_offset_t #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) void -pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) +pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force) { - KASSERT((sva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: sva not page-aligned")); - KASSERT((eva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: eva not page-aligned")); + if (force) { + sva &= ~(vm_offset_t)cpu_clflush_line_size; + } else { + KASSERT((sva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: sva not page-aligned")); + KASSERT((eva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: eva not page-aligned")); + } - if (cpu_feature & CPUID_SS) - ; /* If "Self Snoop" is supported, do nothing. */ + if ((cpu_feature & CPUID_SS) != 0 && !force) + ; /* If "Self Snoop" is supported and allowed, do nothing. */ else if ((cpu_feature & CPUID_CLFSH) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { @@ -5164,7 +5168,7 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_ for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); pmap_invalidate_range(kernel_pmap, va, va + tmpsize); - pmap_invalidate_cache_range(va, va + size); + pmap_invalidate_cache_range(va, va + size, FALSE); return ((void *)(va + offset)); } @@ -5370,7 +5374,7 @@ pmap_change_attr(vm_offset_t va, vm_size */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - pmap_invalidate_cache_range(base, tmpva); + pmap_invalidate_cache_range(base, tmpva, FALSE); } return (0); } Modified: stable/10/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/10/sys/i386/i386/vm_machdep.c Wed Oct 15 13:40:29 2014 (r273135) +++ stable/10/sys/i386/i386/vm_machdep.c Wed Oct 15 14:07:24 2014 (r273136) @@ -799,7 +799,7 @@ sf_buf_invalidate_cache(vm_page_t m) */ pmap_qenter(sf->kva, &m, 1); pmap_invalidate_cache_range(sf->kva, sf->kva + - PAGE_SIZE); + PAGE_SIZE, FALSE); ret = TRUE; break; } Modified: stable/10/sys/i386/include/pmap.h ============================================================================== --- stable/10/sys/i386/include/pmap.h Wed Oct 15 13:40:29 2014 (r273135) +++ stable/10/sys/i386/include/pmap.h Wed Oct 15 14:07:24 2014 (r273136) @@ -458,7 +458,8 @@ void pmap_invalidate_range(pmap_t, vm_of void pmap_invalidate_all(pmap_t); void pmap_invalidate_cache(void); void pmap_invalidate_cache_pages(vm_page_t *pages, int count); -void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva); +void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, + boolean_t force); #endif /* _KERNEL */ Modified: stable/10/sys/i386/xen/pmap.c ============================================================================== --- stable/10/sys/i386/xen/pmap.c Wed Oct 15 13:40:29 2014 (r273135) +++ stable/10/sys/i386/xen/pmap.c Wed Oct 15 14:07:24 2014 (r273136) @@ -888,15 +888,19 @@ pmap_invalidate_cache(void) #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) void -pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) +pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force) { - KASSERT((sva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: sva not page-aligned")); - KASSERT((eva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: eva not page-aligned")); + if (force) { + sva &= ~(vm_offset_t)cpu_clflush_line_size; + } else { + KASSERT((sva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: sva not page-aligned")); + KASSERT((eva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: eva not page-aligned")); + } - if (cpu_feature & CPUID_SS) + if ((cpu_feature & CPUID_SS) != 0 && !force) ; /* If "Self Snoop" is supported, do nothing. */ else if ((cpu_feature & CPUID_CLFSH) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { @@ -4073,7 +4077,7 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_ for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); pmap_invalidate_range(kernel_pmap, va, va + tmpsize); - pmap_invalidate_cache_range(va, va + size); + pmap_invalidate_cache_range(va, va + size, FALSE); return ((void *)(va + offset)); } @@ -4241,7 +4245,7 @@ pmap_change_attr(vm_offset_t va, vm_size */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - pmap_invalidate_cache_range(base, tmpva); + pmap_invalidate_cache_range(base, tmpva, FALSE); } return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 19:27:14 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E32F8700; Wed, 15 Oct 2014 19:27:14 +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 CEAAB371; Wed, 15 Oct 2014 19:27:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9FJREFj014627; Wed, 15 Oct 2014 19:27:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9FJREJw014626; Wed, 15 Oct 2014 19:27:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410151927.s9FJREJw014626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 15 Oct 2014 19:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273145 - stable/10/lib/libgeom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 19:27:15 -0000 Author: jhb Date: Wed Oct 15 19:27:14 2014 New Revision: 273145 URL: https://svnweb.freebsd.org/changeset/base/273145 Log: MFC 271721: Explicitly specify MAP_SHARED when mapping the stats file descriptor. Modified: stable/10/lib/libgeom/geom_stats.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libgeom/geom_stats.c ============================================================================== --- stable/10/lib/libgeom/geom_stats.c Wed Oct 15 19:12:05 2014 (r273144) +++ stable/10/lib/libgeom/geom_stats.c Wed Oct 15 19:27:14 2014 (r273145) @@ -68,7 +68,7 @@ geom_stats_resync(void) return; for (;;) { p = mmap(statp, (npages + 1) * pagesize, - PROT_READ, 0, statsfd, 0); + PROT_READ, MAP_SHARED, statsfd, 0); if (p == MAP_FAILED) break; else @@ -90,7 +90,7 @@ geom_stats_open(void) return (errno); pagesize = getpagesize(); spp = pagesize / sizeof(struct devstat); - p = mmap(NULL, pagesize, PROT_READ, 0, statsfd, 0); + p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0); if (p == MAP_FAILED) { error = errno; close(statsfd); From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 19:59:49 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3309B4B; Wed, 15 Oct 2014 19:59: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 8A10695F; Wed, 15 Oct 2014 19:59: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 s9FJxnZ0029481; Wed, 15 Oct 2014 19:59:49 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9FJxiYW029454; Wed, 15 Oct 2014 19:59:44 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201410151959.s9FJxiYW029454@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 15 Oct 2014 19:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273149 - in stable/10: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bn crypto/openssl/crypt... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 19:59:49 -0000 Author: jkim Date: Wed Oct 15 19:59:43 2014 New Revision: 273149 URL: https://svnweb.freebsd.org/changeset/base/273149 Log: MFC: r273144, r273146 Merge OpenSSL 1.0.1j. Relnotes: yes Added: stable/10/crypto/openssl/crypto/constant_time_locl.h - copied unchanged from r273144, head/crypto/openssl/crypto/constant_time_locl.h stable/10/crypto/openssl/crypto/constant_time_test.c - copied unchanged from r273144, head/crypto/openssl/crypto/constant_time_test.c stable/10/crypto/openssl/doc/apps/c_rehash.pod - copied unchanged from r273144, head/crypto/openssl/doc/apps/c_rehash.pod stable/10/crypto/openssl/doc/crypto/CMS_add1_signer.pod - copied unchanged from r273144, head/crypto/openssl/doc/crypto/CMS_add1_signer.pod stable/10/secure/lib/libcrypto/man/CMS_add1_signer.3 - copied unchanged from r273144, head/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/10/secure/usr.bin/openssl/man/c_rehash.1 - copied unchanged from r273146, head/secure/usr.bin/openssl/man/c_rehash.1 Deleted: stable/10/crypto/openssl/doc/crypto/CMS_sign_add1_signer.pod stable/10/secure/lib/libcrypto/man/CMS_sign_add1_signer.3 Modified: stable/10/ObsoleteFiles.inc stable/10/crypto/openssl/CHANGES stable/10/crypto/openssl/Configure stable/10/crypto/openssl/Makefile stable/10/crypto/openssl/NEWS stable/10/crypto/openssl/README stable/10/crypto/openssl/apps/s_client.c stable/10/crypto/openssl/crypto/Makefile stable/10/crypto/openssl/crypto/aes/asm/aesni-x86_64.pl stable/10/crypto/openssl/crypto/asn1/a_strex.c stable/10/crypto/openssl/crypto/bn/asm/x86_64-gcc.c stable/10/crypto/openssl/crypto/bn/bn_exp.c stable/10/crypto/openssl/crypto/bn/bn_nist.c stable/10/crypto/openssl/crypto/bn/exptest.c stable/10/crypto/openssl/crypto/dsa/dsa_ameth.c stable/10/crypto/openssl/crypto/ebcdic.h stable/10/crypto/openssl/crypto/ec/ec.h stable/10/crypto/openssl/crypto/ec/ec2_smpl.c stable/10/crypto/openssl/crypto/ec/ec_ameth.c stable/10/crypto/openssl/crypto/ec/ec_asn1.c stable/10/crypto/openssl/crypto/ec/ecp_mont.c stable/10/crypto/openssl/crypto/ec/ecp_nist.c stable/10/crypto/openssl/crypto/ec/ecp_smpl.c stable/10/crypto/openssl/crypto/ec/ectest.c stable/10/crypto/openssl/crypto/evp/Makefile stable/10/crypto/openssl/crypto/evp/e_aes.c stable/10/crypto/openssl/crypto/evp/evp_enc.c stable/10/crypto/openssl/crypto/md5/asm/md5-x86_64.pl stable/10/crypto/openssl/crypto/modes/modes.h stable/10/crypto/openssl/crypto/ocsp/ocsp_vfy.c stable/10/crypto/openssl/crypto/opensslconf.h stable/10/crypto/openssl/crypto/opensslv.h stable/10/crypto/openssl/crypto/ossl_typ.h stable/10/crypto/openssl/crypto/pkcs7/pkcs7.h stable/10/crypto/openssl/crypto/pqueue/pqueue.h stable/10/crypto/openssl/crypto/rsa/Makefile stable/10/crypto/openssl/crypto/rsa/rsa.h stable/10/crypto/openssl/crypto/rsa/rsa_err.c stable/10/crypto/openssl/crypto/rsa/rsa_oaep.c stable/10/crypto/openssl/crypto/rsa/rsa_pk1.c stable/10/crypto/openssl/crypto/rsa/rsa_sign.c stable/10/crypto/openssl/crypto/stack/safestack.h stable/10/crypto/openssl/doc/apps/dgst.pod stable/10/crypto/openssl/doc/crypto/BIO_s_accept.pod stable/10/crypto/openssl/doc/crypto/EVP_DigestInit.pod stable/10/crypto/openssl/doc/crypto/EVP_DigestVerifyInit.pod stable/10/crypto/openssl/doc/crypto/EVP_EncryptInit.pod stable/10/crypto/openssl/doc/crypto/EVP_PKEY_set1_RSA.pod stable/10/crypto/openssl/doc/crypto/EVP_PKEY_sign.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod stable/10/crypto/openssl/e_os.h stable/10/crypto/openssl/ssl/Makefile stable/10/crypto/openssl/ssl/d1_both.c stable/10/crypto/openssl/ssl/d1_lib.c stable/10/crypto/openssl/ssl/d1_srtp.c stable/10/crypto/openssl/ssl/dtls1.h stable/10/crypto/openssl/ssl/s23_clnt.c stable/10/crypto/openssl/ssl/s23_srvr.c stable/10/crypto/openssl/ssl/s2_lib.c stable/10/crypto/openssl/ssl/s3_cbc.c stable/10/crypto/openssl/ssl/s3_clnt.c stable/10/crypto/openssl/ssl/s3_enc.c stable/10/crypto/openssl/ssl/s3_lib.c stable/10/crypto/openssl/ssl/s3_pkt.c stable/10/crypto/openssl/ssl/s3_srvr.c stable/10/crypto/openssl/ssl/srtp.h stable/10/crypto/openssl/ssl/ssl.h stable/10/crypto/openssl/ssl/ssl3.h stable/10/crypto/openssl/ssl/ssl_err.c stable/10/crypto/openssl/ssl/ssl_lib.c stable/10/crypto/openssl/ssl/t1_enc.c stable/10/crypto/openssl/ssl/t1_lib.c stable/10/crypto/openssl/ssl/tls1.h stable/10/crypto/openssl/util/mk1mf.pl stable/10/crypto/openssl/util/mkdef.pl stable/10/crypto/openssl/util/ssleay.num stable/10/secure/lib/libcrypto/Makefile.inc stable/10/secure/lib/libcrypto/Makefile.man stable/10/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/10/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/10/secure/lib/libcrypto/man/BIO_ctrl.3 stable/10/secure/lib/libcrypto/man/BIO_f_base64.3 stable/10/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/10/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/10/secure/lib/libcrypto/man/BIO_f_md.3 stable/10/secure/lib/libcrypto/man/BIO_f_null.3 stable/10/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/10/secure/lib/libcrypto/man/BIO_find_type.3 stable/10/secure/lib/libcrypto/man/BIO_new.3 stable/10/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/10/secure/lib/libcrypto/man/BIO_push.3 stable/10/secure/lib/libcrypto/man/BIO_read.3 stable/10/secure/lib/libcrypto/man/BIO_s_accept.3 stable/10/secure/lib/libcrypto/man/BIO_s_bio.3 stable/10/secure/lib/libcrypto/man/BIO_s_connect.3 stable/10/secure/lib/libcrypto/man/BIO_s_fd.3 stable/10/secure/lib/libcrypto/man/BIO_s_file.3 stable/10/secure/lib/libcrypto/man/BIO_s_mem.3 stable/10/secure/lib/libcrypto/man/BIO_s_null.3 stable/10/secure/lib/libcrypto/man/BIO_s_socket.3 stable/10/secure/lib/libcrypto/man/BIO_set_callback.3 stable/10/secure/lib/libcrypto/man/BIO_should_retry.3 stable/10/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_start.3 stable/10/secure/lib/libcrypto/man/BN_add.3 stable/10/secure/lib/libcrypto/man/BN_add_word.3 stable/10/secure/lib/libcrypto/man/BN_bn2bin.3 stable/10/secure/lib/libcrypto/man/BN_cmp.3 stable/10/secure/lib/libcrypto/man/BN_copy.3 stable/10/secure/lib/libcrypto/man/BN_generate_prime.3 stable/10/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/10/secure/lib/libcrypto/man/BN_new.3 stable/10/secure/lib/libcrypto/man/BN_num_bytes.3 stable/10/secure/lib/libcrypto/man/BN_rand.3 stable/10/secure/lib/libcrypto/man/BN_set_bit.3 stable/10/secure/lib/libcrypto/man/BN_swap.3 stable/10/secure/lib/libcrypto/man/BN_zero.3 stable/10/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/10/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/10/secure/lib/libcrypto/man/CMS_compress.3 stable/10/secure/lib/libcrypto/man/CMS_decrypt.3 stable/10/secure/lib/libcrypto/man/CMS_encrypt.3 stable/10/secure/lib/libcrypto/man/CMS_final.3 stable/10/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_type.3 stable/10/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/10/secure/lib/libcrypto/man/CMS_sign.3 stable/10/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/10/secure/lib/libcrypto/man/CMS_uncompress.3 stable/10/secure/lib/libcrypto/man/CMS_verify.3 stable/10/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/10/secure/lib/libcrypto/man/CONF_modules_free.3 stable/10/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/10/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/10/secure/lib/libcrypto/man/DH_generate_key.3 stable/10/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DH_new.3 stable/10/secure/lib/libcrypto/man/DH_set_method.3 stable/10/secure/lib/libcrypto/man/DH_size.3 stable/10/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/10/secure/lib/libcrypto/man/DSA_do_sign.3 stable/10/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/10/secure/lib/libcrypto/man/DSA_generate_key.3 stable/10/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DSA_new.3 stable/10/secure/lib/libcrypto/man/DSA_set_method.3 stable/10/secure/lib/libcrypto/man/DSA_sign.3 stable/10/secure/lib/libcrypto/man/DSA_size.3 stable/10/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/10/secure/lib/libcrypto/man/ERR_clear_error.3 stable/10/secure/lib/libcrypto/man/ERR_error_string.3 stable/10/secure/lib/libcrypto/man/ERR_get_error.3 stable/10/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/10/secure/lib/libcrypto/man/ERR_load_strings.3 stable/10/secure/lib/libcrypto/man/ERR_print_errors.3 stable/10/secure/lib/libcrypto/man/ERR_put_error.3 stable/10/secure/lib/libcrypto/man/ERR_remove_state.3 stable/10/secure/lib/libcrypto/man/ERR_set_mark.3 stable/10/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/10/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/10/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/10/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/10/secure/lib/libcrypto/man/EVP_SealInit.3 stable/10/secure/lib/libcrypto/man/EVP_SignInit.3 stable/10/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/10/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/10/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/10/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/10/secure/lib/libcrypto/man/OPENSSL_config.3 stable/10/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/10/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/10/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/10/secure/lib/libcrypto/man/PKCS12_create.3 stable/10/secure/lib/libcrypto/man/PKCS12_parse.3 stable/10/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/10/secure/lib/libcrypto/man/PKCS7_verify.3 stable/10/secure/lib/libcrypto/man/RAND_add.3 stable/10/secure/lib/libcrypto/man/RAND_bytes.3 stable/10/secure/lib/libcrypto/man/RAND_cleanup.3 stable/10/secure/lib/libcrypto/man/RAND_egd.3 stable/10/secure/lib/libcrypto/man/RAND_load_file.3 stable/10/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/10/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/10/secure/lib/libcrypto/man/RSA_check_key.3 stable/10/secure/lib/libcrypto/man/RSA_generate_key.3 stable/10/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/RSA_new.3 stable/10/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/10/secure/lib/libcrypto/man/RSA_print.3 stable/10/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_set_method.3 stable/10/secure/lib/libcrypto/man/RSA_sign.3 stable/10/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/10/secure/lib/libcrypto/man/RSA_size.3 stable/10/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/10/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/10/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/10/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/10/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/10/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/10/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/10/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/10/secure/lib/libcrypto/man/X509_new.3 stable/10/secure/lib/libcrypto/man/X509_verify_cert.3 stable/10/secure/lib/libcrypto/man/bio.3 stable/10/secure/lib/libcrypto/man/blowfish.3 stable/10/secure/lib/libcrypto/man/bn.3 stable/10/secure/lib/libcrypto/man/bn_internal.3 stable/10/secure/lib/libcrypto/man/buffer.3 stable/10/secure/lib/libcrypto/man/crypto.3 stable/10/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/10/secure/lib/libcrypto/man/d2i_DHparams.3 stable/10/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/10/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_X509.3 stable/10/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/10/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/10/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/10/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/10/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/10/secure/lib/libcrypto/man/des.3 stable/10/secure/lib/libcrypto/man/dh.3 stable/10/secure/lib/libcrypto/man/dsa.3 stable/10/secure/lib/libcrypto/man/ecdsa.3 stable/10/secure/lib/libcrypto/man/engine.3 stable/10/secure/lib/libcrypto/man/err.3 stable/10/secure/lib/libcrypto/man/evp.3 stable/10/secure/lib/libcrypto/man/hmac.3 stable/10/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/10/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/10/secure/lib/libcrypto/man/lh_stats.3 stable/10/secure/lib/libcrypto/man/lhash.3 stable/10/secure/lib/libcrypto/man/md5.3 stable/10/secure/lib/libcrypto/man/mdc2.3 stable/10/secure/lib/libcrypto/man/pem.3 stable/10/secure/lib/libcrypto/man/rand.3 stable/10/secure/lib/libcrypto/man/rc4.3 stable/10/secure/lib/libcrypto/man/ripemd.3 stable/10/secure/lib/libcrypto/man/rsa.3 stable/10/secure/lib/libcrypto/man/sha.3 stable/10/secure/lib/libcrypto/man/threads.3 stable/10/secure/lib/libcrypto/man/ui.3 stable/10/secure/lib/libcrypto/man/ui_compat.3 stable/10/secure/lib/libcrypto/man/x509.3 stable/10/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/10/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/10/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/10/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_free.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/10/secure/lib/libssl/man/SSL_CTX_new.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/10/secure/lib/libssl/man/SSL_SESSION_free.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/10/secure/lib/libssl/man/SSL_accept.3 stable/10/secure/lib/libssl/man/SSL_alert_type_string.3 stable/10/secure/lib/libssl/man/SSL_clear.3 stable/10/secure/lib/libssl/man/SSL_connect.3 stable/10/secure/lib/libssl/man/SSL_do_handshake.3 stable/10/secure/lib/libssl/man/SSL_free.3 stable/10/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/10/secure/lib/libssl/man/SSL_get_ciphers.3 stable/10/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/10/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/10/secure/lib/libssl/man/SSL_get_error.3 stable/10/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/10/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_get_fd.3 stable/10/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/10/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/10/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/10/secure/lib/libssl/man/SSL_get_rbio.3 stable/10/secure/lib/libssl/man/SSL_get_session.3 stable/10/secure/lib/libssl/man/SSL_get_verify_result.3 stable/10/secure/lib/libssl/man/SSL_get_version.3 stable/10/secure/lib/libssl/man/SSL_library_init.3 stable/10/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/10/secure/lib/libssl/man/SSL_new.3 stable/10/secure/lib/libssl/man/SSL_pending.3 stable/10/secure/lib/libssl/man/SSL_read.3 stable/10/secure/lib/libssl/man/SSL_rstate_string.3 stable/10/secure/lib/libssl/man/SSL_session_reused.3 stable/10/secure/lib/libssl/man/SSL_set_bio.3 stable/10/secure/lib/libssl/man/SSL_set_connect_state.3 stable/10/secure/lib/libssl/man/SSL_set_fd.3 stable/10/secure/lib/libssl/man/SSL_set_session.3 stable/10/secure/lib/libssl/man/SSL_set_shutdown.3 stable/10/secure/lib/libssl/man/SSL_set_verify_result.3 stable/10/secure/lib/libssl/man/SSL_shutdown.3 stable/10/secure/lib/libssl/man/SSL_state_string.3 stable/10/secure/lib/libssl/man/SSL_want.3 stable/10/secure/lib/libssl/man/SSL_write.3 stable/10/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/10/secure/lib/libssl/man/ssl.3 stable/10/secure/usr.bin/openssl/Makefile.man stable/10/secure/usr.bin/openssl/man/CA.pl.1 stable/10/secure/usr.bin/openssl/man/asn1parse.1 stable/10/secure/usr.bin/openssl/man/ca.1 stable/10/secure/usr.bin/openssl/man/ciphers.1 stable/10/secure/usr.bin/openssl/man/cms.1 stable/10/secure/usr.bin/openssl/man/crl.1 stable/10/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/10/secure/usr.bin/openssl/man/dgst.1 stable/10/secure/usr.bin/openssl/man/dhparam.1 stable/10/secure/usr.bin/openssl/man/dsa.1 stable/10/secure/usr.bin/openssl/man/dsaparam.1 stable/10/secure/usr.bin/openssl/man/ec.1 stable/10/secure/usr.bin/openssl/man/ecparam.1 stable/10/secure/usr.bin/openssl/man/enc.1 stable/10/secure/usr.bin/openssl/man/errstr.1 stable/10/secure/usr.bin/openssl/man/gendsa.1 stable/10/secure/usr.bin/openssl/man/genpkey.1 stable/10/secure/usr.bin/openssl/man/genrsa.1 stable/10/secure/usr.bin/openssl/man/nseq.1 stable/10/secure/usr.bin/openssl/man/ocsp.1 stable/10/secure/usr.bin/openssl/man/openssl.1 stable/10/secure/usr.bin/openssl/man/passwd.1 stable/10/secure/usr.bin/openssl/man/pkcs12.1 stable/10/secure/usr.bin/openssl/man/pkcs7.1 stable/10/secure/usr.bin/openssl/man/pkcs8.1 stable/10/secure/usr.bin/openssl/man/pkey.1 stable/10/secure/usr.bin/openssl/man/pkeyparam.1 stable/10/secure/usr.bin/openssl/man/pkeyutl.1 stable/10/secure/usr.bin/openssl/man/rand.1 stable/10/secure/usr.bin/openssl/man/req.1 stable/10/secure/usr.bin/openssl/man/rsa.1 stable/10/secure/usr.bin/openssl/man/rsautl.1 stable/10/secure/usr.bin/openssl/man/s_client.1 stable/10/secure/usr.bin/openssl/man/s_server.1 stable/10/secure/usr.bin/openssl/man/s_time.1 stable/10/secure/usr.bin/openssl/man/sess_id.1 stable/10/secure/usr.bin/openssl/man/smime.1 stable/10/secure/usr.bin/openssl/man/speed.1 stable/10/secure/usr.bin/openssl/man/spkac.1 stable/10/secure/usr.bin/openssl/man/ts.1 stable/10/secure/usr.bin/openssl/man/tsget.1 stable/10/secure/usr.bin/openssl/man/verify.1 stable/10/secure/usr.bin/openssl/man/version.1 stable/10/secure/usr.bin/openssl/man/x509.1 stable/10/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/ObsoleteFiles.inc Wed Oct 15 19:59:43 2014 (r273149) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20141015: OpenSSL 1.0.1j import +OLD_FILES+=usr/share/openssl/man/man3/CMS_sign_add1_signer.3.gz # 20140917: hv_kvpd rc.d script removed in favor of devd configuration OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump Modified: stable/10/crypto/openssl/CHANGES ============================================================================== --- stable/10/crypto/openssl/CHANGES Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/CHANGES Wed Oct 15 19:59:43 2014 (r273149) @@ -2,6 +2,57 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1i and 1.0.1j [15 Oct 2014] + + *) SRTP Memory Leak. + + A flaw in the DTLS SRTP extension parsing code allows an attacker, who + sends a carefully crafted handshake message, to cause OpenSSL to fail + to free up to 64k of memory causing a memory leak. This could be + exploited in a Denial Of Service attack. This issue affects OpenSSL + 1.0.1 server implementations for both SSL/TLS and DTLS regardless of + whether SRTP is used or configured. Implementations of OpenSSL that + have been compiled with OPENSSL_NO_SRTP defined are not affected. + + The fix was developed by the OpenSSL team. + (CVE-2014-3513) + [OpenSSL team] + + *) Session Ticket Memory Leak. + + When an OpenSSL SSL/TLS/DTLS server receives a session ticket the + integrity of that ticket is first verified. In the event of a session + ticket integrity check failing, OpenSSL will fail to free memory + causing a memory leak. By sending a large number of invalid session + tickets an attacker could exploit this issue in a Denial Of Service + attack. + (CVE-2014-3567) + [Steve Henson] + + *) Build option no-ssl3 is incomplete. + + When OpenSSL is configured with "no-ssl3" as a build option, servers + could accept and complete a SSL 3.0 handshake, and clients could be + configured to send them. + (CVE-2014-3568) + [Akamai and the OpenSSL team] + + *) Add support for TLS_FALLBACK_SCSV. + Client applications doing fallback retries should call + SSL_set_mode(s, SSL_MODE_SEND_FALLBACK_SCSV). + (CVE-2014-3566) + [Adam Langley, Bodo Moeller] + + *) Add additional DigestInfo checks. + + Reencode DigestInto in DER and check against the original when + verifying RSA signature: this will reject any improperly encoded + DigestInfo structures. + + Note: this is a precautionary measure and no attacks are currently known. + + [Steve Henson] + Changes between 1.0.1h and 1.0.1i [6 Aug 2014] *) Fix SRP buffer overrun vulnerability. Invalid parameters passed to the Modified: stable/10/crypto/openssl/Configure ============================================================================== --- stable/10/crypto/openssl/Configure Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/Configure Wed Oct 15 19:59:43 2014 (r273149) @@ -1767,6 +1767,9 @@ open(OUT,'>crypto/opensslconf.h.new') || print OUT "/* opensslconf.h */\n"; print OUT "/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n"; +print OUT "#ifdef __cplusplus\n"; +print OUT "extern \"C\" {\n"; +print OUT "#endif\n"; print OUT "/* OpenSSL was configured with the following options: */\n"; my $openssl_algorithm_defines_trans = $openssl_algorithm_defines; $openssl_experimental_defines =~ s/^\s*#\s*define\s+OPENSSL_NO_(.*)/#ifndef OPENSSL_EXPERIMENTAL_$1\n# ifndef OPENSSL_NO_$1\n# define OPENSSL_NO_$1\n# endif\n#endif/mg; @@ -1871,6 +1874,9 @@ while () { print OUT $_; } } close(IN); +print OUT "#ifdef __cplusplus\n"; +print OUT "}\n"; +print OUT "#endif\n"; close(OUT); rename("crypto/opensslconf.h","crypto/opensslconf.h.bak") || die "unable to rename crypto/opensslconf.h\n" if -e "crypto/opensslconf.h"; rename("crypto/opensslconf.h.new","crypto/opensslconf.h") || die "unable to rename crypto/opensslconf.h.new\n"; Modified: stable/10/crypto/openssl/Makefile ============================================================================== --- stable/10/crypto/openssl/Makefile Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/Makefile Wed Oct 15 19:59:43 2014 (r273149) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1i +VERSION=1.0.1j MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 Modified: stable/10/crypto/openssl/NEWS ============================================================================== --- stable/10/crypto/openssl/NEWS Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/NEWS Wed Oct 15 19:59:43 2014 (r273149) @@ -5,6 +5,13 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.1i and OpenSSL 1.0.1j [15 Oct 2014] + + o Fix for CVE-2014-3513 + o Fix for CVE-2014-3567 + o Mitigation for CVE-2014-3566 (SSL protocol vulnerability) + o Fix for CVE-2014-3568 + Major changes between OpenSSL 1.0.1h and OpenSSL 1.0.1i [6 Aug 2014] o Fix for CVE-2014-3512 Modified: stable/10/crypto/openssl/README ============================================================================== --- stable/10/crypto/openssl/README Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/README Wed Oct 15 19:59:43 2014 (r273149) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1i 6 Aug 2014 + OpenSSL 1.0.1j 15 Oct 2014 Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/10/crypto/openssl/apps/s_client.c ============================================================================== --- stable/10/crypto/openssl/apps/s_client.c Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/apps/s_client.c Wed Oct 15 19:59:43 2014 (r273149) @@ -337,6 +337,7 @@ static void sc_usage(void) BIO_printf(bio_err," -tls1_1 - just use TLSv1.1\n"); BIO_printf(bio_err," -tls1 - just use TLSv1\n"); BIO_printf(bio_err," -dtls1 - just use DTLSv1\n"); + BIO_printf(bio_err," -fallback_scsv - send TLS_FALLBACK_SCSV\n"); BIO_printf(bio_err," -mtu - set the link layer MTU\n"); BIO_printf(bio_err," -no_tls1_2/-no_tls1_1/-no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n"); BIO_printf(bio_err," -bugs - Switch on all SSL implementation bug workarounds\n"); @@ -617,6 +618,7 @@ int MAIN(int argc, char **argv) char *sess_out = NULL; struct sockaddr peer; int peerlen = sizeof(peer); + int fallback_scsv = 0; int enable_timeouts = 0 ; long socket_mtu = 0; #ifndef OPENSSL_NO_JPAKE @@ -823,6 +825,10 @@ int MAIN(int argc, char **argv) meth=DTLSv1_client_method(); socket_type=SOCK_DGRAM; } + else if (strcmp(*argv,"-fallback_scsv") == 0) + { + fallback_scsv = 1; + } else if (strcmp(*argv,"-timeout") == 0) enable_timeouts=1; else if (strcmp(*argv,"-mtu") == 0) @@ -1235,6 +1241,10 @@ bad: SSL_set_session(con, sess); SSL_SESSION_free(sess); } + + if (fallback_scsv) + SSL_set_mode(con, SSL_MODE_SEND_FALLBACK_SCSV); + #ifndef OPENSSL_NO_TLSEXT if (servername != NULL) { Modified: stable/10/crypto/openssl/crypto/Makefile ============================================================================== --- stable/10/crypto/openssl/crypto/Makefile Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/crypto/Makefile Wed Oct 15 19:59:43 2014 (r273149) @@ -32,6 +32,7 @@ CPUID_OBJ=mem_clr.o LIBS= GENERAL=Makefile README crypto-lib.com install.com +TEST=constant_time_test.c LIB= $(TOP)/libcrypto.a SHARED_LIB= libcrypto$(SHLIB_EXT) @@ -44,7 +45,8 @@ SRC= $(LIBSRC) EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \ ossl_typ.h -HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER) +HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \ + constant_time_locl.h $(EXHEADER) ALL= $(GENERAL) $(SRC) $(HEADER) Modified: stable/10/crypto/openssl/crypto/aes/asm/aesni-x86_64.pl ============================================================================== --- stable/10/crypto/openssl/crypto/aes/asm/aesni-x86_64.pl Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/crypto/aes/asm/aesni-x86_64.pl Wed Oct 15 19:59:43 2014 (r273149) @@ -525,6 +525,16 @@ $code.=<<___; .type aesni_ecb_encrypt,\@function,5 .align 16 aesni_ecb_encrypt: +___ +$code.=<<___ if ($win64); + lea -0x58(%rsp),%rsp + movaps %xmm6,(%rsp) + movaps %xmm7,0x10(%rsp) + movaps %xmm8,0x20(%rsp) + movaps %xmm9,0x30(%rsp) +.Lecb_enc_body: +___ +$code.=<<___; and \$-16,$len jz .Lecb_ret @@ -805,6 +815,16 @@ $code.=<<___; movups $inout5,0x50($out) .Lecb_ret: +___ +$code.=<<___ if ($win64); + movaps (%rsp),%xmm6 + movaps 0x10(%rsp),%xmm7 + movaps 0x20(%rsp),%xmm8 + movaps 0x30(%rsp),%xmm9 + lea 0x58(%rsp),%rsp +.Lecb_enc_ret: +___ +$code.=<<___; ret .size aesni_ecb_encrypt,.-aesni_ecb_encrypt ___ @@ -2730,28 +2750,9 @@ $code.=<<___; .extern __imp_RtlVirtualUnwind ___ $code.=<<___ if ($PREFIX eq "aesni"); -.type ecb_se_handler,\@abi-omnipotent -.align 16 -ecb_se_handler: - push %rsi - push %rdi - push %rbx - push %rbp - push %r12 - push %r13 - push %r14 - push %r15 - pushfq - sub \$64,%rsp - - mov 152($context),%rax # pull context->Rsp - - jmp .Lcommon_seh_tail -.size ecb_se_handler,.-ecb_se_handler - -.type ccm64_se_handler,\@abi-omnipotent +.type ecb_ccm64_se_handler,\@abi-omnipotent .align 16 -ccm64_se_handler: +ecb_ccm64_se_handler: push %rsi push %rdi push %rbx @@ -2788,7 +2789,7 @@ ccm64_se_handler: lea 0x58(%rax),%rax # adjust stack pointer jmp .Lcommon_seh_tail -.size ccm64_se_handler,.-ccm64_se_handler +.size ecb_ccm64_se_handler,.-ecb_ccm64_se_handler .type ctr32_se_handler,\@abi-omnipotent .align 16 @@ -2993,14 +2994,15 @@ ___ $code.=<<___ if ($PREFIX eq "aesni"); .LSEH_info_ecb: .byte 9,0,0,0 - .rva ecb_se_handler + .rva ecb_ccm64_se_handler + .rva .Lecb_enc_body,.Lecb_enc_ret # HandlerData[] .LSEH_info_ccm64_enc: .byte 9,0,0,0 - .rva ccm64_se_handler + .rva ecb_ccm64_se_handler .rva .Lccm64_enc_body,.Lccm64_enc_ret # HandlerData[] .LSEH_info_ccm64_dec: .byte 9,0,0,0 - .rva ccm64_se_handler + .rva ecb_ccm64_se_handler .rva .Lccm64_dec_body,.Lccm64_dec_ret # HandlerData[] .LSEH_info_ctr32: .byte 9,0,0,0 Modified: stable/10/crypto/openssl/crypto/asn1/a_strex.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_strex.c Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/crypto/asn1/a_strex.c Wed Oct 15 19:59:43 2014 (r273149) @@ -568,6 +568,7 @@ int ASN1_STRING_to_UTF8(unsigned char ** mbflag |= MBSTRING_FLAG; stmp.data = NULL; stmp.length = 0; + stmp.flags = 0; ret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag, B_ASN1_UTF8STRING); if(ret < 0) return ret; *out = stmp.data; Modified: stable/10/crypto/openssl/crypto/bn/asm/x86_64-gcc.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Wed Oct 15 19:59:43 2014 (r273149) @@ -189,7 +189,7 @@ BN_ULONG bn_add_words (BN_ULONG *rp, con if (n <= 0) return 0; - asm ( + asm volatile ( " subq %2,%2 \n" ".p2align 4 \n" "1: movq (%4,%2,8),%0 \n" @@ -200,7 +200,7 @@ BN_ULONG bn_add_words (BN_ULONG *rp, con " sbbq %0,%0 \n" : "=&a"(ret),"+c"(n),"=&r"(i) : "r"(rp),"r"(ap),"r"(bp) - : "cc" + : "cc", "memory" ); return ret&1; @@ -212,7 +212,7 @@ BN_ULONG bn_sub_words (BN_ULONG *rp, con if (n <= 0) return 0; - asm ( + asm volatile ( " subq %2,%2 \n" ".p2align 4 \n" "1: movq (%4,%2,8),%0 \n" @@ -223,7 +223,7 @@ BN_ULONG bn_sub_words (BN_ULONG *rp, con " sbbq %0,%0 \n" : "=&a"(ret),"+c"(n),"=&r"(i) : "r"(rp),"r"(ap),"r"(bp) - : "cc" + : "cc", "memory" ); return ret&1; Modified: stable/10/crypto/openssl/crypto/bn/bn_exp.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/bn_exp.c Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/crypto/bn/bn_exp.c Wed Oct 15 19:59:43 2014 (r273149) @@ -874,7 +874,14 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ bits = BN_num_bits(p); if (bits == 0) { - ret = BN_one(rr); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) + { + ret = 1; + BN_zero(rr); + } + else + ret = BN_one(rr); return ret; } if (a == 0) Modified: stable/10/crypto/openssl/crypto/bn/bn_nist.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/bn_nist.c Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/crypto/bn/bn_nist.c Wed Oct 15 19:59:43 2014 (r273149) @@ -1088,9 +1088,9 @@ int BN_nist_mod_521(BIGNUM *r, const BIG /* ... and right shift */ for (val=t_d[0],i=0; i>BN_NIST_521_RSHIFT; - val = t_d[i+1]; - t_d[i] = (tmp | val<>BN_NIST_521_RSHIFT | + (tmp=t_d[i+1])<>BN_NIST_521_RSHIFT; /* lower 521 bits */ Modified: stable/10/crypto/openssl/crypto/bn/exptest.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/exptest.c Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/crypto/bn/exptest.c Wed Oct 15 19:59:43 2014 (r273149) @@ -71,6 +71,43 @@ static const char rnd_seed[] = "string to make the random number generator think it has entropy"; +/* test_exp_mod_zero tests that x**0 mod 1 == 0. It returns zero on success. */ +static int test_exp_mod_zero() { + BIGNUM a, p, m; + BIGNUM r; + BN_CTX *ctx = BN_CTX_new(); + int ret = 1; + + BN_init(&m); + BN_one(&m); + + BN_init(&a); + BN_one(&a); + + BN_init(&p); + BN_zero(&p); + + BN_init(&r); + BN_mod_exp(&r, &a, &p, &m, ctx); + BN_CTX_free(ctx); + + if (BN_is_zero(&r)) + ret = 0; + else + { + printf("1**0 mod 1 = "); + BN_print_fp(stdout, &r); + printf(", should be 0\n"); + } + + BN_free(&r); + BN_free(&a); + BN_free(&p); + BN_free(&m); + + return ret; +} + int main(int argc, char *argv[]) { BN_CTX *ctx; @@ -190,7 +227,13 @@ int main(int argc, char *argv[]) ERR_remove_thread_state(NULL); CRYPTO_mem_leaks(out); BIO_free(out); - printf(" done\n"); + printf("\n"); + + if (test_exp_mod_zero() != 0) + goto err; + + printf("done\n"); + EXIT(0); err: ERR_load_crypto_strings(); Copied: stable/10/crypto/openssl/crypto/constant_time_locl.h (from r273144, head/crypto/openssl/crypto/constant_time_locl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/crypto/openssl/crypto/constant_time_locl.h Wed Oct 15 19:59:43 2014 (r273149, copy of r273144, head/crypto/openssl/crypto/constant_time_locl.h) @@ -0,0 +1,216 @@ +/* crypto/constant_time_locl.h */ +/* + * Utilities for constant-time cryptography. + * + * Author: Emilia Kasper (emilia@openssl.org) + * Based on previous work by Bodo Moeller, Emilia Kasper, Adam Langley + * (Google). + * ==================================================================== + * Copyright (c) 2014 The OpenSSL Project. 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 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_CONSTANT_TIME_LOCL_H +#define HEADER_CONSTANT_TIME_LOCL_H + +#include "e_os.h" /* For 'inline' */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The boolean methods return a bitmask of all ones (0xff...f) for true + * and 0 for false. This is useful for choosing a value based on the result + * of a conditional in constant time. For example, + * + * if (a < b) { + * c = a; + * } else { + * c = b; + * } + * + * can be written as + * + * unsigned int lt = constant_time_lt(a, b); + * c = constant_time_select(lt, a, b); + */ + +/* + * Returns the given value with the MSB copied to all the other + * bits. Uses the fact that arithmetic shift shifts-in the sign bit. + * However, this is not ensured by the C standard so you may need to + * replace this with something else on odd CPUs. + */ +static inline unsigned int constant_time_msb(unsigned int a); + +/* + * Returns 0xff..f if a < b and 0 otherwise. + */ +static inline unsigned int constant_time_lt(unsigned int a, unsigned int b); +/* Convenience method for getting an 8-bit mask. */ +static inline unsigned char constant_time_lt_8(unsigned int a, unsigned int b); + +/* + * Returns 0xff..f if a >= b and 0 otherwise. + */ +static inline unsigned int constant_time_ge(unsigned int a, unsigned int b); +/* Convenience method for getting an 8-bit mask. */ +static inline unsigned char constant_time_ge_8(unsigned int a, unsigned int b); + +/* + * Returns 0xff..f if a == 0 and 0 otherwise. + */ +static inline unsigned int constant_time_is_zero(unsigned int a); +/* Convenience method for getting an 8-bit mask. */ +static inline unsigned char constant_time_is_zero_8(unsigned int a); + + +/* + * Returns 0xff..f if a == b and 0 otherwise. + */ +static inline unsigned int constant_time_eq(unsigned int a, unsigned int b); +/* Convenience method for getting an 8-bit mask. */ +static inline unsigned char constant_time_eq_8(unsigned int a, unsigned int b); +/* Signed integers. */ +static inline unsigned int constant_time_eq_int(int a, int b); +/* Convenience method for getting an 8-bit mask. */ +static inline unsigned char constant_time_eq_int_8(int a, int b); + + +/* + * Returns (mask & a) | (~mask & b). + * + * When |mask| is all 1s or all 0s (as returned by the methods above), + * the select methods return either |a| (if |mask| is nonzero) or |b| + * (if |mask| is zero). + */ +static inline unsigned int constant_time_select(unsigned int mask, + unsigned int a, unsigned int b); +/* Convenience method for unsigned chars. */ +static inline unsigned char constant_time_select_8(unsigned char mask, + unsigned char a, unsigned char b); +/* Convenience method for signed integers. */ +static inline int constant_time_select_int(unsigned int mask, int a, int b); + +static inline unsigned int constant_time_msb(unsigned int a) + { + return (unsigned int)((int)(a) >> (sizeof(int) * 8 - 1)); + } + +static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) + { + unsigned int lt; + /* Case 1: msb(a) == msb(b). a < b iff the MSB of a - b is set.*/ + lt = ~(a ^ b) & (a - b); + /* Case 2: msb(a) != msb(b). a < b iff the MSB of b is set. */ + lt |= ~a & b; + return constant_time_msb(lt); + } + +static inline unsigned char constant_time_lt_8(unsigned int a, unsigned int b) + { + return (unsigned char)(constant_time_lt(a, b)); + } + +static inline unsigned int constant_time_ge(unsigned int a, unsigned int b) + { + unsigned int ge; + /* Case 1: msb(a) == msb(b). a >= b iff the MSB of a - b is not set.*/ + ge = ~((a ^ b) | (a - b)); + /* Case 2: msb(a) != msb(b). a >= b iff the MSB of a is set. */ + ge |= a & ~b; + return constant_time_msb(ge); + } + +static inline unsigned char constant_time_ge_8(unsigned int a, unsigned int b) + { + return (unsigned char)(constant_time_ge(a, b)); + } + +static inline unsigned int constant_time_is_zero(unsigned int a) + { + return constant_time_msb(~a & (a - 1)); + } + +static inline unsigned char constant_time_is_zero_8(unsigned int a) + { + return (unsigned char)(constant_time_is_zero(a)); + } + +static inline unsigned int constant_time_eq(unsigned int a, unsigned int b) + { + return constant_time_is_zero(a ^ b); + } + +static inline unsigned char constant_time_eq_8(unsigned int a, unsigned int b) + { + return (unsigned char)(constant_time_eq(a, b)); + } + +static inline unsigned int constant_time_eq_int(int a, int b) + { + return constant_time_eq((unsigned)(a), (unsigned)(b)); + } + +static inline unsigned char constant_time_eq_int_8(int a, int b) + { + return constant_time_eq_8((unsigned)(a), (unsigned)(b)); + } + +static inline unsigned int constant_time_select(unsigned int mask, + unsigned int a, unsigned int b) + { + return (mask & a) | (~mask & b); + } + +static inline unsigned char constant_time_select_8(unsigned char mask, + unsigned char a, unsigned char b) + { + return (unsigned char)(constant_time_select(mask, a, b)); + } + +inline int constant_time_select_int(unsigned int mask, int a, int b) + { + return (int)(constant_time_select(mask, (unsigned)(a), (unsigned)(b))); + } + +#ifdef __cplusplus +} +#endif + +#endif /* HEADER_CONSTANT_TIME_LOCL_H */ Copied: stable/10/crypto/openssl/crypto/constant_time_test.c (from r273144, head/crypto/openssl/crypto/constant_time_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/crypto/openssl/crypto/constant_time_test.c Wed Oct 15 19:59:43 2014 (r273149, copy of r273144, head/crypto/openssl/crypto/constant_time_test.c) @@ -0,0 +1,330 @@ +/* crypto/constant_time_test.c */ +/* + * Utilities for constant-time cryptography. + * + * Author: Emilia Kasper (emilia@openssl.org) + * Based on previous work by Bodo Moeller, Emilia Kasper, Adam Langley + * (Google). + * ==================================================================== + * Copyright (c) 2014 The OpenSSL Project. 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 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include "../crypto/constant_time_locl.h" + +#include +#include +#include + +static const unsigned int CONSTTIME_TRUE = (unsigned)(~0); +static const unsigned int CONSTTIME_FALSE = 0; +static const unsigned char CONSTTIME_TRUE_8 = 0xff; +static const unsigned char CONSTTIME_FALSE_8 = 0; + +static int test_binary_op(unsigned int (*op)(unsigned int a, unsigned int b), + const char* op_name, unsigned int a, unsigned int b, int is_true) + { + unsigned c = op(a, b); + if (is_true && c != CONSTTIME_TRUE) + { + fprintf(stderr, "Test failed for %s(%du, %du): expected %du " + "(TRUE), got %du\n", op_name, a, b, CONSTTIME_TRUE, c); + return 1; + } + else if (!is_true && c != CONSTTIME_FALSE) + { + fprintf(stderr, "Test failed for %s(%du, %du): expected %du " + "(FALSE), got %du\n", op_name, a, b, CONSTTIME_FALSE, + c); + return 1; + } + return 0; + } + +static int test_binary_op_8(unsigned char (*op)(unsigned int a, unsigned int b), + const char* op_name, unsigned int a, unsigned int b, int is_true) + { + unsigned char c = op(a, b); + if (is_true && c != CONSTTIME_TRUE_8) + { + fprintf(stderr, "Test failed for %s(%du, %du): expected %u " + "(TRUE), got %u\n", op_name, a, b, CONSTTIME_TRUE_8, c); + return 1; + } + else if (!is_true && c != CONSTTIME_FALSE_8) + { + fprintf(stderr, "Test failed for %s(%du, %du): expected %u " + "(FALSE), got %u\n", op_name, a, b, CONSTTIME_FALSE_8, + c); + return 1; + } + return 0; + } + +static int test_is_zero(unsigned int a) + { + unsigned int c = constant_time_is_zero(a); + if (a == 0 && c != CONSTTIME_TRUE) + { + fprintf(stderr, "Test failed for constant_time_is_zero(%du): " + "expected %du (TRUE), got %du\n", a, CONSTTIME_TRUE, c); + return 1; + } + else if (a != 0 && c != CONSTTIME_FALSE) + { + fprintf(stderr, "Test failed for constant_time_is_zero(%du): " + "expected %du (FALSE), got %du\n", a, CONSTTIME_FALSE, + c); + return 1; + } + return 0; + } + +static int test_is_zero_8(unsigned int a) + { + unsigned char c = constant_time_is_zero_8(a); + if (a == 0 && c != CONSTTIME_TRUE_8) + { + fprintf(stderr, "Test failed for constant_time_is_zero(%du): " + "expected %u (TRUE), got %u\n", a, CONSTTIME_TRUE_8, c); + return 1; + } + else if (a != 0 && c != CONSTTIME_FALSE) + { + fprintf(stderr, "Test failed for constant_time_is_zero(%du): " + "expected %u (FALSE), got %u\n", a, CONSTTIME_FALSE_8, + c); + return 1; + } + return 0; + } + +static int test_select(unsigned int a, unsigned int b) + { + unsigned int selected = constant_time_select(CONSTTIME_TRUE, a, b); + if (selected != a) + { + fprintf(stderr, "Test failed for constant_time_select(%du, %du," + "%du): expected %du(first value), got %du\n", + CONSTTIME_TRUE, a, b, a, selected); + return 1; + } + selected = constant_time_select(CONSTTIME_FALSE, a, b); + if (selected != b) + { + fprintf(stderr, "Test failed for constant_time_select(%du, %du," + "%du): expected %du(second value), got %du\n", + CONSTTIME_FALSE, a, b, b, selected); + return 1; + } + return 0; + } + +static int test_select_8(unsigned char a, unsigned char b) + { + unsigned char selected = constant_time_select_8(CONSTTIME_TRUE_8, a, b); + if (selected != a) + { + fprintf(stderr, "Test failed for constant_time_select(%u, %u," + "%u): expected %u(first value), got %u\n", + CONSTTIME_TRUE, a, b, a, selected); + return 1; + } + selected = constant_time_select_8(CONSTTIME_FALSE_8, a, b); + if (selected != b) + { + fprintf(stderr, "Test failed for constant_time_select(%u, %u," + "%u): expected %u(second value), got %u\n", + CONSTTIME_FALSE, a, b, b, selected); + return 1; + } + return 0; + } + +static int test_select_int(int a, int b) + { + int selected = constant_time_select_int(CONSTTIME_TRUE, a, b); + if (selected != a) + { + fprintf(stderr, "Test failed for constant_time_select(%du, %d," + "%d): expected %d(first value), got %d\n", + CONSTTIME_TRUE, a, b, a, selected); + return 1; + } + selected = constant_time_select_int(CONSTTIME_FALSE, a, b); + if (selected != b) + { + fprintf(stderr, "Test failed for constant_time_select(%du, %d," + "%d): expected %d(second value), got %d\n", + CONSTTIME_FALSE, a, b, b, selected); + return 1; + } + return 0; + } + +static int test_eq_int(int a, int b) + { + unsigned int equal = constant_time_eq_int(a, b); + if (a == b && equal != CONSTTIME_TRUE) + { + fprintf(stderr, "Test failed for constant_time_eq_int(%d, %d): " + "expected %du(TRUE), got %du\n", + a, b, CONSTTIME_TRUE, equal); + return 1; + } + else if (a != b && equal != CONSTTIME_FALSE) + { + fprintf(stderr, "Test failed for constant_time_eq_int(%d, %d): " + "expected %du(FALSE), got %du\n", + a, b, CONSTTIME_FALSE, equal); + return 1; + } + return 0; + } + +static int test_eq_int_8(int a, int b) + { + unsigned char equal = constant_time_eq_int_8(a, b); + if (a == b && equal != CONSTTIME_TRUE_8) + { + fprintf(stderr, "Test failed for constant_time_eq_int_8(%d, %d): " + "expected %u(TRUE), got %u\n", + a, b, CONSTTIME_TRUE_8, equal); + return 1; + } + else if (a != b && equal != CONSTTIME_FALSE_8) + { + fprintf(stderr, "Test failed for constant_time_eq_int_8(%d, %d): " + "expected %u(FALSE), got %u\n", + a, b, CONSTTIME_FALSE_8, equal); + return 1; + } + return 0; + } + +static unsigned int test_values[] = {0, 1, 1024, 12345, 32000, UINT_MAX/2-1, + UINT_MAX/2, UINT_MAX/2+1, UINT_MAX-1, + UINT_MAX}; + +static unsigned char test_values_8[] = {0, 1, 2, 20, 32, 127, 128, 129, 255}; + +static int signed_test_values[] = {0, 1, -1, 1024, -1024, 12345, -12345, + 32000, -32000, INT_MAX, INT_MIN, INT_MAX-1, + INT_MIN+1}; + + +int main(int argc, char *argv[]) + { + unsigned int a, b, i, j; + int c, d; + unsigned char e, f; + int num_failed = 0, num_all = 0; + fprintf(stdout, "Testing constant time operations...\n"); + + for (i = 0; i < sizeof(test_values)/sizeof(int); ++i) + { + a = test_values[i]; + num_failed += test_is_zero(a); + num_failed += test_is_zero_8(a); + num_all += 2; + for (j = 0; j < sizeof(test_values)/sizeof(int); ++j) + { + b = test_values[j]; + num_failed += test_binary_op(&constant_time_lt, + "constant_time_lt", a, b, a < b); + num_failed += test_binary_op_8(&constant_time_lt_8, + "constant_time_lt_8", a, b, a < b); + num_failed += test_binary_op(&constant_time_lt, + "constant_time_lt_8", b, a, b < a); + num_failed += test_binary_op_8(&constant_time_lt_8, + "constant_time_lt_8", b, a, b < a); + num_failed += test_binary_op(&constant_time_ge, + "constant_time_ge", a, b, a >= b); + num_failed += test_binary_op_8(&constant_time_ge_8, + "constant_time_ge_8", a, b, a >= b); + num_failed += test_binary_op(&constant_time_ge, + "constant_time_ge", b, a, b >= a); + num_failed += test_binary_op_8(&constant_time_ge_8, + "constant_time_ge_8", b, a, b >= a); + num_failed += test_binary_op(&constant_time_eq, + "constant_time_eq", a, b, a == b); + num_failed += test_binary_op_8(&constant_time_eq_8, + "constant_time_eq_8", a, b, a == b); + num_failed += test_binary_op(&constant_time_eq, + "constant_time_eq", b, a, b == a); + num_failed += test_binary_op_8(&constant_time_eq_8, + "constant_time_eq_8", b, a, b == a); + num_failed += test_select(a, b); + num_all += 13; + } + } + + for (i = 0; i < sizeof(signed_test_values)/sizeof(int); ++i) + { + c = signed_test_values[i]; + for (j = 0; j < sizeof(signed_test_values)/sizeof(int); ++j) + { + d = signed_test_values[j]; + num_failed += test_select_int(c, d); + num_failed += test_eq_int(c, d); + num_failed += test_eq_int_8(c, d); + num_all += 3; + } + } + + for (i = 0; i < sizeof(test_values_8); ++i) + { + e = test_values_8[i]; + for (j = 0; j < sizeof(test_values_8); ++j) + { + f = test_values_8[j]; + num_failed += test_select_8(e, f); + num_all += 1; + } + } + + if (!num_failed) + { + fprintf(stdout, "ok (ran %d tests)\n", num_all); + return EXIT_SUCCESS; + } + else + { + fprintf(stdout, "%d of %d tests failed!\n", num_failed, num_all); + return EXIT_FAILURE; + } + } Modified: stable/10/crypto/openssl/crypto/dsa/dsa_ameth.c ============================================================================== --- stable/10/crypto/openssl/crypto/dsa/dsa_ameth.c Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/crypto/dsa/dsa_ameth.c Wed Oct 15 19:59:43 2014 (r273149) @@ -307,6 +307,12 @@ static int dsa_priv_encode(PKCS8_PRIV_KE unsigned char *dp = NULL; int dplen; + if (!pkey->pkey.dsa || !pkey->pkey.dsa->priv_key) + { + DSAerr(DSA_F_DSA_PRIV_ENCODE,DSA_R_MISSING_PARAMETERS); + goto err; + } + params = ASN1_STRING_new(); if (!params) @@ -701,4 +707,3 @@ const EVP_PKEY_ASN1_METHOD dsa_asn1_meth old_dsa_priv_encode } }; - Modified: stable/10/crypto/openssl/crypto/ebcdic.h ============================================================================== --- stable/10/crypto/openssl/crypto/ebcdic.h Wed Oct 15 19:46:49 2014 (r273148) +++ stable/10/crypto/openssl/crypto/ebcdic.h Wed Oct 15 19:59:43 2014 (r273149) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Oct 15 20:04:22 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A6C5D3; Wed, 15 Oct 2014 20:04: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 5612EA4D; Wed, 15 Oct 2014 20:04: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 s9FK4MmQ033755; Wed, 15 Oct 2014 20:04:22 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9FK4MIO033754; Wed, 15 Oct 2014 20:04:22 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201410152004.s9FK4MIO033754@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 15 Oct 2014 20:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273150 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 20:04:22 -0000 Author: jkim Date: Wed Oct 15 20:04:21 2014 New Revision: 273150 URL: https://svnweb.freebsd.org/changeset/base/273150 Log: MFC: r272718 Make kern.nswbuf tunable from loader. Modified: stable/10/sys/kern/vfs_bio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_bio.c ============================================================================== --- stable/10/sys/kern/vfs_bio.c Wed Oct 15 19:59:43 2014 (r273149) +++ stable/10/sys/kern/vfs_bio.c Wed Oct 15 20:04:21 2014 (r273150) @@ -636,6 +636,10 @@ bd_speedup(void) mtx_unlock(&bdlock); } +#ifndef NSWBUF_MIN +#define NSWBUF_MIN 16 +#endif + #ifdef __i386__ #define TRANSIENT_DENOM 5 #else @@ -747,11 +751,10 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon * swbufs are used as temporary holders for I/O, such as paging I/O. * We have no less then 16 and no more then 256. */ - nswbuf = max(min(nbuf/4, 256), 16); -#ifdef NSWBUF_MIN + nswbuf = min(nbuf / 4, 256); + TUNABLE_INT_FETCH("kern.nswbuf", &nswbuf); if (nswbuf < NSWBUF_MIN) nswbuf = NSWBUF_MIN; -#endif /* * Reserve space for the buffer cache buffers From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 16 08:33:12 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C07A733A; Thu, 16 Oct 2014 08:33: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 A7E8BDBB; Thu, 16 Oct 2014 08:33: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 s9G8XCnV088424; Thu, 16 Oct 2014 08:33:12 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9G8XCiW088423; Thu, 16 Oct 2014 08:33:12 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201410160833.s9G8XCiW088423@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 16 Oct 2014 08:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273161 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 08:33:12 -0000 Author: smh Date: Thu Oct 16 08:33:11 2014 New Revision: 273161 URL: https://svnweb.freebsd.org/changeset/base/273161 Log: MFC r273158: Prevent ZFS leaking pool free space Early MFC approved by re@ Approved by: re@ (glebius) Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Thu Oct 16 08:33:04 2014 (r273160) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Thu Oct 16 08:33:11 2014 (r273161) @@ -1476,13 +1476,6 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * "traverse_dataset_destroyed()", err); } - /* - * If we didn't make progress, mark the async destroy as - * stalled, so that we will not initiate a spa_sync() on - * its behalf. - */ - scn->scn_async_stalled = (scn->scn_visited_this_txg == 0); - if (bptree_is_empty(dp->dp_meta_objset, dp->dp_bptree_obj)) { /* finished; deactivate async destroy feature */ spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY, tx); @@ -1495,6 +1488,14 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * dp->dp_bptree_obj, tx)); dp->dp_bptree_obj = 0; scn->scn_async_destroying = B_FALSE; + } else { + /* + * If we didn't make progress, mark the async destroy as + * stalled, so that we will not initiate a spa_sync() on + * its behalf. + */ + scn->scn_async_stalled = + (scn->scn_visited_this_txg == 0); } } if (scn->scn_visited_this_txg) { From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 16 20:43:12 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF52DD0E; Thu, 16 Oct 2014 20:43: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 AB9E7C80; Thu, 16 Oct 2014 20:43: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 s9GKhCw5069070; Thu, 16 Oct 2014 20:43:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9GKhC07069069; Thu, 16 Oct 2014 20:43:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201410162043.s9GKhC07069069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 16 Oct 2014 20:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273184 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 20:43:12 -0000 Author: glebius Date: Thu Oct 16 20:43:12 2014 New Revision: 273184 URL: https://svnweb.freebsd.org/changeset/base/273184 Log: Merge r272358 from head: Use rn_detachhead() instead of direct free(9) for radix tables. Modified: stable/10/sys/netpfil/pf/pf_table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_table.c Thu Oct 16 20:33:04 2014 (r273183) +++ stable/10/sys/netpfil/pf/pf_table.c Thu Oct 16 20:43:12 2014 (r273184) @@ -1854,11 +1854,11 @@ pfr_destroy_ktable(struct pfr_ktable *kt } if (kt->pfrkt_ip4 != NULL) { RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip4); - free((caddr_t)kt->pfrkt_ip4, M_RTABLE); + rn_detachhead((void **)&kt->pfrkt_ip4); } if (kt->pfrkt_ip6 != NULL) { RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip6); - free((caddr_t)kt->pfrkt_ip6, M_RTABLE); + rn_detachhead((void **)&kt->pfrkt_ip6); } if (kt->pfrkt_shadow != NULL) pfr_destroy_ktable(kt->pfrkt_shadow, flushaddr); From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 16 20:46:03 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17D10E9B; Thu, 16 Oct 2014 20:46:03 +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 044E2C9F; Thu, 16 Oct 2014 20:46:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9GKk2UT069587; Thu, 16 Oct 2014 20:46:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9GKk2K6069586; Thu, 16 Oct 2014 20:46:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201410162046.s9GKk2K6069586@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 16 Oct 2014 20:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273185 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 20:46:03 -0000 Author: glebius Date: Thu Oct 16 20:46:02 2014 New Revision: 273185 URL: https://svnweb.freebsd.org/changeset/base/273185 Log: Merge r272385 by melifaro from head: Free radix mask entries on main radix destroy. This is temporary commit to be merged to 10. Other approach (like hash table) should be used to store different masks. PR: 194078 Modified: stable/10/sys/net/radix.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/radix.c ============================================================================== --- stable/10/sys/net/radix.c Thu Oct 16 20:43:12 2014 (r273184) +++ stable/10/sys/net/radix.c Thu Oct 16 20:46:02 2014 (r273185) @@ -1204,6 +1204,18 @@ rn_inithead(void **head, int off) return (1); } +static int +rn_freeentry(struct radix_node *rn, void *arg) +{ + struct radix_node_head * const rnh = arg; + struct radix_node *x; + + x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh); + if (x != NULL) + Free(x); + return (0); +} + int rn_detachhead(void **head) { @@ -1214,6 +1226,7 @@ rn_detachhead(void **head) rnh = *head; + rn_walktree(rnh->rnh_masks, rn_freeentry, rnh->rnh_masks); rn_detachhead_internal((void **)&rnh->rnh_masks); rn_detachhead_internal(head); return (1); From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 16 22:12:23 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E02A0DB6; Thu, 16 Oct 2014 22:12:23 +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 CB559910; Thu, 16 Oct 2014 22:12:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9GMCN4K014317; Thu, 16 Oct 2014 22:12:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9GMCNrH014316; Thu, 16 Oct 2014 22:12:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410162212.s9GMCNrH014316@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 16 Oct 2014 22:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273191 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 22:12:24 -0000 Author: delphij Date: Thu Oct 16 22:12:23 2014 New Revision: 273191 URL: https://svnweb.freebsd.org/changeset/base/273191 Log: MFV r273060: Use write_psize instead of write_asize when doing vdev_space_update. Without this change the accounting of L2ARC usage would be wrong and give 16EB free space because the number became negative and overflows. Obtained from: FreeNAS (issue #6239) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 16 22:07:43 2014 (r273190) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 16 22:12:23 2014 (r273191) @@ -5228,7 +5228,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); ARCSTAT_INCR(arcstat_l2_size, write_sz); ARCSTAT_INCR(arcstat_l2_asize, write_asize); - vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0); + vdev_space_update(dev->l2ad_vdev, write_psize, 0, 0); /* * Bump device hand to the device start if it is approaching the end. From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 16 22:33:10 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1DFA81D; Thu, 16 Oct 2014 22:33: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 A325DADF; Thu, 16 Oct 2014 22:33:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9GMXAN7023928; Thu, 16 Oct 2014 22:33:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9GMXAiU023926; Thu, 16 Oct 2014 22:33:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410162233.s9GMXAiU023926@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 16 Oct 2014 22:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273193 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 22:33:10 -0000 Author: delphij Date: Thu Oct 16 22:33:09 2014 New Revision: 273193 URL: https://svnweb.freebsd.org/changeset/base/273193 Log: MFC r272506: MFV r272495: In arc_kmem_reap_now(), reap range_seg_cache too to reclaim memory in response of memory pressure. Illumos issue: 5163 arc should reap range_seg_cache Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 16 22:20:38 2014 (r273192) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 16 22:33:09 2014 (r273193) @@ -2594,6 +2594,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t size_t i; kmem_cache_t *prev_cache = NULL; kmem_cache_t *prev_data_cache = NULL; + extern kmem_cache_t *range_seg_cache; DTRACE_PROBE(arc__kmem_reap_start); #ifdef _KERNEL @@ -2631,6 +2632,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t } kmem_cache_reap_now(buf_cache); kmem_cache_reap_now(hdr_cache); + kmem_cache_reap_now(range_seg_cache); #ifdef sun /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Thu Oct 16 22:20:38 2014 (r273192) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Thu Oct 16 22:33:09 2014 (r273193) @@ -33,7 +33,7 @@ #include #include -static kmem_cache_t *range_seg_cache; +kmem_cache_t *range_seg_cache; void range_tree_init(void) From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 16 22:40:22 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA6FCB65; Thu, 16 Oct 2014 22:40: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 C5845B37; Thu, 16 Oct 2014 22:40: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 s9GMeMmI025352; Thu, 16 Oct 2014 22:40:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9GMeMr6025351; Thu, 16 Oct 2014 22:40:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410162240.s9GMeMr6025351@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 16 Oct 2014 22:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273194 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 22:40:23 -0000 Author: delphij Date: Thu Oct 16 22:40:22 2014 New Revision: 273194 URL: https://svnweb.freebsd.org/changeset/base/273194 Log: MFC r272527: Don't make nested definition for range_seg_cache. Reported by: ian Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 16 22:33:09 2014 (r273193) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 16 22:40:22 2014 (r273194) @@ -2587,6 +2587,7 @@ arc_reclaim_needed(void) extern kmem_cache_t *zio_buf_cache[]; extern kmem_cache_t *zio_data_buf_cache[]; +extern kmem_cache_t *range_seg_cache; static void __noinline arc_kmem_reap_now(arc_reclaim_strategy_t strat) @@ -2594,7 +2595,6 @@ arc_kmem_reap_now(arc_reclaim_strategy_t size_t i; kmem_cache_t *prev_cache = NULL; kmem_cache_t *prev_data_cache = NULL; - extern kmem_cache_t *range_seg_cache; DTRACE_PROBE(arc__kmem_reap_start); #ifdef _KERNEL From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 16 22:44:31 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67B30F95; Thu, 16 Oct 2014 22:44:31 +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 39382BF5; Thu, 16 Oct 2014 22:44:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9GMiV9R028921; Thu, 16 Oct 2014 22:44:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9GMiVPS028920; Thu, 16 Oct 2014 22:44:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410162244.s9GMiVPS028920@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 16 Oct 2014 22:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273195 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 22:44:31 -0000 Author: delphij Date: Thu Oct 16 22:44:30 2014 New Revision: 273195 URL: https://svnweb.freebsd.org/changeset/base/273195 Log: MFC r272583: MFV r272500: Don't inherit flags other than DS_FLAG_CI_DATASET and DS_FLAG_INCONSISTENT when cloning. This prevents DS_FLAG_DEFER_DESTROY being inherited from a clone that is marked for deferred destroy, which causes snapshots of the clone being destroyed when getting a hold or clone. Illumos issue: 5150 zfs clone of a defer_destroy snapshot causes strangeness Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Oct 16 22:40:22 2014 (r273194) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Oct 16 22:44:30 2014 (r273195) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright (c) 2011 Martin Matuska - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. */ @@ -699,7 +699,13 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dsphys->ds_uncompressed_bytes = origin->ds_phys->ds_uncompressed_bytes; dsphys->ds_bp = origin->ds_phys->ds_bp; - dsphys->ds_flags |= origin->ds_phys->ds_flags; + + /* + * Inherit flags that describe the dataset's contents + * (INCONSISTENT) or properties (Case Insensitive). + */ + dsphys->ds_flags |= origin->ds_phys->ds_flags & + (DS_FLAG_INCONSISTENT | DS_FLAG_CI_DATASET); dmu_buf_will_dirty(origin->ds_dbuf, tx); origin->ds_phys->ds_num_children++; From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 16 23:16:28 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2BE51A2; Thu, 16 Oct 2014 23:16: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 CCE1CED0; Thu, 16 Oct 2014 23:16: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 s9GNGSvZ043431; Thu, 16 Oct 2014 23:16:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9GNGR7a043423; Thu, 16 Oct 2014 23:16:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410162316.s9GNGR7a043423@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Oct 2014 23:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273198 - in stable/10/release: . amd64 i386 tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 23:16:29 -0000 Author: gjb Date: Thu Oct 16 23:16:26 2014 New Revision: 273198 URL: https://svnweb.freebsd.org/changeset/base/273198 Log: MFC r273093, r273096: r273093: Merge the following from ^/projects/release-vmimage: r272436, r272437, r272792: r272436: Remove the first argument to panic(), which was initially intended to be the exit code, however when a non-zero exit code was returned to release/Makefile, this would prevent any remaining (and possibly successful) stages from being attempted. r272437: If the vm-base target fails, prevent the vm-image target from being run since it cannot possibly succeed. r272792: Add /usr/local/bin and /usr/local/sbin to PATH, needed if third-party software needs to use utilities outside of the base system during post-install stages (indexinfo is one culprit). r273096: Merge the following from ^/projects/release-vmimage: r273076, r273077, r273079, r273095: r273076: Add a separate make(1) target to release/Makefile to build FreeBSD virtual machine disk images for use on the Microsoft Azure service. For now, this target is not directly connected to the build, however can be manually invoked. The 'vm-azure' target invokes {amd64,i386}/mk-azure.sh, which does the heavy lifting to produce proper VHDs. mk-azure.sh uses a configuration file, defaulting to tools/azure.conf if otherwise unset. r273077: Clear VM_RC_LIST. r273079: Fix signal list to trigger umount(8). r273095: Output an informational message when mkimg(1) runs, so it does not appear that the process has stopped while waiting for a 'y/n' response when waagent is deprovisioned. Relnotes: yes Sponsored by: The FreeBSD Foundation Added: stable/10/release/amd64/mk-azure.sh - copied unchanged from r273096, head/release/amd64/mk-azure.sh stable/10/release/i386/mk-azure.sh - copied unchanged from r273096, head/release/i386/mk-azure.sh stable/10/release/tools/azure.conf - copied unchanged from r273096, head/release/tools/azure.conf Modified: stable/10/release/Makefile stable/10/release/amd64/mk-vmimage.sh stable/10/release/i386/mk-vmimage.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Thu Oct 16 23:07:09 2014 (r273197) +++ stable/10/release/Makefile Thu Oct 16 23:16:26 2014 (r273198) @@ -117,6 +117,7 @@ VMTARGETS= vm-base vm-image VMFORMATS?= vhd vmdk qcow2 raw VMSIZE?= 20G VMBASE?= vm +AZURECONF?= ${.CURDIR}/tools/azure.conf CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} .if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) @@ -137,6 +138,12 @@ CLEANDIRS= dist ftp release bootonly dvd .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) CLEANDIRS+= ${VMTARGETS} .endif +.if exists(${.CURDIR}/${TARGET}/mk-azure.sh) +CLEANFILES+= ${OSRELEASE}.vhd \ + ${OSRELEASE}.vhd.raw \ + azure.img +CLEANDIRS+= vm-azure +.endif beforeclean: chflags -R noschg . .include @@ -372,3 +379,11 @@ vm-image: vm-base . endif .endif touch ${.TARGET} + +vm-azure: +.if exists(${.CURDIR}/${TARGET}/mk-azure.sh) + env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} AZURECONF=${AZURECONF} \ + ${.CURDIR}/${TARGET}/mk-azure.sh ${.TARGET} azure.img \ + ${WORLDDIR} ${.TARGET} ${VMSIZE} ${OSRELEASE}.vhd +.endif + touch ${.TARGET} Copied: stable/10/release/amd64/mk-azure.sh (from r273096, head/release/amd64/mk-azure.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/amd64/mk-azure.sh Thu Oct 16 23:16:26 2014 (r273198, copy of r273096, head/release/amd64/mk-azure.sh) @@ -0,0 +1,173 @@ +#!/bin/sh +#- +# Copyright (c) 2014 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Glen Barber under sponsorship +# from the FreeBSD Foundation. +# +# 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. +# +# mk-azure.sh: Create virtual machine disk images for Microsoft Azure +# +# $FreeBSD$ +# + +export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin" + +usage() { + echo "Usage:" + echo -n "$(basename ${0}) vm-azure " + echo " " + exit 1 +} + +panic() { + msg="${@}" + printf "${msg}\n" + if [ ! -z "${mddev}" ]; then + mdconfig -d -u ${mddev} + fi + # Do not allow one failure case to chain through any remaining image + # builds. + exit 0 +} + +vm_create_azure() { + # Arguments: + # vm-azure + + VMBASE="${1}" + WORLDDIR="${2}" + DESTDIR="${3}" + VMSIZE="${4}" + VMIMAGE="${5}" + + if [ -z "${VMBASE}" -o -z "${WORLDDIR}" -o -z "${DESTDIR}" \ + -o -z "${VMSIZE}" -o -z "${VMIMAGE}" ]; then + usage + fi + + trap "umount ${DESTDIR}/dev ${DESTDIR}" INT QUIT TRAP ABRT TERM + + i=0 + mkdir -p ${DESTDIR} + truncate -s ${VMSIZE} ${VMBASE} + mddev=$(mdconfig -f ${VMBASE}) + newfs -j /dev/${mddev} + mkdir -p ${DESTDIR} + mount /dev/${mddev} ${DESTDIR} + make -C ${WORLDDIR} DESTDIR=$(realpath ${DESTDIR}) \ + installworld installkernel distribution || \ + panic 1 "\n\nCannot install the base system to ${DESTDIR}." + mount -t devfs devfs ${DESTDIR}/dev + chroot ${DESTDIR} /usr/bin/newaliases + echo '# Custom /etc/fstab for FreeBSD VM images' \ + > ${DESTDIR}/etc/fstab + echo '/dev/gpt/rootfs / ufs rw 2 2' \ + >> ${DESTDIR}/etc/fstab + # Although a swap partition is created, it is not used in Azure. + echo '#/dev/gpt/swapfs none swap sw 0 0' \ + >> ${DESTDIR}/etc/fstab + + chroot ${DESTDIR} /etc/rc.d/ldconfig forcestart + chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes /usr/sbin/pkg bootstrap -y + chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes /usr/sbin/pkg install -y \ + python python2 python27 py27-asn1 sudo bash + if [ ! -z "${VM_EXTRA_PACKAGES}" ]; then + chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes /usr/sbin/pkg install -y \ + ${VM_EXTRA_PACKAGES} + fi + + fetch -o ${DESTDIR}/usr/sbin/waagent \ + http://people.freebsd.org/~gjb/waagent + chmod +x ${DESTDIR}/usr/sbin/waagent + rm -f ${DESTDIR}/etc/resolv.conf + chroot ${DESTDIR} /usr/sbin/waagent -verbose -install + yes | chroot ${DESTDIR} /usr/sbin/waagent -deprovision + echo 'sshd_enable="YES"' > ${DESTDIR}/etc/rc.conf + echo 'ifconfig_hn0="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf + echo 'waagent_enable="YES"' >> ${DESTDIR}/etc/rc.conf + + echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf + echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf + + if [ ! -z "${VM_RC_LIST}" ]; then + for _rcvar in ${VM_RC_LIST}; do + echo ${_rcvar}_enable="YES" >> ${DESTDIR}/etc/rc.conf + done + fi + + sync + + while ! umount ${DESTDIR}/dev ${DESTDIR}; do + i=$(( $i + 1 )) + if [ $i -ge 10 ]; then + # This should never happen. But, it has happened. + msg="Cannot umount(8) ${DESTDIR}\n" + msg="${msg}Something has gone horribly wrong." + panic 1 "${msg}" + fi + sleep 1 + done + + echo "Creating image... Please wait." + + mkimg -f vhdf -s gpt \ + -b /boot/pmbr -p freebsd-boot/bootfs:=/boot/gptboot \ + -p freebsd-swap/swapfs::1G \ + -p freebsd-ufs/rootfs:=${VMBASE} \ + -o ${VMIMAGE}.raw + + if [ ! -x "/usr/local/bin/qemu-img" ]; then + env ASSUME_ALWAYS_YES=yes pkg install -y emulators/qemu-devel + fi + + size=$(qemu-img info -f raw --output json ${VMIMAGE}.raw | awk '/virtual-size/ {print $2}' | tr -d ',') + size=$(( ( ${size} / ( 1024 * 1024 ) + 1 ) * ( 1024 * 1024 ) )) + qemu-img resize ${VMIMAGE}.raw ${size} + qemu-img convert -f raw -o subformat=fixed -O vpc ${VMIMAGE}.raw ${VMIMAGE} + + return 0 +} + +main() { + cmd="${1}" + shift 1 + + if [ -e "${AZURECONF}" -a ! -c "${AZURECONF}" ]; then + . ${AZURECONF} + fi + + case ${cmd} in + vm-azure) + eval vm_create_azure "$@" || return 0 + ;; + *|\?) + usage + ;; + esac + + return 0 +} + +main "$@" Modified: stable/10/release/amd64/mk-vmimage.sh ============================================================================== --- stable/10/release/amd64/mk-vmimage.sh Thu Oct 16 23:07:09 2014 (r273197) +++ stable/10/release/amd64/mk-vmimage.sh Thu Oct 16 23:16:26 2014 (r273198) @@ -32,7 +32,7 @@ # $FreeBSD$ # -PATH="/bin:/usr/bin:/sbin:/usr/sbin" +PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" export PATH usage_vm_base() { @@ -58,16 +58,25 @@ usage() { } panic() { - rc="${1}" - shift 1 msg="${@}" printf "${msg}\n" if [ ! -z "${mddev}" ]; then mdconfig -d -u ${mddev} fi + case ${cmd} in + vm-base) + # If the vm-base target fails, the vm-image target + # cannot possibly succeed. Touch the .TARGET file + # so it is not attempted. + touch vm-image + ;; + *) + # FALLTHROUGH + ;; + esac # Do not allow one failure case to chain through any remaining image # builds. - exit 0 + return 1 } vm_create_baseimage() { @@ -96,7 +105,7 @@ vm_create_baseimage() { cd ${WORLDDIR} && \ make DESTDIR=${DESTDIR} \ installworld installkernel distribution || \ - panic 1 "\n\nCannot install the base system to ${DESTDIR}." + panic "\n\nCannot install the base system to ${DESTDIR}." chroot ${DESTDIR} /usr/bin/newaliases echo '# Custom /etc/fstab for FreeBSD VM images' \ > ${DESTDIR}/etc/fstab @@ -111,7 +120,7 @@ vm_create_baseimage() { # This should never happen. But, it has happened. msg="Cannot umount(8) ${DESTDIR}\n" msg="${msg}Something has gone horribly wrong." - panic 1 "${msg}" + panic "${msg}" fi sleep 1 done @@ -141,11 +150,11 @@ vm_create_vmdisk() { if [ -z "${mkimg_version}" ]; then msg="Cannot determine mkimg(1) version.\n" msg="${msg}Cannot continue without a known mkimg(1) version." - panic 0 "${msg}" + panic "${msg}" fi if ! mkimg --formats 2>/dev/null | grep -q ${FORMAT}; then - panic 0 "'${FORMAT}' is not supported by this mkimg(1).\n" + panic "'${FORMAT}' is not supported by this mkimg(1).\n" fi case ${FORMAT} in Copied: stable/10/release/i386/mk-azure.sh (from r273096, head/release/i386/mk-azure.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/i386/mk-azure.sh Thu Oct 16 23:16:26 2014 (r273198, copy of r273096, head/release/i386/mk-azure.sh) @@ -0,0 +1,173 @@ +#!/bin/sh +#- +# Copyright (c) 2014 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Glen Barber under sponsorship +# from the FreeBSD Foundation. +# +# 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. +# +# mk-azure.sh: Create virtual machine disk images for Microsoft Azure +# +# $FreeBSD$ +# + +export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin" + +usage() { + echo "Usage:" + echo -n "$(basename ${0}) vm-azure " + echo " " + exit 1 +} + +panic() { + msg="${@}" + printf "${msg}\n" + if [ ! -z "${mddev}" ]; then + mdconfig -d -u ${mddev} + fi + # Do not allow one failure case to chain through any remaining image + # builds. + exit 0 +} + +vm_create_azure() { + # Arguments: + # vm-azure + + VMBASE="${1}" + WORLDDIR="${2}" + DESTDIR="${3}" + VMSIZE="${4}" + VMIMAGE="${5}" + + if [ -z "${VMBASE}" -o -z "${WORLDDIR}" -o -z "${DESTDIR}" \ + -o -z "${VMSIZE}" -o -z "${VMIMAGE}" ]; then + usage + fi + + trap "umount ${DESTDIR}/dev ${DESTDIR}" INT QUIT TRAP ABRT TERM + + i=0 + mkdir -p ${DESTDIR} + truncate -s ${VMSIZE} ${VMBASE} + mddev=$(mdconfig -f ${VMBASE}) + newfs -j /dev/${mddev} + mkdir -p ${DESTDIR} + mount /dev/${mddev} ${DESTDIR} + make -C ${WORLDDIR} DESTDIR=$(realpath ${DESTDIR}) \ + installworld installkernel distribution || \ + panic 1 "\n\nCannot install the base system to ${DESTDIR}." + mount -t devfs devfs ${DESTDIR}/dev + chroot ${DESTDIR} /usr/bin/newaliases + echo '# Custom /etc/fstab for FreeBSD VM images' \ + > ${DESTDIR}/etc/fstab + echo '/dev/gpt/rootfs / ufs rw 2 2' \ + >> ${DESTDIR}/etc/fstab + # Although a swap partition is created, it is not used in Azure. + echo '#/dev/gpt/swapfs none swap sw 0 0' \ + >> ${DESTDIR}/etc/fstab + + chroot ${DESTDIR} /etc/rc.d/ldconfig forcestart + chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes /usr/sbin/pkg bootstrap -y + chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes /usr/sbin/pkg install -y \ + python python2 python27 py27-asn1 sudo bash + if [ ! -z "${VM_EXTRA_PACKAGES}" ]; then + chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes /usr/sbin/pkg install -y \ + ${VM_EXTRA_PACKAGES} + fi + + fetch -o ${DESTDIR}/usr/sbin/waagent \ + http://people.freebsd.org/~gjb/waagent + chmod +x ${DESTDIR}/usr/sbin/waagent + rm -f ${DESTDIR}/etc/resolv.conf + chroot ${DESTDIR} /usr/sbin/waagent -verbose -install + yes | chroot ${DESTDIR} /usr/sbin/waagent -deprovision + echo 'sshd_enable="YES"' > ${DESTDIR}/etc/rc.conf + echo 'ifconfig_hn0="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf + echo 'waagent_enable="YES"' >> ${DESTDIR}/etc/rc.conf + + echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf + echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf + + if [ ! -z "${VM_RC_LIST}" ]; then + for _rcvar in ${VM_RC_LIST}; do + echo ${_rcvar}_enable="YES" >> ${DESTDIR}/etc/rc.conf + done + fi + + sync + + while ! umount ${DESTDIR}/dev ${DESTDIR}; do + i=$(( $i + 1 )) + if [ $i -ge 10 ]; then + # This should never happen. But, it has happened. + msg="Cannot umount(8) ${DESTDIR}\n" + msg="${msg}Something has gone horribly wrong." + panic 1 "${msg}" + fi + sleep 1 + done + + echo "Creating image... Please wait." + + mkimg -f vhdf -s gpt \ + -b /boot/pmbr -p freebsd-boot/bootfs:=/boot/gptboot \ + -p freebsd-swap/swapfs::1G \ + -p freebsd-ufs/rootfs:=${VMBASE} \ + -o ${VMIMAGE}.raw + + if [ ! -x "/usr/local/bin/qemu-img" ]; then + env ASSUME_ALWAYS_YES=yes pkg install -y emulators/qemu-devel + fi + + size=$(qemu-img info -f raw --output json ${VMIMAGE}.raw | awk '/virtual-size/ {print $2}' | tr -d ',') + size=$(( ( ${size} / ( 1024 * 1024 ) + 1 ) * ( 1024 * 1024 ) )) + qemu-img resize ${VMIMAGE}.raw ${size} + qemu-img convert -f raw -o subformat=fixed -O vpc ${VMIMAGE}.raw ${VMIMAGE} + + return 0 +} + +main() { + cmd="${1}" + shift 1 + + if [ -e "${AZURECONF}" -a ! -c "${AZURECONF}" ]; then + . ${AZURECONF} + fi + + case ${cmd} in + vm-azure) + eval vm_create_azure "$@" || return 0 + ;; + *|\?) + usage + ;; + esac + + return 0 +} + +main "$@" Modified: stable/10/release/i386/mk-vmimage.sh ============================================================================== --- stable/10/release/i386/mk-vmimage.sh Thu Oct 16 23:07:09 2014 (r273197) +++ stable/10/release/i386/mk-vmimage.sh Thu Oct 16 23:16:26 2014 (r273198) @@ -32,7 +32,7 @@ # $FreeBSD$ # -PATH="/bin:/usr/bin:/sbin:/usr/sbin" +PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" export PATH usage_vm_base() { @@ -58,16 +58,25 @@ usage() { } panic() { - rc="${1}" - shift 1 msg="${@}" printf "${msg}\n" if [ ! -z "${mddev}" ]; then mdconfig -d -u ${mddev} fi + case ${cmd} in + vm-base) + # If the vm-base target fails, the vm-image target + # cannot possibly succeed. Touch the .TARGET file + # so it is not attempted. + touch vm-image + ;; + *) + # FALLTHROUGH + ;; + esac # Do not allow one failure case to chain through any remaining image # builds. - exit 0 + return 1 } vm_create_baseimage() { @@ -96,7 +105,7 @@ vm_create_baseimage() { cd ${WORLDDIR} && \ make DESTDIR=${DESTDIR} \ installworld installkernel distribution || \ - panic 1 "\n\nCannot install the base system to ${DESTDIR}." + panic "\n\nCannot install the base system to ${DESTDIR}." chroot ${DESTDIR} /usr/bin/newaliases echo '# Custom /etc/fstab for FreeBSD VM images' \ > ${DESTDIR}/etc/fstab @@ -111,7 +120,7 @@ vm_create_baseimage() { # This should never happen. But, it has happened. msg="Cannot umount(8) ${DESTDIR}\n" msg="${msg}Something has gone horribly wrong." - panic 1 "${msg}" + panic "${msg}" fi sleep 1 done @@ -141,11 +150,11 @@ vm_create_vmdisk() { if [ -z "${mkimg_version}" ]; then msg="Cannot determine mkimg(1) version.\n" msg="${msg}Cannot continue without a known mkimg(1) version." - panic 0 "${msg}" + panic "${msg}" fi if ! mkimg --formats 2>/dev/null | grep -q ${FORMAT}; then - panic 0 "'${FORMAT}' is not supported by this mkimg(1).\n" + panic "'${FORMAT}' is not supported by this mkimg(1).\n" fi case ${FORMAT} in Copied: stable/10/release/tools/azure.conf (from r273096, head/release/tools/azure.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/tools/azure.conf Thu Oct 16 23:16:26 2014 (r273198, copy of r273096, head/release/tools/azure.conf) @@ -0,0 +1,14 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Set to a list of packages to install. +# Example: +#export VM_EXTRA_PACKAGES="www/apache24" +export VM_EXTRA_PACKAGES= + +# Set to a list of third-party software to enable in rc.conf(5). +# Example: +#export VM_RC_LIST="apache24" +export VM_RC_LIST= From owner-svn-src-stable-10@FreeBSD.ORG Fri Oct 17 15:29:48 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 933B3703; Fri, 17 Oct 2014 15:29:48 +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 7EBCA6E7; Fri, 17 Oct 2014 15:29:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9HFTmuF008319; Fri, 17 Oct 2014 15:29:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9HFTmFC008318; Fri, 17 Oct 2014 15:29:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410171529.s9HFTmFC008318@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 17 Oct 2014 15:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273221 - in stable: 10/sys/kern 9/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Oct 2014 15:29:48 -0000 Author: jhb Date: Fri Oct 17 15:29:47 2014 New Revision: 273221 URL: https://svnweb.freebsd.org/changeset/base/273221 Log: MFC 272182: Don't panic if a resource is allocated twice. Instead, print a warning and fail the allocation request. Allocations of "reserved" resources such as PCI BARs already fail the request instead of panic'ing in this case. Modified: stable/10/sys/kern/subr_bus.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/kern/subr_bus.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/kern/subr_bus.c ============================================================================== --- stable/10/sys/kern/subr_bus.c Fri Oct 17 15:07:04 2014 (r273220) +++ stable/10/sys/kern/subr_bus.c Fri Oct 17 15:29:47 2014 (r273221) @@ -3300,7 +3300,10 @@ resource_list_alloc(struct resource_list rle->flags |= RLE_ALLOCATED; return (rle->res); } - panic("resource_list_alloc: resource entry is busy"); + device_printf(bus, + "resource entry %#x type %d for child %s is busy\n", *rid, + type, device_get_nameunit(child)); + return (NULL); } if (isdefault) { From owner-svn-src-stable-10@FreeBSD.ORG Fri Oct 17 16:23:38 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB991D7; Fri, 17 Oct 2014 16:23: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 CDFACD1F; Fri, 17 Oct 2014 16:23: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 s9HGNb6O037980; Fri, 17 Oct 2014 16:23:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9HGNboH037976; Fri, 17 Oct 2014 16:23:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201410171623.s9HGNboH037976@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 17 Oct 2014 16:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273232 - in stable/10/contrib/binutils/bfd: . po X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Oct 2014 16:23:38 -0000 Author: emaste Date: Fri Oct 17 16:23:36 2014 New Revision: 273232 URL: https://svnweb.freebsd.org/changeset/base/273232 Log: MFC r257302 by rea: binutils/bfd: fix printf-like format strings for "bfd *" arguments There is a special format argument '%B' that directly handles values of type 'bfd *', they must be used instead of '%s'. Manifestations of this bug can be seen in ld(1) error messages, for example, http://lists.freebsd.org/pipermail/freebsd-current/2013-August/043580.html http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045404.html Modified: stable/10/contrib/binutils/bfd/elf32-score.c stable/10/contrib/binutils/bfd/elflink.c stable/10/contrib/binutils/bfd/po/bfd.pot Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/bfd/elf32-score.c ============================================================================== --- stable/10/contrib/binutils/bfd/elf32-score.c Fri Oct 17 16:02:34 2014 (r273231) +++ stable/10/contrib/binutils/bfd/elf32-score.c Fri Oct 17 16:23:36 2014 (r273232) @@ -2546,7 +2546,7 @@ _bfd_score_elf_check_relocs (bfd *abfd, } else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr)) { - (*_bfd_error_handler) (_("%s: Malformed reloc detected for section %s"), abfd, name); + (*_bfd_error_handler) (_("%B: Malformed reloc detected for section %s"), abfd, name); bfd_set_error (bfd_error_bad_value); return FALSE; } Modified: stable/10/contrib/binutils/bfd/elflink.c ============================================================================== --- stable/10/contrib/binutils/bfd/elflink.c Fri Oct 17 16:02:34 2014 (r273231) +++ stable/10/contrib/binutils/bfd/elflink.c Fri Oct 17 16:23:36 2014 (r273232) @@ -4357,8 +4357,8 @@ elf_link_add_object_symbols (bfd *abfd, if ((elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0) { (*_bfd_error_handler) - (_("%s: invalid DSO for symbol `%s' definition"), - abfd, name); + (_("%B: invalid DSO for symbol `%s' definition"), + abfd, name); bfd_set_error (bfd_error_bad_value); goto error_free_vers; } Modified: stable/10/contrib/binutils/bfd/po/bfd.pot ============================================================================== --- stable/10/contrib/binutils/bfd/po/bfd.pot Fri Oct 17 16:02:34 2014 (r273231) +++ stable/10/contrib/binutils/bfd/po/bfd.pot Fri Oct 17 16:23:36 2014 (r273232) @@ -1572,7 +1572,7 @@ msgstr "" #: elf32-score.c:2549 #, c-format -msgid "%s: Malformed reloc detected for section %s" +msgid "%B: Malformed reloc detected for section %s" msgstr "" #: elf32-score.c:2600 @@ -2440,7 +2440,7 @@ msgstr "" #: elflink.c:4309 #, c-format -msgid "%s: invalid DSO for symbol `%s' definition" +msgid "%B: invalid DSO for symbol `%s' definition" msgstr "" #: elflink.c:5535 From owner-svn-src-stable-10@FreeBSD.ORG Fri Oct 17 19:28:22 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FA40A8D; Fri, 17 Oct 2014 19:28: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 4BABC1C5; Fri, 17 Oct 2014 19:28: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 s9HJSMWA025943; Fri, 17 Oct 2014 19:28:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9HJSM4F025942; Fri, 17 Oct 2014 19:28:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410171928.s9HJSM4F025942@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 17 Oct 2014 19:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273237 - in stable: 10/sys/kern 9/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Oct 2014 19:28:22 -0000 Author: jhb Date: Fri Oct 17 19:28:21 2014 New Revision: 273237 URL: https://svnweb.freebsd.org/changeset/base/273237 Log: MFC 272449: Require p_cansched() for changing a process' protection status via procctl() rather than p_cansee(). Modified: stable/10/sys/kern/sys_process.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/kern/sys_process.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/kern/sys_process.c ============================================================================== --- stable/10/sys/kern/sys_process.c Fri Oct 17 19:04:24 2014 (r273236) +++ stable/10/sys/kern/sys_process.c Fri Oct 17 19:28:21 2014 (r273237) @@ -1240,7 +1240,7 @@ protect_setchild(struct thread *td, stru { PROC_LOCK_ASSERT(p, MA_OWNED); - if (p->p_flag & P_SYSTEM || p_cansee(td, p) != 0) + if (p->p_flag & P_SYSTEM || p_cansched(td, p) != 0) return (0); if (flags & PPROT_SET) { p->p_flag |= P_PROTECTED; From owner-svn-src-stable-10@FreeBSD.ORG Fri Oct 17 19:55:12 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDD6D3D8; Fri, 17 Oct 2014 19:55: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 B95E76A3; Fri, 17 Oct 2014 19:55: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 s9HJtCZ2039964; Fri, 17 Oct 2014 19:55:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9HJtCYh039963; Fri, 17 Oct 2014 19:55:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410171955.s9HJtCYh039963@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 17 Oct 2014 19:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273238 - in stable: 10/usr.sbin/nscd 9/usr.sbin/nscd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Oct 2014 19:55:12 -0000 Author: jhb Date: Fri Oct 17 19:55:12 2014 New Revision: 273238 URL: https://svnweb.freebsd.org/changeset/base/273238 Log: MFC 272668: Properly set the timeout in a query_state. The global query_timeout configuration value is an integer count of seconds, it is not a timeval. Using memcpy() to copy a timeval from it put garbage into the tv_usec field. PR: 194025 Modified: stable/10/usr.sbin/nscd/query.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.sbin/nscd/query.c Directory Properties: stable/9/usr.sbin/nscd/ (props changed) Modified: stable/10/usr.sbin/nscd/query.c ============================================================================== --- stable/10/usr.sbin/nscd/query.c Fri Oct 17 19:28:21 2014 (r273237) +++ stable/10/usr.sbin/nscd/query.c Fri Oct 17 19:55:12 2014 (r273238) @@ -1253,8 +1253,8 @@ init_query_state(int sockfd, size_t keve retval->read_func = query_socket_read; get_time_func(&retval->creation_time); - memcpy(&retval->timeout, &s_configuration->query_timeout, - sizeof(struct timeval)); + retval->timeout.tv_sec = s_configuration->query_timeout; + retval->timeout.tv_usec = 0; TRACE_OUT(init_query_state); return (retval); From owner-svn-src-stable-10@FreeBSD.ORG Fri Oct 17 20:03:01 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC8CD75D; Fri, 17 Oct 2014 20:03:01 +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 C6E0E7E3; Fri, 17 Oct 2014 20:03:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9HK31be044572; Fri, 17 Oct 2014 20:03:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9HK31VN044571; Fri, 17 Oct 2014 20:03:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410172003.s9HK31VN044571@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 17 Oct 2014 20:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273239 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Oct 2014 20:03:02 -0000 Author: jhb Date: Fri Oct 17 20:03:01 2014 New Revision: 273239 URL: https://svnweb.freebsd.org/changeset/base/273239 Log: MFC 268369,268817,272771,272772: Rewrite timeout(9) to be callout(9)-centric instead. Move the description of timeout(9) to the end and mark it prominently as deprecated. Document somewhat how times are specified for the 'sbt' variants. Better explain how using callout_init_*() to associate a lock with a callout resolves common races. Modified: stable/10/share/man/man9/timeout.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/timeout.9 ============================================================================== --- stable/10/share/man/man9/timeout.9 Fri Oct 17 19:55:12 2014 (r273238) +++ stable/10/share/man/man9/timeout.9 Fri Oct 17 20:03:01 2014 (r273239) @@ -29,31 +29,31 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2014 +.Dd October 8, 2014 .Dt TIMEOUT 9 .Os .Sh NAME -.Nm timeout , -.Nm untimeout , +.Nm callout_active , +.Nm callout_deactivate , +.Nm callout_drain , .Nm callout_handle_init , .Nm callout_init , .Nm callout_init_mtx , .Nm callout_init_rm , .Nm callout_init_rw , -.Nm callout_stop , -.Nm callout_drain , +.Nm callout_pending , .Nm callout_reset , -.Nm callout_reset_on , .Nm callout_reset_curcpu , +.Nm callout_reset_on , .Nm callout_reset_sbt , -.Nm callout_reset_sbt_on , .Nm callout_reset_sbt_curcpu , +.Nm callout_reset_sbt_on , .Nm callout_schedule , -.Nm callout_schedule_on , .Nm callout_schedule_curcpu , -.Nm callout_pending , -.Nm callout_active , -.Nm callout_deactivate +.Nm callout_schedule_on , +.Nm callout_stop , +.Nm timeout , +.Nm untimeout .Nd execute a function after a specified length of time .Sh SYNOPSIS .In sys/types.h @@ -61,16 +61,18 @@ .Bd -literal typedef void timeout_t (void *); .Ed -.Ft struct callout_handle -.Fn timeout "timeout_t *func" "void *arg" "int ticks" +.Ft int +.Fn callout_active "struct callout *c" +.Ft void +.Fn callout_deactivate "struct callout *c" +.Ft int +.Fn callout_drain "struct callout *c" .Ft void .Fn callout_handle_init "struct callout_handle *handle" .Bd -literal struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle); .Ed .Ft void -.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" -.Ft void .Fn callout_init "struct callout *c" "int mpsafe" .Ft void .Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" @@ -79,310 +81,337 @@ struct callout_handle handle = CALLOUT_H .Ft void .Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" .Ft int -.Fn callout_stop "struct callout *c" -.Ft int -.Fn callout_drain "struct callout *c" +.Fn callout_pending "struct callout *c" .Ft int .Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg" .Ft int +.Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \ +"void *arg" +.Ft int .Fn callout_reset_on "struct callout *c" "int ticks" "timeout_t *func" \ "void *arg" "int cpu" .Ft int +.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ +"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" +.Ft int +.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ +"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" +.Ft int .Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ "sbintime_t pr" "timeout_t *func" "void *arg" "int cpu" "int flags" .Ft int -.Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \ -"void *arg" -.Ft int .Fn callout_schedule "struct callout *c" "int ticks" .Ft int -.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" -.Ft int .Fn callout_schedule_curcpu "struct callout *c" "int ticks" .Ft int -.Fn callout_pending "struct callout *c" +.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" .Ft int -.Fn callout_active "struct callout *c" +.Fn callout_stop "struct callout *c" +.Ft struct callout_handle +.Fn timeout "timeout_t *func" "void *arg" "int ticks" .Ft void -.Fn callout_deactivate "struct callout *c" +.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" .Sh DESCRIPTION -The function -.Fn timeout -schedules a call to the function given by the argument -.Fa func -to take place after -.Fa ticks Ns No /hz -seconds. -Non-positive values of -.Fa ticks -are silently converted to the value -.Sq 1 . -.Fa func -should be a pointer to a function that takes a -.Fa void * -argument. -Upon invocation, -.Fa func -will receive -.Fa arg -as its only argument. -The return value from -.Fn timeout -is a -.Ft struct callout_handle -which can be used in conjunction with the -.Fn untimeout -function to request that a scheduled timeout be canceled. -The -.Fn timeout -call is the old style and new code should use the -.Fn callout_* -functions. -.Pp -The function -.Fn callout_handle_init -can be used to initialize a handle to a state which will cause -any calls to -.Fn untimeout -with that handle to return with no side -effects. -.Pp -Assigning a callout handle the value of -.Fn CALLOUT_HANDLE_INITIALIZER -performs the same function as -.Fn callout_handle_init -and is provided for use on statically declared or global callout handles. -.Pp -The function -.Fn untimeout -cancels the timeout associated with -.Fa handle -using the -.Fa func -and -.Fa arg -arguments to validate the handle. -If the handle does not correspond to a timeout with -the function -.Fa func -taking the argument -.Fa arg -no action is taken. -.Fa handle -must be initialized by a previous call to -.Fn timeout , -.Fn callout_handle_init , -or assigned the value of -.Fn CALLOUT_HANDLE_INITIALIZER "&handle" -before being passed to -.Fn untimeout . -The behavior of calling -.Fn untimeout -with an uninitialized handle -is undefined. The -.Fn untimeout -call is the old style and new code should use the -.Fn callout_* -functions. +.Nm callout +API is used to schedule a call to an arbitrary function at a specific +time in the future. +Consumers of this API are required to allocate a callout structure +.Pq struct callout +for each pending function invocation. +This structure stores state about the pending function invocation including +the function to be called and the time at which the function should be invoked. +Pending function calls can be cancelled or rescheduled to a different time. +In addition, +a callout structure may be reused to schedule a new function call after a +scheduled call is completed. +.Pp +Callouts only provide a single-shot mode. +If a consumer requires a periodic timer, +it must explicitly reschedule each function call. +This is normally done by rescheduling the subsequent call within the called +function. +.Pp +Callout functions must not sleep. +They may not acquire sleepable locks, +wait on condition variables, +perform blocking allocation requests, +or invoke any other action that might sleep. .Pp -As handles are recycled by the system, it is possible (although unlikely) -that a handle from one invocation of -.Fn timeout -may match the handle of another invocation of -.Fn timeout -if both calls used the same function pointer and argument, and the first -timeout is expired or canceled before the second call. -The timeout facility offers O(1) running time for -.Fn timeout -and -.Fn untimeout . -Timeouts are executed from -.Fn softclock -with the -.Va Giant -lock held. -Thus they are protected from re-entrancy. -.Pp -The functions +Each callout structure must be initialized by .Fn callout_init , .Fn callout_init_mtx , .Fn callout_init_rm , -.Fn callout_init_rw , -.Fn callout_stop , -.Fn callout_drain , -.Fn callout_reset -and -.Fn callout_schedule -are low-level routines for clients who wish to allocate their own -callout structures. -.Pp -The function -.Fn callout_init -initializes a callout so it can be passed to -.Fn callout_stop , -.Fn callout_drain , -.Fn callout_reset or -.Fn callout_schedule -without any side effects. +.Fn callout_init_rw +before it is passed to any of the other callout functions. +The +.Fn callout_init +function initializes a callout structure in +.Fa c +that is not associated with a specific lock. If the .Fa mpsafe argument is zero, the callout structure is not considered to be .Dq multi-processor safe ; -that is, -the Giant lock will be acquired before calling the callout function, +and the Giant lock will be acquired before calling the callout function and released when the callout function returns. .Pp The -.Fn callout_init_mtx -function may be used as an alternative to -.Fn callout_init . -The parameter -.Fa mtx -specifies a mutex that is to be acquired by the callout subsystem -before calling the callout function, and released when the callout -function returns. -The following -.Fa flags -may be specified: -.Bl -tag -width ".Dv CALLOUT_RETURNUNLOCKED" -.It Dv CALLOUT_RETURNUNLOCKED -The callout function will release -.Fa mtx -itself, so the callout subsystem should not attempt to unlock it -after the callout function returns. -.El -.Pp -The +.Fn callout_init_mtx , +.Fn callout_init_rm , +and .Fn callout_init_rw -and the -.Fn callout_init_rm -fuctions serve the need of using rwlocks and rmlocks in conjunction -with callouts. -The functions do the same as -.Fn callout_init -with the possibility of specifying an extra -.Fa rw +functions initialize a callout structure in +.Fa c +that is associated with a specific lock. +The lock is specified by the +.Fa mtx , +.Fa rm , or -.Fa rm -argument. -If an -.Fa rm -argument is specified, the lock should be created without passing the +.Fa rw +parameter. +The associated lock must be held while stopping or rescheduling the +callout. +The callout subsystem acquires the associated lock before calling the +callout function and releases it after the function returns. +If the callout was cancelled while the callout subsystem waited for the +associated lock, +the callout function is not called, +and the associated lock is released. +This ensures that stopping or rescheduling the callout will abort any +previously scheduled invocation. +.Pp +Only regular mutexes may be used with +.Fn callout_init_mtx ; +spin mutexes are not supported. +A sleepable read-mostly lock +.Po +one initialized with the .Dv RM_SLEEPABLE -flag. -The usable lock classes are currently limited to mutexes, rwlocks and -non-sleepable rmlocks, because callout handlers run in softclock swi, -so they cannot sleep nor acquire sleepable locks like sx or lockmgr. -The following +flag +.Pc +may not be used with +.Fn callout_init_rm . +Similarly, other sleepable lock types such as +.Xr sx 9 +and +.Xr lockmgr 9 +cannot be used with callouts because sleeping is not permitted in +the callout subsystem. +.Pp +These .Fa flags -may be specified: -.Bl -tag -width ".Dv CALLOUT_SHAREDLOCK" +may be specified for +.Fn callout_init_mtx , +.Fn callout_init_rm , +or +.Fn callout_init_rw : +.Bl -tag -width ".Dv CALLOUT_RETURNUNLOCKED" +.It Dv CALLOUT_RETURNUNLOCKED +The callout function will release the associated lock itself, +so the callout subsystem should not attempt to unlock it +after the callout function returns. .It Dv CALLOUT_SHAREDLOCK The lock is only acquired in read mode when running the callout handler. -It has no effects when used in conjunction with -.Fa mtx . +This flag is ignored by +.Fn callout_init_mtx . .El .Pp The function .Fn callout_stop -cancels a callout if it is currently pending. +cancels a callout +.Fa c +if it is currently pending. If the callout is pending, then .Fn callout_stop -will return a non-zero value. -If the callout is not set, has already been serviced or is currently -being serviced, then zero will be returned. -If the callout has an associated mutex, then that mutex must be -held when this function is called. +returns a non-zero value. +If the callout is not set, +has already been serviced, +or is currently being serviced, +then zero will be returned. +If the callout has an associated lock, +then that lock must be held when this function is called. .Pp The function .Fn callout_drain is identical to .Fn callout_stop -except that it will wait for the callout to be completed if it is -already in progress. +except that it will wait for the callout +.Fa c +to complete if it is already in progress. This function MUST NOT be called while holding any locks on which the callout might block, or deadlock will result. Note that if the callout subsystem has already begun processing this -callout, then the callout function may be invoked during the execution of -.Fn callout_drain . +callout, then the callout function may be invoked before +.Fn callout_drain +returns. However, the callout subsystem does guarantee that the callout will be fully stopped before .Fn callout_drain returns. .Pp -The function -.Fn callout_reset -first performs the equivalent of -.Fn callout_stop -to disestablish the callout, and then establishes a new callout in the -same manner as -.Fn timeout . -If there was already a pending callout and it was rescheduled, then -.Fn callout_reset -will return a non-zero value. -If the callout has an associated mutex, then that mutex must be -held when this function is called. -The function -.Fn callout_schedule -(re)schedules an existing callout for a new period of time; -it is equivalent to calling -.Fn callout_reset -with the -.Fa func -and -.Fa arg -parameters extracted from the callout structure (though possibly with -lower overhead). -.Pp -The functions -.Fn callout_reset_on -and -.Fn callout_schedule_on -are equivalent to +The .Fn callout_reset and .Fn callout_schedule -but take an extra parameter specifying the target CPU for the callout. +function families schedule a future function invocation for callout +.Fa c . +If +.Fa c +already has a pending callout, +it is cancelled before the new invocation is scheduled. +These functions return a non-zero value if a pending callout was cancelled +and zero if there was no pending callout. +If the callout has an associated lock, +then that lock must be held when any of these functions are called. .Pp -The function -.Fn callout_reset_sbt_on -allows to get higher time resolution, taking relative or absolute time -and precision instead of relative ticks count. -If specified time is in past, it will be silently converted to present -to run handler as soon as possible. +The time at which the callout function will be invoked is determined by +either the +.Fa ticks +argument or the +.Fa sbt , +.Fa pr , +and +.Fa flags +arguments. +When +.Fa ticks +is used, +the callout is scheduled to execute after +.Fa ticks Ns No /hz +seconds. +Non-positive values of +.Fa ticks +are silently converted to the value +.Sq 1 . .Pp -The following +The +.Fa sbt , +.Fa pr , +and +.Fa flags +arguments provide more control over the scheduled time including +support for higher resolution times, +specifying the precision of the scheduled time, +and setting an absolute deadline instead of a relative timeout. +The callout is scheduled to execute in a time window which begins at +the time specified in +.Fa sbt +and extends for the amount of time specified in +.Fa pr . +If +.Fa sbt +specifies a time in the past, +the window is adjusted to start at the current time. +A non-zero value for +.Fa pr +allows the callout subsystem to coalesce callouts scheduled close to each +other into fewer timer interrupts, +reducing processing overhead and power consumption. +These .Fa flags -may be specified: +may be specified to adjust the interpretation of +.Fa sbt +and +.Fa pr : .Bl -tag -width ".Dv C_DIRECT_EXEC" .It Dv C_ABSOLUTE Handle the .Fa sbt -argument as absolute time of the event since boot, or relative time otherwise. +argument as an absolute time since boot. +By default, +.Fa sbt +is treated as a relative amount of time, +similar to +.Fa ticks . .It Dv C_DIRECT_EXEC -Run handler directly from hardware interrupt context instead of softclock swi. -It is faster, but puts more constraints on handlers. -Handlers may use only spin mutexes for locking, and they must be fast because -they run with absolute priority. +Run the handler directly from hardware interrupt context instead of from the +softclock thread. +This reduces latency and overhead, but puts more constraints on the callout +function. +Callout functions run in this context may use only spin mutexes for locking +and should be as small as possible because they run with absolute priority. .It Fn C_PREL Specifies relative event time precision as binary logarithm of time interval divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4, etc. -Smaller value allows to aggregate more events in one timer interrupt to -reduce processing overhead and power consumption. +Note that the larger of +.Fa pr +or this value is used as the length of the time window. +Smaller values +.Pq which result in larger time intervals +allow the callout subsystem to aggregate more events in one timer interrupt. +.It Dv C_HARDCLOCK +Align the timeouts to +.Fn hardclock +calls if possible. .El .Pp -The functions -.Fn callout_reset_curcpu +The +.Fn callout_reset +functions accept a +.Fa func +argument which identifies the function to be called when the time expires. +It must be a pointer to a function that takes a single +.Fa void * +argument. +Upon invocation, +.Fa func +will receive +.Fa arg +as its only argument. +The +.Fn callout_schedule +functions reuse the +.Fa func and -.Fn callout_schedule_curcpu -are wrappers for -.Fn callout_reset_on +.Fa arg +arguments from the previous callout. +Note that one of the +.Fn callout_reset +functions must always be called to initialize +.Fa func +and +.Fa arg +before one of the +.Fn callout_schedule +functions can be used. +.Pp +The callout subsystem provides a softclock thread for each CPU in the system. +Callouts are assigned to a single CPU and are executed by the softclock thread +for that CPU. +Initially, +callouts are assigned to CPU 0. +The +.Fn callout_reset_on , +.Fn callout_reset_sbt_on , and .Fn callout_schedule_on -using the current CPU as the target CPU. +functions assign the callout to CPU +.Fa cpu . +The +.Fn callout_reset_curcpu , +.Fn callout_reset_sbt_curpu , +and +.Fn callout_schedule_curcpu +functions assign the callout to the current CPU. +The +.Fn callout_reset , +.Fn callout_reset_sbt , +and +.Fn callout_schedule +functions schedule the callout to execute in the softclock thread of the CPU +to which it is currently assigned. +.Pp +Softclock threads are not pinned to their respective CPUs by default. +The softclock thread for CPU 0 can be pinned to CPU 0 by setting the +.Va kern.pin_default_swi +loader tunable to a non-zero value. +Softclock threads for CPUs other than zero can be pinned to their +respective CPUs by setting the +.Va kern.pin_pcpu_swi +loader tunable to a non-zero value. .Pp The macros .Fn callout_pending , @@ -390,10 +419,6 @@ The macros and .Fn callout_deactivate provide access to the current state of the callout. -Careful use of these macros can avoid many of the race conditions -that are inherent in asynchronous timer facilities; see -.Sx "Avoiding Race Conditions" -below for further details. The .Fn callout_pending macro checks whether a callout is @@ -406,7 +431,8 @@ starts to process this callout, .Fn callout_pending will return .Dv FALSE -even though the callout function may not have finished (or even begun) +even though the callout function may not have finished +.Pq or even begun executing. The .Fn callout_active @@ -430,45 +456,64 @@ but it clear it when a callout expires normally via the execution of the callout function. .Ss "Avoiding Race Conditions" -The callout subsystem invokes callout functions from its own timer +The callout subsystem invokes callout functions from its own thread context. -Without some kind of synchronization it is possible that a callout +Without some kind of synchronization, +it is possible that a callout function will be invoked concurrently with an attempt to stop or reset the callout by another thread. -In particular, since callout functions typically acquire a mutex as +In particular, since callout functions typically acquire a lock as their first action, the callout function may have already been invoked, -but be blocked waiting for that mutex at the time that another thread +but is blocked waiting for that lock at the time that another thread tries to reset or stop the callout. .Pp -The callout subsystem provides a number of mechanisms to address these -synchronization concerns: +There are three main techniques for addressing these +synchronization concerns. +The first approach is preferred as it is the simplest: .Bl -enum -offset indent .It -If the callout has an associated mutex that was specified using the -.Fn callout_init_mtx -function (or implicitly specified as the -.Va Giant -mutex using +Callouts can be associated with a specific lock when they are initialized +by +.Fn callout_init_mtx , +.Fn callout_init_rm , +or +.Fn callout_init_rw . +When a callout is associated with a lock, +the callout subsystem acquires the lock before the callout function is +invoked. +This allows the callout subsystem to transparently handle races between +callout cancellation, +scheduling, +and execution. +Note that the associated lock must be acquired before calling +.Fn callout_stop +or one of the +.Fn callout_reset +or +.Fn callout_schedule +functions to provide this safety. +.Pp +A callout initialized via .Fn callout_init with .Fa mpsafe -set to -.Dv FALSE ) , -then this mutex is used to avoid the race conditions. -The associated mutex must be acquired by the caller before calling -.Fn callout_stop -or -.Fn callout_reset -and it is guaranteed that the callout will be correctly stopped -or reset as expected. -Note that it is still necessary to use -.Fn callout_drain -before destroying the callout or its associated mutex. +set to zero is implicitly associated with the +.Va Giant +mutex. +If +.Va Giant +is held when cancelling or rescheduling the callout, +then its use will prevent races with the callout function. .It The return value from .Fn callout_stop -and +.Po +or the .Fn callout_reset +and +.Fn callout_schedule +function families +.Pc indicates whether or not the callout was removed. If it is known that the callout was set and the callout function has not yet executed, then a return value of @@ -603,19 +648,134 @@ data objects that have already been dest To ensure that the callout is completely finished, a call to .Fn callout_drain should be used. -.Sh RETURN VALUES -The +In particular, +a callout should always be drained prior to destroying its associated lock +or releasing the storage for the callout structure. +.Sh LEGACY API +.Bf Sy +The functions below are a legacy API that will be removed in a future release. +New code should not use these routines. +.Ef +.Pp +The function .Fn timeout -function returns a +schedules a call to the function given by the argument +.Fa func +to take place after +.Fa ticks Ns No /hz +seconds. +Non-positive values of +.Fa ticks +are silently converted to the value +.Sq 1 . +.Fa func +should be a pointer to a function that takes a +.Fa void * +argument. +Upon invocation, +.Fa func +will receive +.Fa arg +as its only argument. +The return value from +.Fn timeout +is a .Ft struct callout_handle -that can be passed to +which can be used in conjunction with the +.Fn untimeout +function to request that a scheduled timeout be canceled. +.Pp +The function +.Fn callout_handle_init +can be used to initialize a handle to a state which will cause +any calls to +.Fn untimeout +with that handle to return with no side +effects. +.Pp +Assigning a callout handle the value of +.Fn CALLOUT_HANDLE_INITIALIZER +performs the same function as +.Fn callout_handle_init +and is provided for use on statically declared or global callout handles. +.Pp +The function +.Fn untimeout +cancels the timeout associated with +.Fa handle +using the +.Fa func +and +.Fa arg +arguments to validate the handle. +If the handle does not correspond to a timeout with +the function +.Fa func +taking the argument +.Fa arg +no action is taken. +.Fa handle +must be initialized by a previous call to +.Fn timeout , +.Fn callout_handle_init , +or assigned the value of +.Fn CALLOUT_HANDLE_INITIALIZER "&handle" +before being passed to .Fn untimeout . +The behavior of calling +.Fn untimeout +with an uninitialized handle +is undefined. +.Pp +As handles are recycled by the system, it is possible (although unlikely) +that a handle from one invocation of +.Fn timeout +may match the handle of another invocation of +.Fn timeout +if both calls used the same function pointer and argument, and the first +timeout is expired or canceled before the second call. +The timeout facility offers O(1) running time for +.Fn timeout +and +.Fn untimeout . +Timeouts are executed from +.Fn softclock +with the +.Va Giant +lock held. +Thus they are protected from re-entrancy. +.Sh RETURN VALUES +The +.Fn callout_active +macro returns the state of a callout's +.Em active +flag. +.Pp +The +.Fn callout_pending +macro returns the state of a callout's +.Em pending +flag. +.Pp +The +.Fn callout_reset +and +.Fn callout_schedule +function families return non-zero if the callout was pending before the new +function invocation was scheduled. +.Pp The .Fn callout_stop and .Fn callout_drain functions return non-zero if the callout was still pending when it was called or zero otherwise. +The +.Fn timeout +function returns a +.Ft struct callout_handle +that can be passed to +.Fn untimeout . .Sh HISTORY The current timeout and untimeout routines are based on the work of .An Adam M. Costello From owner-svn-src-stable-10@FreeBSD.ORG Sat Oct 18 01:02:31 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81AD97E0; Sat, 18 Oct 2014 01:02:31 +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 6D46A8BF; Sat, 18 Oct 2014 01:02:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9I12VBA092251; Sat, 18 Oct 2014 01:02:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9I12VMh092250; Sat, 18 Oct 2014 01:02:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201410180102.s9I12VMh092250@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 18 Oct 2014 01:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273244 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2014 01:02:31 -0000 Author: adrian Date: Sat Oct 18 01:02:30 2014 New Revision: 273244 URL: https://svnweb.freebsd.org/changeset/base/273244 Log: MFC r273112: Set the DROP_EN bit before the RX queue is brought up and active. He noticed issues setting this bit in SRRCTL after the queue was up, so doing it from the sysctl handler isn't enough and may not actually work correctly. This commit doesn't remove the sysctl path or try to change its behaviour. I'll talk with others about how to finish fixing that before I tackle that. PR: kern/194311 Submitted by: luigi MFC after: 3 days Sponsored by: Norse Corp, Inc Modified: stable/10/sys/dev/ixgbe/ixgbe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.c Fri Oct 17 21:52:57 2014 (r273243) +++ stable/10/sys/dev/ixgbe/ixgbe.c Sat Oct 18 01:02:30 2014 (r273244) @@ -4190,6 +4190,20 @@ ixgbe_initialize_receive_units(struct ad srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; srrctl |= bufsz; srrctl |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF; + + /* + * Set DROP_EN iff we have no flow control and >1 queue. + * Note that srrctl was cleared shortly before during reset, + * so we do not need to clear the bit, but do it just in case + * this code is moved elsewhere. + */ + if (adapter->num_queues > 1 && + adapter->hw.fc.requested_mode == ixgbe_fc_none) { + srrctl |= IXGBE_SRRCTL_DROP_EN; + } else { + srrctl &= ~IXGBE_SRRCTL_DROP_EN; + } + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); /* Setup the HW Rx Head and Tail Descriptor Pointers */ From owner-svn-src-stable-10@FreeBSD.ORG Sat Oct 18 07:07:42 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ABBFD69; Sat, 18 Oct 2014 07:07:42 +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 823ABB3D; Sat, 18 Oct 2014 07:07:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9I77gha062031; Sat, 18 Oct 2014 07:07:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9I77Zic061989; Sat, 18 Oct 2014 07:07:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410180707.s9I77Zic061989@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 18 Oct 2014 07:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273246 - in stable/10/sys: contrib/rdma/krping dev/cxgbe/iw_cxgbe ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/hw/mthca ofed/drivers/infiniband/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2014 07:07:42 -0000 Author: hselasky Date: Sat Oct 18 07:07:34 2014 New Revision: 273246 URL: https://svnweb.freebsd.org/changeset/base/273246 Log: MFC r273135: Update the OFED Linux compatibility layer and Mellanox hardware driver(s): - Properly name an inclusion guard - Fix compile warnings regarding unsigned enums - Add two new sysctl nodes - Remove all empty linux header files - Make an error printout more verbose - Use "mod_delayed_work()" instead of cancelling and starting a timeout. - Implement more Linux scatterlist functions. Sponsored by: Mellanox Technologies Deleted: stable/10/sys/ofed/drivers/net/mlx4/en_frag.c stable/10/sys/ofed/drivers/net/mlx4/en_params.c stable/10/sys/ofed/drivers/net/mlx4/xrcd.c stable/10/sys/ofed/include/asm/page.h stable/10/sys/ofed/include/linux/ethtool.h stable/10/sys/ofed/include/linux/inet.h stable/10/sys/ofed/include/linux/mount.h Modified: stable/10/sys/contrib/rdma/krping/krping.c stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/10/sys/ofed/drivers/infiniband/core/addr.c stable/10/sys/ofed/drivers/infiniband/core/agent.c stable/10/sys/ofed/drivers/infiniband/core/ucm.c stable/10/sys/ofed/drivers/infiniband/core/uverbs_main.c stable/10/sys/ofed/drivers/infiniband/hw/mlx4/ah.c stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_config_reg.h stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_uar.c stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c stable/10/sys/ofed/drivers/net/mlx4/Makefile stable/10/sys/ofed/drivers/net/mlx4/en_ethtool.c stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c stable/10/sys/ofed/drivers/net/mlx4/en_selftest.c stable/10/sys/ofed/drivers/net/mlx4/en_tx.c stable/10/sys/ofed/drivers/net/mlx4/pd.c stable/10/sys/ofed/include/linux/completion.h stable/10/sys/ofed/include/linux/etherdevice.h stable/10/sys/ofed/include/linux/mlx4/device.h stable/10/sys/ofed/include/linux/mlx4/driver.h stable/10/sys/ofed/include/linux/netdevice.h stable/10/sys/ofed/include/linux/scatterlist.h stable/10/sys/ofed/include/linux/vmalloc.h stable/10/sys/ofed/include/rdma/ib_addr.h stable/10/sys/ofed/include/rdma/ib_smi.h stable/10/sys/ofed/include/rdma/ib_user_cm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/10/sys/contrib/rdma/krping/krping.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/contrib/rdma/krping/krping.c Sat Oct 18 07:07:34 2014 (r273246) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Sat Oct 18 07:07:34 2014 (r273246) @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include Modified: stable/10/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/addr.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/core/addr.c Sat Oct 18 07:07:34 2014 (r273246) @@ -35,10 +35,15 @@ #include #include +#include #include +#include +#include #include #include #include +#include + MODULE_AUTHOR("Sean Hefty"); MODULE_DESCRIPTION("IB Address Translation"); @@ -189,13 +194,11 @@ static void set_timeout(unsigned long ti { unsigned long delay; - cancel_delayed_work(&work); - delay = time - jiffies; if ((long)delay <= 0) delay = 1; - queue_delayed_work(addr_wq, &work, delay); + mod_delayed_work(addr_wq, &work, delay); } static void queue_req(struct addr_req *req) @@ -620,7 +623,7 @@ static struct notifier_block nb = { .notifier_call = netevent_callback }; -static int addr_init(void) +static int __init addr_init(void) { INIT_DELAYED_WORK(&work, process_req); addr_wq = create_singlethread_workqueue("ib_addr"); @@ -631,7 +634,7 @@ static int addr_init(void) return 0; } -static void addr_cleanup(void) +static void __exit addr_cleanup(void) { unregister_netevent_notifier(&nb); destroy_workqueue(addr_wq); Modified: stable/10/sys/ofed/drivers/infiniband/core/agent.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/agent.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/core/agent.c Sat Oct 18 07:07:34 2014 (r273246) @@ -101,7 +101,8 @@ void agent_send_response(struct ib_mad * agent = port_priv->agent[qpn]; ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num); if (IS_ERR(ah)) { - printk(KERN_ERR SPFX "ib_create_ah_from_wc error\n"); + printk(KERN_ERR SPFX "ib_create_ah_from_wc error %ld\n", + PTR_ERR(ah)); return; } Modified: stable/10/sys/ofed/drivers/infiniband/core/ucm.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/ucm.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/core/ucm.c Sat Oct 18 07:07:34 2014 (r273246) @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include Modified: stable/10/sys/ofed/drivers/infiniband/core/uverbs_main.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/uverbs_main.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/core/uverbs_main.c Sat Oct 18 07:07:34 2014 (r273246) @@ -40,7 +40,6 @@ #include #include #include -#include #include #include Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/ah.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mlx4/ah.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/hw/mlx4/ah.c Sat Oct 18 07:07:34 2014 (r273246) @@ -38,7 +38,6 @@ #include #include -#include #include #include "mlx4_ib.h" Modified: stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_config_reg.h ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_config_reg.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_config_reg.h Sat Oct 18 07:07:34 2014 (r273246) @@ -34,7 +34,7 @@ #ifndef MTHCA_CONFIG_REG_H #define MTHCA_CONFIG_REG_H -#include +#include #define MTHCA_HCR_BASE 0x80680 #define MTHCA_HCR_SIZE 0x0001c Modified: stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c Sat Oct 18 07:07:34 2014 (r273246) @@ -36,7 +36,7 @@ #include #include -#include +#include #include "mthca_memfree.h" #include "mthca_dev.h" Modified: stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_uar.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_uar.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_uar.c Sat Oct 18 07:07:34 2014 (r273246) @@ -30,7 +30,7 @@ * SOFTWARE. */ -#include /* PAGE_SHIFT */ +#include #include "mthca_dev.h" #include "mthca_memfree.h" Modified: stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c Sat Oct 18 07:07:34 2014 (r273246) @@ -31,7 +31,6 @@ */ #include -#include #include #include "ipoib.h" Modified: stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c Sat Oct 18 07:07:34 2014 (r273246) @@ -32,7 +32,6 @@ */ #include "ipoib.h" -#include int ipoib_mcast_attach(struct ipoib_dev_priv *priv, u16 mlid, union ib_gid *mgid, int set_qkey) { Modified: stable/10/sys/ofed/drivers/net/mlx4/Makefile ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/Makefile Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/net/mlx4/Makefile Sat Oct 18 07:07:34 2014 (r273246) @@ -31,4 +31,3 @@ opt_inet6.h: .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} - Modified: stable/10/sys/ofed/drivers/net/mlx4/en_ethtool.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_ethtool.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/net/mlx4/en_ethtool.c Sat Oct 18 07:07:34 2014 (r273246) @@ -32,7 +32,6 @@ */ #include -#include #include #include #include Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sat Oct 18 07:07:34 2014 (r273246) @@ -2335,9 +2335,11 @@ static void mlx4_en_sysctl_conf(struct m struct sysctl_oid_list *node_list; struct sysctl_oid *coal; struct sysctl_oid_list *coal_list; + const char *pnameunit; dev = priv->dev; ctx = &priv->conf_ctx; + pnameunit = device_get_nameunit(priv->mdev->pdev->dev.bsddev); sysctl_ctx_init(ctx); priv->sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_STATIC_CHILDREN(_hw), @@ -2350,10 +2352,10 @@ static void mlx4_en_sysctl_conf(struct m CTLFLAG_RW, &priv->msg_enable, 0, "Driver message enable bitfield"); SYSCTL_ADD_UINT(ctx, node_list, OID_AUTO, "rx_rings", - CTLTYPE_INT | CTLFLAG_RD, &priv->rx_ring_num, 0, + CTLFLAG_RD, &priv->rx_ring_num, 0, "Number of receive rings"); SYSCTL_ADD_UINT(ctx, node_list, OID_AUTO, "tx_rings", - CTLTYPE_INT | CTLFLAG_RD, &priv->tx_ring_num, 0, + CTLFLAG_RD, &priv->tx_ring_num, 0, "Number of transmit rings"); SYSCTL_ADD_PROC(ctx, node_list, OID_AUTO, "rx_size", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, @@ -2367,6 +2369,12 @@ static void mlx4_en_sysctl_conf(struct m SYSCTL_ADD_PROC(ctx, node_list, OID_AUTO, "rx_ppp", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, mlx4_en_set_rx_ppp, "I", "RX Per-priority pause"); + SYSCTL_ADD_UINT(ctx, node_list, OID_AUTO, "port_num", + CTLFLAG_RD, &priv->port, 0, + "Port Number"); + SYSCTL_ADD_STRING(ctx, node_list, OID_AUTO, "device_name", + CTLFLAG_RD, __DECONST(void *, pnameunit), 0, + "PCI device name"); /* Add coalescer configuration. */ coal = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, Modified: stable/10/sys/ofed/drivers/net/mlx4/en_selftest.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_selftest.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/net/mlx4/en_selftest.c Sat Oct 18 07:07:34 2014 (r273246) @@ -32,7 +32,6 @@ */ #include -#include #include #include #include Modified: stable/10/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_tx.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/net/mlx4/en_tx.c Sat Oct 18 07:07:34 2014 (r273246) @@ -31,7 +31,7 @@ * */ -#include +#include #include #include #include Modified: stable/10/sys/ofed/drivers/net/mlx4/pd.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/pd.c Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/drivers/net/mlx4/pd.c Sat Oct 18 07:07:34 2014 (r273246) @@ -35,7 +35,7 @@ #include #include -#include +#include #include "mlx4.h" #include "icm.h" Modified: stable/10/sys/ofed/include/linux/completion.h ============================================================================== --- stable/10/sys/ofed/include/linux/completion.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/linux/completion.h Sat Oct 18 07:07:34 2014 (r273246) @@ -27,8 +27,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _FBSD_COMPLETION_H_ -#define _FBSD_COMPLETION_H_ +#ifndef _LINUX_COMPLETION_H_ +#define _LINUX_COMPLETION_H_ #include Modified: stable/10/sys/ofed/include/linux/etherdevice.h ============================================================================== --- stable/10/sys/ofed/include/linux/etherdevice.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/linux/etherdevice.h Sat Oct 18 07:07:34 2014 (r273246) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014 Mellanox Technologies, Ltd. All rights reserved. * Modified: stable/10/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/10/sys/ofed/include/linux/mlx4/device.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/linux/mlx4/device.h Sat Oct 18 07:07:34 2014 (r273246) @@ -1036,6 +1036,7 @@ enum mlx4_net_trans_rule_id { MLX4_NET_TRANS_RULE_ID_TCP, MLX4_NET_TRANS_RULE_ID_UDP, MLX4_NET_TRANS_RULE_NUM, /* should be last */ + MLX4_NET_TRANS_RULE_DUMMY = -1, /* force enum to be signed */ }; extern const u16 __sw_id_hw[]; @@ -1058,6 +1059,7 @@ enum mlx4_net_trans_promisc_mode { MLX4_FS_UC_SNIFFER, MLX4_FS_MC_SNIFFER, MLX4_FS_MODE_NUM, /* should be last */ + MLX4_FS_MODE_DUMMY = -1, /* force enum to be signed */ }; struct mlx4_spec_eth { Modified: stable/10/sys/ofed/include/linux/mlx4/driver.h ============================================================================== --- stable/10/sys/ofed/include/linux/mlx4/driver.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/linux/mlx4/driver.h Sat Oct 18 07:07:34 2014 (r273246) @@ -121,7 +121,7 @@ void *mlx4_get_protocol_dev(struct mlx4_ #ifndef ETH_ALEN #define ETH_ALEN 6 #endif -static inline u64 mlx4_mac_to_u64(u8 *addr) +static inline u64 mlx4_mac_to_u64(const u8 *addr) { u64 mac = 0; int i; Modified: stable/10/sys/ofed/include/linux/netdevice.h ============================================================================== --- stable/10/sys/ofed/include/linux/netdevice.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/linux/netdevice.h Sat Oct 18 07:07:34 2014 (r273246) @@ -40,7 +40,6 @@ #include #include -#include #include #include #include Modified: stable/10/sys/ofed/include/linux/scatterlist.h ============================================================================== --- stable/10/sys/ofed/include/linux/scatterlist.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/linux/scatterlist.h Sat Oct 18 07:07:34 2014 (r273246) @@ -31,6 +31,21 @@ #define _LINUX_SCATTERLIST_H_ #include +#include + +/* + * SG table design. + * + * If flags bit 0 is set, then the sg field contains a pointer to the next sg + * table list. Otherwise the next entry is at sg + 1, can be determined using + * the sg_is_chain() function. + * + * If flags bit 1 is set, then this sg entry is the last element in a list, + * can be determined using the sg_is_last() function. + * + * See sg_next(). + * + */ struct scatterlist { union { @@ -49,6 +64,12 @@ struct sg_table { unsigned int orig_nents; /* original size of list */ }; +/* + * Maximum number of entries that will be allocated in one piece, if + * a list larger than this is required then chaining will be utilized. + */ +#define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) + #define sg_dma_address(sg) (sg)->address #define sg_dma_len(sg) (sg)->length #define sg_page(sg) (sg)->sl_un.page @@ -99,6 +120,212 @@ sg_phys(struct scatterlist *sg) return sg_page(sg)->phys_addr + sg->offset; } +/** + * sg_chain - Chain two sglists together + * @prv: First scatterlist + * @prv_nents: Number of entries in prv + * @sgl: Second scatterlist + * + * Description: + * Links @prv@ and @sgl@ together, to form a longer scatterlist. + * + **/ +static inline void +sg_chain(struct scatterlist *prv, unsigned int prv_nents, + struct scatterlist *sgl) +{ +/* + * offset and length are unused for chain entry. Clear them. + */ + struct scatterlist *sg = &prv[prv_nents - 1]; + + sg->offset = 0; + sg->length = 0; + + /* + * Indicate a link pointer, and set the link to the second list. + */ + sg->flags = SG_CHAIN; + sg->sl_un.sg = sgl; +} + +/** + * sg_mark_end - Mark the end of the scatterlist + * @sg: SG entryScatterlist + * + * Description: + * Marks the passed in sg entry as the termination point for the sg + * table. A call to sg_next() on this entry will return NULL. + * + **/ +static inline void sg_mark_end(struct scatterlist *sg) +{ + sg->flags = SG_END; +} + +/** + * __sg_free_table - Free a previously mapped sg table + * @table: The sg table header to use + * @max_ents: The maximum number of entries per single scatterlist + * + * Description: + * Free an sg table previously allocated and setup with + * __sg_alloc_table(). The @max_ents value must be identical to + * that previously used with __sg_alloc_table(). + * + **/ +static inline void +__sg_free_table(struct sg_table *table, unsigned int max_ents) +{ + struct scatterlist *sgl, *next; + + if (unlikely(!table->sgl)) + return; + + sgl = table->sgl; + while (table->orig_nents) { + unsigned int alloc_size = table->orig_nents; + unsigned int sg_size; + + /* + * If we have more than max_ents segments left, + * then assign 'next' to the sg table after the current one. + * sg_size is then one less than alloc size, since the last + * element is the chain pointer. + */ + if (alloc_size > max_ents) { + next = sgl[max_ents - 1].sl_un.sg; + alloc_size = max_ents; + sg_size = alloc_size - 1; + } else { + sg_size = alloc_size; + next = NULL; + } + + table->orig_nents -= sg_size; + kfree(sgl); + sgl = next; + } + + table->sgl = NULL; +} + +/** + * sg_free_table - Free a previously allocated sg table + * @table: The mapped sg table header + * + **/ +static inline void +sg_free_table(struct sg_table *table) +{ + __sg_free_table(table, SG_MAX_SINGLE_ALLOC); +} + +/** + * __sg_alloc_table - Allocate and initialize an sg table with given allocator + * @table: The sg table header to use + * @nents: Number of entries in sg list + * @max_ents: The maximum number of entries the allocator returns per call + * @gfp_mask: GFP allocation mask + * + * Description: + * This function returns a @table @nents long. The allocator is + * defined to return scatterlist chunks of maximum size @max_ents. + * Thus if @nents is bigger than @max_ents, the scatterlists will be + * chained in units of @max_ents. + * + * Notes: + * If this function returns non-0 (eg failure), the caller must call + * __sg_free_table() to cleanup any leftover allocations. + * + **/ +static inline int +__sg_alloc_table(struct sg_table *table, unsigned int nents, + unsigned int max_ents, gfp_t gfp_mask) +{ + struct scatterlist *sg, *prv; + unsigned int left; + + memset(table, 0, sizeof(*table)); + + if (nents == 0) + return -EINVAL; + left = nents; + prv = NULL; + do { + unsigned int sg_size, alloc_size = left; + + if (alloc_size > max_ents) { + alloc_size = max_ents; + sg_size = alloc_size - 1; + } else + sg_size = alloc_size; + + left -= sg_size; + + sg = kmalloc(alloc_size * sizeof(struct scatterlist), gfp_mask); + if (unlikely(!sg)) { + /* + * Adjust entry count to reflect that the last + * entry of the previous table won't be used for + * linkage. Without this, sg_kfree() may get + * confused. + */ + if (prv) + table->nents = ++table->orig_nents; + + return -ENOMEM; + } + + sg_init_table(sg, alloc_size); + table->nents = table->orig_nents += sg_size; + + /* + * If this is the first mapping, assign the sg table header. + * If this is not the first mapping, chain previous part. + */ + if (prv) + sg_chain(prv, max_ents, sg); + else + table->sgl = sg; + + /* + * If no more entries after this one, mark the end + */ + if (!left) + sg_mark_end(&sg[sg_size - 1]); + + prv = sg; + } while (left); + + return 0; +} + +/** + * sg_alloc_table - Allocate and initialize an sg table + * @table: The sg table header to use + * @nents: Number of entries in sg list + * @gfp_mask: GFP allocation mask + * + * Description: + * Allocate and initialize an sg table. If @nents@ is larger than + * SG_MAX_SINGLE_ALLOC a chained sg table will be setup. + * + **/ + +static inline int +sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask) +{ + int ret; + + ret = __sg_alloc_table(table, nents, SG_MAX_SINGLE_ALLOC, + gfp_mask); + if (unlikely(ret)) + __sg_free_table(table, SG_MAX_SINGLE_ALLOC); + + return ret; +} + #define for_each_sg(sglist, sg, sgmax, _itr) \ for (_itr = 0, sg = (sglist); _itr < (sgmax); _itr++, sg = sg_next(sg)) Modified: stable/10/sys/ofed/include/linux/vmalloc.h ============================================================================== --- stable/10/sys/ofed/include/linux/vmalloc.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/linux/vmalloc.h Sat Oct 18 07:07:34 2014 (r273246) @@ -30,7 +30,7 @@ #ifndef _LINUX_VMALLOC_H_ #define _LINUX_VMALLOC_H_ -#include +#include #define VM_MAP 0x0000 #define PAGE_KERNEL 0x0000 Modified: stable/10/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- stable/10/sys/ofed/include/rdma/ib_addr.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/rdma/ib_addr.h Sat Oct 18 07:07:34 2014 (r273246) @@ -41,7 +41,6 @@ #include #include #include -#include #include struct rdma_addr_client { Modified: stable/10/sys/ofed/include/rdma/ib_smi.h ============================================================================== --- stable/10/sys/ofed/include/rdma/ib_smi.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/rdma/ib_smi.h Sat Oct 18 07:07:34 2014 (r273246) @@ -38,6 +38,7 @@ #define IB_SMI_H #include +#include #define IB_SMP_DATA_SIZE 64 #define IB_SMP_MAX_PATH_HOPS 64 Modified: stable/10/sys/ofed/include/rdma/ib_user_cm.h ============================================================================== --- stable/10/sys/ofed/include/rdma/ib_user_cm.h Sat Oct 18 05:39:32 2014 (r273245) +++ stable/10/sys/ofed/include/rdma/ib_user_cm.h Sat Oct 18 07:07:34 2014 (r273246) @@ -34,6 +34,7 @@ #ifndef IB_USER_CM_H #define IB_USER_CM_H +#include #include #define IB_USER_CM_ABI_VERSION 5 From owner-svn-src-stable-10@FreeBSD.ORG Sat Oct 18 15:28:02 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5D98535; Sat, 18 Oct 2014 15:28: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 C1F38A78; Sat, 18 Oct 2014 15:28: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 s9IFS211099431; Sat, 18 Oct 2014 15:28:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9IFS23q099428; Sat, 18 Oct 2014 15:28:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410181528.s9IFS23q099428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Oct 2014 15:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273254 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2014 15:28:03 -0000 Author: kib Date: Sat Oct 18 15:28:01 2014 New Revision: 273254 URL: https://svnweb.freebsd.org/changeset/base/273254 Log: MFC r272534: Add IO_RANGELOCKED flag for vn_rdwr(9), which specifies that vnode is not locked, but range is. Modified: stable/10/sys/kern/vfs_vnops.c stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Sat Oct 18 15:18:31 2014 (r273253) +++ stable/10/sys/kern/vfs_vnops.c Sat Oct 18 15:28:01 2014 (r273254) @@ -502,13 +502,16 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp error = 0; if ((ioflg & IO_NODELOCKED) == 0) { - if (rw == UIO_READ) { - rl_cookie = vn_rangelock_rlock(vp, offset, - offset + len); - } else { - rl_cookie = vn_rangelock_wlock(vp, offset, - offset + len); - } + if ((ioflg & IO_RANGELOCKED) == 0) { + if (rw == UIO_READ) { + rl_cookie = vn_rangelock_rlock(vp, offset, + offset + len); + } else { + rl_cookie = vn_rangelock_wlock(vp, offset, + offset + len); + } + } else + rl_cookie = NULL; mp = NULL; if (rw == UIO_WRITE) { if (vp->v_type != VCHR && Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Sat Oct 18 15:18:31 2014 (r273253) +++ stable/10/sys/sys/vnode.h Sat Oct 18 15:28:01 2014 (r273254) @@ -305,6 +305,7 @@ struct vattr { #define IO_NORMAL 0x0800 /* operate on regular data */ #define IO_NOMACCHECK 0x1000 /* MAC checks unnecessary */ #define IO_BUFLOCKED 0x2000 /* ffs flag; indir buf is locked */ +#define IO_RANGELOCKED 0x4000 /* range locked */ #define IO_SEQMAX 0x7F /* seq heuristic max value */ #define IO_SEQSHIFT 16 /* seq heuristic in upper 16 bits */ From owner-svn-src-stable-10@FreeBSD.ORG Sat Oct 18 15:31:55 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 428CB748; Sat, 18 Oct 2014 15:31:55 +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 14128B25; Sat, 18 Oct 2014 15:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9IFVs0S003523; Sat, 18 Oct 2014 15:31:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9IFVsgX003520; Sat, 18 Oct 2014 15:31:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410181531.s9IFVsgX003520@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Oct 2014 15:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273255 - in stable/10/sys: fs/ext2fs fs/msdosfs ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2014 15:31:55 -0000 Author: kib Date: Sat Oct 18 15:31:53 2014 New Revision: 273255 URL: https://svnweb.freebsd.org/changeset/base/273255 Log: MFC r272952: Do not set IN_ACCESS flag for read-only mounts. Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c stable/10/sys/fs/msdosfs/msdosfs_vnops.c stable/10/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vnops.c Sat Oct 18 15:28:01 2014 (r273254) +++ stable/10/sys/fs/ext2fs/ext2_vnops.c Sat Oct 18 15:31:53 2014 (r273255) @@ -1763,7 +1763,7 @@ ext2_ind_read(struct vop_read_args *ap) } if ((error == 0 || uio->uio_resid != orig_resid) && - (vp->v_mount->mnt_flag & MNT_NOATIME) == 0) + (vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) ip->i_flag |= IN_ACCESS; return (error); } Modified: stable/10/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_vnops.c Sat Oct 18 15:28:01 2014 (r273254) +++ stable/10/sys/fs/msdosfs/msdosfs_vnops.c Sat Oct 18 15:31:53 2014 (r273255) @@ -642,7 +642,7 @@ msdosfs_read(ap) brelse(bp); } while (error == 0 && uio->uio_resid > 0 && n != 0); if (!isadir && (error == 0 || uio->uio_resid != orig_resid) && - (vp->v_mount->mnt_flag & MNT_NOATIME) == 0) + (vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) dep->de_flag |= DE_ACCESS; return (error); } Modified: stable/10/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vnops.c Sat Oct 18 15:28:01 2014 (r273254) +++ stable/10/sys/ufs/ffs/ffs_vnops.c Sat Oct 18 15:31:53 2014 (r273255) @@ -628,7 +628,7 @@ ffs_read(ap) } if ((error == 0 || uio->uio_resid != orig_resid) && - (vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && + (vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0 && (ip->i_flag & IN_ACCESS) == 0) { VI_LOCK(vp); ip->i_flag |= IN_ACCESS; From owner-svn-src-stable-10@FreeBSD.ORG Sat Oct 18 19:23:04 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 954B7C8C; Sat, 18 Oct 2014 19:23: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 7F6C215F; Sat, 18 Oct 2014 19:23: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 s9IJN4C8013907; Sat, 18 Oct 2014 19:23:04 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9IJMxJr013838; Sat, 18 Oct 2014 19:22:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201410181922.s9IJMxJr013838@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 18 Oct 2014 19:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273265 - stable/10/sys/ddb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2014 19:23:04 -0000 Author: pfg Date: Sat Oct 18 19:22:59 2014 New Revision: 273265 URL: https://svnweb.freebsd.org/changeset/base/273265 Log: MFC r272958, r273006: ddb: space/tab fixes and ANSI-fy function declarations. No functional change. Modified: stable/10/sys/ddb/db_access.c stable/10/sys/ddb/db_break.c stable/10/sys/ddb/db_command.c stable/10/sys/ddb/db_examine.c stable/10/sys/ddb/db_input.c stable/10/sys/ddb/db_lex.c stable/10/sys/ddb/db_output.c stable/10/sys/ddb/db_output.h stable/10/sys/ddb/db_print.c stable/10/sys/ddb/db_ps.c stable/10/sys/ddb/db_run.c stable/10/sys/ddb/db_sym.c stable/10/sys/ddb/db_sym.h stable/10/sys/ddb/db_textdump.c stable/10/sys/ddb/db_variables.h stable/10/sys/ddb/db_watch.c stable/10/sys/ddb/db_watch.h stable/10/sys/ddb/db_write_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ddb/db_access.c ============================================================================== --- stable/10/sys/ddb/db_access.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_access.c Sat Oct 18 19:22:59 2014 (r273265) @@ -54,10 +54,7 @@ static unsigned db_extend[] = { /* table #endif db_expr_t -db_get_value(addr, size, is_signed) - db_addr_t addr; - register int size; - boolean_t is_signed; +db_get_value(db_addr_t addr, int size, boolean_t is_signed) { char data[sizeof(u_int64_t)]; register db_expr_t value; @@ -87,10 +84,7 @@ db_get_value(addr, size, is_signed) } void -db_put_value(addr, size, value) - db_addr_t addr; - register int size; - register db_expr_t value; +db_put_value(db_addr_t addr, int size, db_expr_t value) { char data[sizeof(int)]; register int i; Modified: stable/10/sys/ddb/db_break.c ============================================================================== --- stable/10/sys/ddb/db_break.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_break.c Sat Oct 18 19:22:59 2014 (r273265) @@ -59,7 +59,7 @@ static void db_list_breakpoints(void); static void db_set_breakpoint(vm_map_t map, db_addr_t addr, int count); static db_breakpoint_t -db_breakpoint_alloc() +db_breakpoint_alloc(void) { register db_breakpoint_t bkpt; @@ -78,18 +78,14 @@ db_breakpoint_alloc() } static void -db_breakpoint_free(bkpt) - register db_breakpoint_t bkpt; +db_breakpoint_free(db_breakpoint_t bkpt) { bkpt->link = db_free_breakpoints; db_free_breakpoints = bkpt; } static void -db_set_breakpoint(map, addr, count) - vm_map_t map; - db_addr_t addr; - int count; +db_set_breakpoint(vm_map_t map, db_addr_t addr, int count) { register db_breakpoint_t bkpt; @@ -115,9 +111,7 @@ db_set_breakpoint(map, addr, count) } static void -db_delete_breakpoint(map, addr) - vm_map_t map; - db_addr_t addr; +db_delete_breakpoint(vm_map_t map, db_addr_t addr) { register db_breakpoint_t bkpt; register db_breakpoint_t *prev; @@ -140,9 +134,7 @@ db_delete_breakpoint(map, addr) } static db_breakpoint_t -db_find_breakpoint(map, addr) - vm_map_t map; - db_addr_t addr; +db_find_breakpoint(vm_map_t map, db_addr_t addr) { register db_breakpoint_t bkpt; @@ -158,16 +150,15 @@ db_find_breakpoint(map, addr) } db_breakpoint_t -db_find_breakpoint_here(addr) - db_addr_t addr; +db_find_breakpoint_here(db_addr_t addr) { - return db_find_breakpoint(db_map_addr(addr), addr); + return db_find_breakpoint(db_map_addr(addr), addr); } static boolean_t db_breakpoints_inserted = TRUE; #ifndef BKPT_WRITE -#define BKPT_WRITE(addr, storage) \ +#define BKPT_WRITE(addr, storage) \ do { \ *storage = db_get_value(addr, BKPT_SIZE, FALSE); \ db_put_value(addr, BKPT_SIZE, BKPT_SET(*storage)); \ @@ -175,12 +166,12 @@ do { \ #endif #ifndef BKPT_CLEAR -#define BKPT_CLEAR(addr, storage) \ +#define BKPT_CLEAR(addr, storage) \ db_put_value(addr, BKPT_SIZE, *storage) #endif void -db_set_breakpoints() +db_set_breakpoints(void) { register db_breakpoint_t bkpt; @@ -197,7 +188,7 @@ db_set_breakpoints() } void -db_clear_breakpoints() +db_clear_breakpoints(void) { register db_breakpoint_t bkpt; @@ -220,8 +211,7 @@ db_clear_breakpoints() * so the breakpoint does not have to be on the breakpoint list. */ db_breakpoint_t -db_set_temp_breakpoint(addr) - db_addr_t addr; +db_set_temp_breakpoint(db_addr_t addr) { register db_breakpoint_t bkpt; @@ -242,8 +232,7 @@ db_set_temp_breakpoint(addr) } void -db_delete_temp_breakpoint(bkpt) - db_breakpoint_t bkpt; +db_delete_temp_breakpoint(db_breakpoint_t bkpt) { BKPT_CLEAR(bkpt->address, &bkpt->bkpt_inst); db_breakpoint_free(bkpt); @@ -254,7 +243,7 @@ db_delete_temp_breakpoint(bkpt) * List breakpoints. */ static void -db_list_breakpoints() +db_list_breakpoints(void) { register db_breakpoint_t bkpt; @@ -278,11 +267,7 @@ db_list_breakpoints() /* Delete breakpoint */ /*ARGSUSED*/ void -db_delete_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_delete_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif) { db_delete_breakpoint(db_map_addr(addr), (db_addr_t)addr); } @@ -290,11 +275,8 @@ db_delete_cmd(addr, have_addr, count, mo /* Set breakpoint with skip count */ /*ARGSUSED*/ void -db_breakpoint_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_breakpoint_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, + char *modif) { if (count == -1) count = 1; @@ -304,11 +286,8 @@ db_breakpoint_cmd(addr, have_addr, count /* list breakpoints */ void -db_listbreak_cmd(dummy1, dummy2, dummy3, dummy4) - db_expr_t dummy1; - boolean_t dummy2; - db_expr_t dummy3; - char * dummy4; +db_listbreak_cmd(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, + char *dummy4) { db_list_breakpoints(); } @@ -320,8 +299,7 @@ db_listbreak_cmd(dummy1, dummy2, dummy3, */ boolean_t -db_map_equal(map1, map2) - vm_map_t map1, map2; +db_map_equal(vm_map_t map1, vm_map_t map2) { return ((map1 == map2) || ((map1 == NULL) && (map2 == kernel_map)) || @@ -329,8 +307,7 @@ db_map_equal(map1, map2) } boolean_t -db_map_current(map) - vm_map_t map; +db_map_current(vm_map_t map) { #if 0 thread_t thread; @@ -345,8 +322,7 @@ db_map_current(map) } vm_map_t -db_map_addr(addr) - vm_offset_t addr; +db_map_addr(vm_offset_t addr) { #if 0 thread_t thread; Modified: stable/10/sys/ddb/db_command.c ============================================================================== --- stable/10/sys/ddb/db_command.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_command.c Sat Oct 18 19:22:59 2014 (r273265) @@ -157,7 +157,7 @@ static boolean_t db_ed_style = TRUE; * Utility routine - discard tokens through end-of-line. */ void -db_skip_to_eol() +db_skip_to_eol(void) { int t; do { @@ -252,11 +252,8 @@ db_command_unregister(struct command_tab * Helper function to match a single command. */ static void -db_cmd_match(name, cmd, cmdp, resultp) - char * name; - struct command *cmd; - struct command **cmdp; /* out */ - int * resultp; +db_cmd_match(char *name, struct command *cmd, struct command **cmdp, + int *resultp) { char *lp, *rp; int c; @@ -291,10 +288,7 @@ db_cmd_match(name, cmd, cmdp, resultp) * Search for command prefix. */ static int -db_cmd_search(name, table, cmdp) - char * name; - struct command_table *table; - struct command **cmdp; /* out */ +db_cmd_search(char *name, struct command_table *table, struct command **cmdp) { struct command *cmd; int result = CMD_NONE; @@ -315,8 +309,7 @@ db_cmd_search(name, table, cmdp) } static void -db_cmd_list(table) - struct command_table *table; +db_cmd_list(struct command_table *table) { register struct command *cmd; @@ -327,10 +320,8 @@ db_cmd_list(table) } static void -db_command(last_cmdp, cmd_table, dopager) - struct command **last_cmdp; /* IN_OUT */ - struct command_table *cmd_table; - int dopager; +db_command(struct command **last_cmdp, struct command_table *cmd_table, + int dopager) { struct command *cmd = NULL; int t; @@ -483,7 +474,7 @@ DB_COMMAND(panic, db_panic) } void -db_command_loop() +db_command_loop(void) { /* * Initialize 'prev' and 'next' to dot. @@ -521,8 +512,7 @@ db_command_script(const char *command) } void -db_error(s) - const char *s; +db_error(const char *s) { if (s) db_printf("%s", s); @@ -581,11 +571,7 @@ db_fncall_generic(db_expr_t addr, db_exp } static void -db_fncall(dummy1, dummy2, dummy3, dummy4) - db_expr_t dummy1; - boolean_t dummy2; - db_expr_t dummy3; - char * dummy4; +db_fncall(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4) { db_expr_t fn_addr; db_expr_t args[DB_MAXARGS]; @@ -639,16 +625,12 @@ db_halt(db_expr_t dummy, boolean_t dummy } static void -db_kill(dummy1, dummy2, dummy3, dummy4) - db_expr_t dummy1; - boolean_t dummy2; - db_expr_t dummy3; - char * dummy4; +db_kill(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4) { db_expr_t old_radix, pid, sig; struct proc *p; -#define DB_ERROR(f) do { db_printf f; db_flush_lex(); goto out; } while (0) +#define DB_ERROR(f) do { db_printf f; db_flush_lex(); goto out; } while (0) /* * PIDs and signal numbers are typically represented in base @@ -732,11 +714,7 @@ db_reset(db_expr_t addr, boolean_t have_ } static void -db_watchdog(dummy1, dummy2, dummy3, dummy4) - db_expr_t dummy1; - boolean_t dummy2; - db_expr_t dummy3; - char * dummy4; +db_watchdog(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4) { db_expr_t old_radix, tout; int err, i; Modified: stable/10/sys/ddb/db_examine.c ============================================================================== --- stable/10/sys/ddb/db_examine.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_examine.c Sat Oct 18 19:22:59 2014 (r273265) @@ -52,11 +52,8 @@ static void db_search(db_addr_t, int, db */ /*ARGSUSED*/ void -db_examine_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_examine_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, + char *modif) { if (modif[0] != '\0') db_strcpy(db_examine_format, modif); @@ -68,11 +65,7 @@ db_examine_cmd(addr, have_addr, count, m } static void -db_examine(addr, fmt, count) - register - db_addr_t addr; - char * fmt; /* format string */ - int count; /* repeat count */ +db_examine(db_addr_t addr, char *fmt, int count) { int c; db_expr_t value; @@ -197,11 +190,8 @@ static char db_print_format = 'x'; /*ARGSUSED*/ void -db_print_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_print_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, + char *modif) { db_expr_t value; @@ -242,8 +232,7 @@ db_print_cmd(addr, have_addr, count, mod } void -db_print_loc_and_inst(loc) - db_addr_t loc; +db_print_loc_and_inst(db_addr_t loc) { db_printsym(loc, DB_STGY_PROC); db_printf(":\t"); @@ -255,11 +244,8 @@ db_print_loc_and_inst(loc) * Syntax: search [/bhl] addr value [mask] [,count] */ void -db_search_cmd(dummy1, dummy2, dummy3, dummy4) - db_expr_t dummy1; - boolean_t dummy2; - db_expr_t dummy3; - char * dummy4; +db_search_cmd(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, + char *dummy4) { int t; db_addr_t addr; @@ -323,13 +309,8 @@ db_search_cmd(dummy1, dummy2, dummy3, du } static void -db_search(addr, size, value, mask, count) - register - db_addr_t addr; - int size; - db_expr_t value; - db_expr_t mask; - unsigned int count; +db_search(db_addr_t addr, int size, db_expr_t value, db_expr_t mask, + unsigned int count) { while (count-- != 0) { db_prev = addr; Modified: stable/10/sys/ddb/db_input.c ============================================================================== --- stable/10/sys/ddb/db_input.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_input.c Sat Oct 18 19:22:59 2014 (r273265) @@ -346,7 +346,7 @@ db_readline(lstart, lsize) } void -db_check_interrupt() +db_check_interrupt(void) { register int c; Modified: stable/10/sys/ddb/db_lex.c ============================================================================== --- stable/10/sys/ddb/db_lex.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_lex.c Sat Oct 18 19:22:59 2014 (r273265) @@ -49,7 +49,7 @@ static int db_read_char(void); static void db_unread_char(int); int -db_read_line() +db_read_line(void) { int i; @@ -97,7 +97,7 @@ db_flush_line() static int db_look_char = 0; static int -db_read_char() +db_read_char(void) { int c; @@ -148,7 +148,7 @@ char db_tok_string[TOK_STRING_SIZE]; db_expr_t db_radix = 16; void -db_flush_lex() +db_flush_lex(void) { db_flush_line(); db_look_char = 0; @@ -156,7 +156,7 @@ db_flush_lex() } static int -db_lex() +db_lex(void) { int c; Modified: stable/10/sys/ddb/db_output.c ============================================================================== --- stable/10/sys/ddb/db_output.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_output.c Sat Oct 18 19:22:59 2014 (r273265) @@ -91,7 +91,7 @@ static void db_pager(void); * Force pending whitespace. */ void -db_force_whitespace() +db_force_whitespace(void) { register int last_print, next_tab; @@ -308,7 +308,7 @@ db_pager(void) * Return output position */ int -db_print_position() +db_print_position(void) { return (db_output_position); } Modified: stable/10/sys/ddb/db_output.h ============================================================================== --- stable/10/sys/ddb/db_output.h Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_output.h Sat Oct 18 19:22:59 2014 (r273265) @@ -30,7 +30,7 @@ #define _DDB_DB_OUTPUT_H_ /* - * Author: David B. Golub, Carnegie Mellon University + * Author: David B. Golub, Carnegie Mellon University * Date: 8/90 */ Modified: stable/10/sys/ddb/db_print.c ============================================================================== --- stable/10/sys/ddb/db_print.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_print.c Sat Oct 18 19:22:59 2014 (r273265) @@ -25,7 +25,7 @@ * */ /* - * Author: David B. Golub, Carnegie Mellon University + * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 */ Modified: stable/10/sys/ddb/db_ps.c ============================================================================== --- stable/10/sys/ddb/db_ps.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_ps.c Sat Oct 18 19:22:59 2014 (r273265) @@ -155,7 +155,7 @@ db_ps(db_expr_t addr, boolean_t hasaddr, else if (wflag) state[0] = 'W'; else - state[0] = '?'; + state[0] = '?'; } break; case PRS_NEW: @@ -211,7 +211,7 @@ db_ps(db_expr_t addr, boolean_t hasaddr, p = LIST_NEXT(p, p_list); if (p == NULL && np > 0) p = LIST_FIRST(&zombproc); - } + } } static void Modified: stable/10/sys/ddb/db_run.c ============================================================================== --- stable/10/sys/ddb/db_run.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_run.c Sat Oct 18 19:22:59 2014 (r273265) @@ -54,7 +54,7 @@ static int db_run_mode; #define STEP_RETURN 2 #define STEP_CALLT 3 #define STEP_CONTINUE 4 -#define STEP_INVISIBLE 5 +#define STEP_INVISIBLE 5 #define STEP_COUNT 6 static boolean_t db_sstep_print; @@ -78,8 +78,7 @@ db_breakpoint_t db_taken_bkpt = 0; #endif boolean_t -db_stop_at_pc(is_breakpoint) - boolean_t *is_breakpoint; +db_stop_at_pc(boolean_t *is_breakpoint) { register db_addr_t pc; register db_breakpoint_t bkpt; @@ -180,8 +179,7 @@ db_stop_at_pc(is_breakpoint) } void -db_restart_at_pc(watchpt) - boolean_t watchpt; +db_restart_at_pc(boolean_t watchpt) { register db_addr_t pc = PC_REGS(); @@ -328,11 +326,8 @@ db_single_step_cmd(addr, have_addr, coun /* trace and print until call/return */ /*ARGSUSED*/ void -db_trace_until_call_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_trace_until_call_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, + char *modif) { boolean_t print = FALSE; @@ -350,11 +345,8 @@ db_trace_until_call_cmd(addr, have_addr, /*ARGSUSED*/ void -db_trace_until_matching_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_trace_until_matching_cmd(db_expr_t addr, boolean_t have_addr, + db_expr_t count, char *modif) { boolean_t print = FALSE; @@ -374,11 +366,8 @@ db_trace_until_matching_cmd(addr, have_a /* continue */ /*ARGSUSED*/ void -db_continue_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_continue_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, + char *modif) { if (modif[0] == 'c') db_run_mode = STEP_COUNT; Modified: stable/10/sys/ddb/db_sym.c ============================================================================== --- stable/10/sys/ddb/db_sym.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_sym.c Sat Oct 18 19:22:59 2014 (r273265) @@ -170,11 +170,7 @@ db_var_curvnet(struct db_variable *vp, d * Add symbol table, with given name, to list of symbol tables. */ void -db_add_symbol_table(start, end, name, ref) - char *start; - char *end; - char *name; - char *ref; +db_add_symbol_table(char *start, char *end, char *name, char *ref) { if (db_nsymtab >= MAXNOSYMTABS) { printf ("No slots left for %s symbol table", name); @@ -195,9 +191,7 @@ db_add_symbol_table(start, end, name, re * overwritten by each call... but in practice this seems okay. */ static char * -db_qualify(sym, symtabname) - c_db_sym_t sym; - register char *symtabname; +db_qualify(c_db_sym_t sym, char *symtabname) { const char *symname; static char tmp[256]; @@ -209,10 +203,7 @@ db_qualify(sym, symtabname) boolean_t -db_eqname(src, dst, c) - const char *src; - const char *dst; - int c; +db_eqname(const char *src, const char *dst, int c) { if (!strcmp(src, dst)) return (TRUE); @@ -222,9 +213,7 @@ db_eqname(src, dst, c) } boolean_t -db_value_of_name(name, valuep) - const char *name; - db_expr_t *valuep; +db_value_of_name(const char *name, db_expr_t *valuep) { c_db_sym_t sym; @@ -236,9 +225,7 @@ db_value_of_name(name, valuep) } boolean_t -db_value_of_name_pcpu(name, valuep) - const char *name; - db_expr_t *valuep; +db_value_of_name_pcpu(const char *name, db_expr_t *valuep) { static char tmp[256]; db_expr_t value; @@ -261,9 +248,7 @@ db_value_of_name_pcpu(name, valuep) } boolean_t -db_value_of_name_vnet(name, valuep) - const char *name; - db_expr_t *valuep; +db_value_of_name_vnet(const char *name, db_expr_t *valuep) { #ifdef VIMAGE static char tmp[256]; @@ -296,8 +281,7 @@ db_value_of_name_vnet(name, valuep) * otherwise, all symbol tables will be searched. */ static c_db_sym_t -db_lookup(symstr) - const char *symstr; +db_lookup(const char *symstr) { c_db_sym_t sp; register int i; @@ -354,8 +338,7 @@ static volatile boolean_t db_qualify_amb * Used by db_symbol_values to decide whether to qualify a symbol. */ static boolean_t -db_symbol_is_ambiguous(sym) - c_db_sym_t sym; +db_symbol_is_ambiguous(c_db_sym_t sym) { const char *sym_name; register int i; @@ -381,10 +364,7 @@ db_symbol_is_ambiguous(sym) * and the difference between val and the symbol found. */ c_db_sym_t -db_search_symbol( val, strategy, offp) - register db_addr_t val; - db_strategy_t strategy; - db_expr_t *offp; +db_search_symbol(db_addr_t val, db_strategy_t strategy, db_expr_t *offp) { register unsigned int diff; @@ -409,10 +389,7 @@ db_search_symbol( val, strategy, offp) * Return name and value of a symbol */ void -db_symbol_values(sym, namep, valuep) - c_db_sym_t sym; - const char **namep; - db_expr_t *valuep; +db_symbol_values(c_db_sym_t sym, const char **namep, db_expr_t *valuep) { db_expr_t value; @@ -449,9 +426,7 @@ db_symbol_values(sym, namep, valuep) db_expr_t db_maxoff = 0x10000; void -db_printsym(off, strategy) - db_expr_t off; - db_strategy_t strategy; +db_printsym(db_expr_t off, db_strategy_t strategy) { db_expr_t d; char *filename; @@ -486,20 +461,13 @@ db_printsym(off, strategy) } static boolean_t -db_line_at_pc( sym, filename, linenum, pc) - c_db_sym_t sym; - char **filename; - int *linenum; - db_expr_t pc; +db_line_at_pc(c_db_sym_t sym, char **filename, int *linenum, db_expr_t pc) { return X_db_line_at_pc( db_last_symtab, sym, filename, linenum, pc); } int -db_sym_numargs(sym, nargp, argnames) - c_db_sym_t sym; - int *nargp; - char **argnames; +db_sym_numargs(c_db_sym_t sym, int *nargp, char **argnames) { return X_db_sym_numargs(db_last_symtab, sym, nargp, argnames); } Modified: stable/10/sys/ddb/db_sym.h ============================================================================== --- stable/10/sys/ddb/db_sym.h Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_sym.h Sat Oct 18 19:22:59 2014 (r273265) @@ -30,7 +30,7 @@ #define _DDB_DB_SYM_H_ /* - * Author: Alessandro Forin, Carnegie Mellon University + * Author: Alessandro Forin, Carnegie Mellon University * Date: 8/90 */ Modified: stable/10/sys/ddb/db_textdump.c ============================================================================== --- stable/10/sys/ddb/db_textdump.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_textdump.c Sat Oct 18 19:22:59 2014 (r273265) @@ -348,8 +348,8 @@ textdump_dump_msgbuf(struct dumperinfo * */ total_len = 0; offset = 0; - msgbuf_peekbytes(msgbufp, NULL, 0, &seq); - while ((len = msgbuf_peekbytes(msgbufp, buf, sizeof(buf), &seq)) > 0) { + msgbuf_peekbytes(msgbufp, NULL, 0, &seq); + while ((len = msgbuf_peekbytes(msgbufp, buf, sizeof(buf), &seq)) > 0) { for (i = 0; i < len; i++) { if (buf[i] == '\0') continue; @@ -362,7 +362,7 @@ textdump_dump_msgbuf(struct dumperinfo * total_len += offset; offset = 0; } - } + } total_len += offset; /* Without the zero-padding. */ if (offset != 0) { bzero(textdump_block_buffer + offset, Modified: stable/10/sys/ddb/db_variables.h ============================================================================== --- stable/10/sys/ddb/db_variables.h Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_variables.h Sat Oct 18 19:22:59 2014 (r273265) @@ -27,7 +27,7 @@ */ /* - * Author: David B. Golub, Carnegie Mellon University + * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 */ Modified: stable/10/sys/ddb/db_watch.c ============================================================================== --- stable/10/sys/ddb/db_watch.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_watch.c Sat Oct 18 19:22:59 2014 (r273265) @@ -67,7 +67,7 @@ static void db_set_watchpoint(vm_map_t vm_size_t size); static db_watchpoint_t -db_watchpoint_alloc() +db_watchpoint_alloc(void) { register db_watchpoint_t watch; @@ -86,18 +86,14 @@ db_watchpoint_alloc() } static void -db_watchpoint_free(watch) - register db_watchpoint_t watch; +db_watchpoint_free(db_watchpoint_t watch) { watch->link = db_free_watchpoints; db_free_watchpoints = watch; } static void -db_set_watchpoint(map, addr, size) - vm_map_t map; - db_addr_t addr; - vm_size_t size; +db_set_watchpoint(vm_map_t map, db_addr_t addr, vm_size_t size) { register db_watchpoint_t watch; @@ -137,9 +133,7 @@ db_set_watchpoint(map, addr, size) } static void -db_delete_watchpoint(map, addr) - vm_map_t map; - db_addr_t addr; +db_delete_watchpoint(vm_map_t map, db_addr_t addr) { register db_watchpoint_t watch; register db_watchpoint_t *prev; @@ -159,7 +153,7 @@ db_delete_watchpoint(map, addr) } static void -db_list_watchpoints() +db_list_watchpoints(void) { register db_watchpoint_t watch; @@ -189,11 +183,8 @@ db_list_watchpoints() /* Delete watchpoint */ /*ARGSUSED*/ void -db_deletewatch_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_deletewatch_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, + char *modif) { db_delete_watchpoint(db_map_addr(addr), addr); } @@ -201,11 +192,8 @@ db_deletewatch_cmd(addr, have_addr, coun /* Set watchpoint */ /*ARGSUSED*/ void -db_watchpoint_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_watchpoint_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, + char *modif) { vm_size_t size; db_expr_t value; @@ -230,7 +218,7 @@ DB_SHOW_COMMAND(watches, db_listwatch_cm } void -db_set_watchpoints() +db_set_watchpoints(void) { register db_watchpoint_t watch; @@ -248,17 +236,14 @@ db_set_watchpoints() } void -db_clear_watchpoints() +db_clear_watchpoints(void) { db_watchpoints_inserted = FALSE; } #ifdef notused static boolean_t -db_find_watchpoint(map, addr, regs) - vm_map_t map; - db_addr_t addr; - db_regs_t *regs; +db_find_watchpoint(vm_map_t map, db_addr_t addr, db_regs_t regs) { register db_watchpoint_t watch; db_watchpoint_t found = 0; @@ -295,16 +280,13 @@ db_find_watchpoint(map, addr, regs) /* Delete hardware watchpoint */ /*ARGSUSED*/ void -db_deletehwatch_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_deletehwatch_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, + char *modif) { int rc; - if (count < 0) - count = 4; + if (count < 0) + count = 4; rc = db_md_clr_watchpoint(addr, count); if (rc < 0) @@ -314,16 +296,13 @@ db_deletehwatch_cmd(addr, have_addr, cou /* Set hardware watchpoint */ /*ARGSUSED*/ void -db_hwatchpoint_cmd(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_hwatchpoint_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, + char *modif) { int rc; - if (count < 0) - count = 4; + if (count < 0) + count = 4; rc = db_md_set_watchpoint(addr, count); if (rc < 0) Modified: stable/10/sys/ddb/db_watch.h ============================================================================== --- stable/10/sys/ddb/db_watch.h Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_watch.h Sat Oct 18 19:22:59 2014 (r273265) @@ -27,7 +27,7 @@ */ /* - * Author: David B. Golub, Carnegie Mellon University + * Author: David B. Golub, Carnegie Mellon University * Date: 10/90 */ Modified: stable/10/sys/ddb/db_write_cmd.c ============================================================================== --- stable/10/sys/ddb/db_write_cmd.c Sat Oct 18 19:01:07 2014 (r273264) +++ stable/10/sys/ddb/db_write_cmd.c Sat Oct 18 19:22:59 2014 (r273265) @@ -43,11 +43,8 @@ __FBSDID("$FreeBSD$"); */ /*ARGSUSED*/ void -db_write_cmd(address, have_addr, count, modif) - db_expr_t address; - boolean_t have_addr; - db_expr_t count; - char * modif; +db_write_cmd(db_expr_t address, boolean_t have_addr, db_expr_t count, + char * modif) { register db_addr_t addr;