From owner-svn-src-stable-10@freebsd.org Sun May 1 16:49:33 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B850B29ABB; Sun, 1 May 2016 16:49:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6DB341329; Sun, 1 May 2016 16:49:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41GnWxh024193; Sun, 1 May 2016 16:49:32 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GnWVd024192; Sun, 1 May 2016 16:49:32 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201605011649.u41GnWVd024192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sun, 1 May 2016 16:49:32 +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: r298889 - stable/10/usr.sbin/jail 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.22 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, 01 May 2016 16:49:33 -0000 Author: jamie Date: Sun May 1 16:49:32 2016 New Revision: 298889 URL: https://svnweb.freebsd.org/changeset/base/298889 Log: MFC r298888: typo Submitted by: Jimmy Olgeni Modified: stable/10/usr.sbin/jail/jail.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/jail.8 ============================================================================== --- stable/10/usr.sbin/jail/jail.8 Sun May 1 16:48:03 2016 (r298888) +++ stable/10/usr.sbin/jail/jail.8 Sun May 1 16:49:32 2016 (r298889) @@ -653,7 +653,7 @@ its keys. If set to .Dq disable , the jail cannot perform any sysvmsg-related system calls. -.It Va sysvsem, sysvmsg +.It Va sysvsem, sysvshm Allow access to SYSV IPC semaphore and shared memory primitives, in the same manner as .Va sysvmsg. From owner-svn-src-stable-10@freebsd.org Mon May 2 05:46:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88A03B2A245; Mon, 2 May 2016 05:46:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 1E4F21F1D; Mon, 2 May 2016 05:46:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u425kn9f061305; Mon, 2 May 2016 05:46:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u425kmHi061290; Mon, 2 May 2016 05:46:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605020546.u425kmHi061290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 2 May 2016 05:46: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: r298920 - in stable/10: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src lib/libmagic 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.22 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, 02 May 2016 05:46:50 -0000 Author: delphij Date: Mon May 2 05:46:47 2016 New Revision: 298920 URL: https://svnweb.freebsd.org/changeset/base/298920 Log: MFC r298192: MFV r298178: Update file to 5.26. Relnotes: yes Added: stable/10/contrib/file/magic/Magdir/bioinformatics - copied unchanged from r298192, head/contrib/file/magic/Magdir/bioinformatics stable/10/contrib/file/magic/Magdir/coff - copied unchanged from r298192, head/contrib/file/magic/Magdir/coff stable/10/contrib/file/magic/Magdir/der - copied unchanged from r298192, head/contrib/file/magic/Magdir/der stable/10/contrib/file/magic/Magdir/finger - copied unchanged from r298192, head/contrib/file/magic/Magdir/finger stable/10/contrib/file/magic/Magdir/flif - copied unchanged from r298192, head/contrib/file/magic/Magdir/flif stable/10/contrib/file/magic/Magdir/microfocus - copied unchanged from r298192, head/contrib/file/magic/Magdir/microfocus stable/10/contrib/file/magic/Magdir/polyml - copied unchanged from r298192, head/contrib/file/magic/Magdir/polyml stable/10/contrib/file/magic/Magdir/vacuum-cleaner - copied unchanged from r298192, head/contrib/file/magic/Magdir/vacuum-cleaner stable/10/contrib/file/src/der.c - copied unchanged from r298192, head/contrib/file/src/der.c stable/10/contrib/file/src/der.h - copied unchanged from r298192, head/contrib/file/src/der.h stable/10/contrib/file/src/dprintf.c - copied unchanged from r298192, head/contrib/file/src/dprintf.c Modified: stable/10/contrib/file/ChangeLog stable/10/contrib/file/README stable/10/contrib/file/config.h.in stable/10/contrib/file/configure stable/10/contrib/file/configure.ac stable/10/contrib/file/doc/file.man stable/10/contrib/file/doc/libmagic.man stable/10/contrib/file/magic/Magdir/android stable/10/contrib/file/magic/Magdir/animation stable/10/contrib/file/magic/Magdir/apple stable/10/contrib/file/magic/Magdir/archive stable/10/contrib/file/magic/Magdir/audio stable/10/contrib/file/magic/Magdir/c-lang stable/10/contrib/file/magic/Magdir/cafebabe stable/10/contrib/file/magic/Magdir/commands stable/10/contrib/file/magic/Magdir/compress stable/10/contrib/file/magic/Magdir/console stable/10/contrib/file/magic/Magdir/database stable/10/contrib/file/magic/Magdir/filesystems stable/10/contrib/file/magic/Magdir/fonts stable/10/contrib/file/magic/Magdir/fortran stable/10/contrib/file/magic/Magdir/hitachi-sh stable/10/contrib/file/magic/Magdir/images stable/10/contrib/file/magic/Magdir/intel stable/10/contrib/file/magic/Magdir/java stable/10/contrib/file/magic/Magdir/lisp stable/10/contrib/file/magic/Magdir/mach stable/10/contrib/file/magic/Magdir/macintosh stable/10/contrib/file/magic/Magdir/misctools stable/10/contrib/file/magic/Magdir/modem stable/10/contrib/file/magic/Magdir/msdos stable/10/contrib/file/magic/Magdir/msvc stable/10/contrib/file/magic/Magdir/msx stable/10/contrib/file/magic/Magdir/netbsd stable/10/contrib/file/magic/Magdir/psdbms stable/10/contrib/file/magic/Magdir/python stable/10/contrib/file/magic/Magdir/sendmail stable/10/contrib/file/magic/Magdir/sgml stable/10/contrib/file/magic/Magdir/sinclair stable/10/contrib/file/magic/Magdir/sql stable/10/contrib/file/magic/Magdir/terminfo stable/10/contrib/file/magic/Magdir/windows stable/10/contrib/file/magic/Magdir/wordprocessors stable/10/contrib/file/magic/Makefile.am stable/10/contrib/file/magic/Makefile.in stable/10/contrib/file/python/README stable/10/contrib/file/python/magic.py stable/10/contrib/file/python/setup.py stable/10/contrib/file/src/Makefile.am stable/10/contrib/file/src/Makefile.in stable/10/contrib/file/src/apprentice.c stable/10/contrib/file/src/ascmagic.c stable/10/contrib/file/src/compress.c stable/10/contrib/file/src/file.c stable/10/contrib/file/src/file.h stable/10/contrib/file/src/file_opts.h stable/10/contrib/file/src/fmtcheck.c stable/10/contrib/file/src/funcs.c stable/10/contrib/file/src/magic.c stable/10/contrib/file/src/magic.h stable/10/contrib/file/src/print.c stable/10/contrib/file/src/readcdf.c stable/10/contrib/file/src/readelf.c stable/10/contrib/file/src/readelf.h stable/10/contrib/file/src/softmagic.c stable/10/lib/libmagic/Makefile stable/10/lib/libmagic/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/file/ChangeLog ============================================================================== --- stable/10/contrib/file/ChangeLog Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/ChangeLog Mon May 2 05:46:47 2016 (r298920) @@ -1,3 +1,49 @@ +2016-04-16 18:34 Christos Zoulas + + * release 5.25 + +2016-03-31 13:50 Christos Zoulas + + * make the number of bytes read from files configurable. + +2016-03-21 13:40 Christos Zoulas + + * Add bounds checks for DER code (discovered by Thomas Jarosch) + * Change indirect recursion limit to indirect use count and + bump from 15 to 50 to prevent abuse. + +2016-03-13 20:39 Christos Zoulas + + * Add -00 which prints filename\0description\0 + +2016-03-01 13:28 Christos Zoulas + + * Fix ID3 indirect parsing + +2016-01-19 10:18 Christos Zoulas + + * add DER parsing capability + +2015-11-13 10:35 Christos Zoulas + + * provide dprintf(3) for the OS's that don't have it. + +2015-11-11 16:25 Christos Zoulas + + * redo the compression code report decompression errors + +2015-11-10 23:25 Christos Zoulas + + * REG_STARTEND code is not working as expected, delete it. + +2015-11-09 16:05 Christos Zoulas + + * Add zlib support if we have it. + +2015-11-05 11:22 Christos Zoulas + + * PR/492: compression forking was broken with magic_buffer. + 2015-09-16 9:50 Christos Zoulas * release 5.25 Modified: stable/10/contrib/file/README ============================================================================== --- stable/10/contrib/file/README Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/README Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ ## README for file(1) Command ## - @(#) $File: README,v 1.49 2015/01/02 20:23:04 christos Exp $ + @(#) $File: README,v 1.50 2016/04/16 22:40:54 christos Exp $ Mailing List: file@mx.gw.com Mailing List archives: http://mx.gw.com/pipermail/file/ @@ -67,17 +67,41 @@ in magic(5) format please, to the mainta COPYING - read this first. README - read this second (you are currently reading this file). INSTALL - read on how to install +src/localtime_r.c +src/magic.c +src/magic.h +src/mygetopt.h +src/newtest2.c +src/newtest3.c +src/pread.c +src/print.c +src/readcdf.c +src/readelf.c +src/readelf.h +src/regex.c +src/regex2.c +src/softmagic.c +src/strcasestr.c +src/strlcat.c +src/strlcpy.c +src/strndup.c +src/tar.h +src/teststrchr.c +src/vasprintf.c +src/x.c src/apprentice.c - parses /etc/magic to learn magic -src/asctime_r.c - replacement for OS's that don't have it. src/apptype.c - used for OS/2 specific application type magic -src/asprintf.c - replacement for OS's that don't have it. src/ascmagic.c - third & last set of tests, based on hardwired assumptions. src/asctime_r.c - replacement for OS's that don't have it. src/asprintf.c - replacement for OS's that don't have it. +src/asctime_r.c - replacement for OS's that don't have it. +src/asprintf.c - replacement for OS's that don't have it. src/cdf.[ch] - parser for Microsoft Compound Document Files src/cdf_time.c - time converter for CDF. src/compress.c - handles decompressing files to look inside. src/ctime_r.c - replacement for OS's that don't have it. +src/der.[ch] - parser for Distinguished Encoding Rules +src/dprintf.c - replacement for OS's that don't have it. src/elfclass.h - common code for elf 32/64. src/encoding.c - handles unicode encodings src/file.c - the main program @@ -88,10 +112,13 @@ src/fsmagic.c - first set of tests the p src/funcs.c - utilility functions src/getline.c - replacement for OS's that don't have it. src/getopt_long.c - replacement for OS's that don't have it. -src/is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore). -src/names.h - header file for ascmagic.c +src/gmtime_r.c - replacement for OS's that don't have it. +src/is_tar.c, tar.h - knows about Tape ARchive format (courtesy John Gilmore). +src/localtime_r.c - replacement for OS's that don't have it. src/magic.h.in - source file for magic.h +src/mygetopt.h - replacement for OS's that don't have it. src/magic.c - the libmagic api +src/names.h - header file for ascmagic.c src/pread.c - replacement for OS's that don't have it. src/print.c - print results, errors, warnings. src/readcdf.c - CDF wrapper. Modified: stable/10/contrib/file/config.h.in ============================================================================== --- stable/10/contrib/file/config.h.in Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/config.h.in Mon May 2 05:46:47 2016 (r298920) @@ -32,6 +32,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `dprintf' function. */ +#undef HAVE_DPRINTF + /* Define to 1 if you have the header file. */ #undef HAVE_ERR_H Modified: stable/10/contrib/file/configure ============================================================================== --- stable/10/contrib/file/configure Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/configure Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.25. +# Generated by GNU Autoconf 2.69 for file 5.26. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.25' -PACKAGE_STRING='file 5.25' +PACKAGE_VERSION='5.26' +PACKAGE_STRING='file 5.26' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.25 to adapt to many kinds of systems. +\`configure' configures file 5.26 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.25:";; + short | recursive ) echo "Configuration of file 5.26:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.25 +file configure 5.26 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.25, which was +It was created by file $as_me 5.26, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.25' + VERSION='5.26' cat >>confdefs.h <<_ACEOF @@ -14385,6 +14385,19 @@ esac fi +ac_fn_c_check_func "$LINENO" "dprintf" "ac_cv_func_dprintf" +if test "x$ac_cv_func_dprintf" = xyes; then : + $as_echo "#define HAVE_DPRINTF 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" dprintf.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dprintf.$ac_objext" + ;; +esac + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 @@ -15036,7 +15049,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.25, which was +This file was extended by file $as_me 5.26, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15102,7 +15115,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.25 +file config.status 5.26 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/10/contrib/file/configure.ac ============================================================================== --- stable/10/contrib/file/configure.ac Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/configure.ac Mon May 2 05:46:47 2016 (r298920) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.25],[christos@astron.com]) +AC_INIT([file],[5.26],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -145,7 +145,7 @@ dnl Checks for functions AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale) dnl Provide implementation of some required functions if necessary -AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck) +AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf) dnl Checks for libraries AC_CHECK_LIB(z,gzopen) Modified: stable/10/contrib/file/doc/file.man ============================================================================== --- stable/10/contrib/file/doc/file.man Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/doc/file.man Mon May 2 05:46:47 2016 (r298920) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.118 2015/09/11 17:24:09 christos Exp $ -.Dd September 11, 2015 +.\" $File: file.man,v 1.120 2016/03/31 17:51:12 christos Exp $ +.Dd March 13, 2016 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -317,6 +317,7 @@ Set various parameter limits. .It Li elf_phnum Ta 128 Ta max ELF program sections processed .It Li elf_shnum Ta 32768 Ta max ELF sections processed .It Li regex Ta 8192 Ta length limit for regex searches +.It Li bytes Ta 1048576 Ta max number of bytes to read from file .El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. @@ -358,6 +359,11 @@ Nice to .Xr cut 1 the output. This does not affect the separator, which is still printed. +.Pp +If this option is repeated more than once, then +.Nm +prints just the filename followed by a NUL followed by the description +(or ERROR: text) followed by a second NUL for each entry. .It Fl -help Print a help message and exit. .El Modified: stable/10/contrib/file/doc/libmagic.man ============================================================================== --- stable/10/contrib/file/doc/libmagic.man Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/doc/libmagic.man Mon May 2 05:46:47 2016 (r298920) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.38 2015/09/11 17:24:09 christos Exp $ +.\" $File: libmagic.man,v 1.40 2016/03/31 17:51:12 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -225,7 +225,7 @@ It returns 0 on success and \-1 on failu .Pp The .Fn magic_compile -function can be used to compile the the colon +function can be used to compile the colon separated list of database files passed in as .Ar filename , or @@ -251,7 +251,7 @@ for the default database. .Pp The .Fn magic_load -function must be used to load the the colon +function must be used to load the colon separated list of database files passed in as .Ar filename , or @@ -282,7 +282,7 @@ The .Fn magic_getparam and .Fn magic_setparam -allow getting and setting various limits related to the the magic +allow getting and setting various limits related to the magic library. .Bl -column "MAGIC_PARAM_ELF_PHNUM_MAX" "size_t" "Default" -offset indent .It Sy "Parameter" Ta Sy "Type" Ta Sy "Default" @@ -292,6 +292,7 @@ library. .It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128 .It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768 .It Li MAGIC_PARAM_REGEX_MAX Ta size_t Ta 8192 +.It Li MAGIC_PARAM_BYTES_MAX Ta size_t Ta 1048576 .El .Pp The Modified: stable/10/contrib/file/magic/Magdir/android ============================================================================== --- stable/10/contrib/file/magic/Magdir/android Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/android Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #------------------------------------------------------------ -# $File: android,v 1.8 2015/03/19 18:04:37 christos Exp $ +# $File: android,v 1.9 2016/01/11 21:19:18 christos Exp $ # Various android related magic entries #------------------------------------------------------------ @@ -128,7 +128,7 @@ # partition size in blocks ? #>>>>0x22 ulelong x \b*%d -# Android bootimg format +# Android sparse img format # From https://android.googlesource.com/\ # platform/system/core/+/master/libsparse/sparse_format.h 0 lelong 0xed26ff3a Android sparse image Modified: stable/10/contrib/file/magic/Magdir/animation ============================================================================== --- stable/10/contrib/file/magic/Magdir/animation Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/animation Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: animation,v 1.56 2014/10/23 23:12:51 christos Exp $ +# $File: animation,v 1.57 2015/11/29 22:11:07 christos Exp $ # animation: file(1) magic for animation/movie formats # # animation formats @@ -76,6 +76,8 @@ >8 string da2b \b, DMB MAF, ext da2a, with 3GPP timed text, DID, TVA, REL, IPMP >8 string da3a \b, DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images >8 string da3b \b, DMB MAF, ext da3a w/ BIFS, 3GPP, DID, TVA, REL, IPMP +>8 string dash \b, MPEG v4 system, Dynamic Adaptive Streaming over HTTP +!:mime video/mp4 >8 string dmb1 \b, DMB MAF supporting all the components defined in the spec >8 string dmpf \b, Digital Media Project >8 string drc1 \b, Dirac (wavelet compression), encap in ISO base media (MP4) Modified: stable/10/contrib/file/magic/Magdir/apple ============================================================================== --- stable/10/contrib/file/magic/Magdir/apple Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/apple Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: apple,v 1.31 2015/08/29 07:10:35 christos Exp $ +# $File: apple,v 1.32 2015/12/04 20:40:10 christos Exp $ # apple: file(1) magic for Apple file formats # 0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text @@ -65,18 +65,48 @@ # Eric Fischer # AppleWorks word processor: -# -# This matches the standard tab stops for an AppleWorks file, but if -# a file has a tab stop set in the first four columns this will fail. -# +# URL: https://en.wikipedia.org/wiki/AppleWorks +# Reference: http://www.gno.org/pub/apple2/doc/apple/filetypes/ftn.1a.xxxx +# Update: Joerg Jenderek +# NOTE: # The "O" is really the magic number, but that's so common that it's # necessary to check the tab stops that follow it to avoid false positives. - -4 string O==== AppleWorks word processor data ->85 byte&0x01 >0 \b, zoomed ->90 byte&0x01 >0 \b, paginated ->92 byte&0x01 >0 \b, with mail merge -#>91 byte x \b, left margin %d +# and/or look for unused bits of booleans bytes like zoom, paginated, mail merge +# the newer AppleWorks is from claris with extension CWK +4 string O +# test for unused bits of zoom- , paginated-boolean bytes +>84 ubequad ^0x00Fe00000000Fe00 +# look for tabstop definitions "=" no tab, "|" no tab +# "<" left tab,"^" center tab,">" right tab, "." decimal tab, +# unofficial "!" other , "\x8a" other +# official only if SFMinVers is nonzero +>>5 regex/s [=.<>|!^\x8a]{79} AppleWorks Word Processor +# AppleWorks Word Processor File (Apple II) +# ./apple (version 5.25) labeled the entry as "AppleWorks word processor data" +# application/x-appleworks is mime type for claris version with cwk extension +!:mime application/x-appleworks3 +# http://home.earthlink.net/~hughhood/appleiiworksenvoy/ +# ('p' + 1-byte ProDOS File Type + 2-byte ProDOS Aux Type') +# $70 $1A $F8 $FF is this the apple type ? +#:apple pdospøÿ +!:ext awp +# minimum version needed to read this files. SFMinVers (0 , 30~3.0 ) +>>>183 ubyte 30 3.0 +>>>183 ubyte !30 +>>>>183 ubyte !0 0x%x +# usual tabstop start sequence "=====<" +>>>5 string x \b, tabstop ruler "%6.6s" +# tabstop ruler +#>>>5 string >\0 \b, tabstops "%-79s" +# zoom switch +>>>85 byte&0x01 >0 \b, zoomed +# whether paginated +>>>90 byte&0x01 >0 \b, paginated +# contains any mail-merge commands +>>>92 byte&0x01 >0 \b, with mail merge +# left margin in 1/10 inches ( normally 0 or 10 ) +>>>91 ubyte >0 +>>>>91 ubyte x \b, %d/10 inch left margin # AppleWorks database: # Modified: stable/10/contrib/file/magic/Magdir/archive ============================================================================== --- stable/10/contrib/file/magic/Magdir/archive Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/archive Mon May 2 05:46:47 2016 (r298920) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.91 2015/09/16 13:49:33 christos Exp $ +# $File: archive,v 1.102 2016/01/11 20:59:24 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -246,7 +246,15 @@ # BA # TODO: idarc says "bytes 0-2 == bytes 3-5" # TTComp -0 string \0\6 TTComp archive data +# URL: http://fileformats.archiveteam.org/wiki/TTComp_archive +# Update: Joerg Jenderek +# GRR: line below is too general as it matches also Panorama database "TCDB 2003-10 demo.pan", others +0 string \0\6 +# look for first keyword of Panorama database *.pan +>12 search/261 DESIGN +# skip keyword with low entropy +>12 default x TTComp archive, binary, 4K dictionary +# (version 5.25) labeled the above entry as "TTComp archive data" # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation? 0 string ESP ESP archive data # ZPack @@ -544,55 +552,212 @@ >>0x36 string >\0 fstype %.8s # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu) -2 string -lh0- LHarc 1.x/ARX archive data [lh0] -!:mime application/x-lharc -2 string -lh1- LHarc 1.x/ARX archive data [lh1] -!:mime application/x-lharc -2 string -lz4- LHarc 1.x archive data [lz4] -!:mime application/x-lharc -2 string -lz5- LHarc 1.x archive data [lz5] -!:mime application/x-lharc +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/LHA_(file_format) +# Reference: http://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html +# +# check and display information of lharc (LHa,PMarc) file +0 name lharc-file +# check 1st character of method id like -lz4- -lh5- or -pm2- +>2 string - +# check 5th character of method id +>>6 string - +# check header level 0 1 2 3 +>>>20 ubyte <4 +# check 2nd, 3th and 4th character of method id +>>>>3 regex \^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1) \b +!:mime application/x-lzh-compressed +# creator type "LHA " +!:apple ????LHA +# display archive type name like "LHa/LZS archive data" or "LArc archive" +>>>>>2 string -lz \b +!:ext lzs +# already known -lzs- -lz4- -lz5- with old names +>>>>>>2 string -lzs LHa/LZS archive data +>>>>>>3 regex \^lz[45] LHarc 1.x archive data +# missing -lz?- with wikipedia names +>>>>>>3 regex \^lz[2378] LArc archive +# display archive type name like "LHa (2.x) archive data" +>>>>>2 string -lh \b +# already known -lh0- -lh1- -lh2- -lh3- -lh4- -lh5- -lh6- -lh7- -lhd- variants with old names +>>>>>>3 regex \^lh[01] LHarc 1.x/ARX archive data +# LHice archiver use ".ICE" as name extension instead usual one ".lzh" +# FOOBAR archiver use ".foo" as name extension instead usual one +# "Florain Orjanov's and Olga Bachetska's ARchiver" not found at the moment +>>>>>>>2 string -lh1 \b +!:ext lha/lzh/ice +>>>>>>3 regex \^lh[23d] LHa 2.x? archive data +>>>>>>3 regex \^lh[7] LHa (2.x)/LHark archive data +>>>>>>3 regex \^lh[456] LHa (2.x) archive data +>>>>>>>2 string -lh5 \b +# https://en.wikipedia.org/wiki/BIOS +# Some mainboard BIOS like Award use LHa compression. So archives with unusal extension are found like +# bios.rom , kd7_v14.bin, 1010.004, ... +!:ext lha/lzh/rom/bin +# missing -lh?- variants (Joe Jared) +>>>>>>3 regex \^lh[89a-ce] LHa (Joe Jared) archive +# UNLHA32 2.67a +>>>>>>2 string -lhx LHa (UNLHA32) archive +# lha archives with standard file name extensions ".lha" ".lzh" +>>>>>>3 regex !\^(lh1|lh5) \b +!:ext lha/lzh +# this should not happen if all -lh variants are described +>>>>>>2 default x LHa (unknown) archive +#!:ext lha +# PMarc +>>>>>3 regex \^pm[012] PMarc archive data +!:ext pma +# append method id without leading and trailing minus character +>>>>>3 string x [%3.3s] +>>>>>>0 use lharc-header +# +# check and display information of lharc header +0 name lharc-header +# header size 0x4 , 0x1b-0x61 +>0 ubyte x +# compressed data size != compressed file size +#>7 ulelong x \b, data size %d +# attribute: 0x2~?? 0x10~symlink|target 0x20~normal +#>19 ubyte x \b, 19_0x%x +# level identifier 0 1 2 3 +#>20 ubyte x \b, level %d +# time stamp +#>15 ubelong x DATE 0x%8.8x +# OS ID for level 1 +>20 ubyte 1 +# 0x20 types find for *.rom files +>>(21.b+24) ubyte <0x21 \b, 0x%x OS +# ascii type like M for MSDOS +>>(21.b+24) ubyte >0x20 \b, '%c' OS +# OS ID for level 2 +>20 ubyte 2 +#>>23 ubyte x \b, OS ID 0x%x +>>23 ubyte <0x21 \b, 0x%x OS +>>23 ubyte >0x20 \b, '%c' OS +# filename only for level 0 and 1 +>20 ubyte <2 +# length of filename +>>21 ubyte >0 \b, with +# filename +>>>21 pstring x "%s" +# +#2 string -lh0- LHarc 1.x/ARX archive data [lh0] +#!:mime application/x-lharc +2 string -lh0- +>0 use lharc-file +#2 string -lh1- LHarc 1.x/ARX archive data [lh1] +#!:mime application/x-lharc +2 string -lh1- +>0 use lharc-file +# NEW -lz2- ... -lz8- +2 string -lz2- +>0 use lharc-file +2 string -lz3- +>0 use lharc-file +2 string -lz4- +>0 use lharc-file +2 string -lz5- +>0 use lharc-file +2 string -lz7- +>0 use lharc-file +2 string -lz8- +>0 use lharc-file # [never seen any but the last; -lh4- reported in comp.compression:] -2 string -lzs- LHa/LZS archive data [lzs] -!:mime application/x-lha -2 string -lh\40- LHa 2.x? archive data [lh ] -!:mime application/x-lha -2 string -lhd- LHa 2.x? archive data [lhd] -!:mime application/x-lha -2 string -lh2- LHa 2.x? archive data [lh2] -!:mime application/x-lha -2 string -lh3- LHa 2.x? archive data [lh3] -!:mime application/x-lha -2 string -lh4- LHa (2.x) archive data [lh4] -!:mime application/x-lha -2 string -lh5- LHa (2.x) archive data [lh5] -!:mime application/x-lha -2 string -lh6- LHa (2.x) archive data [lh6] -!:mime application/x-lha -2 string -lh7- LHa (2.x)/LHark archive data [lh7] -!:mime application/x-lha ->20 byte x - header level %d +#2 string -lzs- LHa/LZS archive data [lzs] +2 string -lzs- +>0 use lharc-file +# According to wikipedia and others such a version does not exist +#2 string -lh\40- LHa 2.x? archive data [lh ] +#2 string -lhd- LHa 2.x? archive data [lhd] +2 string -lhd- +>0 use lharc-file +#2 string -lh2- LHa 2.x? archive data [lh2] +2 string -lh2- +>0 use lharc-file +#2 string -lh3- LHa 2.x? archive data [lh3] +2 string -lh3- +>0 use lharc-file +#2 string -lh4- LHa (2.x) archive data [lh4] +2 string -lh4- +>0 use lharc-file +#2 string -lh5- LHa (2.x) archive data [lh5] +2 string -lh5- +>0 use lharc-file +#2 string -lh6- LHa (2.x) archive data [lh6] +2 string -lh6- +>0 use lharc-file +#2 string -lh7- LHa (2.x)/LHark archive data [lh7] +2 string -lh7- +# !:mime application/x-lha +# >20 byte x - header level %d +>0 use lharc-file +# NEW -lh8- ... -lhe- , -lhx- +2 string -lh8- +>0 use lharc-file +2 string -lh9- +>0 use lharc-file +2 string -lha- +>0 use lharc-file +2 string -lhb- +>0 use lharc-file +2 string -lhc- +>0 use lharc-file +2 string -lhe- +>0 use lharc-file +2 string -lhx- +>0 use lharc-file # taken from idarc [JW] 2 string -lZ PUT archive data -2 string -lz LZS archive data +# already done by LHarc magics +# this should never happen if all sub types of LZS archive are identified +#2 string -lz LZS archive data 2 string -sw1- Swag archive data -# RAR archiver (Greg Roelofs, newt@uchicago.edu) -0 string Rar! RAR archive data, +0 name rar-file-header +>24 byte 15 \b, v1.5 +>24 byte 20 \b, v2.0 +>24 byte 29 \b, v4 +>15 byte 0 \b, os: MS-DOS +>15 byte 1 \b, os: OS/2 +>15 byte 2 \b, os: Win32 +>15 byte 3 \b, os: Unix +>15 byte 4 \b, os: Mac OS +>15 byte 5 \b, os: BeOS + +0 name rar-archive-header +>3 leshort&0x1ff >0 \b, flags: +>>3 leshort &0x01 ArchiveVolume +>>3 leshort &0x02 Commented +>>3 leshort &0x04 Locked +>>3 leshort &0x10 NewVolumeNaming +>>3 leshort &0x08 Solid +>>3 leshort &0x20 Authenticated +>>3 leshort &0x40 RecoveryRecordPresent +>>3 leshort &0x80 EncryptedBlockHeader +>>3 leshort &0x100 FirstVolume + +# RAR (Roshal Archive) archive +0 string Rar!\x1a\7\0 RAR archive data +!:mime application/x-rar +!:ext rar/cbr +# file header +>(0xc.l+9) byte 0x74 +>>(0xc.l+7) use rar-file-header +# subblock seems to share information with file header +>(0xc.l+9) byte 0x7a +>>(0xc.l+7) use rar-file-header +>9 byte 0x73 +>>7 use rar-archive-header + +0 string Rar!\x1a\7\1\0 RAR archive data, v5 +!:mime application/x-rar +!:ext rar + +# Very old RAR archive +# http://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf +0 string RE\x7e\x5e RAR archive data (44 byte x v%0x, ->10 byte >0 flags: ->>10 byte &0x01 Archive volume, ->>10 byte &0x02 Commented, ->>10 byte &0x04 Locked, ->>10 byte &0x08 Solid, ->>10 byte &0x20 Authenticated, ->35 byte 0 os: MS-DOS ->35 byte 1 os: OS/2 ->35 byte 2 os: Win32 ->35 byte 3 os: Unix -# some old version? idarc says: -0 string RE\x7e\x5e RAR archive data +!:ext rar/cbr # SQUISH archiver (Greg Roelofs, newt@uchicago.edu) 0 string SQSH squished archive data (Acorn RISCOS) @@ -604,9 +769,12 @@ # PKZIP multi-volume archive 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract !:mime application/zip +!:ext zip/cbz # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 0 string PK\005\006 Zip archive data (empty) +!:mime application/zip +!:ext zip/cbz 0 string PK\003\004 # Specialised zip formats which start with a member named 'mimetype' @@ -764,12 +932,24 @@ 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data # # PMA (CP/M derivative of LHA) +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/LHA_(file_format) # -2 string -pm0- PMarc archive data [pm0] -2 string -pm1- PMarc archive data [pm1] -2 string -pm2- PMarc archive data [pm2] +#2 string -pm0- PMarc archive data [pm0] +2 string -pm0- +>0 use lharc-file +#2 string -pm1- PMarc archive data [pm1] +2 string -pm1- +>0 use lharc-file +#2 string -pm2- PMarc archive data [pm2] +2 string -pm2- +>0 use lharc-file 2 string -pms- PMarc SFX archive (CP/M, DOS) +#!:mime application/x-foobar-exec +!:ext com 5 string -pc1- PopCom compressed executable (CP/M) +#!:mime application/x- +#!:ext com # From Rafael Laboissiere # The Project Revision Control System (see @@ -802,6 +982,9 @@ # Felix von Leitner 0 string d8:announce BitTorrent file !:mime application/x-bittorrent +# Durval Menezes, +0 string d13:announce-list BitTorrent file +!:mime application/x-bittorrent # Atari MSA archive - Teemu Hukkanen 0 beshort 0x0e0f Atari MSA archive data @@ -889,19 +1072,16 @@ # From "Nelson A. de Oliveira" 0 string MPQ\032 MoPaQ (MPQ) archive -# From: Dirk Jagdmann -# xar archive format: http://code.google.com/p/xar/ -0 string xar! xar archive ->6 beshort x - version %d - # From: "Nelson A. de Oliveira" # .kgb 0 string KGB_arch KGB Archiver file >10 string x with compression level %.1s # xar (eXtensible ARchiver) archive +# xar archive format: http://code.google.com/p/xar/ # From: "David Remahl" 0 string xar! xar archive +!:mime application/x-xar #>4 beshort x header size %d >6 beshort x version %d, #>8 quad x compressed TOC: %d, @@ -975,3 +1155,9 @@ >0xE08 search/7776 \x55\xAA >>&-512 indirect x \b; contains +# Google Chrome extensions +# https://developer.chrome.com/extensions/crx +# https://developer.chrome.com/extensions/hosting +0 string Cr24 Google Chrome extension +!:mime application/x-chrome-extension +>4 ulong x \b, version %u Modified: stable/10/contrib/file/magic/Magdir/audio ============================================================================== --- stable/10/contrib/file/magic/Magdir/audio Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/audio Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: audio,v 1.73 2015/03/15 23:21:42 christos Exp $ +# $File: audio,v 1.75 2016/02/08 17:30:11 christos Exp $ # audio: file(1) magic for sound formats (see also "iff") # # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com), @@ -585,7 +585,7 @@ 0 string SC68\ Music-file\ /\ (c)\ (BeN)jami sc68 Atari ST music # musepak support From: "Jiri Pejchal" -0 string MP+ Musepack audio +0 string MP+ Musepack audio (MP+) !:mime audio/x-musepack >3 byte 255 \b, SV pre8 >3 byte&0xF 0x6 \b, SV 6 @@ -619,6 +619,9 @@ >>27 byte 114 \b, Beta 1.14 >>27 byte 115 \b, Alpha 1.15 +0 string MPCK Musepack audio (MPCK) +!:mime audio/x-musepack + # IMY # from http://filext.com/detaillist.php?extdetail=IMY # http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm @@ -715,3 +718,41 @@ 0 string ZBOT >4 byte 0xc5 GVOX Encore music, version < 5.0 +# Summary: Garmin Voice Processing Module (WAVE audios) +# From: Joerg Jenderek +# URL: http://www.garmin.com/ +# Reference: http://turboccc.wikispaces.com/share/view/28622555 +# NOTE: there exist 2 other Garmin VPM formats +0 string AUDIMG +# skip text files starting with string "AUDIMG" +>13 ubyte <13 Garmin Voice Processing Module +!:mime audio/x-vpm-wav-garmin +!:ext vpm +# 3 bytes indicating the voice version (200,220) +>>6 string x \b, version %3.3s +# day of release (01-31) +>>12 ubyte x \b, %.2d +# month of release (01-12) +>>13 ubyte x \b.%.2d +# year of release (like 2006, 2007, 2008) +>>14 uleshort x \b.%.4d +# hour of release (0-23) +>>11 ubyte x %.2d +# minute of release (0-59) +>>10 ubyte x \b:%.2d +# second of release (0-59) +>>9 ubyte x \b:%.2d +# if you select a language like german on your garmin device +# you can only select voice modules with correponding language byte ID like 1 +>>18 ubyte x \b, language ID %d +# pointer to 1st audio WAV sample +>>16 uleshort >0 +>>>(16.s) ulelong >0 \b, at offset 0x%x +# WAV length +>>>>(16.s+4) ulelong >0 %d Bytes +# look for magic +>>>>>(&-8.l) string RIFF +# determine type by ./riff +>>>>>>&-4 indirect x \b +# 2 - ~ 131 WAV samples following same way + Copied: stable/10/contrib/file/magic/Magdir/bioinformatics (from r298192, head/contrib/file/magic/Magdir/bioinformatics) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/file/magic/Magdir/bioinformatics Mon May 2 05:46:47 2016 (r298920, copy of r298192, head/contrib/file/magic/Magdir/bioinformatics) @@ -0,0 +1,178 @@ + +#------------------------------------------------------------------------------ +# $File: bioinformatics,v 1.2 2016/02/14 15:53:53 christos Exp $ +# bioinfomatics: file(1) magic for Bioinfomatics file formats + +############################################################################### +# BGZF (Blocked GNU Zip Format) - gzip compatible, but also indexable +# used by SAMtools bgzip/tabix (http://samtools.sourceforge.net/tabix.shtml) +############################################################################### +0 string \037\213 +>3 byte &0x04 +>>12 string BC +>>>14 leshort &0x02 Blocked GNU Zip Format (BGZF; gzip compatible) +>>>>16 leshort x \b, block length %d +!:mime application/x-gzip + + +############################################################################### +# Tabix index file +# used by SAMtools bgzip/tabix (http://samtools.sourceforge.net/tabix.shtml) +############################################################################### +0 string TBI\1 SAMtools TBI (Tabix index format) +>0x04 lelong =1 \b, with %d reference sequence +>0x04 lelong >1 \b, with %d reference sequences +>0x08 lelong &0x10000 \b, using half-closed-half-open coordinates (BED style) +>0x08 lelong ^0x10000 +>>0x08 lelong =0 \b, using closed and one based coordinates (GFF style) +>>0x08 lelong =1 \b, using SAM format +>>0x08 lelong =2 \b, using VCF format +>0x0c lelong x \b, sequence name column: %d +>0x10 lelong x \b, region start column: %d +>0x08 lelong =0 +>>0x14 lelong x \b, region end column: %d +>0x18 byte x \b, comment character: %c +>0x1c lelong x \b, skip line count: %d + + +############################################################################### +# BAM (Binary Sequence Alignment/Map format) +# used by SAMtools (http://samtools.sourceforge.net/SAM1.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BAM\1 SAMtools BAM (Binary Sequence Alignment/Map) +>0x04 lelong >0 +>>&0x00 regex =^[@]HD\t.*VN: \b, with SAM header +>>>&0 regex =[0-9.]+ \b version %s +>>&(0x04) lelong >0 \b, with %d reference sequences + + +############################################################################### +# BAI (BAM indexing format) +# used by SAMtools (http://samtools.sourceforge.net/SAM1.pdf) +############################################################################### +0 string BAI\1 SAMtools BAI (BAM indexing format) +>0x04 lelong >0 \b, with %d reference sequences + + +############################################################################### +# CRAM (Binary Sequence Alignment/Map format) +############################################################################### +0 string CRAM CRAM +>0x04 byte >-1 version %d. +>0x05 byte >-1 \b%d +>0x06 string >\0 (identified as %s) + + +############################################################################### +# BCF (Binary Call Format), version 1 +# used by SAMtools & VCFtools (http://vcftools.sourceforge.net/bcf.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\4 +# length of seqnm data in bytes is positive +>&0x00 lelong >0 +# length of smpl data in bytes is positive +>>&(&-0x04) lelong >0 SAMtools BCF (Binary Call Format) +# length of meta in bytes +>>>&(&-0x04) lelong >0 +# have meta text string +>>>>&0x00 search ##samtoolsVersion= +>>>>>&0x00 string x \b, generated by SAMtools version %s + + +############################################################################### +# BCF (Binary Call Format), version 2.1 +# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\2\1 Binary Call Format (BCF) version 2.1 +# length of header text +>&0x00 lelong >0 +# have header string +>>&0x00 search ##samtoolsVersion= +>>>&0x00 string x \b, generated by SAMtools version %s + + +############################################################################### +# BCF (Binary Call Format), version 2.2 +# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\2\2 Binary Call Format (BCF) version 2.2 +# length of header text +>&0x00 lelong >0 +# have header string +>>&0x00 search ##samtoolsVersion= +>>>&0x00 string x \b, generated by SAMtools version %s + +############################################################################### +# VCF (Variant Call Format) +# used by VCFtools (http://vcftools.sourceforge.net/) +############################################################################### +0 search ##fileformat=VCFv Variant Call Format (VCF) +>&0 string x \b version %s + +############################################################################### +# FASTQ +# used by MAQ (http://maq.sourceforge.net/fastq.shtml) +############################################################################### +# XXX Broken? +# @ +#0 regex =^@[A-Za-z0-9_.:-]+\?\n +# +#>&1 regex =^[A-Za-z\n.~]++ +# +[] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Tue May 3 07:48:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D72EB2B6C7; Tue, 3 May 2016 07:48:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4CFC516A3; Tue, 3 May 2016 07:48:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437mqki038335; Tue, 3 May 2016 07:48:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437mqlm038331; Tue, 3 May 2016 07:48:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030748.u437mqlm038331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:48: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: r298957 - in stable/10: share/man/man4 sys/amd64/conf sys/dev/wbwd sys/i386/conf 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.22 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, 03 May 2016 07:48:53 -0000 Author: mav Date: Tue May 3 07:48:52 2016 New Revision: 298957 URL: https://svnweb.freebsd.org/changeset/base/298957 Log: MFC r297243: Polish wbwd(4) driver and add more supported chips. Modified: stable/10/share/man/man4/wbwd.4 stable/10/sys/amd64/conf/GENERIC.hints stable/10/sys/dev/wbwd/wbwd.c stable/10/sys/i386/conf/GENERIC.hints Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/wbwd.4 ============================================================================== --- stable/10/share/man/man4/wbwd.4 Tue May 3 07:17:13 2016 (r298956) +++ stable/10/share/man/man4/wbwd.4 Tue May 3 07:48:52 2016 (r298957) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 28, 2012 +.Dd March 24, 2016 .Dt WBWD 4 .Os .Sh NAME .Nm wbwd -.Nd device driver for watchdog timer found on Winbond Super I/O chips +.Nd device driver for Winbond/Nuvoton Super I/O chips watchdog timer .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: @@ -50,18 +50,51 @@ The driver provides .Xr watchdog 4 support for the watchdog interrupt timer present on at least the following -Winbond Super I/O chips: -.Pp +Super I/O chips: .Bl -bullet -compact .It -83627HF/F/HG/G Rev. G +Winbond 83627HF/F/HG/G +.It +Winbond 83627S +.It +Winbond 83697HF +.It +Winbond 83697UG +.It +Winbond 83637HF +.It +Winbond 83627THF +.It +Winbond 83687THF +.It +Winbond 83627EHF +.It +Winbond 83627DHG .It -83627HF/F/HG/G Rev. J +Winbond 83627UHG .It -83627HF/F/HG/G Rev. UD-A +Winbond 83667HG .It -83627DHG IC ver. 5 +Winbond 83627DHG-P +.It +Winbond 83667HG-B +.It +Nuvoton NCT6775 +.It +Nuvoton NCT6776 +.It +Nuvoton NCT6102 +.It +Nuvoton NCT6779 +.It +Nuvoton NCT6791 +.It +Nuvoton NCT6792 .El +.Pp +Driver may be forced to attach to unknown chips by adding to +.Pa /boot/device.hints : +.Cd hint.wbwd.0.at="isa" .Sh SYSCTL VARIABLES The .Nm Modified: stable/10/sys/amd64/conf/GENERIC.hints ============================================================================== --- stable/10/sys/amd64/conf/GENERIC.hints Tue May 3 07:17:13 2016 (r298956) +++ stable/10/sys/amd64/conf/GENERIC.hints Tue May 3 07:48:52 2016 (r298957) @@ -30,6 +30,5 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" -hint.wbwd.0.at="isa" hint.acpi_throttle.0.disabled="1" hint.p4tcc.0.disabled="1" Modified: stable/10/sys/dev/wbwd/wbwd.c ============================================================================== --- stable/10/sys/dev/wbwd/wbwd.c Tue May 3 07:17:13 2016 (r298956) +++ stable/10/sys/dev/wbwd/wbwd.c Tue May 3 07:48:52 2016 (r298957) @@ -91,8 +91,11 @@ __FBSDID("$FreeBSD$"); #define WB_LDN8_CRF7_FORCE 0x20 /* 1: force timeout (self-clear) */ #define WB_LDN8_CRF7_TS 0x10 /* 0: counting, 1: fired */ #define WB_LDN8_CRF7_IRQS 0x0f /* irq source for watchdog, 2 == SMI */ -#define WB_LDN8_CRF7_CLEAR_MASK \ - (WB_LDN8_CRF7_MOUSE|WB_LDN8_CRF7_KEYB|WB_LDN8_CRF7_TS|WB_LDN8_CRF7_IRQS) + +enum chips { w83627hf, w83627s, w83697hf, w83697ug, w83637hf, w83627thf, + w83687thf, w83627ehf, w83627dhg, w83627uhg, w83667hg, + w83627dhg_p, w83667hg_b, nct6775, nct6776, nct6779, nct6791, + nct6792, nct6102 }; struct wb_softc { device_t dev; @@ -103,6 +106,10 @@ struct wb_softc { eventhandler_tag ev_tag; int (*ext_cfg_enter_f)(struct wb_softc *, u_short); void (*ext_cfg_exit_f)(struct wb_softc *, u_short); + enum chips chip; + uint8_t ctl_reg; + uint8_t time_reg; + uint8_t csr_reg; int debug_verbose; /* @@ -144,46 +151,104 @@ struct winbond_superio_cfg { }; struct winbond_vendor_device_id { - uint16_t vendor_id; uint8_t device_id; - uint8_t device_rev; + enum chips chip; const char * descr; } wb_devs[] = { { - .vendor_id = 0x5ca3, .device_id = 0x52, - .device_rev = 0x17, - .descr = "Winbond 83627HF/F/HG/G Rev. G", + .chip = w83627hf, + .descr = "Winbond 83627HF/F/HG/G", }, { - .vendor_id = 0x5ca3, - .device_id = 0x52, - .device_rev = 0x3a, - .descr = "Winbond 83627HF/F/HG/G Rev. J", + .device_id = 0x59, + .chip = w83627s, + .descr = "Winbond 83627S", }, { - .vendor_id = 0x5ca3, - .device_id = 0x52, - .device_rev = 0x41, - .descr = "Winbond 83627HF/F/HG/G Rev. UD-A", + .device_id = 0x60, + .chip = w83697hf, + .descr = "Winbond 83697HF", + }, + { + .device_id = 0x68, + .chip = w83697ug, + .descr = "Winbond 83697UG", + }, + { + .device_id = 0x70, + .chip = w83637hf, + .descr = "Winbond 83637HF", + }, + { + .device_id = 0x82, + .chip = w83627thf, + .descr = "Winbond 83627THF", + }, + { + .device_id = 0x85, + .chip = w83687thf, + .descr = "Winbond 83687THF", + }, + { + .device_id = 0x88, + .chip = w83627ehf, + .descr = "Winbond 83627EHF", }, { - .vendor_id = 0x5ca3, .device_id = 0xa0, - .device_rev = 0x25, - .descr = "Winbond 83627DHG IC ver. 5", + .chip = w83627dhg, + .descr = "Winbond 83627DHG", + }, + { + .device_id = 0xa2, + .chip = w83627uhg, + .descr = "Winbond 83627UHG", + }, + { + .device_id = 0xa5, + .chip = w83667hg, + .descr = "Winbond 83667HG", }, { - .vendor_id = 0x5ca3, .device_id = 0xb0, - .device_rev = 0x73, - .descr = "Winbond 83627DHG-P", + .chip = w83627dhg_p, + .descr = "Winbond 83627DHG-P", + }, + { + .device_id = 0xb3, + .chip = w83667hg_b, + .descr = "Winbond 83667HG-B", + }, + { + .device_id = 0xb4, + .chip = nct6775, + .descr = "Nuvoton NCT6775", }, { - .vendor_id = 0x5ca3, .device_id = 0xc3, - .device_rev = 0x33, - .descr = "Nuvoton WPCM450RA0BX", + .chip = nct6776, + .descr = "Nuvoton NCT6776", + }, + { + .device_id = 0xc4, + .chip = nct6102, + .descr = "Nuvoton NCT6102", + }, + { + .device_id = 0xc5, + .chip = nct6779, + .descr = "Nuvoton NCT6779", + }, + { + .device_id = 0xc8, + .chip = nct6791, + .descr = "Nuvoton NCT6791", + }, + { + .device_id = 0xc9, + .chip = nct6792, + .descr = "Nuvoton NCT6792", }, }; @@ -231,6 +296,22 @@ read_efdr_1(struct wb_softc *sc, u_short return (inb(baseport + 1)); } +static void +write_reg(struct wb_softc *sc, uint8_t reg, uint8_t value) +{ + + write_efir_1(sc, 0, reg); + write_efdr_1(sc, 0, value); +} + +static uint8_t +read_reg(struct wb_softc *sc, uint8_t reg) +{ + + write_efir_1(sc, 0, reg); + return (read_efdr_1(sc, 0)); +} + /* * Return the watchdog related registers as we last read them. This will * usually not give the current timeout or state on whether the watchdog @@ -248,9 +329,9 @@ sysctl_wb_debug(SYSCTL_HANDLER_ARGS) sbuf_new_for_sysctl(&sb, NULL, 64, req); sbuf_printf(&sb, "LDN8 (GPIO2, Watchdog): "); - sbuf_printf(&sb, "CRF5 0x%02x ", sc->reg_1); - sbuf_printf(&sb, "CRF6 0x%02x ", sc->reg_timeout); - sbuf_printf(&sb, "CRF7 0x%02x", sc->reg_2); + sbuf_printf(&sb, "CR%02X 0x%02x ", sc->ctl_reg, sc->reg_1); + sbuf_printf(&sb, "CR%02X 0x%02x ", sc->time_reg, sc->reg_timeout); + sbuf_printf(&sb, "CR%02X 0x%02x", sc->csr_reg, sc->reg_2); error = sbuf_finish(&sb); sbuf_delete(&sb); @@ -269,23 +350,17 @@ sysctl_wb_debug_current(SYSCTL_HANDLER_A sc = arg1; - /* - * Enter extended function mode in case someone else has been - * poking on the registers. We will not leave it though. - */ if ((*sc->ext_cfg_enter_f)(sc, 0) != 0) return (ENXIO); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); + + sc->reg_1 = read_reg(sc, sc->ctl_reg); + sc->reg_timeout = read_reg(sc, sc->time_reg); + sc->reg_2 = read_reg(sc, sc->csr_reg); - write_efir_1(sc, 0, WB_LDN8_CRF5); - sc->reg_1 = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF6); - sc->reg_timeout = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + (*sc->ext_cfg_exit_f)(sc, 0); return (sysctl_wb_debug(oidp, arg1, arg2, req)); } @@ -326,10 +401,6 @@ sysctl_wb_force_test_nmi(SYSCTL_HANDLER_ } #endif - /* - * Enter extended function mode in case someone else has been - * poking on the registers. We will not leave it though. - */ if ((*sc->ext_cfg_enter_f)(sc, 0) != 0) return (ENXIO); @@ -343,16 +414,14 @@ sysctl_wb_force_test_nmi(SYSCTL_HANDLER_ #endif /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); /* Force watchdog to fire. */ - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + sc->reg_2 = read_reg(sc, sc->csr_reg); sc->reg_2 |= WB_LDN8_CRF7_FORCE; + write_reg(sc, sc->csr_reg, sc->reg_2); - write_efir_1(sc, 0, WB_LDN8_CRF7); - write_efdr_1(sc, 0, sc->reg_2); + (*sc->ext_cfg_exit_f)(sc, 0); return (0); } @@ -414,30 +483,36 @@ static int wb_set_watchdog(struct wb_softc *sc, unsigned int timeout) { + if (timeout != 0) { + /* + * In case an override is set, let it override. It may lead + * to strange results as we do not check the input of the sysctl. + */ + if (sc->timeout_override > 0) + timeout = sc->timeout_override; + + /* Make sure we support the requested timeout. */ + if (timeout > 255 * 60) + return (EINVAL); + } + if (sc->debug_verbose) wb_print_state(sc, "Before watchdog counter (re)load"); - /* - * Enter extended function mode in case someone else has been - * poking on the registers. We will not leave it though. - */ if ((*sc->ext_cfg_enter_f)(sc, 0) != 0) return (ENXIO); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog) */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); /* Disable and validate or arm/reset watchdog. */ if (timeout == 0) { /* Disable watchdog. */ - write_efir_1(sc, 0, WB_LDN8_CRF6); - write_efdr_1(sc, 0, 0x00); + write_reg(sc, sc->time_reg, 0x00); + sc->reg_timeout = read_reg(sc, sc->time_reg); + (*sc->ext_cfg_exit_f)(sc, 0); /* Re-check. */ - write_efir_1(sc, 0, WB_LDN8_CRF6); - sc->reg_timeout = read_efdr_1(sc, 0); - if (sc->reg_timeout != 0x00) { device_printf(sc->dev, "Failed to disable watchdog: " "0x%02x.\n", sc->reg_timeout); @@ -445,20 +520,8 @@ wb_set_watchdog(struct wb_softc *sc, uns } } else { - /* - * In case an override is set, let it override. It may lead - * to strange results as we do not check the input of the sysctl. - */ - if (sc->timeout_override > 0) - timeout = sc->timeout_override; - - /* Make sure we support the requested timeout. */ - if (timeout > 255 * 60) - return (EINVAL); - /* Read current scaling factor. */ - write_efir_1(sc, 0, WB_LDN8_CRF5); - sc->reg_1 = read_efdr_1(sc, 0); + sc->reg_1 = read_reg(sc, sc->ctl_reg); if (timeout > 255) { /* Set scaling factor to 60s. */ @@ -473,21 +536,18 @@ wb_set_watchdog(struct wb_softc *sc, uns } /* In case we fired before we need to clear to fire again. */ - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + sc->reg_2 = read_reg(sc, sc->csr_reg); if (sc->reg_2 & WB_LDN8_CRF7_TS) { sc->reg_2 &= ~WB_LDN8_CRF7_TS; - write_efir_1(sc, 0, WB_LDN8_CRF7); - write_efdr_1(sc, 0, sc->reg_2); + write_reg(sc, sc->csr_reg, sc->reg_2); } /* Write back scaling factor. */ - write_efir_1(sc, 0, WB_LDN8_CRF5); - write_efdr_1(sc, 0, sc->reg_1); + write_reg(sc, sc->ctl_reg, sc->reg_1); /* Set timer and arm/reset the watchdog. */ - write_efir_1(sc, 0, WB_LDN8_CRF6); - write_efdr_1(sc, 0, sc->reg_timeout); + write_reg(sc, sc->time_reg, sc->reg_timeout); + (*sc->ext_cfg_exit_f)(sc, 0); } if (sc->debug_verbose) @@ -556,6 +616,7 @@ wb_probe_enable(device_t dev, int probe) struct wb_softc *sc; int error, found, i, j; uint8_t dev_id, dev_rev, cr26; + char buf[128]; if (dev == NULL) sc = NULL; @@ -566,6 +627,7 @@ wb_probe_enable(device_t dev, int probe) } error = ENXIO; + found = 0; for (i = 0; i < sizeof(probe_addrs) / sizeof(*probe_addrs); i++) { if (sc != NULL) { @@ -578,7 +640,6 @@ wb_probe_enable(device_t dev, int probe) sc->bsh = rman_get_bushandle(sc->portres); } - found = 0; error = (*probe_addrs[i].ext_cfg_enter_f)(sc, probe_addrs[i].efer); if (error != 0) goto cleanup; @@ -591,6 +652,9 @@ wb_probe_enable(device_t dev, int probe) write_efir_1(sc, probe_addrs[i].efer, WB_CR26); cr26 = read_efdr_1(sc, probe_addrs[i].efer); + if (dev_id == 0xff && dev_rev == 0xff) + goto cleanup; + /* HEFRAS of 0 means EFER at 0x2e, 1 means EFER at 0x4e. */ if (((cr26 & 0x40) == 0x00 && probe_addrs[i].efer != 0x2e) || ((cr26 & 0x40) == 0x40 && probe_addrs[i].efer != 0x4e)) { @@ -602,36 +666,30 @@ wb_probe_enable(device_t dev, int probe) goto cleanup; } - if (dev_id == 0xff && dev_rev == 0xff) - goto cleanup; - for (j = 0; j < sizeof(wb_devs) / sizeof(*wb_devs); j++) { - if (wb_devs[j].device_id == dev_id && - wb_devs[j].device_rev == dev_rev) { - if (probe && dev != NULL) - device_set_desc(dev, wb_devs[j].descr); - found++; + if (wb_devs[j].device_id == dev_id) { + found = 1; break; } } - if (!found) { - if (probe && dev != NULL) { - device_set_desc(dev, "Unknown Winbond/Nuvoton model"); - device_printf(dev, "DevID 0x%02x DevRev 0x%02x, " - "please report this.\n", dev_id, dev_rev); - } - found++; + if (probe && dev != NULL) { + snprintf(buf, sizeof(buf), + "%s (0x%02x/0x%02x) Watchdog Timer", + found ? wb_devs[j].descr : + "Unknown Winbond/Nuvoton", dev_id, dev_rev); + device_set_desc_copy(dev, buf); + } + + /* If this is hinted attach, try to guess the model. */ + if (dev != NULL && !found) { + found = 1; + j = 0; } - if (probe && found && bootverbose && dev != NULL) - device_printf(dev, "%s EFER 0x%02x ID 0x%02x Rev 0x%02x" - " CR26 0x%02x (probing)\n", device_get_desc(dev), - probe_addrs[i].efer, dev_id, dev_rev, cr26); cleanup: if (probe || !found) { (*probe_addrs[i].ext_cfg_exit_f)(sc, probe_addrs[i].efer); - if (sc != NULL) (void) bus_release_resource(dev, SYS_RES_IOPORT, sc->rid, sc->portres); @@ -646,9 +704,21 @@ cleanup: if (sc != NULL) { sc->ext_cfg_enter_f = probe_addrs[i].ext_cfg_enter_f; sc->ext_cfg_exit_f = probe_addrs[i].ext_cfg_exit_f; + sc->chip = wb_devs[j].chip; + sc->ctl_reg = 0xf5; + sc->time_reg = 0xf6; + sc->csr_reg = 0xf7; + if (sc->chip == w83697hf || + sc->chip == w83697ug) { + sc->ctl_reg = 0xf3; + sc->time_reg = 0xf4; + } else if (sc->chip == nct6102) { + sc->ctl_reg = 0xf0; + sc->time_reg = 0xf1; + sc->csr_reg = 0xf2; + } } - error = BUS_PROBE_DEFAULT; - break; + return (BUS_PROBE_SPECIFIC); } else error = ENXIO; } @@ -659,15 +729,10 @@ cleanup: static void wb_identify(driver_t *driver, device_t parent) { - device_t dev; - if ((dev = device_find_child(parent, driver->name, 0)) == NULL) { - if (wb_probe_enable(dev, 1) != BUS_PROBE_DEFAULT) { - if (bootverbose) - device_printf(dev, "can not find compatible Winbond chip.\n"); - } else - dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); - return; + if (device_find_child(parent, driver->name, 0) == NULL) { + if (wb_probe_enable(NULL, 1) <= 0) + BUS_ADD_CHILD(parent, 0, driver->name, 0); } } @@ -690,6 +755,7 @@ wb_attach(device_t dev) struct sysctl_oid *soid; unsigned long timeout; int error; + uint8_t t; error = wb_probe_enable(dev, 0); if (error > 0) @@ -700,37 +766,95 @@ wb_attach(device_t dev) ("%s: successfull probe result but not setup correctly", __func__)); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); - /* Make sure LDN8 is enabled (Do we need to? Also affects GPIO). */ - write_efir_1(sc, 0, WB_LDN8_CR30); - write_efdr_1(sc, 0, WB_LDN8_CR30_ACTIVE); + /* Make sure WDT is enabled. */ + write_reg(sc, WB_LDN8_CR30, + read_reg(sc, WB_LDN8_CR30) | WB_LDN8_CR30_ACTIVE); + + switch (sc->chip) { + case w83627hf: + case w83627s: + t = read_reg(sc, 0x2B) & ~0x10; + write_reg(sc, 0x2B, t); /* set GPIO24 to WDT0 */ + break; + case w83697hf: + /* Set pin 119 to WDTO# mode (= CR29, WDT0) */ + t = read_reg(sc, 0x29) & ~0x60; + t |= 0x20; + write_reg(sc, 0x29, t); + break; + case w83697ug: + /* Set pin 118 to WDTO# mode */ + t = read_reg(sc, 0x2b) & ~0x04; + write_reg(sc, 0x2b, t); + break; + case w83627thf: + t = (read_reg(sc, 0x2B) & ~0x08) | 0x04; + write_reg(sc, 0x2B, t); /* set GPIO3 to WDT0 */ + break; + case w83627dhg: + case w83627dhg_p: + t = read_reg(sc, 0x2D) & ~0x01; /* PIN77 -> WDT0# */ + write_reg(sc, 0x2D, t); /* set GPIO5 to WDT0 */ + t = read_reg(sc, sc->ctl_reg); + t |= 0x02; /* enable the WDTO# output low pulse + * to the KBRST# pin */ + write_reg(sc, sc->ctl_reg, t); + break; + case w83637hf: + break; + case w83687thf: + t = read_reg(sc, 0x2C) & ~0x80; /* PIN47 -> WDT0# */ + write_reg(sc, 0x2C, t); + break; + case w83627ehf: + case w83627uhg: + case w83667hg: + case w83667hg_b: + case nct6775: + case nct6776: + case nct6779: + case nct6791: + case nct6792: + case nct6102: + /* + * These chips have a fixed WDTO# output pin (W83627UHG), + * or support more than one WDTO# output pin. + * Don't touch its configuration, and hope the BIOS + * does the right thing. + */ + t = read_reg(sc, sc->ctl_reg); + t |= 0x02; /* enable the WDTO# output low pulse + * to the KBRST# pin */ + write_reg(sc, sc->ctl_reg, t); + break; + default: + break; + } /* Read the current watchdog configuration. */ - write_efir_1(sc, 0, WB_LDN8_CRF5); - sc->reg_1 = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF6); - sc->reg_timeout = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + sc->reg_1 = read_reg(sc, sc->ctl_reg); + sc->reg_timeout = read_reg(sc, sc->time_reg); + sc->reg_2 = read_reg(sc, sc->csr_reg); /* Print current state if bootverbose or watchdog already enabled. */ if (bootverbose || (sc->reg_timeout > 0x00)) wb_print_state(sc, "Before watchdog attach"); + sc->reg_1 &= ~WB_LDN8_CRF5_KEYB_P20; + sc->reg_1 |= WB_LDN8_CRF5_KBRST; + write_reg(sc, sc->ctl_reg, sc->reg_1); + /* - * Clear a previous watchdog timeout event (if (still) set). - * Disable all all interrupt reset sources (defaults). + * Clear a previous watchdog timeout event (if still set). + * Disable timer reset on mouse interrupts. Leave reset on keyboard, + * since one of my boards is getting stuck in reboot without it. */ - sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); - sc->reg_1 |= WB_LDN8_CRF5_KBRST; - write_efir_1(sc, 0, WB_LDN8_CRF5); - write_efdr_1(sc, 0, sc->reg_1); + sc->reg_2 &= ~(WB_LDN8_CRF7_MOUSE|WB_LDN8_CRF7_TS); + write_reg(sc, sc->csr_reg, sc->reg_2); - sc->reg_2 &= ~WB_LDN8_CRF7_CLEAR_MASK; - write_efir_1(sc, 0, WB_LDN8_CRF7); - write_efdr_1(sc, 0, sc->reg_2); + (*sc->ext_cfg_exit_f)(sc, 0); /* Read global timeout override tunable, Add per device sysctls. */ if (TUNABLE_ULONG_FETCH("hw.wbwd.timeout_override", &timeout)) { Modified: stable/10/sys/i386/conf/GENERIC.hints ============================================================================== --- stable/10/sys/i386/conf/GENERIC.hints Tue May 3 07:17:13 2016 (r298956) +++ stable/10/sys/i386/conf/GENERIC.hints Tue May 3 07:48:52 2016 (r298957) @@ -38,6 +38,5 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" -hint.wbwd.0.at="isa" hint.acpi_throttle.0.disabled="1" hint.p4tcc.0.disabled="1" From owner-svn-src-stable-10@freebsd.org Tue May 3 07:49:41 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9992B2B78E; Tue, 3 May 2016 07:49:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 86CD519D8; Tue, 3 May 2016 07:49:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437nelV038416; Tue, 3 May 2016 07:49:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437neAd038415; Tue, 3 May 2016 07:49:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030749.u437neAd038415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:49:40 +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: r298958 - stable/10/sys/dev/wbwd 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.22 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, 03 May 2016 07:49:41 -0000 Author: mav Date: Tue May 3 07:49:40 2016 New Revision: 298958 URL: https://svnweb.freebsd.org/changeset/base/298958 Log: MFC r297963: Remove watchdog timer stop check. There are bunch of reports that this check fails at least on Nuvoton NCT6776 chips. I don't see why this check needed there, and Linux does not have it either. So far this check only made watchdogd unstopable. Modified: stable/10/sys/dev/wbwd/wbwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/wbwd/wbwd.c ============================================================================== --- stable/10/sys/dev/wbwd/wbwd.c Tue May 3 07:48:52 2016 (r298957) +++ stable/10/sys/dev/wbwd/wbwd.c Tue May 3 07:49:40 2016 (r298958) @@ -505,19 +505,10 @@ wb_set_watchdog(struct wb_softc *sc, uns /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog) */ write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); - /* Disable and validate or arm/reset watchdog. */ if (timeout == 0) { /* Disable watchdog. */ - write_reg(sc, sc->time_reg, 0x00); - sc->reg_timeout = read_reg(sc, sc->time_reg); - (*sc->ext_cfg_exit_f)(sc, 0); - - /* Re-check. */ - if (sc->reg_timeout != 0x00) { - device_printf(sc->dev, "Failed to disable watchdog: " - "0x%02x.\n", sc->reg_timeout); - return (EIO); - } + sc->reg_timeout = 0; + write_reg(sc, sc->time_reg, sc->reg_timeout); } else { /* Read current scaling factor. */ @@ -547,12 +538,12 @@ wb_set_watchdog(struct wb_softc *sc, uns /* Set timer and arm/reset the watchdog. */ write_reg(sc, sc->time_reg, sc->reg_timeout); - (*sc->ext_cfg_exit_f)(sc, 0); } + (*sc->ext_cfg_exit_f)(sc, 0); + if (sc->debug_verbose) wb_print_state(sc, "After watchdog counter (re)load"); - return (0); } From owner-svn-src-stable-10@freebsd.org Tue May 3 07:50:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1A69B2B8CF; Tue, 3 May 2016 07:50:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AF7811BA2; Tue, 3 May 2016 07:50:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437owG4039161; Tue, 3 May 2016 07:50:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437owti039160; Tue, 3 May 2016 07:50:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030750.u437owti039160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:50:58 +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: r298959 - stable/10/sys/dev/ahci 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.22 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, 03 May 2016 07:51:00 -0000 Author: mav Date: Tue May 3 07:50:58 2016 New Revision: 298959 URL: https://svnweb.freebsd.org/changeset/base/298959 Log: MFC r297921: Add hint.ahci.X.quirks tunable for some odd cases. Modified: stable/10/sys/dev/ahci/ahci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci_pci.c Tue May 3 07:49:40 2016 (r298958) +++ stable/10/sys/dev/ahci/ahci_pci.c Tue May 3 07:50:58 2016 (r298959) @@ -395,6 +395,8 @@ ahci_pci_attach(device_t dev) pci_get_subvendor(dev) == 0x1043 && pci_get_subdevice(dev) == 0x81e4) ctlr->quirks |= AHCI_Q_SATA1_UNIT0; + resource_int_value(device_get_name(dev), device_get_unit(dev), + "quirks", &ctlr->quirks); ctlr->vendorid = pci_get_vendor(dev); ctlr->deviceid = pci_get_device(dev); ctlr->subvendorid = pci_get_subvendor(dev); From owner-svn-src-stable-10@freebsd.org Tue May 3 07:52:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A5A1B2B937; Tue, 3 May 2016 07:52:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 F1B4F1EBD; Tue, 3 May 2016 07:52:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437q7x8041235; Tue, 3 May 2016 07:52:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437q7Uf041233; Tue, 3 May 2016 07:52:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030752.u437q7Uf041233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:52:07 +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: r298960 - stable/10/sys/dev/xen/blkfront 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.22 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, 03 May 2016 07:52:08 -0000 Author: mav Date: Tue May 3 07:52:06 2016 New Revision: 298960 URL: https://svnweb.freebsd.org/changeset/base/298960 Log: MFC r297522: Pass through some new block device features. Modified: stable/10/sys/dev/xen/blkfront/blkfront.c stable/10/sys/dev/xen/blkfront/block.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/10/sys/dev/xen/blkfront/blkfront.c Tue May 3 07:50:58 2016 (r298959) +++ stable/10/sys/dev/xen/blkfront/blkfront.c Tue May 3 07:52:06 2016 (r298960) @@ -849,6 +849,20 @@ xbd_feature_string(struct xbd_softc *sc, feature_cnt++; } + if ((sc->xbd_flags & XBDF_DISCARD) != 0) { + if (feature_cnt != 0) + sbuf_printf(&sb, ", "); + sbuf_printf(&sb, "discard"); + feature_cnt++; + } + + if ((sc->xbd_flags & XBDF_PERSISTENT) != 0) { + if (feature_cnt != 0) + sbuf_printf(&sb, ", "); + sbuf_printf(&sb, "persistent_grants"); + feature_cnt++; + } + (void) sbuf_finish(&sb); return (sbuf_len(&sb)); } @@ -979,7 +993,8 @@ xbd_vdevice_to_unit(uint32_t vdevice, in int xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors, - int vdevice, uint16_t vdisk_info, unsigned long sector_size) + int vdevice, uint16_t vdisk_info, unsigned long sector_size, + unsigned long phys_sector_size) { char features[80]; int unit, error = 0; @@ -1007,6 +1022,8 @@ xbd_instance_create(struct xbd_softc *sc sc->xbd_disk->d_name = name; sc->xbd_disk->d_drv1 = sc; sc->xbd_disk->d_sectorsize = sector_size; + sc->xbd_disk->d_stripesize = phys_sector_size; + sc->xbd_disk->d_stripeoffset = 0; sc->xbd_disk->d_mediasize = sectors * sector_size; sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; @@ -1200,7 +1217,7 @@ static void xbd_connect(struct xbd_softc *sc) { device_t dev = sc->xbd_dev; - unsigned long sectors, sector_size; + unsigned long sectors, sector_size, phys_sector_size; unsigned int binfo; int err, feature_barrier, feature_flush; int i, j; @@ -1223,6 +1240,11 @@ xbd_connect(struct xbd_softc *sc) return; } err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), + "physical-sector-size", "%lu", &phys_sector_size, + NULL); + if (err || phys_sector_size <= sector_size) + phys_sector_size = 0; + err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), "feature-barrier", "%lu", &feature_barrier, NULL); if (err == 0 && feature_barrier != 0) @@ -1324,7 +1346,7 @@ xbd_connect(struct xbd_softc *sc) bus_print_child_footer(device_get_parent(dev), dev); xbd_instance_create(sc, sectors, sc->xbd_vdevice, binfo, - sector_size); + sector_size, phys_sector_size); } (void)xenbus_set_state(dev, XenbusStateConnected); Modified: stable/10/sys/dev/xen/blkfront/block.h ============================================================================== --- stable/10/sys/dev/xen/blkfront/block.h Tue May 3 07:50:58 2016 (r298959) +++ stable/10/sys/dev/xen/blkfront/block.h Tue May 3 07:52:06 2016 (r298960) @@ -159,10 +159,12 @@ typedef enum { XBDF_READY = 1 << 3, /* Is ready */ XBDF_CM_SHORTAGE = 1 << 4, /* Free cm resource shortage active. */ XBDF_GNT_SHORTAGE = 1 << 5, /* Grant ref resource shortage active */ - XBDF_WAIT_IDLE = 1 << 6 /* + XBDF_WAIT_IDLE = 1 << 6, /* * No new work until oustanding work * completes. */ + XBDF_DISCARD = 1 << 7, /* backend supports discard */ + XBDF_PERSISTENT = 1 << 8 /* backend supports persistent grants */ } xbd_flag_t; /* @@ -200,7 +202,8 @@ struct xbd_softc { }; int xbd_instance_create(struct xbd_softc *, blkif_sector_t sectors, int device, - uint16_t vdisk_info, unsigned long sector_size); + uint16_t vdisk_info, unsigned long sector_size, + unsigned long phys_sector_size); static inline void xbd_added_qentry(struct xbd_softc *sc, xbd_q_index_t index) From owner-svn-src-stable-10@freebsd.org Tue May 3 07:56:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A78BFB2BA82; Tue, 3 May 2016 07:56:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7407B1136; Tue, 3 May 2016 07:56:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437ugE1041505; Tue, 3 May 2016 07:56:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437ug6d041504; Tue, 3 May 2016 07:56:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030756.u437ug6d041504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:56: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: r298961 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 07:56:43 -0000 Author: mav Date: Tue May 3 07:56:42 2016 New Revision: 298961 URL: https://svnweb.freebsd.org/changeset/base/298961 Log: MFC r297741: Reduce code duplication when executing Passthrough IOCB. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:52:06 2016 (r298960) +++ stable/10/sys/dev/isp/isp.c Tue May 3 07:56:42 2016 (r298961) @@ -3494,26 +3494,17 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan } static int -isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan) +isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cmd_bcnt, uint32_t rsp_bcnt) { mbreg_t mbs; fcparam *fcp = FCPARAM(isp, chan); union { isp_ct_pt_t plocal; - ct_hdr_t clocal; uint8_t q[QENTRY_LEN]; } un; isp_ct_pt_t *pt; - ct_hdr_t *ct; - uint32_t *rp; uint8_t *scp = fcp->isp_scratch; - isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT via CT", chan); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - return (-1); - } - /* * Build a Passthrough IOCB in memory. */ @@ -3527,39 +3518,21 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); pt->ctp_time = 10; pt->ctp_rsp_cnt = 1; - pt->ctp_rsp_bcnt = GIDLEN; - pt->ctp_cmd_bcnt = sizeof (*ct) + sizeof (uint32_t); + pt->ctp_rsp_bcnt = rsp_bcnt; + pt->ctp_cmd_bcnt = cmd_bcnt; pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_count = sizeof (*ct) + sizeof (uint32_t); + pt->ctp_dataseg[0].ds_count = cmd_bcnt; pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_count = GIDLEN; - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "ct IOCB", QENTRY_LEN, pt); - } - isp_put_ct_pt(isp, pt, (isp_ct_pt_t *) &scp[CTXOFF]); + pt->ctp_dataseg[1].ds_count = rsp_bcnt; + isp_put_ct_pt(isp, pt, (isp_ct_pt_t *)&scp[CTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, &scp[CTXOFF]); /* - * Build the CT header and command in memory. - * - * Note that the CT header has to end up as Big Endian format in memory. + * Execute the Passthrough IOCB. */ - ct = &un.clocal; - ISP_MEMZERO(ct, sizeof (*ct)); - ct->ct_revision = CT_REVISION; - ct->ct_fcs_type = CT_FC_TYPE_FC; - ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; - ct->ct_cmd_resp = SNS_GID_FT; - ct->ct_bcnt_resid = (GIDLEN - 16) >> 2; - - isp_put_ct_hdr(isp, ct, (ct_hdr_t *) &scp[XTXOFF]); - rp = (uint32_t *) &scp[XTXOFF+sizeof (*ct)]; - ISP_IOZPUT_32(isp, FC4_SCSI, rp); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "CT HDR + payload after put", - sizeof (*ct) + sizeof (uint32_t), &scp[XTXOFF]); - } ISP_MEMZERO(&scp[ZTXOFF], QENTRY_LEN); MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); @@ -3574,18 +3547,58 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, return (-1); } MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, &scp[ZTXOFF]); pt = &un.plocal; isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); - } - if (pt->ctp_status && pt->ctp_status != RQCS_DATA_UNDERRUN) { isp_prt(isp, ISP_LOGWARN, "Chan %d GID_FT CT Passthrough returned 0x%x", chan, pt->ctp_status); return (-1); } + + return (0); +} + +static int +isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + ct_hdr_t ct; + uint32_t *rp; + uint8_t *scp = fcp->isp_scratch; + + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT via CT", chan); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + isp_prt(isp, ISP_LOGERR, sacq); + return (-1); + } + + /* + * Build the CT header and command in memory. + * + * Note that the CT header has to end up as Big Endian format in memory. + */ + ISP_MEMZERO(&ct, sizeof (ct)); + ct.ct_revision = CT_REVISION; + ct.ct_fcs_type = CT_FC_TYPE_FC; + ct.ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct.ct_cmd_resp = SNS_GID_FT; + ct.ct_bcnt_resid = (GIDLEN - 16) >> 2; + isp_put_ct_hdr(isp, &ct, (ct_hdr_t *) &scp[XTXOFF]); + rp = (uint32_t *) &scp[XTXOFF + sizeof(ct)]; + ISP_IOZPUT_32(isp, FC4_SCSI, rp); + if (isp->isp_dblev & ISP_LOGDEBUG1) { + isp_print_bytes(isp, "CT request", + sizeof(ct) + sizeof(uint32_t), &scp[XTXOFF]); + } + + if (isp_ct_passthru(isp, chan, sizeof(ct) + sizeof(uint32_t), GIDLEN)) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } + if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_bytes(isp, "CT response", GIDLEN, scp); isp_get_gid_ft_response(isp, (sns_gid_ft_rsp_t *)scp, @@ -3957,16 +3970,9 @@ isp_register_fc4_type(ispsoftc_t *isp, i static int isp_register_fc4_type_24xx(ispsoftc_t *isp, int chan) { - mbreg_t mbs; fcparam *fcp = FCPARAM(isp, chan); - union { - isp_ct_pt_t plocal; - rft_id_t clocal; - uint8_t q[QENTRY_LEN]; - } un; - isp_ct_pt_t *pt; ct_hdr_t *ct; - rft_id_t *rp; + rft_id_t rp; uint8_t *scp = fcp->isp_scratch; if (FC_SCRATCH_ACQUIRE(isp, chan)) { @@ -3975,110 +3981,50 @@ isp_register_fc4_type_24xx(ispsoftc_t *i } /* - * Build a Passthrough IOCB in memory. - */ - ISP_MEMZERO(un.q, QENTRY_LEN); - pt = &un.plocal; - pt->ctp_header.rqs_entry_count = 1; - pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; - pt->ctp_handle = 0xffffffff; - pt->ctp_nphdl = fcp->isp_sns_hdl; - pt->ctp_cmd_cnt = 1; - pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 4; - pt->ctp_rsp_cnt = 1; - pt->ctp_rsp_bcnt = sizeof (ct_hdr_t); - pt->ctp_cmd_bcnt = sizeof (rft_id_t); - pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_count = sizeof (rft_id_t); - pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_count = sizeof (ct_hdr_t); - isp_put_ct_pt(isp, pt, (isp_ct_pt_t *) &scp[CTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB CT Request", QENTRY_LEN, pt); - } - - /* * Build the CT header and command in memory. * * Note that the CT header has to end up as Big Endian format in memory. */ - ISP_MEMZERO(&un.clocal, sizeof (un.clocal)); - ct = &un.clocal.rftid_hdr; + ISP_MEMZERO(&rp, sizeof(rp)); + ct = &rp.rftid_hdr; ct->ct_revision = CT_REVISION; ct->ct_fcs_type = CT_FC_TYPE_FC; ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; ct->ct_cmd_resp = SNS_RFT_ID; ct->ct_bcnt_resid = (sizeof (rft_id_t) - sizeof (ct_hdr_t)) >> 2; - rp = &un.clocal; - rp->rftid_portid[0] = fcp->isp_portid >> 16; - rp->rftid_portid[1] = fcp->isp_portid >> 8; - rp->rftid_portid[2] = fcp->isp_portid; - rp->rftid_fc4types[FC4_SCSI >> 5] = 1 << (FC4_SCSI & 0x1f); - isp_put_rft_id(isp, rp, (rft_id_t *) &scp[XTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "CT Header", QENTRY_LEN, &scp[XTXOFF]); - } - - ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); + rp.rftid_portid[0] = fcp->isp_portid >> 16; + rp.rftid_portid[1] = fcp->isp_portid >> 8; + rp.rftid_portid[2] = fcp->isp_portid; + rp.rftid_fc4types[FC4_SCSI >> 5] = 1 << (FC4_SCSI & 0x1f); + isp_put_rft_id(isp, &rp, (rft_id_t *)&scp[XTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT request", sizeof(rft_id_t), &scp[XTXOFF]); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); - mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); - mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); - mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); - pt = &un.plocal; - isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); - } - if (pt->ctp_status) { - FC_SCRATCH_RELEASE(isp, chan); - isp_prt(isp, ISP_LOGWARN, - "Chan %d Register FC4 Type CT Passthrough returned 0x%x", - chan, pt->ctp_status); - return (1); - } isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct); FC_SCRATCH_RELEASE(isp, chan); - if (ct->ct_cmd_resp == LS_RJT) { isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, "Chan %d Register FC4 Type rejected", chan); return (-1); } else if (ct->ct_cmd_resp == LS_ACC) { isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Register FC4 Type accepted", chan); - return (0); } else { isp_prt(isp, ISP_LOGWARN, "Chan %d Register FC4 Type: 0x%x", chan, ct->ct_cmd_resp); return (-1); } + return (0); } static int isp_register_fc4_features_24xx(ispsoftc_t *isp, int chan) { - mbreg_t mbs; fcparam *fcp = FCPARAM(isp, chan); - union { - isp_ct_pt_t plocal; - rff_id_t clocal; - uint8_t q[QENTRY_LEN]; - } un; - isp_ct_pt_t *pt; ct_hdr_t *ct; - rff_id_t *rp; + rff_id_t rp; uint8_t *scp = fcp->isp_scratch; if (FC_SCRATCH_ACQUIRE(isp, chan)) { @@ -4087,90 +4033,37 @@ isp_register_fc4_features_24xx(ispsoftc_ } /* - * Build a Passthrough IOCB in memory. - */ - ISP_MEMZERO(un.q, QENTRY_LEN); - pt = &un.plocal; - pt->ctp_header.rqs_entry_count = 1; - pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; - pt->ctp_handle = 0xffffffff; - pt->ctp_nphdl = fcp->isp_sns_hdl; - pt->ctp_cmd_cnt = 1; - pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 4; - pt->ctp_rsp_cnt = 1; - pt->ctp_rsp_bcnt = sizeof (ct_hdr_t); - pt->ctp_cmd_bcnt = sizeof (rff_id_t); - pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_count = sizeof (rff_id_t); - pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_count = sizeof (ct_hdr_t); - isp_put_ct_pt(isp, pt, (isp_ct_pt_t *) &scp[CTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB CT Request", QENTRY_LEN, pt); - } - - /* * Build the CT header and command in memory. * * Note that the CT header has to end up as Big Endian format in memory. */ - ISP_MEMZERO(&un.clocal, sizeof (un.clocal)); - ct = &un.clocal.rffid_hdr; + ISP_MEMZERO(&rp, sizeof(rp)); + ct = &rp.rffid_hdr; ct->ct_revision = CT_REVISION; ct->ct_fcs_type = CT_FC_TYPE_FC; ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; ct->ct_cmd_resp = SNS_RFF_ID; ct->ct_bcnt_resid = (sizeof (rff_id_t) - sizeof (ct_hdr_t)) >> 2; - rp = &un.clocal; - rp->rffid_portid[0] = fcp->isp_portid >> 16; - rp->rffid_portid[1] = fcp->isp_portid >> 8; - rp->rffid_portid[2] = fcp->isp_portid; - rp->rffid_fc4features = 0; + rp.rffid_portid[0] = fcp->isp_portid >> 16; + rp.rffid_portid[1] = fcp->isp_portid >> 8; + rp.rffid_portid[2] = fcp->isp_portid; + rp.rffid_fc4features = 0; if (fcp->role & ISP_ROLE_TARGET) - rp->rffid_fc4features |= 1; + rp.rffid_fc4features |= 1; if (fcp->role & ISP_ROLE_INITIATOR) - rp->rffid_fc4features |= 2; - rp->rffid_fc4type = FC4_SCSI; - isp_put_rff_id(isp, rp, (rff_id_t *) &scp[XTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "CT Header", QENTRY_LEN, &scp[XTXOFF]); - } - - ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); + rp.rffid_fc4features |= 2; + rp.rffid_fc4type = FC4_SCSI; + isp_put_rff_id(isp, &rp, (rff_id_t *)&scp[XTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT request", sizeof(rft_id_t), &scp[XTXOFF]); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); - mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); - mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); - mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); - pt = &un.plocal; - isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); - } - if (pt->ctp_status) { - FC_SCRATCH_RELEASE(isp, chan); - isp_prt(isp, ISP_LOGWARN, - "Chan %d Register FC4 Features CT Passthrough returned 0x%x", - chan, pt->ctp_status); - return (1); - } isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct); FC_SCRATCH_RELEASE(isp, chan); - if (ct->ct_cmd_resp == LS_RJT) { isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, "Chan %d Register FC4 Features rejected", chan); @@ -4178,12 +4071,12 @@ isp_register_fc4_features_24xx(ispsoftc_ } else if (ct->ct_cmd_resp == LS_ACC) { isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Register FC4 Features accepted", chan); - return (0); } else { isp_prt(isp, ISP_LOGWARN, "Chan %d Register FC4 Features: 0x%x", chan, ct->ct_cmd_resp); return (-1); } + return (0); } static uint16_t From owner-svn-src-stable-10@freebsd.org Tue May 3 07:57:28 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5200AB2BAEA; Tue, 3 May 2016 07:57:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 10B341292; Tue, 3 May 2016 07:57:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437vRjL041596; Tue, 3 May 2016 07:57:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437vQML041590; Tue, 3 May 2016 07:57:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030757.u437vQML041590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:57:26 +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: r298962 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 07:57:28 -0000 Author: mav Date: Tue May 3 07:57:26 2016 New Revision: 298962 URL: https://svnweb.freebsd.org/changeset/base/298962 Log: MFC r297751: Register symbolic port/node names in FC name server. This is cosmetics that simplifies identification of new ports on FC switch. It would be good to use target name from CTL here instead of hostname, but it is not passed here through CAM now. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/isp_library.h stable/10/sys/dev/isp/isp_stds.h stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp.c Tue May 3 07:57:26 2016 (r298962) @@ -126,6 +126,8 @@ static int isp_send_change_request(ispso static int isp_register_fc4_type(ispsoftc_t *, int); static int isp_register_fc4_type_24xx(ispsoftc_t *, int); static int isp_register_fc4_features_24xx(ispsoftc_t *, int); +static int isp_register_port_name_24xx(ispsoftc_t *, int); +static int isp_register_node_name_24xx(ispsoftc_t *, int); static uint16_t isp_next_handle(ispsoftc_t *, uint16_t *); static int isp_fw_state(ispsoftc_t *, int); static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int); @@ -3073,6 +3075,8 @@ isp_fclink_test(ispsoftc_t *isp, int cha r = isp_register_fc4_type_24xx(isp, chan); if (r == 0) isp_register_fc4_features_24xx(isp, chan); + isp_register_port_name_24xx(isp, chan); + isp_register_node_name_24xx(isp, chan); } else { fcp->isp_sns_hdl = SNS_ID; r = isp_register_fc4_type(isp, chan); @@ -3577,8 +3581,6 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, /* * Build the CT header and command in memory. - * - * Note that the CT header has to end up as Big Endian format in memory. */ ISP_MEMZERO(&ct, sizeof (ct)); ct.ct_revision = CT_REVISION; @@ -3982,8 +3984,6 @@ isp_register_fc4_type_24xx(ispsoftc_t *i /* * Build the CT header and command in memory. - * - * Note that the CT header has to end up as Big Endian format in memory. */ ISP_MEMZERO(&rp, sizeof(rp)); ct = &rp.rftid_hdr; @@ -4034,8 +4034,6 @@ isp_register_fc4_features_24xx(ispsoftc_ /* * Build the CT header and command in memory. - * - * Note that the CT header has to end up as Big Endian format in memory. */ ISP_MEMZERO(&rp, sizeof(rp)); ct = &rp.rffid_hdr; @@ -4079,6 +4077,130 @@ isp_register_fc4_features_24xx(ispsoftc_ return (0); } +static int +isp_register_port_name_24xx(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + ct_hdr_t *ct; + rspn_id_t rp; + uint8_t *scp = fcp->isp_scratch; + int len; + + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + isp_prt(isp, ISP_LOGERR, sacq); + return (-1); + } + + /* + * Build the CT header and command in memory. + */ + ISP_MEMZERO(&rp, sizeof(rp)); + ct = &rp.rspnid_hdr; + ct->ct_revision = CT_REVISION; + ct->ct_fcs_type = CT_FC_TYPE_FC; + ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct->ct_cmd_resp = SNS_RSPN_ID; + rp.rspnid_portid[0] = fcp->isp_portid >> 16; + rp.rspnid_portid[1] = fcp->isp_portid >> 8; + rp.rspnid_portid[2] = fcp->isp_portid; + rp.rspnid_length = 0; + len = offsetof(rspn_id_t, rspnid_name); + mtx_lock(&prison0.pr_mtx); + rp.rspnid_length += sprintf(&scp[XTXOFF + len + rp.rspnid_length], + "%s", prison0.pr_hostname[0] ? prison0.pr_hostname : "FreeBSD"); + mtx_unlock(&prison0.pr_mtx); + rp.rspnid_length += sprintf(&scp[XTXOFF + len + rp.rspnid_length], + ":%s", device_get_nameunit(isp->isp_dev)); + if (chan != 0) { + rp.rspnid_length += sprintf(&scp[XTXOFF + len + + rp.rspnid_length], "/%d", chan); + } + len += rp.rspnid_length; + ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; + isp_put_rspn_id(isp, &rp, (rspn_id_t *)&scp[XTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT request", len, &scp[XTXOFF]); + + if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } + + isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct); + FC_SCRATCH_RELEASE(isp, chan); + if (ct->ct_cmd_resp == LS_RJT) { + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, + "Chan %d Register Symbolic Port Name rejected", chan); + return (-1); + } else if (ct->ct_cmd_resp == LS_ACC) { + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d Register Symbolic Port Name accepted", chan); + } else { + isp_prt(isp, ISP_LOGWARN, + "Chan %d Register Symbolic Port Name: 0x%x", chan, ct->ct_cmd_resp); + return (-1); + } + return (0); +} + +static int +isp_register_node_name_24xx(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + ct_hdr_t *ct; + rsnn_nn_t rp; + uint8_t *scp = fcp->isp_scratch; + int len; + + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + isp_prt(isp, ISP_LOGERR, sacq); + return (-1); + } + + /* + * Build the CT header and command in memory. + */ + ISP_MEMZERO(&rp, sizeof(rp)); + ct = &rp.rsnnnn_hdr; + ct->ct_revision = CT_REVISION; + ct->ct_fcs_type = CT_FC_TYPE_FC; + ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct->ct_cmd_resp = SNS_RSNN_NN; + MAKE_NODE_NAME_FROM_WWN(rp.rsnnnn_nodename, fcp->isp_wwnn); + rp.rsnnnn_length = 0; + len = offsetof(rsnn_nn_t, rsnnnn_name); + mtx_lock(&prison0.pr_mtx); + rp.rsnnnn_length += sprintf(&scp[XTXOFF + len + rp.rsnnnn_length], + "%s", prison0.pr_hostname[0] ? prison0.pr_hostname : "FreeBSD"); + mtx_unlock(&prison0.pr_mtx); + len += rp.rsnnnn_length; + ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; + isp_put_rsnn_nn(isp, &rp, (rsnn_nn_t *)&scp[XTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT request", len, &scp[XTXOFF]); + + if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } + + isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct); + FC_SCRATCH_RELEASE(isp, chan); + if (ct->ct_cmd_resp == LS_RJT) { + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, + "Chan %d Register Symbolic Node Name rejected", chan); + return (-1); + } else if (ct->ct_cmd_resp == LS_ACC) { + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d Register Symbolic Node Name accepted", chan); + } else { + isp_prt(isp, ISP_LOGWARN, + "Chan %d Register Symbolic Node Name: 0x%x", chan, ct->ct_cmd_resp); + return (-1); + } + return (0); +} + static uint16_t isp_next_handle(ispsoftc_t *isp, uint16_t *ohp) { Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp_freebsd.h Tue May 3 07:57:26 2016 (r298962) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp_library.c Tue May 3 07:57:26 2016 (r298962) @@ -1988,6 +1988,17 @@ isp_put_rft_id(ispsoftc_t *isp, rft_id_t } void +isp_put_rspn_id(ispsoftc_t *isp, rspn_id_t *src, rspn_id_t *dst) +{ +/* int i;*/ + isp_put_ct_hdr(isp, &src->rspnid_hdr, &dst->rspnid_hdr); + ISP_IOZPUT_8(isp, src->rspnid_reserved, &dst->rspnid_reserved); + ISP_IOZPUT_8(isp, src->rspnid_length, &dst->rspnid_length); +/* for (i = 0; i < src->rspnid_length; i++) + ISP_IOZPUT_8(isp, src->rspnid_name[i], &dst->rspnid_name[i]);*/ +} + +void isp_put_rff_id(ispsoftc_t *isp, rff_id_t *src, rff_id_t *dst) { int i; @@ -2002,6 +2013,18 @@ isp_put_rff_id(ispsoftc_t *isp, rff_id_t } void +isp_put_rsnn_nn(ispsoftc_t *isp, rsnn_nn_t *src, rsnn_nn_t *dst) +{ + int i; + isp_put_ct_hdr(isp, &src->rsnnnn_hdr, &dst->rsnnnn_hdr); + for (i = 0; i < 8; i++) + ISP_IOZPUT_8(isp, src->rsnnnn_nodename[i], &dst->rsnnnn_nodename[i]); + ISP_IOZPUT_8(isp, src->rsnnnn_length, &dst->rsnnnn_length); +/* for (i = 0; i < src->rsnnnn_length; i++) + ISP_IOZPUT_8(isp, src->rsnnnn_name[i], &dst->rsnnnn_name[i]);*/ +} + +void isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *src, ct_hdr_t *dst) { ISP_IOZGET_8(isp, &src->ct_revision, dst->ct_revision); Modified: stable/10/sys/dev/isp/isp_library.h ============================================================================== --- stable/10/sys/dev/isp/isp_library.h Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp_library.h Tue May 3 07:57:26 2016 (r298962) @@ -144,7 +144,9 @@ void isp_get_fc_hdr(ispsoftc_t *, fc_hdr void isp_put_fc_hdr(ispsoftc_t *, fc_hdr_t *, fc_hdr_t *); void isp_get_fcp_cmnd_iu(ispsoftc_t *, fcp_cmnd_iu_t *, fcp_cmnd_iu_t *); void isp_put_rft_id(ispsoftc_t *, rft_id_t *, rft_id_t *); +void isp_put_rspn_id(ispsoftc_t *, rspn_id_t *, rspn_id_t *); void isp_put_rff_id(ispsoftc_t *, rff_id_t *, rff_id_t *); +void isp_put_rsnn_nn(ispsoftc_t *, rsnn_nn_t *, rsnn_nn_t *); void isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); void isp_put_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); void isp_put_fcp_rsp_iu(ispsoftc_t *isp, fcp_rsp_iu_t *, fcp_rsp_iu_t *); Modified: stable/10/sys/dev/isp/isp_stds.h ============================================================================== --- stable/10/sys/dev/isp/isp_stds.h Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp_stds.h Tue May 3 07:57:26 2016 (r298962) @@ -139,6 +139,19 @@ typedef struct { } rft_id_t; /* + * RSPN_ID Requet CT_IU + * + * Source: INCITS 463-2010 Generic Services 6 Section 5.2.5.32 + */ +typedef struct { + ct_hdr_t rspnid_hdr; + uint8_t rspnid_reserved; + uint8_t rspnid_portid[3]; + uint8_t rspnid_length; + uint8_t rspnid_name[0]; +} rspn_id_t; + +/* * RFF_ID Requet CT_IU * * Source: INCITS 463-2010 Generic Services 6 Section 5.2.5.34 @@ -153,6 +166,18 @@ typedef struct { } rff_id_t; /* + * RSNN_NN Requet CT_IU + * + * Source: INCITS 463-2010 Generic Services 6 Section 5.2.5.35 + */ +typedef struct { + ct_hdr_t rsnnnn_hdr; + uint8_t rsnnnn_nodename[8]; + uint8_t rsnnnn_length; + uint8_t rsnnnn_name[0]; +} rsnn_nn_t; + +/* * FCP Response IU and bits of interest * Source: NCITS T10, Project 1828D, Revision 02b (aka FCP4r02b) */ Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/ispmbox.h Tue May 3 07:57:26 2016 (r298962) @@ -1548,7 +1548,9 @@ typedef struct { #define SNS_GFF_ID 0x11F #define SNS_GID_FT 0x171 #define SNS_RFT_ID 0x217 +#define SNS_RSPN_ID 0x218 #define SNS_RFF_ID 0x21F +#define SNS_RSNN_NN 0x239 typedef struct { uint16_t snscb_rblen; /* response buffer length (words) */ uint16_t snscb_reserved0; From owner-svn-src-stable-10@freebsd.org Tue May 3 07:58:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DA96B2BB55; Tue, 3 May 2016 07:58:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 386F213E5; Tue, 3 May 2016 07:58:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437wBDK041690; Tue, 3 May 2016 07:58:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437wBBt041688; Tue, 3 May 2016 07:58:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030758.u437wBBt041688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:58: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: r298963 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 07:58:12 -0000 Author: mav Date: Tue May 3 07:58:11 2016 New Revision: 298963 URL: https://svnweb.freebsd.org/changeset/base/298963 Log: MFC r297817: Polish debugging IOCB dumping. Add few more missing cases, unify byte order. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_library.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:57:26 2016 (r298962) +++ stable/10/sys/dev/isp/isp.c Tue May 3 07:58:11 2016 (r298963) @@ -1972,10 +1972,12 @@ isp_fibre_init(ispsoftc_t *isp) } isp_prt(isp, ISP_LOGDEBUG0, "isp_fibre_init: fwopt 0x%x xfwopt 0x%x zfwopt 0x%x", icbp->icb_fwoptions, icbp->icb_xfwoptions, icbp->icb_zfwoptions); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "isp_fibre_init", sizeof (*icbp), icbp); isp_put_icb(isp, icbp, (isp_icb_t *)fcp->isp_scratch); + if (isp->isp_dblev & ISP_LOGDEBUG1) { + isp_print_bytes(isp, "isp_fibre_init", + sizeof(*icbp), fcp->isp_scratch); + } /* * Init the firmware @@ -2240,16 +2242,16 @@ isp_fibre_init_2400(ispsoftc_t *isp) DMA_WD1(isp->isp_rquest_dma), DMA_WD0(isp->isp_rquest_dma), DMA_WD3(isp->isp_result_dma), DMA_WD2(isp->isp_result_dma), DMA_WD1(isp->isp_result_dma), DMA_WD0(isp->isp_result_dma)); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "isp_fibre_init_2400", sizeof (*icbp), icbp); - } - if (FC_SCRATCH_ACQUIRE(isp, 0)) { isp_prt(isp, ISP_LOGERR, sacq); return; } ISP_MEMZERO(fcp->isp_scratch, ISP_FC_SCRLEN); isp_put_icb_2400(isp, icbp, fcp->isp_scratch); + if (isp->isp_dblev & ISP_LOGDEBUG1) { + isp_print_bytes(isp, "isp_fibre_init_2400", + sizeof (*icbp), fcp->isp_scratch); + } /* * Now fill in information about any additional channels @@ -2395,6 +2397,8 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch return (EIO); } isp_put_vp_modify(isp, &vp, (vp_modify_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_MODIFY", QENTRY_LEN, reqp); ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "VP_MODIFY", 5*hz) == EWOULDBLOCK) { isp_prt(isp, ISP_LOGERR, @@ -2402,6 +2406,8 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch isp_destroy_handle(isp, vp.vp_mod_hdl); return (EIO); } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_MODIFY response", QENTRY_LEN, resp); isp_get_vp_modify(isp, (vp_modify_t *)resp, &vp); if (vp.vp_mod_hdr.rqs_flags != 0 || vp.vp_mod_status != VP_STS_OK) { @@ -2452,6 +2458,8 @@ isp_fc_disable_vp(ispsoftc_t *isp, int c return (EIO); } isp_put_vp_ctrl_info(isp, &vp, (vp_ctrl_info_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_CTRL", QENTRY_LEN, reqp); ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "VP_CTRL", 5*hz) == EWOULDBLOCK) { isp_prt(isp, ISP_LOGERR, @@ -2459,6 +2467,8 @@ isp_fc_disable_vp(ispsoftc_t *isp, int c isp_destroy_handle(isp, vp.vp_ctrl_handle); return (EIO); } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_CTRL response", QENTRY_LEN, resp); isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)resp, &vp); if (vp.vp_ctrl_hdr.rqs_flags != 0 || vp.vp_ctrl_status != 0) { @@ -2602,9 +2612,9 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_destroy_handle(isp, pl.plogx_handle); return (-1); } - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, &pl); isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp); ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) == EWOULDBLOCK) { @@ -2613,9 +2623,9 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_destroy_handle(isp, pl.plogx_handle); return (-1); } - isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, &pl); + isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp); + isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); if (pl.plogx_status == PLOGX_STATUS_OK) { return (0); @@ -5155,15 +5165,14 @@ again: * Synchronize our view of this response queue entry. */ MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN, -1); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_qentry(isp, "Response Queue Entry", oop, hp); isp_get_hdr(isp, hp, &sp->req_header); etype = sp->req_header.rqs_entry_type; if (IS_24XX(isp) && etype == RQSTYPE_RESPONSE) { isp24xx_statusreq_t *sp2 = (isp24xx_statusreq_t *)qe; isp_get_24xx_response(isp, (isp24xx_statusreq_t *)hp, sp2); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, sp2); - } scsi_status = sp2->req_scsi_status; completion_status = sp2->req_completion_status; if ((scsi_status & 0xff) != 0) @@ -5173,9 +5182,6 @@ again: resid = sp2->req_resid; } else if (etype == RQSTYPE_RESPONSE) { isp_get_response(isp, (ispstatusreq_t *) hp, sp); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, sp); - } scsi_status = sp->req_scsi_status; completion_status = sp->req_completion_status; req_status_flags = sp->req_status_flags; @@ -5184,9 +5190,6 @@ again: } else if (etype == RQSTYPE_RIO1) { isp_rio1_t *rio = (isp_rio1_t *) qe; isp_get_rio1(isp, (isp_rio1_t *) hp, rio); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, rio); - } for (i = 0; i < rio->req_header.rqs_seqno; i++) { isp_fastpost_complete(isp, rio->req_handles[i]); } @@ -5250,7 +5253,6 @@ again: */ if (etype != RQSTYPE_REQUEST) { isp_prt(isp, ISP_LOGERR, notresp, etype, oop, optr, nlooked); - isp_print_bytes(isp, "Request Queue Entry", QENTRY_LEN, sp); ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ last_etype = etype; continue; @@ -5265,7 +5267,8 @@ again: if (sp->req_header.rqs_flags & RQSFLAG_MASK) { if (sp->req_header.rqs_flags & RQSFLAG_CONTINUATION) { - isp_print_bytes(isp, "unexpected continuation segment", QENTRY_LEN, sp); + isp_print_qentry(isp, "unexpected continuation segment", + oop, hp); last_etype = etype; continue; } @@ -5276,19 +5279,23 @@ again: */ } if (sp->req_header.rqs_flags & RQSFLAG_BADHEADER) { - isp_print_bytes(isp, "bad header flag", QENTRY_LEN, sp); + isp_print_qentry(isp, "bad header flag", + oop, hp); buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADPACKET) { - isp_print_bytes(isp, "bad request packet", QENTRY_LEN, sp); + isp_print_qentry(isp, "bad request packet", + oop, hp); buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADCOUNT) { - isp_print_bytes(isp, "invalid entry count", QENTRY_LEN, sp); + isp_print_qentry(isp, "invalid entry count", + oop, hp); buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADORDER) { - isp_print_bytes(isp, "invalid IOCB ordering", QENTRY_LEN, sp); + isp_print_qentry(isp, "invalid IOCB ordering", + oop, hp); last_etype = etype; continue; } @@ -5446,7 +5453,8 @@ again: XS_SAVE_SENSE(xs, snsp, totslen, slen); } else if ((req_status_flags & RQSF_GOT_STATUS) && (scsi_status & 0xff) == SCSI_CHECK && IS_FC(isp)) { isp_prt(isp, ISP_LOGWARN, "CHECK CONDITION w/o sense data for CDB=0x%x", XS_CDBP(xs)[0] & 0xff); - isp_print_bytes(isp, "CC with no Sense", QENTRY_LEN, qe); + isp_print_qentry(isp, "CC with no Sense", + oop, hp); } isp_prt(isp, ISP_LOGDEBUG2, "asked for %ld got raw resid %ld settled for %ld", (long) XS_XFRLEN(xs), resid, (long) XS_GET_RESID(xs)); break; @@ -5472,7 +5480,8 @@ again: XS_SET_RESID(xs, XS_XFRLEN(xs)); break; default: - isp_print_bytes(isp, "Unhandled Response Type", QENTRY_LEN, qe); + isp_print_qentry(isp, "Unhandled Response Type", + oop, hp); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_BOTCH); } Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Tue May 3 07:57:26 2016 (r298962) +++ stable/10/sys/dev/isp/isp_library.c Tue May 3 07:58:11 2016 (r298963) @@ -180,7 +180,8 @@ isp_send_cmd(ispsoftc_t *isp, void *fqe, isp_put_cont_req(isp, (ispcontreq_t *)storage, qe1); } if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "additional queue entry", QENTRY_LEN, storage); + isp_print_bytes(isp, "additional queue entry", + QENTRY_LEN, qe1); } nqe++; } @@ -241,7 +242,7 @@ copy_and_sync: return (CMD_COMPLETE); } if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "first queue entry", QENTRY_LEN, fqe); + isp_print_bytes(isp, "first queue entry", QENTRY_LEN, qe0); } ISP_ADD_REQUEST(isp, nxt); return (CMD_QUEUED); @@ -2193,7 +2194,8 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void * isp_put_cont_req(isp, (ispcontreq_t *)storage, qe1); } if (isp->isp_dblev & ISP_LOGTDEBUG1) { - isp_print_bytes(isp, "additional queue entry", QENTRY_LEN, storage); + isp_print_bytes(isp, "additional queue entry", + QENTRY_LEN, qe1); } nqe++; } @@ -2230,7 +2232,7 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void * return (CMD_COMPLETE); } if (isp->isp_dblev & ISP_LOGTDEBUG1) { - isp_print_bytes(isp, "first queue entry", QENTRY_LEN, fqe); + isp_print_bytes(isp, "first queue entry", QENTRY_LEN, qe0); } ISP_ADD_REQUEST(isp, nxt); return (CMD_QUEUED); From owner-svn-src-stable-10@freebsd.org Tue May 3 07:58:52 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A283B2BBAC; Tue, 3 May 2016 07:58:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 52EC616C0; Tue, 3 May 2016 07:58:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437wpSY041772; Tue, 3 May 2016 07:58:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437wpE9041771; Tue, 3 May 2016 07:58:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030758.u437wpE9041771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:58: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: r298964 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 07:58:52 -0000 Author: mav Date: Tue May 3 07:58:51 2016 New Revision: 298964 URL: https://svnweb.freebsd.org/changeset/base/298964 Log: MFC r297854: Add couple missing memory barriers. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:58:11 2016 (r298963) +++ stable/10/sys/dev/isp/isp.c Tue May 3 07:58:51 2016 (r298964) @@ -2802,12 +2802,13 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui isp_prt(isp, ISP_LOGERR, sacq); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un), chan); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof(un), chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0] | (mbs.param[1] << 16)); } + MEMORYBARRIER(isp, SYNC_SFORCPU, 0, sizeof(un), chan); if (IS_24XX(isp)) { isp_get_pdb_24xx(isp, fcp->isp_scratch, &un.bill); pdb->handle = un.bill.pdb_handle; @@ -2875,6 +2876,7 @@ isp_gethandles(ispsoftc_t *isp, int chan FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0] | (mbs.param[1] << 16)); } + MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan); elp1 = fcp->isp_scratch; elp3 = fcp->isp_scratch; elp4 = fcp->isp_scratch; From owner-svn-src-stable-10@freebsd.org Tue May 3 07:59:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C49BBB2BC33; Tue, 3 May 2016 07:59:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 83D4D184D; Tue, 3 May 2016 07:59:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437xgPf041862; Tue, 3 May 2016 07:59:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437xg9m041861; Tue, 3 May 2016 07:59:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030759.u437xg9m041861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:59: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: r298965 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 07:59:43 -0000 Author: mav Date: Tue May 3 07:59:42 2016 New Revision: 298965 URL: https://svnweb.freebsd.org/changeset/base/298965 Log: MFC r297856: Reimplement ISP_TSK_MGMT IOCTL via asynchronous request. I am not sure this code is not completely dead, but it used DMA scratch are without good reason and asked to be refactored. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Tue May 3 07:58:51 2016 (r298964) +++ stable/10/sys/dev/isp/isp_freebsd.c Tue May 3 07:59:42 2016 (r298965) @@ -607,9 +607,10 @@ ispioctl(struct cdev *dev, u_long c, cad nphdl = fct->loopid; ISP_LOCK(isp); if (IS_24XX(isp)) { - uint8_t local[QENTRY_LEN]; - isp24xx_tmf_t *tmf; - isp24xx_statusreq_t *sp; + void *reqp; + uint8_t resp[QENTRY_LEN]; + isp24xx_tmf_t tmf; + isp24xx_statusreq_t sp; fcparam *fcp = FCPARAM(isp, chan); fcportdb_t *lp; int i; @@ -625,39 +626,37 @@ ispioctl(struct cdev *dev, u_long c, cad ISP_UNLOCK(isp); break; } - /* XXX VALIDATE LP XXX */ - tmf = (isp24xx_tmf_t *) local; - ISP_MEMZERO(tmf, QENTRY_LEN); - tmf->tmf_header.rqs_entry_type = RQSTYPE_TSK_MGMT; - tmf->tmf_header.rqs_entry_count = 1; - tmf->tmf_nphdl = lp->handle; - tmf->tmf_delay = 2; - tmf->tmf_timeout = 4; - tmf->tmf_tidlo = lp->portid; - tmf->tmf_tidhi = lp->portid >> 16; - tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); - tmf->tmf_lun[1] = fct->lun & 0xff; + ISP_MEMZERO(&tmf, sizeof(tmf)); + tmf.tmf_header.rqs_entry_type = RQSTYPE_TSK_MGMT; + tmf.tmf_header.rqs_entry_count = 1; + tmf.tmf_nphdl = lp->handle; + tmf.tmf_delay = 2; + tmf.tmf_timeout = 4; + tmf.tmf_tidlo = lp->portid; + tmf.tmf_tidhi = lp->portid >> 16; + tmf.tmf_vpidx = ISP_GET_VPIDX(isp, chan); + tmf.tmf_lun[1] = fct->lun & 0xff; if (fct->lun >= 256) { - tmf->tmf_lun[0] = 0x40 | (fct->lun >> 8); + tmf.tmf_lun[0] = 0x40 | (fct->lun >> 8); } switch (fct->action) { case IPT_CLEAR_ACA: - tmf->tmf_flags = ISP24XX_TMF_CLEAR_ACA; + tmf.tmf_flags = ISP24XX_TMF_CLEAR_ACA; break; case IPT_TARGET_RESET: - tmf->tmf_flags = ISP24XX_TMF_TARGET_RESET; + tmf.tmf_flags = ISP24XX_TMF_TARGET_RESET; needmarker = 1; break; case IPT_LUN_RESET: - tmf->tmf_flags = ISP24XX_TMF_LUN_RESET; + tmf.tmf_flags = ISP24XX_TMF_LUN_RESET; needmarker = 1; break; case IPT_CLEAR_TASK_SET: - tmf->tmf_flags = ISP24XX_TMF_CLEAR_TASK_SET; + tmf.tmf_flags = ISP24XX_TMF_CLEAR_TASK_SET; needmarker = 1; break; case IPT_ABORT_TASK_SET: - tmf->tmf_flags = ISP24XX_TMF_ABORT_TASK_SET; + tmf.tmf_flags = ISP24XX_TMF_ABORT_TASK_SET; needmarker = 1; break; default: @@ -668,36 +667,52 @@ ispioctl(struct cdev *dev, u_long c, cad ISP_UNLOCK(isp); break; } - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { + /* Prepare space for response in memory */ + memset(resp, 0xff, sizeof(resp)); + tmf.tmf_handle = isp_allocate_handle(isp, resp, + ISP_HANDLE_CTRL); + if (tmf.tmf_handle == 0) { + isp_prt(isp, ISP_LOGERR, + "%s: TMF of Chan %d out of handles", + __func__, chan); ISP_UNLOCK(isp); retval = ENOMEM; break; } - isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); - sp = (isp24xx_statusreq_t *) local; - sp->req_completion_status = 1; - retval = isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); - FC_SCRATCH_RELEASE(isp, chan); - if (retval || sp->req_completion_status != 0) { - FC_SCRATCH_RELEASE(isp, chan); + + /* Send request and wait for response. */ + reqp = isp_getrqentry(isp); + if (reqp == NULL) { + isp_prt(isp, ISP_LOGERR, + "%s: TMF of Chan %d out of rqent", + __func__, chan); + isp_destroy_handle(isp, tmf.tmf_handle); + ISP_UNLOCK(isp); retval = EIO; + break; } - if (retval == 0) { - if (needmarker) { - fcp->sendmarker = 1; - } + isp_put_24xx_tmf(isp, &tmf, (isp24xx_tmf_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB TMF", QENTRY_LEN, reqp); + ISP_SYNC_REQUEST(isp); + if (msleep(resp, &isp->isp_lock, 0, "TMF", 5*hz) == EWOULDBLOCK) { + isp_prt(isp, ISP_LOGERR, + "%s: TMF of Chan %d timed out", + __func__, chan); + isp_destroy_handle(isp, tmf.tmf_handle); + ISP_UNLOCK(isp); + retval = EIO; + break; } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB TMF response", QENTRY_LEN, resp); + isp_get_24xx_response(isp, (isp24xx_statusreq_t *)resp, &sp); + + if (sp.req_completion_status != 0) + retval = EIO; + else if (needmarker) + fcp->sendmarker = 1; } else { MBSINIT(&mbs, 0, MBLOGALL, 0); if (ISP_CAP_2KLOGIN(isp) == 0) { From owner-svn-src-stable-10@freebsd.org Tue May 3 08:00:55 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA34FB2BFBC; Tue, 3 May 2016 08:00:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B2A181A61; Tue, 3 May 2016 08:00:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4380sis042626; Tue, 3 May 2016 08:00:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4380sDg042622; Tue, 3 May 2016 08:00:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030800.u4380sDg042622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:00: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: r298966 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 08:00:56 -0000 Author: mav Date: Tue May 3 08:00:54 2016 New Revision: 298966 URL: https://svnweb.freebsd.org/changeset/base/298966 Log: MFC r297858: Allocate separate DMA area for synchronous IOCB execution. Usually IOCBs should be put on queue for asynchronous processing and should not require additional DMA memory. But there are some cases like aborts and resets that for external reasons has to be synchronous. Give those cases separate 2*64 byte DMA area to decouple them from other DMA scratch area users, using it for asynchronous requests. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:59:42 2016 (r298965) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:00:54 2016 (r298966) @@ -4667,31 +4667,25 @@ isp_control(ispsoftc_t *isp, ispctl_t ct tmf->tmf_tidlo = lp->portid; tmf->tmf_tidhi = lp->portid >> 16; tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); + isp_put_24xx_tmf(isp, tmf, isp->isp_iocb); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, QENTRY_LEN, chan); + fcp->sendmarker = 1; + isp_prt(isp, ISP_LOGALL, "Chan %d Reset N-Port Handle 0x%04x @ Port 0x%06x", chan, lp->handle, lp->portid); MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 1000000); mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - break; - } - isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); - fcp->sendmarker = 1; + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) break; - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + + MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); sp = (isp24xx_statusreq_t *) local; - isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); - FC_SCRATCH_RELEASE(isp, chan); + isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)isp->isp_iocb)[1], sp); if (sp->req_completion_status == 0) { return (0); } @@ -4731,7 +4725,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct break; } if (IS_24XX(isp)) { - isp24xx_abrt_t local, *ab = &local, *ab2; + isp24xx_abrt_t local, *ab = &local; fcparam *fcp; fcportdb_t *lp; @@ -4755,31 +4749,23 @@ isp_control(ispsoftc_t *isp, ispctl_t ct ab->abrt_tidlo = lp->portid; ab->abrt_tidhi = lp->portid >> 16; ab->abrt_vpidx = ISP_GET_VPIDX(isp, chan); + isp_put_24xx_abrt(isp, ab, isp->isp_iocb); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, 2 * QENTRY_LEN, chan); ISP_MEMZERO(&mbs, sizeof (mbs)); MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 5000000); mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - break; - } - isp_put_24xx_abrt(isp, ab, fcp->isp_scratch); - ab2 = (isp24xx_abrt_t *) &((uint8_t *)fcp->isp_scratch)[QENTRY_LEN]; - ab2->abrt_nphdl = 0xdeaf; - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) break; - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_24xx_abrt(isp, ab2, ab); - FC_SCRATCH_RELEASE(isp, chan); + + MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_24xx_abrt(isp, &((isp24xx_abrt_t *)isp->isp_iocb)[1], ab); if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) { return (0); } Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Tue May 3 07:59:42 2016 (r298965) +++ stable/10/sys/dev/isp/isp_freebsd.h Tue May 3 08:00:54 2016 (r298966) @@ -293,10 +293,12 @@ struct isposinfo { bus_dma_tag_t reqdmat; bus_dma_tag_t respdmat; bus_dma_tag_t atiodmat; + bus_dma_tag_t iocbdmat; bus_dma_tag_t scdmat; bus_dmamap_t reqmap; bus_dmamap_t respmap; bus_dmamap_t atiomap; + bus_dmamap_t iocbmap; /* * Command and transaction related related stuff @@ -441,6 +443,14 @@ case SYNC_ATIOQ: \ bus_dmamap_sync(isp->isp_osinfo.atiodmat, \ isp->isp_osinfo.atiomap, BUS_DMASYNC_POSTREAD); \ break; \ +case SYNC_IFORDEV: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); \ + break; \ +case SYNC_IFORCPU: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); \ + break; \ default: \ break; \ } @@ -469,6 +479,14 @@ case SYNC_REG: \ bus_barrier(isp->isp_osinfo.regs, offset, size, \ BUS_SPACE_BARRIER_WRITE); \ break; \ +case SYNC_IFORDEV: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_PREWRITE); \ + break; \ +case SYNC_IFORCPU: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_POSTWRITE); \ + break; \ default: \ break; \ } Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Tue May 3 07:59:42 2016 (r298965) +++ stable/10/sys/dev/isp/isp_pci.c Tue May 3 08:00:54 2016 (r298966) @@ -1730,9 +1730,23 @@ isp_pci_mbxdma(ispsoftc_t *isp) if (IS_FC(isp)) { if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - ISP_FC_SCRLEN, 1, ISP_FC_SCRLEN, 0, &isp->isp_osinfo.scdmat)) { + 2*QENTRY_LEN, 1, 2*QENTRY_LEN, 0, &isp->isp_osinfo.iocbdmat)) { goto bad; } + if (bus_dmamem_alloc(isp->isp_osinfo.iocbdmat, + (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.iocbmap) != 0) + goto bad; + isp->isp_iocb = base; + im.error = 0; + if (bus_dmamap_load(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, + base, 2*QENTRY_LEN, imc, &im, 0) || im.error) + goto bad; + isp->isp_iocb_dma = im.maddr; + + if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + ISP_FC_SCRLEN, 1, ISP_FC_SCRLEN, 0, &isp->isp_osinfo.scdmat)) + goto bad; for (cmap = 0; cmap < isp->isp_nchan; cmap++) { struct isp_fc *fc = ISP_FC_PC(isp, cmap); if (bus_dmamem_alloc(isp->isp_osinfo.scdmat, @@ -1791,7 +1805,8 @@ bad: while (--cmap >= 0) { struct isp_fc *fc = ISP_FC_PC(isp, cmap); bus_dmamap_unload(isp->isp_osinfo.scdmat, fc->scmap); - bus_dmamem_free(isp->isp_osinfo.scdmat, base, fc->scmap); + bus_dmamem_free(isp->isp_osinfo.scdmat, + FCPARAM(isp, cmap)->isp_scratch, fc->scmap); while (fc->nexus_free_list) { struct isp_nexus *n = fc->nexus_free_list; fc->nexus_free_list = n->next; @@ -1799,6 +1814,10 @@ bad: } } bus_dma_tag_destroy(isp->isp_osinfo.scdmat); + bus_dmamap_unload(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap); + bus_dmamem_free(isp->isp_osinfo.iocbdmat, isp->isp_iocb, + isp->isp_osinfo.iocbmap); + bus_dma_tag_destroy(isp->isp_osinfo.iocbdmat); } bad1: if (isp->isp_rquest_dma != 0) { Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 07:59:42 2016 (r298965) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:00:54 2016 (r298966) @@ -130,6 +130,8 @@ struct ispmdvec { #define SYNC_SFORCPU 3 /* scratch, sync for CPU */ #define SYNC_REG 4 /* for registers */ #define SYNC_ATIOQ 5 /* atio result queue (24xx) */ +#define SYNC_IFORDEV 6 /* synchrounous IOCB, sync for ISP */ +#define SYNC_IFORCPU 7 /* synchrounous IOCB, sync for CPU */ /* * Request/Response Queue defines and macros. @@ -596,6 +598,12 @@ struct ispsoftc { isp_hdl_t *isp_xffree; /* + * DMA mapped in area for synchronous IOCB requests. + */ + void * isp_iocb; + XS_DMA_ADDR_T isp_iocb_dma; + + /* * request/result queue pointers and DMA handles for them. */ void * isp_rquest; From owner-svn-src-stable-10@freebsd.org Tue May 3 08:02:01 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 913DEB29041; Tue, 3 May 2016 08:02:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 515721CD9; Tue, 3 May 2016 08:02:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43820sh044690; Tue, 3 May 2016 08:02:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43820nO044689; Tue, 3 May 2016 08:02:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030802.u43820nO044689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:02:00 +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: r298967 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 08:02:01 -0000 Author: mav Date: Tue May 3 08:02:00 2016 New Revision: 298967 URL: https://svnweb.freebsd.org/changeset/base/298967 Log: MFC r297859: Switch isp_getpdb() to synchronous IOCB DMA area. While technically it is not IOCB, it is synchronous and can be called from different places, so calling FC_SCRATCH_ACQUIRE() here is inconvenient. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:00:54 2016 (r298966) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:02:00 2016 (r298967) @@ -2776,7 +2776,6 @@ isp_port_logout(ispsoftc_t *isp, uint16_ static int isp_getpdb(ispsoftc_t *isp, int chan, uint16_t id, isp_pdb_t *pdb) { - fcparam *fcp = FCPARAM(isp, chan); mbreg_t mbs; union { isp_pdb_21xx_t fred; @@ -2794,23 +2793,19 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui } else { mbs.param[1] = id << 8; } - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - return (-1); - } - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof(un), chan); + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, sizeof(un), chan); + isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) return (mbs.param[0] | (mbs.param[1] << 16)); - } - MEMORYBARRIER(isp, SYNC_SFORCPU, 0, sizeof(un), chan); + + MEMORYBARRIER(isp, SYNC_IFORCPU, 0, sizeof(un), chan); if (IS_24XX(isp)) { - isp_get_pdb_24xx(isp, fcp->isp_scratch, &un.bill); + isp_get_pdb_24xx(isp, isp->isp_iocb, &un.bill); pdb->handle = un.bill.pdb_handle; pdb->prli_word3 = un.bill.pdb_prli_svc3; pdb->portid = BITS2WORD_24XX(un.bill.pdb_portid_bits); @@ -2822,11 +2817,10 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui un.bill.pdb_curstate); if (un.bill.pdb_curstate < PDB2400_STATE_PLOGI_DONE || un.bill.pdb_curstate > PDB2400_STATE_LOGGED_IN) { mbs.param[0] = MBOX_NOT_LOGGED_IN; - FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0]); } } else { - isp_get_pdb_21xx(isp, fcp->isp_scratch, &un.fred); + isp_get_pdb_21xx(isp, isp->isp_iocb, &un.fred); pdb->handle = un.fred.pdb_loopid; pdb->prli_word3 = un.fred.pdb_prli_svc3; pdb->portid = BITS2WORD(un.fred.pdb_portid_bits); @@ -2835,7 +2829,6 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui isp_prt(isp, ISP_LOGDEBUG1, "Chan %d handle 0x%x Port 0x%06x", chan, id, pdb->portid); } - FC_SCRATCH_RELEASE(isp, chan); return (0); } From owner-svn-src-stable-10@freebsd.org Tue May 3 08:03:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98BB7B29127; Tue, 3 May 2016 08:03:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 73E531F96; Tue, 3 May 2016 08:03:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u438371A044783; Tue, 3 May 2016 08:03:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43837Md044782; Tue, 3 May 2016 08:03:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030803.u43837Md044782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:03:07 +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: r298968 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 08:03:08 -0000 Author: mav Date: Tue May 3 08:03:07 2016 New Revision: 298968 URL: https://svnweb.freebsd.org/changeset/base/298968 Log: MFC r297867: Make all CT Pass-Through (name server requests) asynchronous. Previously we had to do it synchronously because we could not drop the lock due to potential scratch memory use conflicts. Previous commits fixed that collision, so here it goes -- slower and less reliable external requests are executed asynchronously without spinning in tight loop and with more safe timeout handling. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:02:00 2016 (r298967) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:03:07 2016 (r298968) @@ -3078,20 +3078,31 @@ isp_fclink_test(ispsoftc_t *isp, int cha fcp->isp_fabric_params = mbs.param[7]; fcp->isp_sns_hdl = NPH_SNS_ID; r = isp_register_fc4_type_24xx(isp, chan); - if (r == 0) - isp_register_fc4_features_24xx(isp, chan); - isp_register_port_name_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; + if (r != 0) + goto not_on_fabric; + r = isp_register_fc4_features_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; + if (r != 0) + goto not_on_fabric; + r = isp_register_port_name_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; + if (r != 0) + goto not_on_fabric; isp_register_node_name_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; } else { fcp->isp_sns_hdl = SNS_ID; r = isp_register_fc4_type(isp, chan); - if (r == 0 && fcp->role == ISP_ROLE_TARGET) + if (r != 0) + goto not_on_fabric; + if (fcp->role == ISP_ROLE_TARGET) isp_send_change_request(isp, chan); } - if (r) { - isp_prt(isp, ISP_LOGWARN|ISP_LOG_SANCFG, "%s: register fc4 type failed", __func__); - return (-1); - } } not_on_fabric: @@ -3505,65 +3516,66 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan static int isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cmd_bcnt, uint32_t rsp_bcnt) { - mbreg_t mbs; fcparam *fcp = FCPARAM(isp, chan); - union { - isp_ct_pt_t plocal; - uint8_t q[QENTRY_LEN]; - } un; - isp_ct_pt_t *pt; - uint8_t *scp = fcp->isp_scratch; + isp_ct_pt_t pt; + void *reqp; + uint8_t resp[QENTRY_LEN]; /* * Build a Passthrough IOCB in memory. */ - pt = &un.plocal; - ISP_MEMZERO(un.q, QENTRY_LEN); - pt->ctp_header.rqs_entry_count = 1; - pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; - pt->ctp_handle = 0xffffffff; - pt->ctp_nphdl = fcp->isp_sns_hdl; - pt->ctp_cmd_cnt = 1; - pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 10; - pt->ctp_rsp_cnt = 1; - pt->ctp_rsp_bcnt = rsp_bcnt; - pt->ctp_cmd_bcnt = cmd_bcnt; - pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_count = cmd_bcnt; - pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_count = rsp_bcnt; - isp_put_ct_pt(isp, pt, (isp_ct_pt_t *)&scp[CTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, &scp[CTXOFF]); + ISP_MEMZERO(&pt, sizeof(pt)); + pt.ctp_header.rqs_entry_count = 1; + pt.ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; + pt.ctp_nphdl = fcp->isp_sns_hdl; + pt.ctp_cmd_cnt = 1; + pt.ctp_vpidx = ISP_GET_VPIDX(isp, chan); + pt.ctp_time = 10; + pt.ctp_rsp_cnt = 1; + pt.ctp_rsp_bcnt = rsp_bcnt; + pt.ctp_cmd_bcnt = cmd_bcnt; + pt.ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); + pt.ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); + pt.ctp_dataseg[0].ds_count = cmd_bcnt; + pt.ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); + pt.ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); + pt.ctp_dataseg[1].ds_count = rsp_bcnt; + + /* Prepare space for response in memory */ + memset(resp, 0xff, sizeof(resp)); + pt.ctp_handle = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); + if (pt.ctp_handle == 0) { + isp_prt(isp, ISP_LOGERR, + "%s: CTP of Chan %d out of handles", __func__, chan); + return (-1); + } - /* - * Execute the Passthrough IOCB. - */ - ISP_MEMZERO(&scp[ZTXOFF], QENTRY_LEN); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); - mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); - mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); - mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + /* Send request and wait for response. */ + reqp = isp_getrqentry(isp); + if (reqp == NULL) { + isp_prt(isp, ISP_LOGERR, + "%s: CTP of Chan %d out of rqent", __func__, chan); + isp_destroy_handle(isp, pt.ctp_handle); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan); + isp_put_ct_pt(isp, &pt, (isp_ct_pt_t *)reqp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, &scp[ZTXOFF]); - pt = &un.plocal; - isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); - if (pt->ctp_status && pt->ctp_status != RQCS_DATA_UNDERRUN) { + isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, reqp); + ISP_SYNC_REQUEST(isp); + if (msleep(resp, &isp->isp_lock, 0, "CTP", pt.ctp_time*hz) == EWOULDBLOCK) { + isp_prt(isp, ISP_LOGERR, + "%s: CTP of Chan %d timed out", __func__, chan); + isp_destroy_handle(isp, pt.ctp_handle); + return (-1); + } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, resp); + + isp_get_ct_pt(isp, (isp_ct_pt_t *)resp, &pt); + if (pt.ctp_status && pt.ctp_status != RQCS_DATA_UNDERRUN) { isp_prt(isp, ISP_LOGWARN, "Chan %d GID_FT CT Passthrough returned 0x%x", - chan, pt->ctp_status); + chan, pt.ctp_status); return (-1); } @@ -3931,7 +3943,13 @@ isp_send_change_request(ispsoftc_t *isp, mbs.param[1] = 0x03; mbs.param[9] = chan; isp_mboxcmd(isp, &mbs); - return (mbs.param[0] == MBOX_COMMAND_COMPLETE ? 0 : -1); + if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { + return (0); + } else { + isp_prt(isp, ISP_LOGWARN, "Chan %d Send Change Request: 0x%x", + chan, mbs.param[0]); + return (-1); + } } static int @@ -3970,6 +3988,8 @@ isp_register_fc4_type(ispsoftc_t *isp, i if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { return (0); } else { + isp_prt(isp, ISP_LOGWARN, "Chan %d Register FC4 Type: 0x%x", + chan, mbs.param[0]); return (-1); } } @@ -6140,6 +6160,7 @@ isp_handle_other_response(ispsoftc_t *is } } return (1); + case RQSTYPE_CT_PASSTHRU: case RQSTYPE_VP_MODIFY: case RQSTYPE_VP_CTRL: case RQSTYPE_LOGIN: From owner-svn-src-stable-10@freebsd.org Tue May 3 08:03:52 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9851CB291F2; Tue, 3 May 2016 08:03:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5758B116E; Tue, 3 May 2016 08:03:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4383pS3044884; Tue, 3 May 2016 08:03:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4383pG8044882; Tue, 3 May 2016 08:03:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030803.u4383pG8044882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:03: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: r298969 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 08:03:52 -0000 Author: mav Date: Tue May 3 08:03:51 2016 New Revision: 298969 URL: https://svnweb.freebsd.org/changeset/base/298969 Log: MFC r297912: Respect NVRAM topology settings on 24xx and above chips. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:03:07 2016 (r298968) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:03:51 2016 (r298969) @@ -1822,22 +1822,24 @@ isp_fibre_init(ispsoftc_t *isp) * Prefer or force Point-To-Point instead Loop? */ switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { - case ISP_CFG_NPORT: + case ISP_CFG_LPORT_ONLY: icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; - icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP; + icbp->icb_xfwoptions |= ICBXOPT_LOOP_ONLY; break; case ISP_CFG_NPORT_ONLY: icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; icbp->icb_xfwoptions |= ICBXOPT_PTP_ONLY; break; - case ISP_CFG_LPORT_ONLY: + case ISP_CFG_LPORT: icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; - icbp->icb_xfwoptions |= ICBXOPT_LOOP_ONLY; + icbp->icb_xfwoptions |= ICBXOPT_LOOP_2_PTP; + break; + case ISP_CFG_NPORT: + icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; + icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP; break; default: - /* - * Let NVRAM settings define it if they are sane - */ + /* Let NVRAM settings define it if they are sane */ switch (icbp->icb_xfwoptions & ICBXOPT_TOPO_MASK) { case ICBXOPT_PTP_2_LOOP: case ICBXOPT_PTP_ONLY: @@ -2109,19 +2111,32 @@ isp_fibre_init_2400(ispsoftc_t *isp) } switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { - case ISP_CFG_NPORT_ONLY: - icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; - icbp->icb_fwoptions2 |= ICB2400_OPT2_PTP_ONLY; - break; case ISP_CFG_LPORT_ONLY: icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_ONLY; break; - default: + case ISP_CFG_NPORT_ONLY: + icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; + icbp->icb_fwoptions2 |= ICB2400_OPT2_PTP_ONLY; + break; + case ISP_CFG_NPORT: /* ISP_CFG_PTP_2_LOOP not available in 24XX/25XX */ + case ISP_CFG_LPORT: icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_2_PTP; break; + default: + /* Let NVRAM settings define it if they are sane */ + switch (icbp->icb_fwoptions2 & ICB2400_OPT2_TOPO_MASK) { + case ICB2400_OPT2_LOOP_ONLY: + case ICB2400_OPT2_PTP_ONLY: + case ICB2400_OPT2_LOOP_2_PTP: + break; + default: + icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; + icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_2_PTP; + } + break; } switch (icbp->icb_fwoptions2 & ICB2400_OPT2_TIMER_MASK) { @@ -7807,23 +7822,23 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c if (IS_24XX(isp)) { fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS; fcp->isp_fwoptions |= ICB2400_OPT1_HARD_ADDRESS; - if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) { + if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) fcp->isp_fwoptions |= ICB2400_OPT1_FULL_DUPLEX; - } fcp->isp_fwoptions |= ICB2400_OPT1_BOTH_WWNS; + fcp->isp_xfwoptions |= ICB2400_OPT2_LOOP_2_PTP; fcp->isp_zfwoptions |= ICB2400_OPT3_RATE_AUTO; } else { fcp->isp_fwoptions |= ICBOPT_FAIRNESS; fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE; fcp->isp_fwoptions |= ICBOPT_HARD_ADDRESS; - if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) { + if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) fcp->isp_fwoptions |= ICBOPT_FULL_DUPLEX; - } /* * Make sure this is turned off now until we get * extended options from NVRAM */ fcp->isp_fwoptions &= ~ICBOPT_EXTENDED; + fcp->isp_xfwoptions |= ICBXOPT_LOOP_2_PTP; fcp->isp_zfwoptions |= ICBZOPT_RATE_AUTO; } Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 08:03:07 2016 (r298968) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:03:51 2016 (r298969) @@ -645,11 +645,12 @@ struct ispsoftc { * ISP Runtime Configuration Options */ #define ISP_CFG_FULL_DUPLEX 0x01 /* Full Duplex (Fibre Channel only) */ -#define ISP_CFG_PORT_PREF 0x0c /* Mask for Port Prefs (all FC except 2100) */ -#define ISP_CFG_LPORT 0x00 /* prefer {N/F}L-Port connection */ -#define ISP_CFG_NPORT 0x04 /* prefer {N/F}-Port connection */ -#define ISP_CFG_NPORT_ONLY 0x08 /* insist on {N/F}-Port connection */ -#define ISP_CFG_LPORT_ONLY 0x0c /* insist on {N/F}L-Port connection */ +#define ISP_CFG_PORT_PREF 0x0e /* Mask for Port Prefs (all FC except 2100) */ +#define ISP_CFG_PORT_DEF 0x00 /* prefer connection type from NVRAM */ +#define ISP_CFG_LPORT_ONLY 0x02 /* insist on {N/F}L-Port connection */ +#define ISP_CFG_NPORT_ONLY 0x04 /* insist on {N/F}-Port connection */ +#define ISP_CFG_LPORT 0x06 /* prefer {N/F}L-Port connection */ +#define ISP_CFG_NPORT 0x08 /* prefer {N/F}-Port connection */ #define ISP_CFG_1GB 0x10 /* force 1GB connection (23XX only) */ #define ISP_CFG_2GB 0x20 /* force 2GB connection (23XX only) */ #define ISP_CFG_NORELOAD 0x80 /* don't download f/w */ From owner-svn-src-stable-10@freebsd.org Tue May 3 08:04:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 733DFB292C7; Tue, 3 May 2016 08:04:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 34CA312E1; Tue, 3 May 2016 08:04:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4384Y4c044979; Tue, 3 May 2016 08:04:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4384YHt044977; Tue, 3 May 2016 08:04:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030804.u4384YHt044977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:04:34 +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: r298970 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 08:04:35 -0000 Author: mav Date: Tue May 3 08:04:34 2016 New Revision: 298970 URL: https://svnweb.freebsd.org/changeset/base/298970 Log: MFC r297915: Filter Port Database Changed notifications. For some reason firmware sends Port Database Changed notifications in case of explicit login requests from the driver when target port is unavailabe. Those notifications don't give driver any new information, but only cause infinite scan loop. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:03:51 2016 (r298969) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:04:34 2016 (r298970) @@ -2630,6 +2630,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp); + FCPARAM(isp, chan)->isp_login_hdl = handle; ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) == EWOULDBLOCK) { @@ -2638,6 +2639,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_destroy_handle(isp, pl.plogx_handle); return (-1); } + FCPARAM(isp, chan)->isp_login_hdl = NIL_HANDLE; if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp); isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); @@ -6000,9 +6002,13 @@ isp_parse_async_fc(ispsoftc_t *isp, uint fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) continue; - if (fcp->isp_loopstate > LOOP_LTEST_DONE) + if (fcp->isp_loopstate > LOOP_LTEST_DONE) { + if (nphdl != NIL_HANDLE && + nphdl == fcp->isp_login_hdl && + reason == PDB24XX_AE_OPN_2) + continue; fcp->isp_loopstate = LOOP_LTEST_DONE; - else if (fcp->isp_loopstate < LOOP_HAVE_LINK) + } else if (fcp->isp_loopstate < LOOP_HAVE_LINK) fcp->isp_loopstate = LOOP_HAVE_LINK; isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason); @@ -7818,6 +7824,7 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c fcp->isp_xfwoptions = 0; fcp->isp_zfwoptions = 0; fcp->isp_lasthdl = NIL_HANDLE; + fcp->isp_login_hdl = NIL_HANDLE; if (IS_24XX(isp)) { fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS; Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 08:03:51 2016 (r298969) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:04:34 2016 (r298970) @@ -449,6 +449,7 @@ typedef struct { uint16_t isp_lasthdl; /* only valid for channel 0 */ uint16_t isp_maxalloc; uint16_t isp_fabric_params; + uint16_t isp_login_hdl; /* Logging in handle */ uint8_t isp_retry_delay; uint8_t isp_retry_count; From owner-svn-src-stable-10@freebsd.org Tue May 3 08:05:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77DAEB29401; Tue, 3 May 2016 08:05:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3C407171A; Tue, 3 May 2016 08:05:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4385VC2045131; Tue, 3 May 2016 08:05:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4385VcT045128; Tue, 3 May 2016 08:05:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030805.u4385VcT045128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:05: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: r298972 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 08:05:32 -0000 Author: mav Date: Tue May 3 08:05:31 2016 New Revision: 298972 URL: https://svnweb.freebsd.org/changeset/base/298972 Log: MFC r297991: Extract virtual port address from RQSTYPE_RPT_ID_ACQ. This should close the race between request arriving on new target mode virtual port and its scanner thread finally fetch its address for request routing. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:05:14 2016 (r298971) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:05:31 2016 (r298972) @@ -3011,7 +3011,6 @@ isp_fclink_test(ispsoftc_t *isp, int cha return (0); isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC link test", chan); - fcp->isp_loopstate = LOOP_TESTING_LINK; /* * Wait up to N microseconds for F/W to go to a ready state. @@ -3022,7 +3021,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha if (fcp->isp_fwstate == FW_READY) { break; } - if (fcp->isp_loopstate < LOOP_TESTING_LINK) + if (fcp->isp_loopstate < LOOP_HAVE_LINK) goto abort; GET_NANOTIME(&hrb); if ((NANOTIME_SUB(&hrb, &hra) / 1000 + 1000 >= usdelay)) @@ -3077,6 +3076,11 @@ isp_fclink_test(ispsoftc_t *isp, int cha fcp->isp_loopid = i; } +#if 0 + fcp->isp_loopstate = LOOP_HAVE_ADDR; +#endif + fcp->isp_loopstate = LOOP_TESTING_LINK; + if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) { nphdl = IS_24XX(isp) ? NPH_FL_ID : FL_ID; r = isp_getpdb(isp, chan, nphdl, &pdb); @@ -6138,7 +6142,7 @@ isp_handle_other_response(ispsoftc_t *is { isp_ridacq_t rid; int chan, c; - uint32_t hdl; + uint32_t hdl, portid; void *ptr; switch (type) { @@ -6150,6 +6154,8 @@ isp_handle_other_response(ispsoftc_t *is return (1); case RQSTYPE_RPT_ID_ACQ: isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid); + portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | + rid.ridacq_vp_port_lo; if (rid.ridacq_format == 0) { for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); @@ -6171,7 +6177,9 @@ isp_handle_other_response(ispsoftc_t *is fcparam *fcp = FCPARAM(isp, rid.ridacq_vp_index); if (rid.ridacq_vp_status == RIDACQ_STS_COMPLETE || rid.ridacq_vp_status == RIDACQ_STS_CHANGED) { - fcp->isp_loopstate = LOOP_HAVE_LINK; + fcp->isp_topo = (rid.ridacq_map[0] >> 9) & 0x7; + fcp->isp_portid = portid; + fcp->isp_loopstate = LOOP_HAVE_ADDR; isp_async(isp, ISPASYNC_CHANGE_NOTIFY, rid.ridacq_vp_index, ISPASYNC_CHANGE_OTHER); } else { Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Tue May 3 08:05:14 2016 (r298971) +++ stable/10/sys/dev/isp/isp_library.c Tue May 3 08:05:31 2016 (r298972) @@ -532,6 +532,7 @@ isp_fc_loop_statename(int state) switch (state) { case LOOP_NIL: return "NIL"; case LOOP_HAVE_LINK: return "Have Link"; + case LOOP_HAVE_ADDR: return "Have Address"; case LOOP_TESTING_LINK: return "Testing Link"; case LOOP_LTEST_DONE: return "Link Test Done"; case LOOP_SCANNING_LOOP: return "Scanning Loop"; @@ -548,7 +549,7 @@ const char * isp_fc_toponame(fcparam *fcp) { - if (fcp->isp_loopstate < LOOP_LTEST_DONE) { + if (fcp->isp_loopstate < LOOP_HAVE_ADDR) { return "Unavailable"; } switch (fcp->isp_topo) { @@ -2329,7 +2330,7 @@ isp_find_chan_by_did(ispsoftc_t *isp, ui for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if ((fcp->role & ISP_ROLE_TARGET) == 0 || - fcp->isp_loopstate < LOOP_LTEST_DONE) { + fcp->isp_loopstate < LOOP_HAVE_ADDR) { continue; } if (fcp->isp_portid == did) { Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 08:05:14 2016 (r298971) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:05:31 2016 (r298972) @@ -490,14 +490,15 @@ typedef struct { #define LOOP_NIL 0 #define LOOP_HAVE_LINK 1 -#define LOOP_TESTING_LINK 2 -#define LOOP_LTEST_DONE 3 -#define LOOP_SCANNING_LOOP 4 -#define LOOP_LSCAN_DONE 5 -#define LOOP_SCANNING_FABRIC 6 -#define LOOP_FSCAN_DONE 7 -#define LOOP_SYNCING_PDB 8 -#define LOOP_READY 9 +#define LOOP_HAVE_ADDR 2 +#define LOOP_TESTING_LINK 3 +#define LOOP_LTEST_DONE 4 +#define LOOP_SCANNING_LOOP 5 +#define LOOP_LSCAN_DONE 6 +#define LOOP_SCANNING_FABRIC 7 +#define LOOP_FSCAN_DONE 8 +#define LOOP_SYNCING_PDB 9 +#define LOOP_READY 10 #define TOPO_NL_PORT 0 #define TOPO_FL_PORT 1 From owner-svn-src-stable-10@freebsd.org Tue May 3 08:07:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8C57B295B3; Tue, 3 May 2016 08:07:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7CFFA1937; Tue, 3 May 2016 08:07:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4387cPx045274; Tue, 3 May 2016 08:07:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4387cGB045273; Tue, 3 May 2016 08:07:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030807.u4387cGB045273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:07: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: r298973 - stable/10/sys/dev/ispfw 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.22 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, 03 May 2016 08:07:40 -0000 Author: mav Date: Tue May 3 08:07:38 2016 New Revision: 298973 URL: https://svnweb.freebsd.org/changeset/base/298973 Log: MFC r297818: Update 25xx chips firmware from 7.03.00 to 8.03.00. While the same update is also available for 24xx chips, it seems have a problem with disabling virtual ports -- firmware handles the request, but does not respong on it, causing timeout in driver. Modified: stable/10/sys/dev/ispfw/asm_2500.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ispfw/asm_2500.h ============================================================================== --- stable/10/sys/dev/ispfw/asm_2500.h Tue May 3 08:05:31 2016 (r298972) +++ stable/10/sys/dev/ispfw/asm_2500.h Tue May 3 08:07:38 2016 (r298973) @@ -30,1158 +30,1197 @@ * * * ******************************************************************** */ /* - * Firmware Version 7.03.00 (Apr 14, 2014) + * Firmware Version 8.03.00 (2015) */ #ifdef ISP_2500 static const uint32_t isp_2500_risc_code[] = { - 0x0501f042, 0x00112000, 0x00100000, 0x0000d32a, - 0x00000007, 0x00000003, 0x00000000, 0x000090d5, + 0x0501f06b, 0x00116000, 0x00100000, 0x0000daa9, + 0x00000008, 0x00000003, 0x00000000, 0x001090d5, 0x00000004, 0x00000000, 0x20434f50, 0x59524947, - 0x48542032, 0x30303720, 0x514c4f47, 0x49432043, + 0x48542032, 0x30313520, 0x514c4f47, 0x49432043, 0x4f52504f, 0x52415449, 0x4f4e2020, 0x20495350, 0x32357878, 0x20466972, 0x6d776172, 0x65202020, - 0x56657273, 0x696f6e20, 0x2020372e, 0x30332e30, + 0x56657273, 0x696f6e20, 0x2020382e, 0x30332e30, 0x30202024, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100000, 0x00100000, - 0x0000d32a, 0xffffffff, 0x00112004, 0x00020000, - 0x000011a6, 0xffffffff, 0x001131af, 0x0000c000, - 0x00000aa2, 0x00ffffff, 0x00113c51, 0x00008000, - 0x00000703, 0x00ffffff, 0x00114354, 0x0000a000, - 0x00000621, 0x00ffffff, 0x00114975, 0x0000400e, + 0x0000daa9, 0xffffffff, 0x00116004, 0x00020000, + 0x000011e7, 0xffffffff, 0x001171f0, 0x0000c000, + 0x00000adf, 0x00ffffff, 0x00117ccf, 0x00008000, + 0x0000070b, 0x00ffffff, 0x001183da, 0x0000a000, + 0x0000062a, 0x00ffffff, 0x00118a04, 0x0000400e, 0x00000808, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x4203f000, 0x00021fff, - 0x40000000, 0x4203e000, 0x90000100, 0x40000000, - 0x42000800, 0x000211a7, 0x6002f000, 0x608c00e0, - 0x50000000, 0x8c000500, 0x05020003, 0x42000800, - 0x00020000, 0x45780800, 0x80040800, 0x82040580, - 0x00022000, 0x05fe07fc, 0x4178a000, 0x4200a800, - 0x0010d32a, 0x42000800, 0x00111b00, 0x40540000, - 0x8004b480, 0x0569f852, 0x0501ffcd, 0x600c6020, - 0x50304800, 0x8c240500, 0x0500001c, 0x59e00016, - 0x8c000504, 0x05020019, 0x0569f8a9, 0x604808fa, - 0x50041000, 0x82081500, 0xfffffffc, 0x90081d43, - 0x90081540, 0x84244d00, 0x440c0800, 0x44080800, - 0x44246000, 0x64030000, 0x4203e000, 0x70000000, - 0x4203e000, 0xb0300000, 0x603ff84e, 0x59e00016, - 0x8c000504, 0x05020002, 0x05fe47fd, 0x84244d40, - 0x44246000, 0x0569f892, 0x64030000, 0x0501fde5, - 0x4803c856, 0x0509fbf8, 0x6413c020, 0x4203e000, - 0x6000000f, 0x640f70e8, 0x640f78e8, 0x640da8e8, - 0x59e00023, 0x8c000500, 0x0502002b, 0x42002800, - 0x00100022, 0x58140800, 0x4817c857, 0x4807c857, - 0x800409c0, 0x0500000a, 0x58142002, 0x4813c857, - 0x58141003, 0x4c140000, 0x0501ff8c, 0x5c002800, - 0x0502003d, 0x90142c04, 0x05fdf7f3, 0x42002800, - 0x00100022, 0x5814a000, 0x4817c857, 0x4853c857, - 0x8050a1c0, 0x05000014, 0x4c140000, 0x5814a801, - 0x4857c857, 0x40500000, 0x80540480, 0x0500000b, - 0x82540480, 0x0000400e, 0x05020005, 0x9050a404, - 0x0509ff8a, 0x05020028, 0x0501f004, 0x5814b002, - 0x485bc857, 0x0565fff6, 0x5c002800, 0x90142c04, - 0x05fdf7e9, 0x050dfdf3, 0x42001000, 0x7ff481fe, - 0x59e00002, 0x8c00051e, 0x05020003, 0x42001000, - 0x7ff480fe, 0x50081000, 0x480b5092, 0x42002800, - 0x00100022, 0x58140801, 0x4817c857, 0x4807c857, - 0x800409c0, 0x05000023, 0x58142002, 0x4813c857, - 0x58141003, 0x4c140000, 0x82040480, 0x0000400e, - 0x05020004, 0x0509ff94, 0x4803c856, 0x0501f003, - 0x0501ff52, 0x05020004, 0x5c002800, 0x90142c04, - 0x05fdf7ed, 0x4803c856, 0x4a03c020, 0x00004010, - 0x4a03c011, 0x40100011, 0x05006000, 0x4203e000, - 0x40000000, 0x59e00017, 0x60000800, 0x8c00050a, - 0x050a0df0, 0x8d0c0530, 0x050a0de3, 0x050a0de5, - 0x6403c017, 0x4203e000, 0x30000001, 0x0501f000, - 0x4803c856, 0x59e00024, 0x8c000500, 0x050a0f32, - 0x0501ffca, 0x4a03c014, 0x001c001c, 0x4817c857, - 0x0501fff8, 0x42002000, 0x00111b00, 0x0565ffc3, - 0x59a800a1, 0x800001c0, 0x0500000c, 0x59a800ca, - 0x8c000500, 0x05000005, 0x59a8000a, 0x82000480, - 0x0013ffff, 0x05001005, 0x59a820a1, 0x80102000, - 0x59a8280a, 0x0565ffb5, 0x0569f9db, 0x0569fa02, - 0x59a8280a, 0x60000812, 0x60001802, 0x4807503b, - 0x480f529c, 0x60c01000, 0x053dfe68, 0x82040c00, - 0x00111b00, 0x4807500b, 0x600400de, 0x50000000, - 0x8c000502, 0x05000004, 0x59a800ca, 0x84000540, - 0x480350ca, 0x4a03c810, 0x00100000, 0x4a03c811, - 0x0010d32a, 0x0501ff90, 0x6447c829, 0x59e40001, - 0x82000540, 0x0003401f, 0x4803c801, 0x4a03c802, - 0x00000933, 0x59e00003, 0x82000540, 0x00240000, - 0x4803c003, 0x64ffc019, 0x60701000, 0x0501fedf, - 0x4202c000, 0x00111b00, 0x59aab00b, 0x59aaa00b, - 0x59aaa80b, 0x59aac83b, 0x4967509b, 0x496754dd, - 0x59a8000b, 0x4803500c, 0x0501fffe, 0x0549fa90, - 0x0505f807, 0x0505f875, 0x0509ffb5, 0x59a80084, - 0x8c000508, 0x05000004, 0x050dfebf, 0x0525f87d, - 0x050dffef, 0x0505f9b8, 0x0505ffb0, 0x053dfe71, - 0x0501fc55, 0x0515f812, 0x0531fb18, 0x052dfc90, - 0x0539fd03, 0x0509ffe6, 0x0509fe0f, 0x4203e000, - 0xf0000001, 0x0569f9c9, 0x6403c018, 0x4203e000, - 0xa0000001, 0x59a800ca, 0x80000540, 0x05000004, - 0x4203e000, 0x20000551, 0x0501f003, 0x4203e000, - 0x20000511, 0x4203e000, 0x50010000, 0x6403c020, - 0x05027019, 0x59e00020, 0x90000582, 0x05020016, - 0x4a03c020, 0x00004000, 0x4a03c011, 0x40000010, - 0x05006000, 0x4203e000, 0x40000000, 0x4df00000, - 0x4203e000, 0x50000000, 0x59e00017, 0x60000800, - 0x8c00050a, 0x00020892, 0x8d0c0530, 0x050a0d5a, - 0x000209bc, 0x5c03e000, 0x6403c017, 0x4203e000, - 0x30000001, 0x6002d800, 0x4203e000, 0xb0600000, - 0x59a800d5, 0x4003f800, 0x0001f004, 0x4df00000, - 0x4203e000, 0x50000000, 0x416c0000, 0x90000c88, - 0x05021c5e, 0x0c01f803, 0x5c03e000, 0x0001f006, - 0x00100189, 0x0010019a, 0x001002bf, 0x00100188, - 0x001003fa, 0x00100188, 0x00100188, 0x00100592, - 0x0501fc52, 0x42000800, 0x0010dceb, 0x5804001e, - 0x8c000500, 0x0500000c, 0x84000500, 0x4800081e, - 0x6012d800, 0x0501fe6d, 0x49f3c857, 0x5c000800, - 0x5c000000, 0x82000540, 0x00007e20, 0x4c000000, - 0x4c040000, 0x1c01f000, 0x41780000, 0x800001c0, - 0x05020039, 0x59c4000d, 0x8c00051e, 0x0502001f, - 0x59a800a7, 0x8c000500, 0x05000012, 0x60300830, - 0x050dfc0d, 0x90040560, 0x60300830, 0x4c000000, - 0x050dfc0e, 0x6041d04e, 0x0539fe5b, 0x5c000000, - 0x8400050a, 0x60300830, 0x050dfc08, 0x6191d000, - 0x0539fe55, 0x59c4000d, 0x8c00051e, 0x0502000b, - 0x59c40005, 0x8c000500, 0x05020008, 0x050dff96, - 0x640b50b4, 0x64075075, 0x6012d800, 0x42000000, - 0x0010e4be, 0x0565f622, 0x0501fe39, 0x052dfeef, - 0x0500000f, 0x052dfeff, 0x05020032, 0x5994002d, - 0x82000580, 0x001051ae, 0x05020004, 0x5994002c, - 0x800001c0, 0x0502002b, 0x59c40006, 0x82000540, - 0x000000c0, 0x48038806, 0x0501f026, 0x052dfe62, - 0x916c0581, 0x050200c5, 0x59a8003f, 0x90000589, - 0x050200c2, 0x497b503d, 0x42000800, 0xffffd815, - 0x0511fcf2, 0x42024800, 0x0010e512, 0x497a4805, - 0x64078893, 0x4a038805, 0x000000f0, 0x052dfedb, - 0x59c41006, 0x05020006, 0x82081540, 0x000000f1, - 0x82081500, 0xbbffffff, 0x0501f003, 0x82081540, - 0x440000f1, 0x480b8806, 0x0539fe23, 0x0541fb6d, - 0x0501f8ab, 0x050000a9, 0x42000000, 0x0010e39b, - 0x0565fdec, 0x60c01100, 0x497b50b2, 0x0501f036, - 0x0525f9b0, 0x59c400a4, 0x9000050f, 0x90000487, - 0x0502109e, 0x0539fe14, 0x59c400a3, 0x82000500, - 0xffefffff, 0x480388a3, 0x59a800bd, 0x800001c0, - 0x05020003, 0x0525ff01, 0x0501f094, 0x59a80043, - 0x84000546, 0x48035043, 0x052dfeae, 0x59c41006, - 0x05020006, 0x82081540, 0x44000001, 0x82081500, - 0xffffff0f, 0x0501f003, 0x82081540, 0x440000f1, - 0x480b8806, 0x497b9005, 0x0501f885, 0x05000083, - 0x60000000, 0x052dfc3b, 0x4a038802, 0x0000ffff, - 0x4a0378e4, 0x00003000, 0x42007000, 0x0010e060, - 0x58380401, 0x8c000508, 0x05020003, 0x4a01a8e4, - 0x0000c000, 0x42000000, 0x0010e392, 0x0565fdb9, - 0x59a8103d, 0x600c0800, 0x0541fb1b, 0x60401100, - 0x59a81809, 0x0521fdb3, 0x59a804cc, 0x82000500, - 0xffffff40, 0x480354cc, 0x59a80249, 0x84000518, - 0x48035249, 0x59c40001, 0x82000500, 0x00018000, - 0x82000580, 0x00018000, 0x59c400a3, 0x05020004, - 0x82000540, 0x00001000, 0x0501f003, 0x82000500, - 0xffffefff, 0x480388a3, 0x59c80015, 0x84000548, - 0x48039015, 0x050dfacb, 0x59a81008, 0x84081500, - 0x480b5008, 0x850e1d0a, 0x0529fd8a, 0x052dfe67, - 0x05000007, 0x8d0c0506, 0x05000005, 0x640750b2, - 0x850e1d0e, 0x0525fa79, 0x0501f048, 0x0529fe89, - 0x05000005, 0x59c41002, 0x8408150c, 0x480b8802, - 0x0501f017, 0x052dfe59, 0x05020005, 0x59a80046, - 0x80000540, 0x05540e1d, 0x0501f011, 0x0555fe1b, - 0x59a80249, 0x8c000506, 0x0502000d, 0x59a80046, - 0x80000540, 0x05020007, 0x59a81c49, 0x820c0580, - 0x0000ffff, 0x05000006, 0x8c0c0508, 0x05000004, - 0x4a035449, 0x0000ffff, 0x0525ffb4, 0x497b504b, - 0x497b504a, 0x497b50b3, 0x052dfe40, 0x59a81249, - 0x05020009, 0x050df8bd, 0x80001580, 0x59a8004d, - 0x82000500, 0xffff0000, 0x80040d40, 0x4807504d, - 0x0501f005, 0x59a8004d, 0x82000500, 0xffff0000, - 0x4803504d, 0x599c0017, 0x8c00050a, 0x05000002, - 0x84081544, 0x480b5249, 0x052dfe2c, 0x05000003, - 0x050df8aa, 0x48078880, 0x60141000, 0x0541ffae, - 0x497b504b, 0x497b5044, 0x4a035045, 0x0000ffff, - 0x4a01a8e4, 0x000000c0, 0x600ad800, 0x052dfe1f, - 0x05000005, 0x59a80249, 0x9000050c, 0x90000584, - 0x05000002, 0x0511fa30, 0x1c01f000, 0x0521fe7f, - 0x05020026, 0x599c0019, 0x82000500, 0x0000e000, - 0x82000580, 0x00004000, 0x05020020, 0x59c40001, - 0x82000d00, 0x00018000, 0x82040580, 0x00010000, - 0x05000004, 0x82040580, 0x00008000, 0x05020017, - 0x59a800a6, 0x90000483, 0x05001003, 0x90000541, - 0x0501f012, 0x050dfe6f, 0x64075075, 0x4a035076, - 0xaabbccdd, 0x64135069, 0x6403506a, 0x6012d800, - 0x59a800a6, 0x80000000, 0x480350a6, 0x59a800a5, - 0x82000500, 0xfffffff8, 0x90000544, 0x480350a5, - 0x0501fd42, 0x80000580, 0x1c01f000, 0x0525f854, - 0x05000051, 0x59a80249, 0x90000523, 0x900005a3, - 0x0502004d, 0x0525f853, 0x0500004b, 0x4a038802, - 0x0000ffbf, 0x59a804cc, 0x8c00050c, 0x0502012e, - 0x8c000506, 0x0502000b, 0x8c000508, 0x0502012a, - 0x84000548, 0x480354cc, 0x0525f84b, 0x05000004, - 0x417a5800, 0x0559fcae, 0x0501f123, 0x0501f0ea, - 0x8c00050a, 0x05020038, 0x8400054a, 0x480354cc, - 0x497b504b, 0x497b504a, 0x497b5044, 0x4a035045, - 0x0000ffff, 0x59a80249, 0x82000500, 0xffffff7c, - 0x48035249, 0x42024800, 0x0010e512, 0x59240200, - 0x82000500, 0xffffff1f, 0x48024a00, 0x59a802cc, - 0x5924100b, 0x82081500, 0x00001fff, 0x80080580, - 0x05000012, 0x4d3c0000, 0x4d300000, 0x4d400000, - 0x60aa8000, 0x417a6000, 0x600a7800, 0x41780800, - 0x0511fc4a, 0x5c028000, 0x5c026000, 0x5c027800, - 0x59a802cc, 0x5924080b, 0x82040d00, 0xffffe000, - 0x80040540, 0x4802480b, 0x4d300000, 0x417a6000, - 0x0511fbeb, 0x5c026000, 0x4803c856, 0x5924000c, - 0x800001c0, 0x05020006, 0x0001f817, 0x050000ee, - 0x492e480c, 0x5924000b, 0x48025802, 0x0511f9b6, - 0x0501f0e9, 0x59a80045, 0x82000580, 0x0000ffff, - 0x05000003, 0x0511f9b0, 0x0501f0e3, 0x0565fdfe, - 0x05000017, 0x0565fe01, 0x05000008, 0x052dfd93, - 0x05000006, 0x59a80249, 0x8c000506, 0x0500004e, - 0x0529fdb8, 0x050200d8, 0x80000580, 0x0509ff61, - 0x600ed800, 0x4a035045, 0x0000ffff, 0x4a01a8e4, - 0x00000080, 0x4a038802, 0x0000ffff, 0x850e1d02, - 0x0541fd6a, 0x0501fcb8, 0x0501f0cb, 0x59a80249, - 0x8c00050a, 0x05020003, 0x8c000506, 0x05000037, - 0x8c000500, 0x05000035, 0x4a038802, 0x0000ffbf, - 0x8c000502, 0x05000031, 0x0521ffde, 0x05020004, - 0x599c0018, 0x8c000516, 0x05020029, 0x59a8004a, - 0x82000580, 0x0000ffff, 0x05000020, 0x0521ffd5, - 0x05000006, 0x59a804cc, 0x8c000500, 0x05000003, - 0x0511fc27, 0x0501f008, 0x41781800, 0x0565fddb, - 0x05000002, 0x60401800, 0x59a80249, 0x8c00050a, - 0x05120a8a, 0x42024800, 0x0010e512, 0x417a4000, - 0x59240200, 0x82000500, 0x000000e0, 0x82000580, - 0x000000e0, 0x050200a0, 0x050dff2c, 0x59a80249, - 0x8c000504, 0x0502009c, 0x600c1000, 0x417a5800, - 0x050dff4b, 0x0501f098, 0x59a80249, 0x8c00051c, - 0x05020003, 0x8c000504, 0x05fc07f8, 0x59a8004b, - 0x80000540, 0x05020090, 0x59a80249, 0x8c000508, - 0x05020017, 0x59a80044, 0x80000540, 0x0502008a, - 0x59a80249, 0x8c00050e, 0x0500000c, 0x8c000502, - 0x0502000a, 0x052dfd39, 0x05000083, 0x82000500, - 0xffffff77, 0x48035249, 0x4a035045, 0x0000ffff, - 0x0511f949, 0x0501f07c, 0x0565fda8, 0x0500000c, - 0x0511fcc7, 0x05020078, 0x0501f009, 0x599c1819, - 0x8c0c0510, 0x05000004, 0x8c000502, 0x0502001d, - 0x0501f071, 0x8c000516, 0x0500006f, 0x0529fd4d, - 0x0502006d, 0x0521ff8b, 0x05020004, 0x599c0018, - 0x8c000516, 0x05020003, 0x052df90d, 0x05020066, - 0x59a80006, 0x8c00051c, 0x05020004, 0x599c0017, - 0x8c00050a, 0x0500000b, 0x61c0b00f, 0x417a8800, - 0x0001fb00, 0x05020004, 0x59340200, 0x8c00051a, - 0x05020059, 0x81468800, 0x8058b040, 0x05fe07f9, - 0x0565fda3, 0x05000004, 0x4a038802, 0x0000ffbf, - 0x0501f003, 0x4a038802, 0x0000ffff, 0x42001800, - 0x0010dd46, 0x0501fd73, 0x42001800, 0x0010dd53, - 0x0501fd70, 0x850e1d02, 0x4a01a8e4, 0x00000080, - 0x600ed800, 0x4a035045, 0x0000ffff, 0x0501fc2e, - 0x80000580, 0x0509fecb, 0x497b50a6, 0x64075078, - 0x0521ff5c, 0x0502000b, 0x599c0018, 0x8c000516, - 0x05000008, 0x59a804cc, 0x8c00050e, 0x05020036, - 0x8400054e, 0x480354cc, 0x0521fcda, 0x0501f016, - 0x59a81a49, 0x59a82041, 0x82102580, 0x0000aaaa, - 0x05000004, 0x8c0c0506, 0x05020002, 0x480f5449, - 0x8c0c0508, 0x05000007, 0x599c1819, 0x8c0c0510, - 0x05000004, 0x61f8180f, 0x60102000, 0x0501f003, - 0x61fc19ff, 0x60182000, 0x60003000, 0x417a4000, - 0x0521fc6c, 0x052dfce3, 0x0500000a, 0x59c40006, - 0x052dfcce, 0x05000004, 0x82000500, 0xffffff0f, - 0x0501f003, 0x82000500, 0xfbffffff, 0x48038806, - 0x0521ff30, 0x0500000a, 0x59a804cc, 0x8c000500, - 0x05000007, 0x59c40801, 0x82040d40, 0x00004000, - 0x48078801, 0x64c378e4, 0x0501f006, 0x59c40801, - 0x82040d00, 0xffffbfff, 0x48078801, 0x648378e4, - 0x0541fc9e, 0x1c01f000, 0x4c040000, 0x4c080000, - 0x4c100000, 0x59a8006a, 0x90000c84, 0x050219db, - 0x0c01f805, 0x5c002000, 0x5c001000, 0x5c000800, - 0x1c01f000, 0x00100409, 0x001004a3, 0x001004c8, - 0x00100576, 0x60380938, 0x050df9a7, 0x90040550, - 0x82000500, 0xfffffff7, 0x60380938, 0x050df9a7, - 0x59c410a3, 0x84081518, 0x480b88a3, 0x0521fd03, - 0x05020021, 0x599c0019, 0x82000500, 0x0000e000, - 0x82000580, 0x00004000, 0x0502001b, 0x59a808a5, - 0x90040d07, 0x90040580, 0x0502000b, 0x59a80069, - 0x90000582, 0x05000011, 0x050df8ea, 0x497b5068, - 0x050dfce9, 0x640f5076, 0x640b5069, 0x64075075, - 0x0501f00a, 0x90040584, 0x05020008, 0x497b2804, - 0x497b2805, 0x050dfcef, 0x64075075, 0x4a035076, - 0xaabbccdd, 0x64135069, 0x59a800a5, 0x80000000, - 0x480350a5, 0x60000001, 0x0509fe4e, 0x0539fbd6, - 0x59c408a3, 0x82040d00, 0xfffffff7, 0x480788a3, - 0x052dfc78, 0x0500000d, 0x052dfc82, 0x0500000b, - 0x052dfc7a, 0x05020999, 0x59c400a3, 0x84000532, - 0x84000570, 0x480388a3, 0x052dffa3, 0x4a038808, - 0x00000208, 0x0501f012, 0x59c400a3, 0x84000530, - 0x82000500, 0xbf7fffff, 0x480388a3, 0x61e00801, - 0x0525fd72, 0x59c400a3, 0x82000540, 0x00018000, - 0x8400051c, 0x480388a3, 0x82000500, 0xfffeffff, - 0x480388a3, 0x4a038808, 0x00000200, 0x59c40006, - 0x82000500, 0xfbffff0e, 0x48038806, 0x497b282c, - 0x497b282d, 0x61d00803, 0x42001000, 0x00100590, - 0x0539fa3c, 0x59c40805, 0x64078805, 0x0509fefb, - 0x05020006, 0x60040000, 0x050df8db, 0x60040000, - 0x050df8a9, 0x0501f01e, 0x0509fefa, 0x05020006, - 0x41780000, 0x050df8d4, 0x41780000, 0x050df8a2, - 0x0501f017, 0x0509fef9, 0x05020006, 0x60080000, - 0x050df8cd, 0x60080000, 0x050df89b, 0x0501f010, - 0x0509fef8, 0x05020006, 0x600c0000, 0x050df8c6, - 0x600c0000, 0x050df894, 0x0501f009, 0x0509fef7, - 0x05020956, 0x59a80075, 0x800001c0, 0x05000004, - 0x0509fef7, 0x6407506a, 0x0501f018, 0x050df914, - 0x6407506a, 0x052dfc27, 0x05000008, 0x052dfc31, - 0x05000006, 0x052dfc29, 0x05020948, 0x64075042, - 0x052dfb9d, 0x0501f00d, 0x59c400a4, 0x9000050f, - 0x90000588, 0x05000003, 0x4a038805, 0x04000000, - 0x59c400a3, 0x82000540, 0x0001c000, 0x480388a3, - 0x84000520, 0x480388a3, 0x1c01f000, 0x0501f8e9, - 0x05020003, 0x640f506a, 0x0501f021, 0x0509fed3, - 0x0502000d, 0x59a80075, 0x800001c0, 0x0500000a, - 0x0509fed3, 0x59a80074, 0x8c00051e, 0x05000018, - 0x052dfc0a, 0x05020006, 0x64075042, 0x052dfb7e, - 0x0501f003, 0x050df8be, 0x05020011, 0x050df855, - 0x640b506a, 0x497b5075, 0x59c400a3, 0x84000520, - 0x480388a3, 0x052dfbfd, 0x05000009, 0x0521fc57, - 0x05000007, 0x497b282c, 0x497b282d, 0x60b40800, - 0x42001000, 0x00100590, 0x0539f9da, 0x1c01f000, - 0x0501f8c4, 0x05020003, 0x640f506a, 0x0501f0a9, - 0x4a038805, 0x000000f0, 0x050df8a5, 0x050200a0, - 0x050dfab0, 0x05000017, 0x050dfa95, 0x05020015, - 0x050dfa9e, 0x0502000a, 0x59a80076, 0x90000584, - 0x05fc07f2, 0x0509fe9b, 0x0502000e, 0x59a80076, - 0x82000580, 0xaabbccdd, 0x05fc07ec, 0x59a80076, - 0x90000580, 0x05fc07e9, 0x0509fe80, 0x05020005, - 0x59a80076, 0x82000580, 0xaabbccdd, 0x05fc07e3, - 0x59a800a7, 0x8c000500, 0x0502000b, 0x59a80884, - 0x8c04050c, 0x05020008, 0x60380938, 0x050df8c2, - 0x90040548, 0x82000500, 0xffffffef, 0x60380938, - 0x050df8c2, 0x050dfa8b, 0x05000032, 0x0521fe5a, - 0x0500000c, 0x4a03c014, 0x00200020, 0x59c40001, - 0x82000500, 0x00018000, 0x82000580, 0x00018000, - 0x05020026, 0x4a03c013, 0x00200020, 0x0501f025, - 0x4a03c013, 0x03800300, 0x4a03c014, 0x03800380, + 0x00000000, 0x00000000, 0x00000009, 0x0000000c, + 0x0000000f, 0x00000012, 0x00000015, 0x00000000, + 0x00000000, 0x0000000f, 0x00000000, 0x00000000, + 0x00000000, 0x00100046, 0x00100045, 0x00000000, + 0x00100046, 0x00000000, 0x00000000, 0x00100046, + 0x00100045, 0x00100042, 0x00100046, 0x00100045, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00100046, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00100046, + 0x00100046, 0x00100046, 0x00000000, 0x00100046, + 0x00000000, 0x00000000, 0x00000000, 0x4203f000, + 0x00021fff, 0x40000000, 0x4203e000, 0x90000100, + 0x40000000, 0x42000800, 0x000211e8, 0x6002f000, + 0x608c00e0, 0x50000000, 0x8c000500, 0x05020003, + 0x42000800, 0x00020000, 0x45780800, 0x80040800, + 0x82040580, 0x00022000, 0x05fe07fc, 0x4178a000, + 0x4200a800, 0x0010daa9, 0x42000800, 0x00115aa4, + 0x40540000, 0x8004b480, 0x0569ffa4, 0x0501ffd3, + 0x600c6020, 0x50304800, 0x8c240500, 0x0500001c, + 0x59e00016, 0x8c000504, 0x05020019, 0x0569fffb, + 0x604808fa, 0x50041000, 0x82081500, 0xfffffffc, + 0x90081d43, 0x90081540, 0x84244d00, 0x440c0800, + 0x44080800, 0x44246000, 0x64030000, 0x4203e000, + 0x70000000, 0x4203e000, 0xb0300000, 0x603ff84e, + 0x59e00016, 0x8c000504, 0x05020002, 0x05fe47fd, + 0x84244d40, 0x44246000, 0x0569ffe4, 0x64030000, + 0x0501fdf7, 0x4803c856, 0x0509fc3e, 0x6413c020, + 0x4203e000, 0x6000000f, 0x640f70e8, 0x640f78e8, + 0x640da8e8, 0x59e00023, 0x8c000500, 0x0502002b, + 0x42002800, 0x00100022, 0x58140800, 0x4817c857, + 0x4807c857, 0x800409c0, 0x0500000a, 0x58142002, + 0x4813c857, 0x58141003, 0x4c140000, 0x0501ff92, + 0x5c002800, 0x0502003d, 0x90142c04, 0x05fdf7f3, + 0x42002800, 0x00100022, 0x5814a000, 0x4817c857, + 0x4853c857, 0x8050a1c0, 0x05000014, 0x4c140000, + 0x5814a801, 0x4857c857, 0x40500000, 0x80540480, + 0x0500000b, 0x82540480, 0x0000400e, 0x05020005, + 0x9050a404, 0x0509ffd2, 0x05020028, 0x0501f004, + 0x5814b002, 0x485bc857, 0x0569ff48, 0x5c002800, + 0x90142c04, 0x05fdf7e9, 0x050dfe4a, 0x42001000, + 0x7ff481fe, 0x59e00002, 0x8c00051e, 0x05020003, + 0x42001000, 0x7ff480fe, 0x50081000, 0x480b5095, + 0x42002800, 0x00100022, 0x58140801, 0x4817c857, + 0x4807c857, 0x800409c0, 0x05000023, 0x58142002, + 0x4813c857, 0x58141003, 0x4c140000, 0x82040480, + 0x0000400e, 0x05020004, 0x0509ffdc, 0x4803c856, + 0x0501f003, 0x0501ff58, 0x05020004, 0x5c002800, + 0x90142c04, 0x05fdf7ed, 0x4803c856, 0x4a03c020, + 0x00004010, 0x4a03c011, 0x40100011, 0x05006000, + 0x4203e000, 0x40000000, 0x59e00017, 0x60000800, + 0x8c00050a, 0x050a0e38, 0x8d0c0530, 0x050a0e2b, + 0x050a0e2d, 0x6403c017, 0x4203e000, 0x30000001, + 0x0501f000, 0x4803c856, 0x59e00024, 0x8c000500, + 0x050a0f7a, 0x59e00024, 0x8c00050e, 0x05000003, + 0x4a020200, 0x00003800, 0x0501ffd3, 0x4a03c014, + 0x001c001c, 0x4817c857, 0x0505f801, 0x42002000, + 0x00115aa4, 0x0569ff10, 0x59a800a4, 0x800001c0, + 0x0500000c, 0x59a800cf, 0x8c000500, 0x05000005, + 0x59a8000a, 0x82000480, 0x0013ffff, 0x05001005, + 0x59a820a4, 0x80102000, 0x59a8280a, 0x0569ff02, + 0x056df92b, 0x056df953, 0x59a8280a, 0x60800812, + 0x60001802, 0x4807503d, 0x480f529f, 0x900d0420, + 0x800404a0, 0x4803543e, 0x60c01000, 0x0541faf0, + 0x82040c00, 0x00115aa4, 0x4807500b, 0x600400de, + 0x50000000, 0x8c000502, 0x05000004, 0x59a800cf, + 0x84000540, 0x480350cf, 0x4a03c810, 0x00100000, + 0x4a03c811, 0x0010daa9, 0x0501ff96, 0x6447c829, + 0x59e40001, 0x82000540, 0x0003401f, 0x4803c801, + 0x4a03c802, 0x00000933, 0x59e00003, 0x82000540, + 0x00240000, 0x4803c003, 0x64ffc019, 0x60701000, + 0x0501fedd, 0x4202c000, 0x00115aa4, 0x42017800, + 0x00115aa4, 0x59aab00b, 0x59aaa00b, 0x59aaa80b, + 0x59aac83d, 0x4967509e, 0x496754e2, 0x59a8000b, + 0x4803500c, 0x0505f802, 0x0549ff51, 0x0505f80b, + 0x0505f898, 0x0509fff9, 0x59a80087, 0x8c000508, + 0x05000004, 0x050dff0c, 0x0525f9f0, 0x0511f83c, + 0x0505f9e7, 0x0509f81c, 0x0541faf7, 0x0501fc59, + 0x0515f887, 0x0531fdd5, 0x052dff41, 0x053df8ea, + 0x050df82a, 0x0509fe4d, 0x4203e000, 0xf0000001, + 0x056df915, 0x6403c018, 0x4203e000, 0xa0000001, + 0x59a800cf, 0x80000540, 0x05000004, 0x4203e000, + 0x20000551, 0x0501f003, 0x4203e000, 0x20000511, + 0x4203e000, 0x50010000, 0x6403c020, 0x05027019, + 0x59e00020, 0x90000582, 0x05020016, 0x4a03c020, + 0x00004000, 0x4a03c011, 0x40000010, 0x05006000, + 0x4203e000, 0x40000000, 0x4df00000, 0x4203e000, + 0x50000000, 0x59e00017, 0x60000800, 0x8c00050a, + 0x0002089a, 0x8d0c0530, 0x050a0d98, 0x000209c4, + 0x5c03e000, 0x6403c017, 0x4203e000, 0x30000001, + 0x6002d800, 0x4203e000, 0xb0600000, 0x59a800da, + 0x4003f800, 0x0001f004, 0x4df00000, 0x4203e000, + 0x50000000, 0x416c0000, 0x90000c88, 0x05021c66, + 0x0c01f803, 0x5c03e000, 0x0001f006, 0x001001bc, + 0x001001cd, 0x001002f2, 0x001001bb, 0x00100431, + 0x001001bb, 0x001001bb, 0x001005c9, 0x0501fc5a, + 0x42000800, 0x00111c71, 0x5804001e, 0x8c000500, + 0x0500000c, 0x84000500, 0x4800081e, 0x6012d800, + 0x0501fe69, 0x49f3c857, 0x5c000800, 0x5c000000, + 0x82000540, 0x00007e20, 0x4c000000, 0x4c040000, + 0x1c01f000, 0x41780000, 0x800001c0, 0x05020039, + 0x59c4000d, 0x8c00051e, 0x0502001f, 0x59a800aa, + 0x8c000500, 0x05000012, 0x60300830, 0x050dfc5a, + 0x90040560, 0x60300830, 0x4c000000, 0x050dfc5b, + 0x6041d04e, 0x053dfa93, 0x5c000000, 0x8400050a, + 0x60300830, 0x050dfc55, 0x6191d000, 0x053dfa8d, + 0x59c4000d, 0x8c00051e, 0x0502000b, 0x59c40005, + 0x8c000500, 0x05020008, 0x050dffe3, 0x640b50b9, + 0x64075078, 0x6012d800, 0x42000000, 0x00112462, + 0x0569f56a, 0x0501fe35, 0x0531f9a6, 0x0500000f, + 0x0531f9b6, 0x05020032, 0x5994002e, 0x82000580, + 0x001053a5, 0x05020004, 0x5994002d, 0x800001c0, + 0x0502002b, 0x59c40006, 0x82000540, 0x000000c0, + 0x48038806, 0x0501f026, 0x0531f913, 0x916c0581, + 0x050200c5, 0x59a80042, 0x90000589, 0x050200c2, + 0x497b5040, 0x42000800, 0xffffd815, 0x0511fd66, + 0x42024800, 0x001124b6, 0x497a4805, 0x64078893, + 0x4a038805, 0x000000f0, 0x0531f992, 0x59c41006, + 0x05020006, 0x82081540, 0x000000f1, 0x82081500, + 0xbbffffff, 0x0501f003, 0x82081540, 0x440000f1, + 0x480b8806, 0x053dfa5b, 0x0541fff8, 0x0501f8ab, + 0x050000a9, 0x42000000, 0x0011233c, 0x0569fd34, + 0x60c01100, 0x497b50b7, 0x0501f036, 0x0525fb72, + 0x59c400a4, 0x9000050f, 0x90000487, 0x0502109e, + 0x053dfa4c, 0x59c400a3, 0x82000500, 0xffefffff, + 0x480388a3, 0x59a800c2, 0x800001c0, 0x05020003, + 0x0529f8c5, 0x0501f094, 0x59a80046, 0x84000546, + 0x48035046, 0x0531f965, 0x59c41006, 0x05020006, + 0x82081540, 0x44000001, 0x82081500, 0xffffff0f, + 0x0501f003, 0x82081540, 0x440000f1, 0x480b8806, + 0x497b9005, 0x0501f885, 0x05000083, 0x60000000, + 0x052dfeec, 0x4a038802, 0x0000ffff, 0x4a0378e4, + 0x00003000, 0x42007000, 0x00111ffa, 0x58380401, + 0x8c000508, 0x05020003, 0x4a01a8e4, 0x0000c000, + 0x42000000, 0x00112333, 0x0569fd01, 0x59a81040, + 0x600c0800, 0x0541ffa6, 0x60401100, 0x59a81809, + 0x0521ff1d, 0x59a804d1, 0x82000500, 0xffffff40, + 0x480354d1, 0x59a8024c, 0x84000518, 0x4803524c, 0x59c40001, 0x82000500, 0x00018000, 0x82000580, - 0x00018000, 0x0502000c, 0x60880801, 0x61d81000, - 0x60201800, 0x0521fe44, 0x050008c8, 0x60880801, - 0x61b81000, 0x60201800, 0x0521fe3f, 0x050008c3, - 0x0501f00b, 0x60880801, 0x61d81000, 0x60201800, - 0x0521fe47, 0x050008bd, 0x60880801, 0x61b81000, - 0x60201800, 0x0521fe42, 0x050008b8, 0x4a03c014, - 0x03800000, 0x0501f003, 0x4a03c013, 0x00200000, - 0x052dfb92, 0x0500003d, 0x59c400a4, 0x9000050f, - 0x90000588, 0x05000021, 0x59c40005, 0x8c000534, - 0x0502001e, 0x5994002e, 0x800001c0, 0x05000007, - 0x0501fae3, 0x90000402, 0x5994082c, 0x80040480, - 0x0502103c, 0x0501f004, 0x5994002c, 0x90000482, - 0x05021038, 0x052dfb83, 0x05020036, 0x4a038805, - 0x000000f0, 0x052dfbad, 0x4a035041, 0x0000aaaa, - 0x64035042, 0x59c408a3, 0x90040d48, 0x480788a3, - 0x6006d800, 0x6403506a, 0x64078805, 0x497b282c, - 0x497b282d, 0x0501f019, 0x052dfb72, 0x05020007, - 0x59a80041, 0x82000580, 0x0000aaaa, 0x05020003, - 0x4a03503d, 0x00ffffff, 0x497b5041, 0x59c40006, - 0x82000540, 0x04000001, 0x48038806, 0x8d0c0506, - 0x05020004, 0x59c408a3, 0x90040d48, 0x480788a3, - 0x6006d800, 0x6403506a, 0x64078805, 0x497b282c, - 0x497b282d, 0x0501f00f, 0x59c40005, 0x82000500, - 0x000000c0, 0x0500000b, 0x59c40006, 0x82000540, - 0x000000f1, 0x48038806, 0x05fdf7f2, 0x0509fe0b, - 0x05020004, 0x59a80075, 0x800001c0, 0x05fe0757, - 0x497b8885, 0x1c01f000, 0x4803c856, 0x0521fb9f, - 0x05020005, 0x050dfbc2, 0x42000000, 0x0010e4bf, - 0x0565fa63, 0x60000001, 0x0509fd06, 0x6403506a, - 0x0509fdfa, 0x05020009, 0x59a80068, 0x800001c0, - 0x05000004, 0x80000040, 0x48035068, 0x05020003, - 0x642b5068, 0x64075075, 0x497b8885, 0x0501f22c, - 0x5994002c, 0x5994082d, 0x80040540, 0x1c01f000, - 0x497b282d, 0x1c01f000, 0x4a038805, 0x000000f0, - 0x1c01f000, 0x641f5093, 0x640f5094, 0x64035095, - 0x4a035096, 0x000090d5, 0x052dfe64, 0x4a035449, - 0x0000ffff, 0x4a03503d, 0x00ffffff, 0x0555fad7, - 0x4a03504d, 0x20200000, 0x4a03504e, 0x88000200, - 0x4a03504f, 0x00ff001f, 0x4a035050, 0x000007d0, - 0x4a035051, 0x80000a00, 0x4a035052, 0xa0000200, - 0x4a035053, 0x00ff0004, 0x4a035054, 0x00010000, - 0x4a035055, 0x80000000, 0x4a035056, 0x00000200, - 0x4a035057, 0x00ff0000, 0x4a035058, 0x00010000, - 0x4a03505f, 0x514c4f47, 0x4a035060, 0x49432020, - 0x1c01f000, 0x4d440000, 0x417a8800, 0x4c5c0000, - 0x4178b800, 0x0001fb00, 0x05020004, 0x0529fc62, - 0x05020002, 0x805cb800, 0x81468800, 0x83440580, - 0x000007f0, 0x05fe07f8, 0x405c0800, 0x5c00b800, - 0x5c028800, 0x1c01f000, 0x4803c857, 0x5c000000, - 0x4c000000, 0x4803c857, 0x0501f808, 0x485fc857, - 0x4203e000, 0x50000000, 0x5c000000, 0x4d780000, - 0x6008b900, 0x0501f005, 0x485fc857, 0x4203e000, - 0x50000000, 0x6008b900, 0x05006000, 0x4c000000, - 0x4c040000, 0x59bc00ea, 0x4803c857, 0x90000507, - 0x90000581, 0x05020003, 0x60000800, 0x053dff51, - 0x59b800ea, 0x4803c857, 0x641370e8, 0x5c000800, - 0x4807c025, 0x80040920, 0x4807c026, 0x5c000000, - 0x4803c023, 0x80000120, 0x4803c024, 0x5c000000, - 0x4803c857, 0x4803c021, 0x80000120, 0x4803c022, - 0x41f80000, 0x4803c029, 0x80000120, 0x4803c02a, - 0x41780800, 0x4807c027, 0x59a800af, 0x8c00050a, - 0x05000005, 0x59e00027, 0x8400054a, 0x4803c857, - 0x4803c027, 0x0565fafa, 0x0500004a, 0x42000800, - 0x001105c8, 0x46000800, 0xfaceface, 0x80040800, - 0x4c080000, 0x4c0c0000, 0x600010f4, 0x58080013, - 0x44000800, 0x80040800, 0x58080022, 0x44000800, - 0x80040800, 0x58080023, 0x44000800, 0x80040800, - 0x58080024, 0x44000800, 0x80040800, 0x58080025, - 0x44000800, 0x80040800, 0x58080028, 0x44000800, - 0x80040800, 0x610010f4, 0x602c1800, 0x50080000, - 0x44000800, 0x80081000, 0x80040800, 0x800c1840, - 0x05fe07fb, 0x600c1800, 0x600010f6, 0x480c1003, - 0x58080005, 0x44000800, 0x80040800, 0x800c1840, - 0x05fe17fb, 0x600010f8, 0x58080002, 0x44000800, - 0x80040800, 0x58080003, 0x44000800, 0x80040800, - 0x58080020, 0x44000800, 0x80040800, 0x58080021, - 0x44000800, 0x80040800, 0x58080022, 0x44000800, - 0x80040800, 0x58080023, 0x44000800, 0x80040800, - 0x600010f6, 0x58080007, 0x44000800, 0x80040800, - 0x5808002b, 0x44000800, 0x80040800, 0x5808007c, - 0x44000800, 0x80040800, 0x5c001800, 0x5c001000, - 0x64030000, 0x485fc020, 0x905cb9c0, 0x905cbd52, - 0x485fc011, 0x4203e000, 0x40000000, 0x6016d800, - 0x59e00017, 0x60000800, 0x8c00050a, 0x050a0875, - 0x8d0c0530, 0x050a0868, 0x050a086a, 0x6403c017, - 0x4203e000, 0x30000001, 0x0501f956, 0x05fdf7ff, - 0x60100000, 0x0501f80c, 0x4a03c855, 0x0001eb5a, - 0x59e40001, 0x82000540, 0xff000700, 0x4803c801, - 0x42000000, 0x0010e4e5, 0x49780003, 0x49780004, - 0x1c01f000, 0x42000800, 0x0010e4e7, 0x44000800, - 0x59e40801, 0x82041500, 0x00f3c0ff, 0x480bc801, - 0x8c040524, 0x0500000b, 0x4c000000, 0x59e41052, - 0x59e40054, 0x800000d4, 0x82000400, 0x00110772, - 0x80081480, 0x480bc853, 0x6503c800, 0x5c000000, - 0x4a03c850, 0x00110772, 0x800000d4, 0x82002400, - 0x00110771, 0x4813c851, 0x4a03c853, 0x00000400, - 0x42000000, 0x00110772, 0x82001400, 0x00001000, - 0x45780000, 0x80000000, 0x80081d80, 0x05fe07fd, - 0x4807c801, 0x1c01f000, 0x42002000, 0x0010e4e5, - 0x59e41801, 0x58100c01, 0x82040500, 0x00003800, - 0x820c1d00, 0xffffc7ff, 0x800c1d40, 0x480fc801, - 0x1c01f000, 0x5c036000, 0x4db00000, 0x49b3c857, - 0x4803c857, 0x1c01f000, 0x4c5c0000, 0x4c600000, - 0x4c640000, 0x8d0c052a, 0x0500002f, 0x401c0000, - 0x80040d40, 0x4004b800, 0x400cc000, 0x4018c800, - 0x0501f8d3, 0x41784000, 0x42002800, 0x0010e4e5, - 0x58142017, 0x5814000d, 0x80100400, 0x445c0000, - 0x80102000, 0x80000000, 0x82104d00, 0x000000ff, - 0x050008a9, 0x0500001c, 0x4c000000, 0x0501f890, - 0x5c000000, 0x44080000, 0x80102000, 0x80000000, - 0x82104d00, 0x000000ff, 0x0500089f, 0x05000012, - 0x44600000, 0x80102000, 0x80000000, 0x82104d00, - 0x000000ff, 0x05000898, 0x0500000b, 0x44640000, - 0x80102000, 0x80000000, 0x82104d00, 0x000000ff, - 0x05000891, 0x05000004, 0x48102817, 0x802041c0, - 0x05060d32, 0x5c00c800, 0x5c00c000, 0x5c00b800, + 0x00018000, 0x59c400a3, 0x05020004, 0x82000540, + 0x00001000, 0x0501f003, 0x82000500, 0xffffefff, + 0x480388a3, 0x59c80015, 0x84000548, 0x48039015, + 0x050dfb18, 0x59a81008, 0x84081500, 0x480b5008, + 0x850e1d0a, 0x0529ffc1, 0x0531f91e, 0x05000007, + 0x8d0c0506, 0x05000005, 0x640750b7, 0x850e1d0e, + 0x0525fc3b, 0x0501f048, 0x052df8c8, 0x05000005, + 0x59c41002, 0x8408150c, 0x480b8802, 0x0501f017, + 0x0531f910, 0x05020005, 0x59a80049, 0x80000540, + 0x05580b82, 0x0501f011, 0x0559fb80, 0x59a8024c, + 0x8c000506, 0x0502000d, 0x59a80049, 0x80000540, + 0x05020007, 0x59a81c4c, 0x820c0580, 0x0000ffff, + 0x05000006, 0x8c0c0508, 0x05000004, 0x4a03544c, + 0x0000ffff, 0x0529f978, 0x497b504e, 0x497b504d, + 0x497b50b8, 0x0531f8f7, 0x59a8124c, 0x05020009, + 0x050df90a, 0x80001580, 0x59a80050, 0x82000500, + 0xffff0000, 0x80040d40, 0x48075050, 0x0501f005, + 0x59a80050, 0x82000500, 0xffff0000, 0x48035050, + 0x599c0017, 0x8c00050a, 0x05000002, 0x84081544, + 0x480b524c, 0x0531f8e3, 0x05000003, 0x050df8f7, + 0x48078880, 0x60141000, 0x0545fc39, 0x497b504e, + 0x497b5047, 0x4a035048, 0x0000ffff, 0x4a01a8e4, + 0x000000c0, 0x600ad800, 0x0531f8d6, 0x05000005, + 0x59a8024c, 0x9000050c, 0x90000584, 0x05000002, + 0x0511fa95, 0x1c01f000, 0x0521fff2, 0x05020026, + 0x599c0019, 0x82000500, 0x0000e000, 0x82000580, + 0x00004000, 0x05020020, 0x59c40001, 0x82000d00, + 0x00018000, 0x82040580, 0x00010000, 0x05000004, + 0x82040580, 0x00008000, 0x05020017, 0x59a800a9, + 0x90000483, 0x05001003, 0x90000541, 0x0501f012, + 0x050dfebc, 0x64075078, 0x4a035079, 0xaabbccdd, + 0x6413506c, 0x6403506d, 0x6012d800, 0x59a800a9, + 0x80000000, 0x480350a9, 0x59a800a8, 0x82000500, + 0xfffffff8, 0x90000544, 0x480350a8, 0x0501fd3e, + 0x80000580, 0x1c01f000, 0x0525f9c7, 0x05000051, + 0x59a8024c, 0x90000523, 0x900005a3, 0x0502004d, + 0x0525f9c6, 0x0500004b, 0x4a038802, 0x0000ffbf, + 0x59a804d1, 0x8c00050c, 0x05020132, 0x8c000506, + 0x0502000b, 0x8c000508, 0x0502012e, 0x84000548, + 0x480354d1, 0x0525f9be, 0x05000004, 0x417a5800, + 0x055dfa2c, 0x0501f127, 0x0501f0ee, 0x8c00050a, + 0x05020038, 0x8400054a, 0x480354d1, 0x497b504e, + 0x497b504d, 0x497b5047, 0x4a035048, 0x0000ffff, + 0x59a8024c, 0x82000500, 0xffffff7c, 0x4803524c, + 0x42024800, 0x001124b6, 0x59240200, 0x82000500, + 0xffffff1f, 0x48024a00, 0x59a802d1, 0x5924100b, + 0x82081500, 0x00001fff, 0x80080580, 0x05000012, + 0x4d3c0000, 0x4d300000, 0x4d400000, 0x60aa8000, + 0x417a6000, 0x600a7800, 0x41780800, 0x0511fcbe, + 0x5c028000, 0x5c026000, 0x5c027800, 0x59a802d1, + 0x5924080b, 0x82040d00, 0xffffe000, 0x80040540, + 0x4802480b, 0x4d300000, 0x417a6000, 0x0511fc5f, + 0x5c026000, 0x4803c856, 0x5924000c, 0x800001c0, + 0x05020006, 0x0001f81f, 0x050000f2, 0x492e480c, + 0x5924000b, 0x48025802, 0x0511fa1b, 0x0501f0ed, + 0x59a80048, 0x82000580, 0x0000ffff, 0x05000003, + 0x0511fa15, 0x0501f0e7, 0x0569fd46, 0x05000017, + 0x0569fd49, 0x05000008, 0x0531f84a, 0x05000006, + 0x59a8024c, 0x8c000506, 0x0500004e, 0x0529fff7, + 0x050200dc, 0x80000580, 0x0509ffae, 0x600ed800, + 0x4a035048, 0x0000ffff, 0x4a01a8e4, 0x00000080, + 0x4a038802, 0x0000ffff, 0x850e1d02, 0x0545f9f5, + 0x0501fcb4, 0x0501f0cf, 0x59a8024c, 0x8c00050a, + 0x05020003, 0x8c000506, 0x05000037, 0x8c000500, + 0x05000035, 0x4a038802, 0x0000ffbf, 0x8c000502, + 0x05000031, 0x0525f951, 0x05020004, 0x599c0018, + 0x8c000516, 0x05020029, 0x59a8004d, 0x82000580, + 0x0000ffff, 0x05000020, 0x0525f948, 0x05000006, + 0x59a804d1, 0x8c000500, 0x05000003, 0x0511fc9b, + 0x0501f008, 0x41781800, 0x0569fd23, 0x05000002, + 0x60401800, 0x59a8024c, 0x8c00050a, 0x05120af3, + 0x42024800, 0x001124b6, 0x417a4000, 0x59240200, + 0x82000500, 0x000000e0, 0x82000580, 0x000000e0, + 0x050200a4, 0x050dff8c, 0x59a8024c, 0x8c000504, + 0x050200a0, 0x600c1000, 0x417a5800, 0x050dffab, + 0x0501f09c, 0x59a8024c, 0x8c00051c, 0x05020003, + 0x8c000504, 0x05fc07f8, 0x59a8004e, 0x80000540, + 0x05020094, 0x59a8024c, 0x8c000508, 0x05020017, + 0x59a80047, 0x80000540, 0x0502008e, 0x59a8024c, + 0x8c00050e, 0x0500000c, 0x8c000502, 0x0502000a, + 0x052dfff0, 0x05000087, 0x82000500, 0xffffff77, + 0x4803524c, 0x4a035048, 0x0000ffff, 0x0511f9ae, + 0x0501f080, 0x0569fcf0, 0x0500000c, 0x0511fd3c, + 0x0502007c, 0x0501f009, 0x599c1819, 0x8c0c0510, + 0x05000004, 0x8c000502, 0x05020021, 0x0501f075, + 0x8c000516, 0x05000073, 0x0529ff8c, 0x05020071, + 0x0525f8fe, 0x05020004, 0x599c0018, 0x8c000516, + 0x05020003, 0x052dfbaf, 0x0502006a, 0x59a80006, + 0x8c00051c, 0x05020004, 0x599c0017, 0x8c00050a, + 0x0500000f, 0x59a8b0ac, 0x417a8800, 0x0001fb08, + 0x05020004, 0x59340200, 0x8c00051a, 0x0502005d, + 0x81468800, 0x83440580, 0x000007f0, 0x05020002, + 0x60028810, 0x8058b040, 0x05fe07f5, 0x0569fce7, + 0x05000004, 0x4a038802, 0x0000ffbf, 0x0501f003, + 0x4a038802, 0x0000ffff, 0x42001800, 0x00111ce0, + 0x0501fd73, 0x42001800, 0x00111ced, 0x0501fd70, + 0x850e1d02, 0x4a01a8e4, 0x00000080, 0x600ed800, + 0x4a035048, 0x0000ffff, 0x0501fc26, 0x80000580, + 0x0509ff14, 0x497b50a9, 0x6407507b, 0x0525f8cb, + 0x0502000b, 0x599c0018, 0x8c000516, 0x05000008, + 0x59a804d1, 0x8c00050e, 0x05020036, 0x8400054e, + 0x480354d1, 0x0521fe46, 0x0501f016, 0x59a81a4c, + 0x59a82044, 0x82102580, 0x0000aaaa, 0x05000004, + 0x8c0c0506, 0x05020002, 0x480f544c, 0x8c0c0508, + 0x05000007, 0x599c1819, 0x8c0c0510, 0x05000004, + 0x61f8180f, 0x60102000, 0x0501f003, 0x61fc19ff, + 0x60182000, 0x60003000, 0x417a4000, 0x0521fdd2, + 0x052dff96, 0x0500000a, 0x59c40006, 0x052dff81, + 0x05000004, 0x82000500, 0xffffff0f, 0x0501f003, + 0x82000500, 0xfbffffff, 0x48038806, 0x0525f89f, + 0x0500000a, 0x59a804d1, 0x8c000500, 0x05000007, + 0x59c40801, 0x82040d40, 0x00004000, 0x48078801, + 0x64c378e4, 0x0501f006, 0x59c40801, 0x82040d00, + 0xffffbfff, 0x48078801, 0x648378e4, 0x0545f925, + 0x1c01f000, 0x4c040000, 0x4c080000, 0x4c100000, + 0x59a8006d, 0x90000c84, 0x050219df, 0x0c01f805, + 0x5c002000, 0x5c001000, 0x5c000800, 0x1c01f000, + 0x00100440, 0x001004da, 0x001004ff, 0x001005ad, + 0x60380938, 0x050df9f0, 0x90040550, 0x82000500, + 0xfffffff7, 0x60380938, 0x050df9f0, 0x59c410a3, + 0x84081518, 0x480b88a3, 0x0521fe72, 0x05020021, + 0x599c0019, 0x82000500, 0x0000e000, 0x82000580, + 0x00004000, 0x0502001b, 0x59a808a8, 0x90040d07, + 0x90040580, 0x0502000b, 0x59a8006c, 0x90000582, + 0x05000011, 0x050df933, 0x497b506b, 0x050dfd32, + 0x640f5079, 0x640b506c, 0x64075078, 0x0501f00a, + 0x90040584, 0x05020008, 0x497b2804, 0x497b2805, + 0x050dfd38, 0x64075078, 0x4a035079, 0xaabbccdd, + 0x6413506c, 0x59a800a8, 0x80000000, 0x480350a8, + 0x60000001, 0x0509fe97, 0x053df80a, 0x59c408a3, + 0x82040d00, 0xfffffff7, 0x480788a3, 0x052dff2b, + 0x0500000d, 0x052dff35, 0x0500000b, 0x052dff2d, + 0x0502099d, 0x59c400a3, 0x84000532, 0x84000570, + 0x480388a3, 0x0531fa5c, 0x4a038808, 0x00000208, + 0x0501f012, 0x59c400a3, 0x84000530, 0x82000500, + 0xbf7fffff, 0x480388a3, 0x61e00801, 0x0525ff32, + 0x59c400a3, 0x82000540, 0x00018000, 0x8400051c, + 0x480388a3, 0x82000500, 0xfffeffff, 0x480388a3, + 0x4a038808, 0x00000200, 0x59c40006, 0x82000500, + 0xfbffff0e, 0x48038806, 0x497b282d, 0x497b282e, + 0x61d00803, 0x42001000, 0x001005c7, 0x0539fe1f, + 0x59c40805, 0x64078805, 0x0509ff44, 0x05020006, + 0x60040000, 0x050df924, 0x60040000, 0x050df8f2, + 0x0501f01e, 0x0509ff43, 0x05020006, 0x41780000, + 0x050df91d, 0x41780000, 0x050df8eb, 0x0501f017, + 0x0509ff42, 0x05020006, 0x60080000, 0x050df916, + 0x60080000, 0x050df8e4, 0x0501f010, 0x0509ff41, + 0x05020006, 0x600c0000, 0x050df90f, 0x600c0000, + 0x050df8dd, 0x0501f009, 0x0509ff40, 0x0502095a, + 0x59a80078, 0x800001c0, 0x05000004, 0x0509ff40, + 0x6407506d, 0x0501f018, 0x050df95d, 0x6407506d, + 0x052dfeda, 0x05000008, 0x052dfee4, 0x05000006, + 0x052dfedc, 0x0502094c, 0x64075045, 0x052dfe4a, + 0x0501f00d, 0x59c400a4, 0x9000050f, 0x90000588, + 0x05000003, 0x4a038805, 0x04000000, 0x59c400a3, + 0x82000540, 0x0001c000, 0x480388a3, 0x84000520, + 0x480388a3, 0x1c01f000, 0x0501f8e9, 0x05020003, + 0x640f506d, 0x0501f021, 0x0509ff1c, 0x0502000d, + 0x59a80078, 0x800001c0, 0x0500000a, 0x0509ff1c, + 0x59a80077, 0x8c00051e, 0x05000018, 0x052dfebd, + 0x05020006, 0x64075045, 0x052dfe2b, 0x0501f003, + 0x050df907, 0x05020011, 0x050df89e, 0x640b506d, + 0x497b5078, 0x59c400a3, 0x84000520, 0x480388a3, + 0x052dfeb0, 0x05000009, 0x0521fdc6, 0x05000007, + 0x497b282d, 0x497b282e, 0x60b40800, 0x42001000, + 0x001005c7, 0x0539fdbd, 0x1c01f000, 0x0501f8c4, + 0x05020003, 0x640f506d, 0x0501f0a9, 0x4a038805, + 0x000000f0, 0x050df8ee, 0x050200a0, 0x050dfaf9, + 0x05000017, 0x050dfade, 0x05020015, 0x050dfae7, + 0x0502000a, 0x59a80079, 0x90000584, 0x05fc07f2, + 0x0509fee4, 0x0502000e, 0x59a80079, 0x82000580, + 0xaabbccdd, 0x05fc07ec, 0x59a80079, 0x90000580, + 0x05fc07e9, 0x0509fec9, 0x05020005, 0x59a80079, + 0x82000580, 0xaabbccdd, 0x05fc07e3, 0x59a800aa, + 0x8c000500, 0x0502000b, 0x59a80887, 0x8c04050c, + 0x05020008, 0x60380938, 0x050df90b, 0x90040548, + 0x82000500, 0xffffffef, 0x60380938, 0x050df90b, + 0x050dfad4, 0x05000032, 0x0525f817, 0x0500000c, + 0x4a03c014, 0x00200020, 0x59c40001, 0x82000500, + 0x00018000, 0x82000580, 0x00018000, 0x05020026, + 0x4a03c013, 0x00200020, 0x0501f025, 0x4a03c013, + 0x03800300, 0x4a03c014, 0x03800380, 0x59c40001, + 0x82000500, 0x00018000, 0x82000580, 0x00018000, + 0x0502000c, 0x60880801, 0x61d81000, 0x60201800, + 0x0525f801, 0x050008cc, 0x60880801, 0x61b81000, + 0x60201800, 0x0521fffc, 0x050008c7, 0x0501f00b, + 0x60880801, 0x61d81000, 0x60201800, 0x0525f804, + 0x050008c1, 0x60880801, 0x61b81000, 0x60201800, + 0x0521ffff, 0x050008bc, 0x4a03c014, 0x03800000, + 0x0501f003, 0x4a03c013, 0x00200000, 0x052dfe45, + 0x0500003d, 0x59c400a4, 0x9000050f, 0x90000588, + 0x05000021, 0x59c40005, 0x8c000534, 0x0502001e, + 0x5994002f, 0x800001c0, 0x05000007, 0x0501fadb, + 0x90000402, 0x5994082d, 0x80040480, 0x0502103c, + 0x0501f004, 0x5994002d, 0x90000482, 0x05021038, + 0x052dfe36, 0x05020036, 0x4a038805, 0x000000f0, + 0x052dfe60, 0x4a035044, 0x0000aaaa, 0x64035045, + 0x59c408a3, 0x90040d48, 0x480788a3, 0x6006d800, + 0x6403506d, 0x64078805, 0x497b282d, 0x497b282e, + 0x0501f019, 0x052dfe25, 0x05020007, 0x59a80044, + 0x82000580, 0x0000aaaa, 0x05020003, 0x4a035040, + 0x00ffffff, 0x497b5044, 0x59c40006, 0x82000540, + 0x04000001, 0x48038806, 0x8d0c0506, 0x05020004, + 0x59c408a3, 0x90040d48, 0x480788a3, 0x6006d800, + 0x6403506d, 0x64078805, 0x497b282d, 0x497b282e, + 0x0501f00f, 0x59c40005, 0x82000500, 0x000000c0, + 0x0500000b, 0x59c40006, 0x82000540, 0x000000f1, + 0x48038806, 0x05fdf7f2, 0x0509fe54, 0x05020004, + 0x59a80078, 0x800001c0, 0x05fe0757, 0x497b8885, + 0x1c01f000, 0x4803c856, 0x0521fd0e, 0x05020005, + 0x050dfc0b, 0x42000000, 0x00112463, 0x0569f9a7, + 0x60000001, 0x0509fd4f, 0x6403506d, 0x0509fe43, + 0x05020009, 0x59a8006b, 0x800001c0, 0x05000004, + 0x80000040, 0x4803506b, 0x05020003, 0x642b506b, + 0x64075078, 0x497b8885, 0x0501f224, 0x5994002d, + 0x5994082e, 0x80040540, 0x1c01f000, 0x497b282e, + 0x1c01f000, 0x4a038805, 0x000000f0, 0x1c01f000, + 0x64235096, 0x640f5097, 0x64035098, 0x4a035099, + 0x001090d5, 0x0531f91d, 0x4a03544c, 0x0000ffff, + 0x4a035040, 0x00ffffff, 0x0559f838, 0x4a035050, + 0x20200000, 0x4a035051, 0x88000200, 0x4a035052, + 0x00ff001f, 0x4a035053, 0x000007d0, 0x4a035054, + 0x80000a00, 0x4a035055, 0xa0000200, 0x4a035056, + 0x00ff0004, 0x4a035057, 0x00010000, 0x4a035058, + 0x80000000, 0x4a035059, 0x00000200, 0x4a03505a, + 0x00ff0000, 0x4a03505b, 0x00010000, 0x4a035062, + 0x514c4f47, 0x4a035063, 0x49432020, 0x1c01f000, + 0x4d440000, 0x417a8800, 0x4c5c0000, 0x4178b800, + 0x0001fb08, 0x05020004, 0x0529fef4, 0x05020002, + 0x805cb800, 0x81468800, 0x83440580, 0x000007f0, + 0x05020002, 0x60028810, 0x59a800ad, 0x81440580, + 0x05fe07f4, 0x405c0800, 0x5c00b800, 0x5c028800, + 0x1c01f000, 0x4803c857, 0x5c000000, 0x4c000000, + 0x4803c857, 0x0501f808, 0x485fc857, 0x4203e000, + 0x50000000, 0x5c000000, 0x4d780000, 0x6008b900, + 0x0501f005, 0x485fc857, 0x4203e000, 0x50000000, + 0x6008b900, 0x05006000, 0x4c000000, 0x4c040000, + 0x59bc00ea, 0x4803c857, 0x90000507, 0x90000581, + 0x05020003, 0x60000800, 0x0541fbd4, 0x59b800ea, + 0x4803c857, 0x641370e8, 0x5c000800, 0x4807c025, + 0x80040920, 0x4807c026, 0x5c000000, 0x4803c023, + 0x80000120, 0x4803c024, 0x5c000000, 0x4803c857, + 0x4803c021, 0x80000120, 0x4803c022, 0x41f80000, + 0x4803c029, 0x80000120, 0x4803c02a, 0x41780800, + 0x4807c027, 0x59a800b4, 0x8c00050a, 0x05000005, + 0x59e00027, 0x8400054a, 0x4803c857, 0x4803c027, + 0x0569fa3a, 0x0500004a, 0x42000800, 0x0011456c, + 0x46000800, 0xfaceface, 0x80040800, 0x4c080000, + 0x4c0c0000, 0x600010f4, 0x58080013, 0x44000800, + 0x80040800, 0x58080022, 0x44000800, 0x80040800, + 0x58080023, 0x44000800, 0x80040800, 0x58080024, + 0x44000800, 0x80040800, 0x58080025, 0x44000800, + 0x80040800, 0x58080028, 0x44000800, 0x80040800, + 0x610010f4, 0x602c1800, 0x50080000, 0x44000800, + 0x80081000, 0x80040800, 0x800c1840, 0x05fe07fb, + 0x600c1800, 0x600010f6, 0x480c1003, 0x58080005, + 0x44000800, 0x80040800, 0x800c1840, 0x05fe17fb, + 0x600010f8, 0x58080002, 0x44000800, 0x80040800, + 0x58080003, 0x44000800, 0x80040800, 0x58080020, + 0x44000800, 0x80040800, 0x58080021, 0x44000800, + 0x80040800, 0x58080022, 0x44000800, 0x80040800, + 0x58080023, 0x44000800, 0x80040800, 0x600010f6, + 0x58080007, 0x44000800, 0x80040800, 0x5808002b, + 0x44000800, 0x80040800, 0x5808007c, 0x44000800, + 0x80040800, 0x5c001800, 0x5c001000, 0x64030000, + 0x485fc020, 0x905cb9c0, 0x905cbd52, 0x485fc011, + 0x4203e000, 0x40000000, 0x6016d800, 0x59e00017, + 0x60000800, 0x8c00050a, 0x050a08ab, 0x8d0c0530, + 0x050a089e, 0x050a08a0, 0x6403c017, 0x4203e000, + 0x30000001, 0x0501f94a, 0x05fdf7ff, 0x600c0000, + 0x0501f80c, 0x4a03c855, 0x0001eb5a, 0x59e40001, + 0x82000540, 0xff000700, 0x4803c801, 0x42000000, + 0x00112489, 0x49780003, 0x49780004, 0x1c01f000, + 0x42000800, 0x0011248b, 0x44000800, 0x59e40801, + 0x82041500, 0x00f3c0ff, 0x480bc801, 0x4a03c850, + 0x00114716, 0x800000d4, 0x82002400, 0x00114715, + 0x4813c851, 0x4a03c853, 0x00000400, 0x42000000, + 0x00114716, 0x82001400, 0x00000c00, 0x45780000, + 0x80000000, 0x80081d80, 0x05fe07fd, 0x4807c801, + 0x1c01f000, 0x42002000, 0x00112489, 0x59e41801, + 0x58100c01, 0x82040500, 0x00003800, 0x820c1d00, + 0xffffc7ff, 0x800c1d40, 0x480fc801, 0x1c01f000, + 0x5c036000, 0x4db00000, 0x49b3c857, 0x4803c857, 0x1c01f000, 0x4c5c0000, 0x4c600000, 0x4c640000, - 0x42001000, 0x04000000, 0x41ccc800, 0x42002800, - 0x0010e4e5, 0x59a800d0, 0x82000d00, 0x000003ff, - 0x4c000000, 0x58140212, 0x0501f85d, 0x5c000000, - 0x4004b800, 0x4008c000, 0x905cbc06, 0x8c000516, - 0x05000002, 0x905cbc02, 0x0501f016, 0x4c5c0000, - 0x4c600000, 0x4c640000, 0x42002800, 0x0010e4e5, - 0x42001000, 0x03000000, 0x4000c800, 0x821c0500, - 0x00003c00, 0x80000114, 0x821c0d00, 0x000003ff, - 0x4c000000, 0x58140412, 0x0501f845, 0x5c000000, - 0x4004b800, 0x4008c000, 0x805cbc00, 0x805cb840, - 0x825c0480, 0x00000240, 0x05fe1ed0, 0x0501f878, - 0x405c0000, 0x905cbc02, 0x80600d40, 0x42002800, - 0x0010e4e5, 0x41784000, 0x58142017, 0x825c0480, - 0x00000101, 0x05021028, 0x5814000d, 0x80100400, - 0x44040000, 0x80102000, 0x80000000, 0x805cb840, - 0x82104d00, 0x000000ff, 0x05000847, 0x0500001a, - 0x4c000000, 0x0501f82e, 0x5c000000, 0x44080000, + 0x8d0c052a, 0x0500002f, 0x401c0000, 0x80040d40, + 0x4004b800, 0x400cc000, 0x4018c800, 0x0501f8d3, + 0x41784000, 0x42002800, 0x00112489, 0x58142017, + 0x5814000d, 0x80100400, 0x445c0000, 0x80102000, + 0x80000000, 0x82104d00, 0x000000ff, 0x050008a9, + 0x0500001c, 0x4c000000, 0x0501f890, 0x5c000000, + 0x44080000, 0x80102000, 0x80000000, 0x82104d00, + 0x000000ff, 0x0500089f, 0x05000012, 0x44600000, + 0x80102000, 0x80000000, 0x82104d00, 0x000000ff, + 0x05000898, 0x0500000b, 0x44640000, 0x80102000, + 0x80000000, 0x82104d00, 0x000000ff, 0x05000891, + 0x05000004, 0x48102817, 0x802041c0, 0x05060d72, + 0x5c00c800, 0x5c00c000, 0x5c00b800, 0x1c01f000, + 0x4c5c0000, 0x4c600000, 0x4c640000, 0x42001000, + 0x04000000, 0x41ccc800, 0x42002800, 0x00112489, + 0x59a800d5, 0x82000d00, 0x000003ff, 0x4c000000, + 0x58140212, 0x0501f85d, 0x5c000000, 0x4004b800, + 0x4008c000, 0x905cbc06, 0x8c000516, 0x05000002, + 0x905cbc02, 0x0501f016, 0x4c5c0000, 0x4c600000, + 0x4c640000, 0x42002800, 0x00112489, 0x42001000, + 0x03000000, 0x4000c800, 0x821c0500, 0x00003c00, + 0x80000114, 0x821c0d00, 0x000003ff, 0x4c000000, + 0x58140412, 0x0501f845, 0x5c000000, 0x4004b800, + 0x4008c000, 0x805cbc00, 0x805cb840, 0x825c0480, + 0x00000240, 0x05fe1edc, 0x0501f878, 0x405c0000, + 0x905cbc02, 0x80600d40, 0x42002800, 0x00112489, + 0x41784000, 0x58142017, 0x825c0480, 0x00000101, + 0x05021028, 0x5814000d, 0x80100400, 0x44040000, 0x80102000, 0x80000000, 0x805cb840, 0x82104d00, - 0x000000ff, 0x0500083c, 0x0500000f, 0x50641800, - 0x440c0000, 0x80000000, 0x80102000, 0x8064c800, - 0x805cb840, 0x05fe07f6, 0x82104d00, 0x000000ff, - 0x05000831, 0x05000004, 0x48102817, 0x802041c0, - 0x05060cd2, 0x5c00c800, 0x5c00c000, 0x5c00b800, - 0x1c01f000, 0x82100500, 0x000000ff, 0x805c0400, - 0x82000480, 0x00000200, 0x05fc17d4, 0x6108b800, - 0x82600d40, 0x00008040, 0x05fdf7d0, 0x800001c0, - 0x05000006, 0x80041c80, 0x05001004, 0x05000003, - 0x40000800, 0x8408155c, 0x1c01f000, 0x59a800ba, - 0x800018c4, 0x800010ca, 0x800000cc, 0x800c0400, - 0x80081400, 0x59940024, 0x61a01807, 0x800c1c80, - 0x05021002, 0x61a01807, 0x5994002e, 0x800c0400, - 0x82001c80, 0x000007d0, 0x05001002, 0x6140000f, - 0x4c080000, 0x0501f8b6, 0x5c001000, 0x80081400, - 0x1c01f000, 0x4813c857, 0x5c036000, 0x4db00000, - 0x49b3c857, 0x40001800, 0x58140000, 0x8c000502, - 0x05000009, 0x58140821, 0x80040800, 0x48042821, - 0x4807c857, 0x8400054a, 0x48002800, 0x80000580, - 0x0501f00e, 0x82102500, 0x000003ff, 0x80204000, - 0x58140014, 0x80000000, 0x90000503, 0x48002814, - 0x05000003, 0x400c0000, 0x0501f002, 0x5814000d, - 0x80000540, 0x4803c857, 0x1c01f000, 0x42002800, - 0x0010e4e5, 0x58140000, 0x8c00050a, 0x0500002f, - 0x8c000502, 0x0502002d, 0x4c5c0000, 0x5814b821, - 0x49782821, 0x8400050a, 0x48002800, 0x58142017, - 0x4813c857, 0x5814000d, 0x80100400, 0x41784000, - 0x42000800, 0x0b000001, 0x44040000, 0x80000000, - 0x80102000, 0x82104d00, 0x000000ff, 0x05fc0fca, - 0x05fc0e3e, 0x4c000000, 0x05fdffb1, 0x5c000000, - 0x44080000, 0x80000000, 0x80102000, 0x82104d00, - 0x000000ff, 0x05fc0fc0, 0x05fc0e34, 0x445c0000, + 0x000000ff, 0x05000847, 0x0500001a, 0x4c000000, + 0x0501f82e, 0x5c000000, 0x44080000, 0x80102000, + 0x80000000, 0x805cb840, 0x82104d00, 0x000000ff, + 0x0500083c, 0x0500000f, 0x50641800, 0x440c0000, + 0x80000000, 0x80102000, 0x8064c800, 0x805cb840, + 0x05fe07f6, 0x82104d00, 0x000000ff, 0x05000831, + 0x05000004, 0x48102817, 0x802041c0, 0x05060d12, + 0x5c00c800, 0x5c00c000, 0x5c00b800, 0x1c01f000, + 0x82100500, 0x000000ff, 0x805c0400, 0x82000480, + 0x00000200, 0x05fc17d4, 0x6108b800, 0x82600d40, + 0x00008040, 0x05fdf7d0, 0x800001c0, 0x05000006, + 0x80041c80, 0x05001004, 0x05000003, 0x40000800, + 0x8408155c, 0x1c01f000, 0x59a800bf, 0x800018c4, + 0x800010ca, 0x800000cc, 0x800c0400, 0x80081400, + 0x59940024, 0x61a01807, 0x800c1c80, 0x05021002, + 0x61a01807, 0x5994002f, 0x800c0400, 0x82001c80, + 0x000007d0, 0x05001002, 0x6140000f, 0x4c080000, + 0x0501f8b6, 0x5c001000, 0x80081400, 0x1c01f000, + 0x4813c857, 0x5c036000, 0x4db00000, 0x49b3c857, + 0x40001800, 0x58140000, 0x8c000502, 0x05000009, + 0x58140821, 0x80040800, 0x48042821, 0x4807c857, + 0x8400054a, 0x48002800, 0x80000580, 0x0501f00e, + 0x82102500, 0x000003ff, 0x80204000, 0x58140014, + 0x80000000, 0x90000503, 0x48002814, 0x05000003, + 0x400c0000, 0x0501f002, 0x5814000d, 0x80000540, + 0x4803c857, 0x1c01f000, 0x42002800, 0x00112489, + 0x58140000, 0x8c00050a, 0x0500002f, 0x8c000502, + 0x0502002d, 0x4c5c0000, 0x5814b821, 0x49782821, + 0x8400050a, 0x48002800, 0x58142017, 0x4813c857, + 0x5814000d, 0x80100400, 0x41784000, 0x42000800, + 0x0b000001, 0x44040000, 0x80000000, 0x80102000, + 0x82104d00, 0x000000ff, 0x05fc0fca, 0x05fc0e4a, + 0x4c000000, 0x05fdffb1, 0x5c000000, 0x44080000, 0x80000000, 0x80102000, 0x82104d00, 0x000000ff, - 0x05fc0fb9, 0x05fc0e2d, 0x48102817, 0x802041c0, - 0x05060c5a, 0x405c2000, 0x600c1800, 0x60a01100, - 0x0521f828, 0x5c00b800, 0x1c01f000, 0x1c01f000, - 0x59a800b5, 0x8c000530, 0x05fe07fe, 0x4c080000, - 0x60101000, 0x0501f849, 0x5c001000, 0x4201d000, - 0x00028b0a, 0x0539f844, 0x4c080000, 0x60201000, - 0x0501f842, 0x5c001000, 0x4201d000, 0x00028b0a, - 0x0539f83d, 0x4c080000, 0x60401000, 0x0501f83b, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Tue May 3 08:35:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94FE9B2A080; Tue, 3 May 2016 08:35:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 71A321C6B; Tue, 3 May 2016 08:35:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u438ZZgi054748; Tue, 3 May 2016 08:35:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u438ZZ0w054747; Tue, 3 May 2016 08:35:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030835.u438ZZ0w054747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:35: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: r298975 - stable/10/sys/dev/isp 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.22 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, 03 May 2016 08:35:36 -0000 Author: mav Date: Tue May 3 08:35:35 2016 New Revision: 298975 URL: https://svnweb.freebsd.org/changeset/base/298975 Log: MFC r298103: Simplify memory allocation for NS requests. Since we no longer need additional buffers for request and response IOCBs, we can increase receive space by 192 bytes, that is enough for fetching 48 more ports. The new limit is 1020 fabric ports per virtual port. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:13:25 2016 (r298974) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:35:35 2016 (r298975) @@ -3465,19 +3465,14 @@ abort: * * Use the GID_FT command to get all Port IDs for FC4 SCSI devices it knows. * - * For 2100-23XX cards, we can use the SNS mailbox command to pass simple - * name server commands to the switch management server via the QLogic f/w. + * For 2100-23XX cards, we use the SNS mailbox command to pass simple name + * server commands to the switch management server via the QLogic f/w. * - * For the 24XX card, we have to use CT-Pass through run via the Execute IOCB - * mailbox command. + * For the 24XX and above card, we use CT Pass-through IOCB. */ -#define GIDLEN (ISP_FC_SCRLEN - (3 * QENTRY_LEN)) +#define GIDLEN ISP_FC_SCRLEN #define NGENT ((GIDLEN - 16) >> 2) -#define XTXOFF (ISP_FC_SCRLEN - (3 * QENTRY_LEN)) /* CT request */ -#define CTXOFF (ISP_FC_SCRLEN - (2 * QENTRY_LEN)) /* Request IOCB */ -#define ZTXOFF (ISP_FC_SCRLEN - (1 * QENTRY_LEN)) /* Response IOCB */ - static int isp_gid_ft_sns(ispsoftc_t *isp, int chan) { @@ -3507,16 +3502,16 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan rq->snscb_mword_div_2 = NGENT; rq->snscb_fc4_type = FC4_SCSI; - isp_put_gid_ft_request(isp, rq, (sns_gid_ft_req_t *)&scp[CTXOFF]); - MEMORYBARRIER(isp, SYNC_SFORDEV, CTXOFF, SNS_GID_FT_REQ_SIZE, chan); + isp_put_gid_ft_request(isp, rq, (sns_gid_ft_req_t *)scp); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE, chan); MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 10000000); mbs.param[0] = MBOX_SEND_SNS; mbs.param[1] = SNS_GID_FT_REQ_SIZE >> 1; - mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); - mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); - mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); - mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { if (mbs.param[0] == MBOX_INVALID_COMMAND) { @@ -3555,8 +3550,8 @@ isp_ct_passthru(ispsoftc_t *isp, int cha pt.ctp_rsp_cnt = 1; pt.ctp_rsp_bcnt = rsp_bcnt; pt.ctp_cmd_bcnt = cmd_bcnt; - pt.ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); - pt.ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); + pt.ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma); + pt.ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma); pt.ctp_dataseg[0].ds_count = cmd_bcnt; pt.ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); pt.ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); @@ -3626,12 +3621,12 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, ct.ct_fcs_subtype = CT_FC_SUBTYPE_NS; ct.ct_cmd_resp = SNS_GID_FT; ct.ct_bcnt_resid = (GIDLEN - 16) >> 2; - isp_put_ct_hdr(isp, &ct, (ct_hdr_t *) &scp[XTXOFF]); - rp = (uint32_t *) &scp[XTXOFF + sizeof(ct)]; + isp_put_ct_hdr(isp, &ct, (ct_hdr_t *)scp); + rp = (uint32_t *) &scp[sizeof(ct)]; ISP_IOZPUT_32(isp, FC4_SCSI, rp); if (isp->isp_dblev & ISP_LOGDEBUG1) { isp_print_bytes(isp, "CT request", - sizeof(ct) + sizeof(uint32_t), &scp[XTXOFF]); + sizeof(ct) + sizeof(uint32_t), scp); } if (isp_ct_passthru(isp, chan, sizeof(ct) + sizeof(uint32_t), GIDLEN)) { @@ -4042,9 +4037,9 @@ isp_register_fc4_type_24xx(ispsoftc_t *i rp.rftid_portid[1] = fcp->isp_portid >> 8; rp.rftid_portid[2] = fcp->isp_portid; rp.rftid_fc4types[FC4_SCSI >> 5] = 1 << (FC4_SCSI & 0x1f); - isp_put_rft_id(isp, &rp, (rft_id_t *)&scp[XTXOFF]); + isp_put_rft_id(isp, &rp, (rft_id_t *)scp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", sizeof(rft_id_t), &scp[XTXOFF]); + isp_print_bytes(isp, "CT request", sizeof(rft_id_t), scp); if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); @@ -4097,9 +4092,9 @@ isp_register_fc4_features_24xx(ispsoftc_ if (fcp->role & ISP_ROLE_INITIATOR) rp.rffid_fc4features |= 2; rp.rffid_fc4type = FC4_SCSI; - isp_put_rff_id(isp, &rp, (rff_id_t *)&scp[XTXOFF]); + isp_put_rff_id(isp, &rp, (rff_id_t *)scp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", sizeof(rft_id_t), &scp[XTXOFF]); + isp_print_bytes(isp, "CT request", sizeof(rft_id_t), scp); if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); @@ -4152,20 +4147,20 @@ isp_register_port_name_24xx(ispsoftc_t * rp.rspnid_length = 0; len = offsetof(rspn_id_t, rspnid_name); mtx_lock(&prison0.pr_mtx); - rp.rspnid_length += sprintf(&scp[XTXOFF + len + rp.rspnid_length], + rp.rspnid_length += sprintf(&scp[len + rp.rspnid_length], "%s", prison0.pr_hostname[0] ? prison0.pr_hostname : "FreeBSD"); mtx_unlock(&prison0.pr_mtx); - rp.rspnid_length += sprintf(&scp[XTXOFF + len + rp.rspnid_length], + rp.rspnid_length += sprintf(&scp[len + rp.rspnid_length], ":%s", device_get_nameunit(isp->isp_dev)); if (chan != 0) { - rp.rspnid_length += sprintf(&scp[XTXOFF + len + - rp.rspnid_length], "/%d", chan); + rp.rspnid_length += sprintf(&scp[len + rp.rspnid_length], + "/%d", chan); } len += rp.rspnid_length; ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; - isp_put_rspn_id(isp, &rp, (rspn_id_t *)&scp[XTXOFF]); + isp_put_rspn_id(isp, &rp, (rspn_id_t *)scp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", len, &scp[XTXOFF]); + isp_print_bytes(isp, "CT request", len, scp); if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); @@ -4216,14 +4211,14 @@ isp_register_node_name_24xx(ispsoftc_t * rp.rsnnnn_length = 0; len = offsetof(rsnn_nn_t, rsnnnn_name); mtx_lock(&prison0.pr_mtx); - rp.rsnnnn_length += sprintf(&scp[XTXOFF + len + rp.rsnnnn_length], + rp.rsnnnn_length += sprintf(&scp[len + rp.rsnnnn_length], "%s", prison0.pr_hostname[0] ? prison0.pr_hostname : "FreeBSD"); mtx_unlock(&prison0.pr_mtx); len += rp.rsnnnn_length; ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; - isp_put_rsnn_nn(isp, &rp, (rsnn_nn_t *)&scp[XTXOFF]); + isp_put_rsnn_nn(isp, &rp, (rsnn_nn_t *)scp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", len, &scp[XTXOFF]); + isp_print_bytes(isp, "CT request", len, scp); if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); From owner-svn-src-stable-10@freebsd.org Tue May 3 15:04:58 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C56FB2B5AA; Tue, 3 May 2016 15:04:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B174E1970; Tue, 3 May 2016 15:04:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43F4uvU075143; Tue, 3 May 2016 15:04:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43F4ubx075142; Tue, 3 May 2016 15:04:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605031504.u43F4ubx075142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 15:04:56 +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: r298979 - stable/10/sbin/ifconfig 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.22 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, 03 May 2016 15:04:58 -0000 Author: pfg Date: Tue May 3 15:04:56 2016 New Revision: 298979 URL: https://svnweb.freebsd.org/changeset/base/298979 Log: MFC r298556: ifconfig: prevent some improbable signed integer overflows. ic_nchans, from struct:ieee80211req_chaninfo, is an unsigned int. Use an unsigned index to prevent overflowing the index. Adopt unsigned integers in other cases where it is useful to be aware of the unsigned quantities and there is no risk of the values being negative. Modified: stable/10/sbin/ifconfig/ifieee80211.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifieee80211.c ============================================================================== --- stable/10/sbin/ifconfig/ifieee80211.c Tue May 3 14:49:49 2016 (r298978) +++ stable/10/sbin/ifconfig/ifieee80211.c Tue May 3 15:04:56 2016 (r298979) @@ -223,7 +223,7 @@ static int canpromote(int i, int from, int to) { const struct ieee80211_channel *fc = &chaninfo->ic_chans[i]; - int j; + u_int j; if ((fc->ic_flags & from) != from) return i; @@ -302,7 +302,7 @@ promote(int i) static void mapfreq(struct ieee80211_channel *chan, int freq, int flags) { - int i; + u_int i; for (i = 0; i < chaninfo->ic_nchans; i++) { const struct ieee80211_channel *c = &chaninfo->ic_chans[i]; @@ -322,7 +322,7 @@ mapfreq(struct ieee80211_channel *chan, static void mapchan(struct ieee80211_channel *chan, int ieee, int flags) { - int i; + u_int i; for (i = 0; i < chaninfo->ic_nchans; i++) { const struct ieee80211_channel *c = &chaninfo->ic_chans[i]; @@ -2939,7 +2939,7 @@ copy_essid(char buf[], size_t bufsize, c { const u_int8_t *p; size_t maxlen; - int i; + u_int i; if (essid_len > bufsize) maxlen = bufsize; @@ -4133,7 +4133,7 @@ static void printkey(const struct ieee80211req_key *ik) { static const uint8_t zerodata[IEEE80211_KEYBUF_SIZE]; - int keylen = ik->ik_keylen; + u_int keylen = ik->ik_keylen; int printcontents; printcontents = printkeys && @@ -4170,7 +4170,7 @@ printkey(const struct ieee80211req_key * break; } if (printcontents) { - int i; + u_int i; printf(" <"); for (i = 0; i < keylen; i++) From owner-svn-src-stable-10@freebsd.org Tue May 3 18:54:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03016B2C26A; Tue, 3 May 2016 18:54:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9C5051BCC; Tue, 3 May 2016 18:54:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43IsN49046322; Tue, 3 May 2016 18:54:23 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43IsKBj046289; Tue, 3 May 2016 18:54:20 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605031854.u43IsKBj046289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 3 May 2016 18:54: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: r298999 - in stable/10: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bn/asm crypto/openssl/crypto/comp crypto/openssl/crypto... 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.22 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, 03 May 2016 18:54:25 -0000 Author: jkim Date: Tue May 3 18:54:20 2016 New Revision: 298999 URL: https://svnweb.freebsd.org/changeset/base/298999 Log: Merge OpenSSL 1.0.1t. Relnotes: yes Added: stable/10/crypto/openssl/doc/crypto/EVP_EncodeInit.pod - copied unchanged from r298993, vendor-crypto/openssl/dist-1.0.1/doc/crypto/EVP_EncodeInit.pod stable/10/secure/lib/libcrypto/man/EVP_EncodeInit.3 (contents, props changed) Modified: stable/10/crypto/openssl/CHANGES stable/10/crypto/openssl/Makefile stable/10/crypto/openssl/NEWS stable/10/crypto/openssl/README stable/10/crypto/openssl/apps/pkcs7.c stable/10/crypto/openssl/crypto/asn1/a_bytes.c stable/10/crypto/openssl/crypto/asn1/a_d2i_fp.c stable/10/crypto/openssl/crypto/asn1/a_type.c stable/10/crypto/openssl/crypto/asn1/asn1_lib.c stable/10/crypto/openssl/crypto/asn1/asn1_par.c stable/10/crypto/openssl/crypto/asn1/t_x509.c stable/10/crypto/openssl/crypto/asn1/tasn_dec.c stable/10/crypto/openssl/crypto/asn1/tasn_enc.c stable/10/crypto/openssl/crypto/asn1/x_name.c stable/10/crypto/openssl/crypto/asn1/x_x509.c stable/10/crypto/openssl/crypto/bn/asm/x86-mont.pl stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont.pl stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl stable/10/crypto/openssl/crypto/comp/comp.h stable/10/crypto/openssl/crypto/evp/Makefile stable/10/crypto/openssl/crypto/evp/digest.c stable/10/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c stable/10/crypto/openssl/crypto/evp/encode.c stable/10/crypto/openssl/crypto/evp/evp_enc.c stable/10/crypto/openssl/crypto/opensslv.h stable/10/crypto/openssl/crypto/pem/pem_lib.c stable/10/crypto/openssl/crypto/pem/pvkfmt.c stable/10/crypto/openssl/crypto/x509/x509.h stable/10/crypto/openssl/crypto/x509/x509_err.c stable/10/crypto/openssl/crypto/x509/x509_obj.c stable/10/crypto/openssl/doc/apps/ciphers.pod stable/10/crypto/openssl/doc/crypto/evp.pod stable/10/crypto/openssl/ssl/d1_both.c stable/10/crypto/openssl/ssl/s2_lib.c stable/10/crypto/openssl/ssl/s2_meth.c stable/10/crypto/openssl/ssl/s3_clnt.c stable/10/crypto/openssl/ssl/s3_lib.c stable/10/crypto/openssl/ssl/ssl.h stable/10/crypto/openssl/ssl/ssl_ciph.c stable/10/crypto/openssl/ssl/ssl_locl.h stable/10/crypto/openssl/ssl/t1_lib.c stable/10/crypto/openssl/util/libeay.num 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/amd64/x86_64-mont.S stable/10/secure/lib/libcrypto/amd64/x86_64-mont5.S stable/10/secure/lib/libcrypto/i386/x86-mont.s 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_add1_signer.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_CMS_ContentInfo.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_ECPrivateKey.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_read_ahead.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_status_cb.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/man/CA.pl.1 stable/10/secure/usr.bin/openssl/man/asn1parse.1 stable/10/secure/usr.bin/openssl/man/c_rehash.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 Modified: stable/10/crypto/openssl/CHANGES ============================================================================== --- stable/10/crypto/openssl/CHANGES Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/CHANGES Tue May 3 18:54:20 2016 (r298999) @@ -2,6 +2,103 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1s and 1.0.1t [3 May 2016] + + *) Prevent padding oracle in AES-NI CBC MAC check + + A MITM attacker can use a padding oracle attack to decrypt traffic + when the connection uses an AES CBC cipher and the server support + AES-NI. + + This issue was introduced as part of the fix for Lucky 13 padding + attack (CVE-2013-0169). The padding check was rewritten to be in + constant time by making sure that always the same bytes are read and + compared against either the MAC or padding bytes. But it no longer + checked that there was enough data to have both the MAC and padding + bytes. + + This issue was reported by Juraj Somorovsky using TLS-Attacker. + (CVE-2016-2107) + [Kurt Roeckx] + + *) Fix EVP_EncodeUpdate overflow + + An overflow can occur in the EVP_EncodeUpdate() function which is used for + Base64 encoding of binary data. If an attacker is able to supply very large + amounts of input data then a length check can overflow resulting in a heap + corruption. + + Internally to OpenSSL the EVP_EncodeUpdate() function is primarly used by + the PEM_write_bio* family of functions. These are mainly used within the + OpenSSL command line applications, so any application which processes data + from an untrusted source and outputs it as a PEM file should be considered + vulnerable to this issue. User applications that call these APIs directly + with large amounts of untrusted data may also be vulnerable. + + This issue was reported by Guido Vranken. + (CVE-2016-2105) + [Matt Caswell] + + *) Fix EVP_EncryptUpdate overflow + + An overflow can occur in the EVP_EncryptUpdate() function. If an attacker + is able to supply very large amounts of input data after a previous call to + EVP_EncryptUpdate() with a partial block then a length check can overflow + resulting in a heap corruption. Following an analysis of all OpenSSL + internal usage of the EVP_EncryptUpdate() function all usage is one of two + forms. The first form is where the EVP_EncryptUpdate() call is known to be + the first called function after an EVP_EncryptInit(), and therefore that + specific call must be safe. The second form is where the length passed to + EVP_EncryptUpdate() can be seen from the code to be some small value and + therefore there is no possibility of an overflow. Since all instances are + one of these two forms, it is believed that there can be no overflows in + internal code due to this problem. It should be noted that + EVP_DecryptUpdate() can call EVP_EncryptUpdate() in certain code paths. + Also EVP_CipherUpdate() is a synonym for EVP_EncryptUpdate(). All instances + of these calls have also been analysed too and it is believed there are no + instances in internal usage where an overflow could occur. + + This issue was reported by Guido Vranken. + (CVE-2016-2106) + [Matt Caswell] + + *) Prevent ASN.1 BIO excessive memory allocation + + When ASN.1 data is read from a BIO using functions such as d2i_CMS_bio() + a short invalid encoding can casuse allocation of large amounts of memory + potentially consuming excessive resources or exhausting memory. + + Any application parsing untrusted data through d2i BIO functions is + affected. The memory based functions such as d2i_X509() are *not* affected. + Since the memory based functions are used by the TLS library, TLS + applications are not affected. + + This issue was reported by Brian Carpenter. + (CVE-2016-2109) + [Stephen Henson] + + *) EBCDIC overread + + ASN1 Strings that are over 1024 bytes can cause an overread in applications + using the X509_NAME_oneline() function on EBCDIC systems. This could result + in arbitrary stack data being returned in the buffer. + + This issue was reported by Guido Vranken. + (CVE-2016-2176) + [Matt Caswell] + + *) Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + [Todd Short] + + *) Remove LOW from the DEFAULT cipher list. This removes singles DES from the + default. + [Kurt Roeckx] + + *) Only remove the SSLv2 methods with the no-ssl2-method option. When the + methods are enabled and ssl2 is disabled the methods return NULL. + [Kurt Roeckx] + Changes between 1.0.1r and 1.0.1s [1 Mar 2016] * Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: stable/10/crypto/openssl/Makefile ============================================================================== --- stable/10/crypto/openssl/Makefile Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/Makefile Tue May 3 18:54:20 2016 (r298999) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1s +VERSION=1.0.1t MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 Modified: stable/10/crypto/openssl/NEWS ============================================================================== --- stable/10/crypto/openssl/NEWS Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/NEWS Tue May 3 18:54:20 2016 (r298999) @@ -5,6 +5,19 @@ 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.1s and OpenSSL 1.0.1t [3 May 2016] + + o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107) + o Fix EVP_EncodeUpdate overflow (CVE-2016-2105) + o Fix EVP_EncryptUpdate overflow (CVE-2016-2106) + o Prevent ASN.1 BIO excessive memory allocation (CVE-2016-2109) + o EBCDIC overread (CVE-2016-2176) + o Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + o Remove LOW from the DEFAULT cipher list. This removes singles DES from + the default. + o Only remove the SSLv2 methods with the no-ssl2-method option. + Major changes between OpenSSL 1.0.1r and OpenSSL 1.0.1s [1 Mar 2016] o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: stable/10/crypto/openssl/README ============================================================================== --- stable/10/crypto/openssl/README Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/README Tue May 3 18:54:20 2016 (r298999) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1s 1 Mar 2016 + OpenSSL 1.0.1t 3 May 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/10/crypto/openssl/apps/pkcs7.c ============================================================================== --- stable/10/crypto/openssl/apps/pkcs7.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/apps/pkcs7.c Tue May 3 18:54:20 2016 (r298999) @@ -235,12 +235,16 @@ int MAIN(int argc, char **argv) i = OBJ_obj2nid(p7->type); switch (i) { case NID_pkcs7_signed: - certs = p7->d.sign->cert; - crls = p7->d.sign->crl; + if (p7->d.sign != NULL) { + certs = p7->d.sign->cert; + crls = p7->d.sign->crl; + } break; case NID_pkcs7_signedAndEnveloped: - certs = p7->d.signed_and_enveloped->cert; - crls = p7->d.signed_and_enveloped->crl; + if (p7->d.signed_and_enveloped != NULL) { + certs = p7->d.signed_and_enveloped->cert; + crls = p7->d.signed_and_enveloped->crl; + } break; default: break; Modified: stable/10/crypto/openssl/crypto/asn1/a_bytes.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_bytes.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/a_bytes.c Tue May 3 18:54:20 2016 (r298999) @@ -200,13 +200,13 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING } else { if (len != 0) { if ((ret->length < len) || (ret->data == NULL)) { - if (ret->data != NULL) - OPENSSL_free(ret->data); s = (unsigned char *)OPENSSL_malloc((int)len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; goto err; } + if (ret->data != NULL) + OPENSSL_free(ret->data); } else s = ret->data; memcpy(s, p, (int)len); Modified: stable/10/crypto/openssl/crypto/asn1/a_d2i_fp.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_d2i_fp.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/a_d2i_fp.c Tue May 3 18:54:20 2016 (r298999) @@ -141,6 +141,7 @@ void *ASN1_item_d2i_fp(const ASN1_ITEM * #endif #define HEADER_SIZE 8 +#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024) static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) { BUF_MEM *b; @@ -217,29 +218,44 @@ static int asn1_d2i_read_bio(BIO *in, BU /* suck in c.slen bytes of data */ want = c.slen; if (want > (len - off)) { + size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE; + want -= (len - off); if (want > INT_MAX /* BIO_read takes an int length */ || len + want < len) { ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ASN1_R_TOO_LONG); goto err; } - if (!BUF_MEM_grow_clean(b, len + want)) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); - goto err; - } while (want > 0) { - i = BIO_read(in, &(b->data[len]), want); - if (i <= 0) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, - ASN1_R_NOT_ENOUGH_DATA); + /* + * Read content in chunks of increasing size + * so we can return an error for EOF without + * having to allocate the entire content length + * in one go. + */ + size_t chunk = want > chunk_max ? chunk_max : want; + + if (!BUF_MEM_grow_clean(b, len + chunk)) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); goto err; } + want -= chunk; + while (chunk > 0) { + i = BIO_read(in, &(b->data[len]), chunk); + if (i <= 0) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, + ASN1_R_NOT_ENOUGH_DATA); + goto err; + } /* * This can't overflow because |len+want| didn't * overflow. */ - len += i; - want -= i; + len += i; + chunk -= i; + } + if (chunk_max < INT_MAX/2) + chunk_max *= 2; } } if (off + c.slen < off) { Modified: stable/10/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_type.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/a_type.c Tue May 3 18:54:20 2016 (r298999) @@ -126,9 +126,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: stable/10/crypto/openssl/crypto/asn1/asn1_lib.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/asn1_lib.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/asn1_lib.c Tue May 3 18:54:20 2016 (r298999) @@ -63,7 +63,7 @@ #include static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max); + long max); static void asn1_put_length(unsigned char **pp, int length); const char ASN1_version[] = "ASN.1" OPENSSL_VERSION_PTEXT; @@ -131,7 +131,7 @@ int ASN1_get_object(const unsigned char } *ptag = tag; *pclass = xclass; - if (!asn1_get_length(&p, &inf, plength, (int)max)) + if (!asn1_get_length(&p, &inf, plength, max)) goto err; if (inf && !(ret & V_ASN1_CONSTRUCTED)) @@ -159,14 +159,14 @@ int ASN1_get_object(const unsigned char } static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max) + long max) { const unsigned char *p = *pp; unsigned long ret = 0; - unsigned int i; + unsigned long i; if (max-- < 1) - return (0); + return 0; if (*p == 0x80) { *inf = 1; ret = 0; @@ -175,15 +175,11 @@ static int asn1_get_length(const unsigne *inf = 0; i = *p & 0x7f; if (*(p++) & 0x80) { - if (i > sizeof(long)) + if (i > sizeof(ret) || max < (long)i) return 0; - if (max-- == 0) - return (0); while (i-- > 0) { ret <<= 8L; ret |= *(p++); - if (max-- == 0) - return (0); } } else ret = i; @@ -192,7 +188,7 @@ static int asn1_get_length(const unsigne return 0; *pp = p; *rl = (long)ret; - return (1); + return 1; } /* Modified: stable/10/crypto/openssl/crypto/asn1/asn1_par.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/asn1_par.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/asn1_par.c Tue May 3 18:54:20 2016 (r298999) @@ -173,6 +173,8 @@ static int asn1_parse2(BIO *bp, const un if (!asn1_print_info(bp, tag, xclass, j, (indent) ? depth : 0)) goto end; if (j & V_ASN1_CONSTRUCTED) { + const unsigned char *sp; + ep = p + len; if (BIO_write(bp, "\n", 1) <= 0) goto end; @@ -182,6 +184,7 @@ static int asn1_parse2(BIO *bp, const un goto end; } if ((j == 0x21) && (len == 0)) { + sp = p; for (;;) { r = asn1_parse2(bp, &p, (long)(tot - p), offset + (p - *pp), depth + 1, @@ -190,19 +193,25 @@ static int asn1_parse2(BIO *bp, const un ret = 0; goto end; } - if ((r == 2) || (p >= tot)) + if ((r == 2) || (p >= tot)) { + len = p - sp; break; + } } - } else + } else { + long tmp = len; + while (p < ep) { - r = asn1_parse2(bp, &p, (long)len, - offset + (p - *pp), depth + 1, + sp = p; + r = asn1_parse2(bp, &p, tmp, offset + (p - *pp), depth + 1, indent, dump); if (r == 0) { ret = 0; goto end; } + tmp -= p - sp; } + } } else if (xclass != 0) { p += len; if (BIO_write(bp, "\n", 1) <= 0) Modified: stable/10/crypto/openssl/crypto/asn1/t_x509.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/t_x509.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/t_x509.c Tue May 3 18:54:20 2016 (r298999) @@ -140,7 +140,8 @@ int X509_print_ex(BIO *bp, X509 *x, unsi goto err; bs = X509_get_serialNumber(x); - if (bs->length <= (int)sizeof(long)) { + if (bs->length < (int)sizeof(long) + || (bs->length == sizeof(long) && (bs->data[0] & 0x80) == 0)) { l = ASN1_INTEGER_get(bs); if (bs->type == V_ASN1_NEG_INTEGER) { l = -l; Modified: stable/10/crypto/openssl/crypto/asn1/tasn_dec.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/tasn_dec.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/tasn_dec.c Tue May 3 18:54:20 2016 (r298999) @@ -903,9 +903,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: stable/10/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/tasn_enc.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/tasn_enc.c Tue May 3 18:54:20 2016 (r298999) @@ -611,9 +611,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: stable/10/crypto/openssl/crypto/asn1/x_name.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/x_name.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/x_name.c Tue May 3 18:54:20 2016 (r298999) @@ -66,6 +66,13 @@ typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY) +/* + * Maximum length of X509_NAME: much larger than anything we should + * ever see in practice. + */ + +#define X509_NAME_MAX (1024 * 1024) + static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it, @@ -192,6 +199,10 @@ static int x509_name_ex_d2i(ASN1_VALUE * int i, j, ret; STACK_OF(X509_NAME_ENTRY) *entries; X509_NAME_ENTRY *entry; + if (len > X509_NAME_MAX) { + ASN1err(ASN1_F_X509_NAME_EX_D2I, ASN1_R_TOO_LONG); + return 0; + } q = p; /* Get internal representation of Name */ Modified: stable/10/crypto/openssl/crypto/asn1/x_x509.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/x_x509.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/x_x509.c Tue May 3 18:54:20 2016 (r298999) @@ -201,9 +201,19 @@ X509 *d2i_X509_AUX(X509 **a, const unsig int i2d_X509_AUX(X509 *a, unsigned char **pp) { - int length; + int length, tmplen; + unsigned char *start = pp != NULL ? *pp : NULL; length = i2d_X509(a, pp); - if (a) - length += i2d_X509_CERT_AUX(a->aux, pp); + if (length < 0 || a == NULL) + return length; + + tmplen = i2d_X509_CERT_AUX(a->aux, pp); + if (tmplen < 0) { + if (start != NULL) + *pp = start; + return tmplen; + } + length += tmplen; + return length; } Modified: stable/10/crypto/openssl/crypto/bn/asm/x86-mont.pl ============================================================================== --- stable/10/crypto/openssl/crypto/bn/asm/x86-mont.pl Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/bn/asm/x86-mont.pl Tue May 3 18:54:20 2016 (r298999) @@ -85,6 +85,21 @@ $frame=32; # size of above frame roun &and ("esp",-64); # align to cache line + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + &mov ("eax","ebp"); + &sub ("eax","esp"); + &and ("eax",-4096); +&set_label("page_walk"); + &mov ("edx",&DWP(0,"esp","eax")); + &sub ("eax",4096); + &data_byte(0x2e); + &jnc (&label("page_walk")); + ################################# load argument block... &mov ("eax",&DWP(0*4,"esi"));# BN_ULONG *rp &mov ("ebx",&DWP(1*4,"esi"));# const BN_ULONG *ap Modified: stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont.pl ============================================================================== --- stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Tue May 3 18:54:20 2016 (r298999) @@ -91,6 +91,20 @@ bn_mul_mont: mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x66,0x2e # predict non-taken + jnc .Lmul_page_walk + mov $bp,%r12 # reassign $bp ___ $bp="%r12"; @@ -296,6 +310,14 @@ bn_mul4x_mont: mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul4x_body: + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + mov $rp,16(%rsp,$num,8) # tp[num+2]=$rp mov %rdx,%r12 # reassign $bp ___ @@ -707,6 +729,7 @@ $code.=<<___; .align 16 bn_sqr4x_mont: .Lsqr4x_enter: + mov %rsp,%rax push %rbx push %rbp push %r12 @@ -715,12 +738,23 @@ bn_sqr4x_mont: push %r15 shl \$3,${num}d # convert $num to bytes - xor %r10,%r10 mov %rsp,%r11 # put aside %rsp - sub $num,%r10 # -$num + neg $num # -$num mov ($n0),$n0 # *n0 - lea -72(%rsp,%r10,2),%rsp # alloca(frame+2*$num) + lea -72(%rsp,$num,2),%rsp # alloca(frame+2*$num) and \$-1024,%rsp # minimize TLB usage + + sub %rsp,%r11 + and \$-4096,%r11 +.Lsqr4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lsqr4x_page_walk + + mov $num,%r10 + neg $num # restore $num + lea -48(%rax),%r11 # restore saved %rsp ############################################################## # Stack layout # Modified: stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl ============================================================================== --- stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Tue May 3 18:54:20 2016 (r298999) @@ -84,6 +84,20 @@ bn_mul_mont_gather5: mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%rax + and \$-4096,%rax +.Lmul_page_walk: + mov (%rsp,%rax),%r11 + sub \$4096,%rax + .byte 0x2e # predict non-taken + jnc .Lmul_page_walk + lea 128($bp),%r12 # reassign $bp (+size optimization) ___ $bp="%r12"; @@ -407,6 +421,14 @@ bn_mul4x_mont_gather5: mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul4x_body: + sub %rsp,%rax + and \$-4096,%rax +.Lmul4x_page_walk: + mov (%rsp,%rax),%r11 + sub \$4096,%rax + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + mov $rp,16(%rsp,$num,8) # tp[num+2]=$rp lea 128(%rdx),%r12 # reassign $bp (+size optimization) ___ Modified: stable/10/crypto/openssl/crypto/comp/comp.h ============================================================================== --- stable/10/crypto/openssl/crypto/comp/comp.h Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/comp/comp.h Tue May 3 18:54:20 2016 (r298999) @@ -4,6 +4,10 @@ # include +# ifdef OPENSSL_NO_COMP +# error COMP is disabled. +# endif + #ifdef __cplusplus extern "C" { #endif Modified: stable/10/crypto/openssl/crypto/evp/Makefile ============================================================================== --- stable/10/crypto/openssl/crypto/evp/Makefile Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/Makefile Tue May 3 18:54:20 2016 (r298999) @@ -199,8 +199,8 @@ e_aes.o: ../../include/openssl/opensslv. e_aes.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h e_aes.o: ../modes/modes_lcl.h e_aes.c evp_locl.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/bio.h +e_aes_cbc_hmac_sha1.o: ../../e_os.h ../../include/openssl/aes.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/crypto.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/e_os2.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/evp.h @@ -212,8 +212,8 @@ e_aes_cbc_hmac_sha1.o: ../../include/ope e_aes_cbc_hmac_sha1.o: ../../include/openssl/safestack.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/sha.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/stack.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h e_aes_cbc_hmac_sha1.c -e_aes_cbc_hmac_sha1.o: evp_locl.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h ../constant_time_locl.h +e_aes_cbc_hmac_sha1.o: e_aes_cbc_hmac_sha1.c evp_locl.h e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h Modified: stable/10/crypto/openssl/crypto/evp/digest.c ============================================================================== --- stable/10/crypto/openssl/crypto/evp/digest.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/digest.c Tue May 3 18:54:20 2016 (r298999) @@ -200,8 +200,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, c } #endif if (ctx->digest != type) { - if (ctx->digest && ctx->digest->ctx_size) + if (ctx->digest && ctx->digest->ctx_size) { OPENSSL_free(ctx->md_data); + ctx->md_data = NULL; + } ctx->digest = type; if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) { ctx->update = type->update; Modified: stable/10/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c ============================================================================== --- stable/10/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 18:54:20 2016 (r298999) @@ -59,6 +59,7 @@ # include # include # include "evp_locl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -286,6 +287,8 @@ static int aesni_cbc_hmac_sha1_cipher(EV maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA_DIGEST_LENGTH + pad + 1); mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1))); inp_len &= mask; Modified: stable/10/crypto/openssl/crypto/evp/encode.c ============================================================================== --- stable/10/crypto/openssl/crypto/evp/encode.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/encode.c Tue May 3 18:54:20 2016 (r298999) @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -151,13 +152,13 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct const unsigned char *in, int inl) { int i, j; - unsigned int total = 0; + size_t total = 0; *outl = 0; if (inl <= 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); - if ((ctx->num + inl) < ctx->length) { + if (ctx->length - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; return; @@ -174,7 +175,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total = j + 1; } - while (inl >= ctx->length) { + while (inl >= ctx->length && total <= INT_MAX) { j = EVP_EncodeBlock(out, in, ctx->length); in += ctx->length; inl -= ctx->length; @@ -183,6 +184,11 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total += j + 1; } + if (total > INT_MAX) { + /* Too much output data! */ + *outl = 0; + return; + } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; Modified: stable/10/crypto/openssl/crypto/evp/evp_enc.c ============================================================================== --- stable/10/crypto/openssl/crypto/evp/evp_enc.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/evp_enc.c Tue May 3 18:54:20 2016 (r298999) @@ -334,7 +334,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ct bl = ctx->cipher->block_size; OPENSSL_assert(bl <= (int)sizeof(ctx->buf)); if (i != 0) { - if (i + inl < bl) { + if (bl - i > inl) { memcpy(&(ctx->buf[i]), in, inl); ctx->buf_len += inl; *outl = 0; Modified: stable/10/crypto/openssl/crypto/opensslv.h ============================================================================== --- stable/10/crypto/openssl/crypto/opensslv.h Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/opensslv.h Tue May 3 18:54:20 2016 (r298999) @@ -30,11 +30,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1000113fL +# define OPENSSL_VERSION_NUMBER 0x1000114fL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1s-fips 1 Mar 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1t-fips 3 May 2016" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1s-freebsd 1 Mar 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1t-freebsd 3 May 2016" # endif # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT Modified: stable/10/crypto/openssl/crypto/pem/pem_lib.c ============================================================================== --- stable/10/crypto/openssl/crypto/pem/pem_lib.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/pem/pem_lib.c Tue May 3 18:54:20 2016 (r298999) @@ -344,7 +344,7 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, if (enc != NULL) { objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); - if (objstr == NULL) { + if (objstr == NULL || EVP_CIPHER_iv_length(enc) == 0) { PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, PEM_R_UNSUPPORTED_CIPHER); goto err; } Modified: stable/10/crypto/openssl/crypto/pem/pvkfmt.c ============================================================================== --- stable/10/crypto/openssl/crypto/pem/pvkfmt.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/pem/pvkfmt.c Tue May 3 18:54:20 2016 (r298999) @@ -131,6 +131,10 @@ static int read_lebn(const unsigned char # define MS_PVKMAGIC 0xb0b5f11eL /* Salt length for PVK files */ # define PVK_SALTLEN 0x10 +/* Maximum length in PVK header */ +# define PVK_MAX_KEYLEN 102400 +/* Maximum salt length */ +# define PVK_MAX_SALTLEN 10240 static EVP_PKEY *b2i_rsa(const unsigned char **in, unsigned int length, unsigned int bitlen, int ispub); @@ -644,6 +648,9 @@ static int do_PVK_header(const unsigned *psaltlen = read_ledword(&p); *pkeylen = read_ledword(&p); + if (*pkeylen > PVK_MAX_KEYLEN || *psaltlen > PVK_MAX_SALTLEN) + return 0; + if (is_encrypted && !*psaltlen) { PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_INCONSISTENT_HEADER); return 0; Modified: stable/10/crypto/openssl/crypto/x509/x509.h ============================================================================== --- stable/10/crypto/openssl/crypto/x509/x509.h Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/x509/x509.h Tue May 3 18:54:20 2016 (r298999) @@ -1281,6 +1281,7 @@ void ERR_load_X509_strings(void); # define X509_R_LOADING_CERT_DIR 103 # define X509_R_LOADING_DEFAULTS 104 # define X509_R_METHOD_NOT_SUPPORTED 124 +# define X509_R_NAME_TOO_LONG 134 # define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 # define X509_R_PUBLIC_KEY_DECODE_ERROR 125 # define X509_R_PUBLIC_KEY_ENCODE_ERROR 126 Modified: stable/10/crypto/openssl/crypto/x509/x509_err.c ============================================================================== --- stable/10/crypto/openssl/crypto/x509/x509_err.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/x509/x509_err.c Tue May 3 18:54:20 2016 (r298999) @@ -145,6 +145,7 @@ static ERR_STRING_DATA X509_str_reasons[ {ERR_REASON(X509_R_LOADING_CERT_DIR), "loading cert dir"}, {ERR_REASON(X509_R_LOADING_DEFAULTS), "loading defaults"}, {ERR_REASON(X509_R_METHOD_NOT_SUPPORTED), "method not supported"}, + {ERR_REASON(X509_R_NAME_TOO_LONG), "name too long"}, {ERR_REASON(X509_R_NO_CERT_SET_FOR_US_TO_VERIFY), "no cert set for us to verify"}, {ERR_REASON(X509_R_PUBLIC_KEY_DECODE_ERROR), "public key decode error"}, Modified: stable/10/crypto/openssl/crypto/x509/x509_obj.c ============================================================================== --- stable/10/crypto/openssl/crypto/x509/x509_obj.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/x509/x509_obj.c Tue May 3 18:54:20 2016 (r298999) @@ -63,6 +63,13 @@ #include #include +/* + * Limit to ensure we don't overflow: much greater than + * anything enountered in practice. + */ + +#define NAME_ONELINE_MAX (1024 * 1024) + char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) { X509_NAME_ENTRY *ne; @@ -86,6 +93,8 @@ char *X509_NAME_oneline(X509_NAME *a, ch goto err; b->data[0] = '\0'; len = 200; + } else if (len == 0) { + return NULL; } if (a == NULL) { if (b) { @@ -110,6 +119,10 @@ char *X509_NAME_oneline(X509_NAME *a, ch type = ne->value->type; num = ne->value->length; + if (num > NAME_ONELINE_MAX) { + X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); + goto end; + } q = ne->value->data; #ifdef CHARSET_EBCDIC if (type == V_ASN1_GENERALSTRING || @@ -117,8 +130,9 @@ char *X509_NAME_oneline(X509_NAME *a, ch type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { - ascii2ebcdic(ebcdic_buf, q, (num > sizeof ebcdic_buf) - ? sizeof ebcdic_buf : num); + if (num > (int)sizeof(ebcdic_buf)) + num = sizeof(ebcdic_buf); + ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif @@ -154,6 +168,10 @@ char *X509_NAME_oneline(X509_NAME *a, ch lold = l; l += 1 + l1 + 1 + l2; + if (l > NAME_ONELINE_MAX) { + X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); + goto end; + } if (b != NULL) { if (!BUF_MEM_grow(b, l + 1)) goto err; @@ -206,7 +224,7 @@ char *X509_NAME_oneline(X509_NAME *a, ch return (p); err: X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE); - if (b != NULL) - BUF_MEM_free(b); + end: + BUF_MEM_free(b); return (NULL); } Modified: stable/10/crypto/openssl/doc/apps/ciphers.pod ============================================================================== --- stable/10/crypto/openssl/doc/apps/ciphers.pod Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/doc/apps/ciphers.pod Tue May 3 18:54:20 2016 (r298999) @@ -107,7 +107,7 @@ The following is a list of all permitted The default cipher list. This is determined at compile time and is normally -B. +B. When used, this must be the first cipherstring specified. =item B Copied: stable/10/crypto/openssl/doc/crypto/EVP_EncodeInit.pod (from r298993, vendor-crypto/openssl/dist-1.0.1/doc/crypto/EVP_EncodeInit.pod) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/crypto/openssl/doc/crypto/EVP_EncodeInit.pod Tue May 3 18:54:20 2016 (r298999, copy of r298993, vendor-crypto/openssl/dist-1.0.1/doc/crypto/EVP_EncodeInit.pod) @@ -0,0 +1,127 @@ +=pod + +=head1 NAME + +EVP_EncodeInit, EVP_EncodeUpdate, EVP_EncodeFinal, EVP_EncodeBlock, +EVP_DecodeInit, EVP_DecodeUpdate, EVP_DecodeFinal, EVP_DecodeBlock - EVP base 64 +encode/decode routines + +=head1 SYNOPSIS + + #include + + void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); + void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); + void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); + int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); + + void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); + int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); + int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned + char *out, int *outl); + int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); + +=head1 DESCRIPTION + +The EVP encode routines provide a high level interface to base 64 encoding and +decoding. Base 64 encoding converts binary data into a printable form that uses +the characters A-Z, a-z, 0-9, "+" and "/" to represent the data. For every 3 +bytes of binary data provided 4 bytes of base 64 encoded data will be produced +plus some occasional newlines (see below). If the input data length is not a +multiple of 3 then the output data will be padded at the end using the "=" +character. + +Encoding of binary data is performed in blocks of 48 input bytes (or less for +the final block). For each 48 byte input block encoded 64 bytes of base 64 data +is output plus an additional newline character (i.e. 65 bytes in total). The +final block (which may be less than 48 bytes) will output 4 bytes for every 3 +bytes of input. If the data length is not divisible by 3 then a full 4 bytes is +still output for the final 1 or 2 bytes of input. Similarly a newline character +will also be output. + +EVP_EncodeInit() initialises B for the start of a new encoding operation. + +EVP_EncodeUpdate() encode B bytes of data found in the buffer pointed to by +B. The output is stored in the buffer B and the number of bytes output +is stored in B<*outl>. It is the caller's responsibility to ensure that the +buffer at B is sufficiently large to accommodate the output data. Only full +blocks of data (48 bytes) will be immediately processed and output by this +function. Any remainder is held in the B object and will be processed by a +subsequent call to EVP_EncodeUpdate() or EVP_EncodeFinal(). To calculate the +required size of the output buffer add together the value of B with the +amount of unprocessed data held in B and divide the result by 48 (ignore +any remainder). This gives the number of blocks of data that will be processed. +Ensure the output buffer contains 65 bytes of storage for each block, plus an +additional byte for a NUL terminator. EVP_EncodeUpdate() may be called +repeatedly to process large amounts of input data. In the event of an error +EVP_EncodeUpdate() will set B<*outl> to 0. + +EVP_EncodeFinal() must be called at the end of an encoding operation. It will +process any partial block of data remaining in the B object. The output +data will be stored in B and the length of the data written will be stored +in B<*outl>. It is the caller's responsibility to ensure that B is +sufficiently large to accommodate the output data which will never be more than +65 bytes plus an additional NUL terminator (i.e. 66 bytes in total). + +EVP_EncodeBlock() encodes a full block of input data in B and of length +B and stores it in B. For every 3 bytes of input provided 4 bytes of +output data will be produced. If B is not divisible by 3 then the block is +encoded as a final block of data and the output is padded such that it is always +divisible by 4. Additionally a NUL terminator character will be added. For +example if 16 bytes of input data is provided then 24 bytes of encoded data is +created plus 1 byte for a NUL terminator (i.e. 25 bytes in total). The length of +the data generated I the NUL terminator is returned from the function. + +EVP_DecodeInit() initialises B for the start of a new decoding operation. + +EVP_DecodeUpdate() decodes B characters of data found in the buffer pointed +to by B. The output is stored in the buffer B and the number of bytes +output is stored in B<*outl>. It is the caller's responsibility to ensure that +the buffer at B is sufficiently large to accommodate the output data. This +function will attempt to decode as much data as possible in 4 byte chunks. Any +whitespace, newline or carriage return characters are ignored. Any partial chunk +of unprocessed data (1, 2 or 3 bytes) that remains at the end will be held in +the B object and processed by a subsequent call to EVP_DecodeUpdate(). If +any illegal base 64 characters are encountered or if the base 64 padding +character "=" is encountered in the middle of the data then the function returns +-1 to indicate an error. A return value of 0 or 1 indicates successful +processing of the data. A return value of 0 additionally indicates that the last +input data characters processed included the base 64 padding character "=" and +therefore no more non-padding character data is expected to be processed. For +every 4 valid base 64 bytes processed (ignoring whitespace, carriage returns and +line feeds), 3 bytes of binary output data will be produced (or less at the end +of the data where the padding character "=" has been used). + +EVP_DecodeFinal() must be called at the end of a decoding operation. If there +is any unprocessed data still in B then the input data must not have been +a multiple of 4 and therefore an error has occurred. The function will return -1 +in this case. Otherwise the function returns 1 on success. + +EVP_DecodeBlock() will decode the block of B characters of base 64 data +contained in B and store the result in B. Any leading whitespace will be +trimmed as will any trailing whitespace, newlines, carriage returns or EOF +characters. After such trimming the length of the data in B must be divisbile +by 4. For every 4 input bytes exactly 3 output bytes will be produced. The +output will be padded with 0 bits if necessary to ensure that the output is +always 3 bytes for every 4 input bytes. This function will return the length of +the data decoded or -1 on error. + +=head1 RETURN VALUES + +EVP_EncodeBlock() returns the number of bytes encoded excluding the NUL +terminator. + +EVP_DecodeUpdate() returns -1 on error and 0 or 1 on success. If 0 is returned *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Tue May 3 19:43:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10767B2C06B; Tue, 3 May 2016 19:43:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D1A011F0B; Tue, 3 May 2016 19:42:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43Jgwm6061711; Tue, 3 May 2016 19:42:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43Jgw5n061710; Tue, 3 May 2016 19:42:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605031942.u43Jgw5n061710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 3 May 2016 19:42:58 +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: r299001 - stable/10/sys/cddl/dev/sdt 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.22 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, 03 May 2016 19:43:00 -0000 Author: markj Date: Tue May 3 19:42:58 2016 New Revision: 299001 URL: https://svnweb.freebsd.org/changeset/base/299001 Log: MFC r297771: Initialize SDT probes during SI_SUB_DTRACE_PROVIDER. Modified: stable/10/sys/cddl/dev/sdt/sdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/10/sys/cddl/dev/sdt/sdt.c Tue May 3 19:37:25 2016 (r299000) +++ stable/10/sys/cddl/dev/sdt/sdt.c Tue May 3 19:42:58 2016 (r299001) @@ -381,28 +381,20 @@ sdt_unload() static int sdt_modevent(module_t mod __unused, int type, void *data __unused) { - int error = 0; switch (type) { case MOD_LOAD: - sdt_load(); - break; - case MOD_UNLOAD: - error = sdt_unload(); - break; - case MOD_SHUTDOWN: - break; - + return (0); default: - error = EOPNOTSUPP; - break; + return (EOPNOTSUPP); } - - return (error); } +SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL); +SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL); + DEV_MODULE(sdt, sdt_modevent, NULL); MODULE_VERSION(sdt, 1); MODULE_DEPEND(sdt, dtrace, 1, 1, 1); From owner-svn-src-stable-10@freebsd.org Tue May 3 20:08:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7A61B2C738; Tue, 3 May 2016 20:08:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 755401313; Tue, 3 May 2016 20:08:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43K85KH067827; Tue, 3 May 2016 20:08:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43K85Fp067823; Tue, 3 May 2016 20:08:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605032008.u43K85Fp067823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 3 May 2016 20:08: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: r299003 - in stable/10/sys/cddl/contrib/opensolaris/uts: common/dtrace common/sys intel/dtrace powerpc/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.22 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, 03 May 2016 20:08:06 -0000 Author: markj Date: Tue May 3 20:08:05 2016 New Revision: 299003 URL: https://svnweb.freebsd.org/changeset/base/299003 Log: MFC r296479: Fix fasttrap tracepoint locking. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue May 3 19:45:24 2016 (r299002) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue May 3 20:08:05 2016 (r299003) @@ -63,14 +63,16 @@ #ifndef illumos #include #include +#include #include #include #include + #include #include #include #include -#include + #include #endif @@ -225,7 +227,7 @@ static void fasttrap_thread_dtor(void *, #define FASTTRAP_PROCS_INDEX(pid) ((pid) & fasttrap_procs.fth_mask) #ifndef illumos -static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU]; +struct rmlock fasttrap_tp_lock; static eventhandler_tag fasttrap_thread_dtor_tag; #endif @@ -440,10 +442,15 @@ fasttrap_mod_barrier(uint64_t gen) fasttrap_mod_gen++; +#ifdef illumos CPU_FOREACH(i) { mutex_enter(&fasttrap_cpuc_pid_lock[i]); mutex_exit(&fasttrap_cpuc_pid_lock[i]); } +#else + rm_wlock(&fasttrap_tp_lock); + rm_wunlock(&fasttrap_tp_lock); +#endif } /* @@ -2565,10 +2572,7 @@ fasttrap_load(void) mutex_init(&fasttrap_procs.fth_table[i].ftb_mtx, "processes bucket mtx", MUTEX_DEFAULT, NULL); - CPU_FOREACH(i) { - mutex_init(&fasttrap_cpuc_pid_lock[i], "fasttrap barrier", - MUTEX_DEFAULT, NULL); - } + rm_init(&fasttrap_tp_lock, "fasttrap tracepoint"); /* * This event handler must run before kdtrace_thread_dtor() since it @@ -2701,9 +2705,7 @@ fasttrap_unload(void) #ifndef illumos destroy_dev(fasttrap_cdev); mutex_destroy(&fasttrap_count_mtx); - CPU_FOREACH(i) { - mutex_destroy(&fasttrap_cpuc_pid_lock[i]); - } + rm_destroy(&fasttrap_tp_lock); #endif return (0); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Tue May 3 19:45:24 2016 (r299002) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Tue May 3 20:08:05 2016 (r299003) @@ -206,6 +206,10 @@ extern fasttrap_scrspace_t *fasttrap_scr extern dtrace_id_t fasttrap_probe_id; extern fasttrap_hash_t fasttrap_tpoints; +#ifndef illumos +extern struct rmlock fasttrap_tp_lock; +#endif + #define FASTTRAP_TPOINTS_INDEX(pid, pc) \ (((pc) / sizeof (fasttrap_instr_t) + (pid)) & fasttrap_tpoints.fth_mask) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue May 3 19:45:24 2016 (r299002) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue May 3 20:08:05 2016 (r299003) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -749,11 +750,13 @@ fasttrap_return_common(struct reg *rp, u fasttrap_id_t *id; #ifdef illumos kmutex_t *pid_mtx; -#endif -#ifdef illumos pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; mutex_enter(pid_mtx); +#else + struct rm_priotracker tracker; + + rm_rlock(&fasttrap_tp_lock, &tracker); #endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -771,6 +774,8 @@ fasttrap_return_common(struct reg *rp, u if (tp == NULL) { #ifdef illumos mutex_exit(pid_mtx); +#else + rm_runlock(&fasttrap_tp_lock, &tracker); #endif return; } @@ -794,6 +799,8 @@ fasttrap_return_common(struct reg *rp, u #ifdef illumos mutex_exit(pid_mtx); +#else + rm_runlock(&fasttrap_tp_lock, &tracker); #endif } @@ -1002,6 +1009,7 @@ fasttrap_pid_probe(struct reg *rp) { proc_t *p = curproc; #ifndef illumos + struct rm_priotracker tracker; proc_t *pp; #endif uintptr_t pc = rp->r_rip - 1; @@ -1061,8 +1069,7 @@ fasttrap_pid_probe(struct reg *rp) sx_sunlock(&proctree_lock); pp = NULL; - PROC_LOCK(p); - _PHOLD(p); + rm_rlock(&fasttrap_tp_lock, &tracker); #endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -1085,8 +1092,7 @@ fasttrap_pid_probe(struct reg *rp) #ifdef illumos mutex_exit(pid_mtx); #else - _PRELE(p); - PROC_UNLOCK(p); + rm_runlock(&fasttrap_tp_lock, &tracker); #endif return (-1); } @@ -1212,7 +1218,7 @@ fasttrap_pid_probe(struct reg *rp) #ifdef illumos mutex_exit(pid_mtx); #else - PROC_UNLOCK(p); + rm_runlock(&fasttrap_tp_lock, &tracker); #endif tp = &tp_local; @@ -1825,7 +1831,6 @@ done: #ifndef illumos PROC_LOCK(p); proc_write_regs(curthread, rp); - _PRELE(p); PROC_UNLOCK(p); #endif Modified: stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Tue May 3 19:45:24 2016 (r299002) +++ stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Tue May 3 20:08:05 2016 (r299003) @@ -33,6 +33,7 @@ #include #include #include +#include #include #define OP(x) ((x) >> 26) @@ -302,10 +303,12 @@ static void fasttrap_return_common(struct reg *rp, uintptr_t pc, pid_t pid, uintptr_t new_pc) { + struct rm_priotracker tracker; fasttrap_tracepoint_t *tp; fasttrap_bucket_t *bucket; fasttrap_id_t *id; + rm_rlock(&fasttrap_tp_lock, &tracker); bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) { @@ -320,6 +323,7 @@ fasttrap_return_common(struct reg *rp, u * is not essential to the correct execution of the process. */ if (tp == NULL) { + rm_runlock(&fasttrap_tp_lock, &tracker); return; } @@ -337,6 +341,7 @@ fasttrap_return_common(struct reg *rp, u pc - id->fti_probe->ftp_faddr, rp->fixreg[3], rp->fixreg[4], 0, 0); } + rm_runlock(&fasttrap_tp_lock, &tracker); } @@ -365,6 +370,7 @@ fasttrap_branch_taken(int bo, int bi, st int fasttrap_pid_probe(struct reg *rp) { + struct rm_priotracker tracker; proc_t *p = curproc; uintptr_t pc = rp->pc; uintptr_t new_pc = 0; @@ -395,8 +401,7 @@ fasttrap_pid_probe(struct reg *rp) curthread->t_dtrace_scrpc = 0; curthread->t_dtrace_astpc = 0; - - PROC_LOCK(p); + rm_rlock(&fasttrap_tp_lock, &tracker); pid = p->p_pid; bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -415,7 +420,7 @@ fasttrap_pid_probe(struct reg *rp) * fasttrap_ioctl), or somehow we have mislaid this tracepoint. */ if (tp == NULL) { - PROC_UNLOCK(p); + rm_runlock(&fasttrap_tp_lock, &tracker); return (-1); } @@ -469,7 +474,7 @@ fasttrap_pid_probe(struct reg *rp) * tracepoint again later if we need to light up any return probes. */ tp_local = *tp; - PROC_UNLOCK(p); + rm_runlock(&fasttrap_tp_lock, &tracker); tp = &tp_local; /* From owner-svn-src-stable-10@freebsd.org Tue May 3 23:46:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E450CB2CCA1; Tue, 3 May 2016 23:46:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A5FC71E13; Tue, 3 May 2016 23:46:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43Nk1bd035299; Tue, 3 May 2016 23:46:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43Nk19F035296; Tue, 3 May 2016 23:46:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605032346.u43Nk19F035296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 3 May 2016 23:46: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: r299014 - stable/10/sys/netinet6 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.22 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, 03 May 2016 23:46:03 -0000 Author: markj Date: Tue May 3 23:46:01 2016 New Revision: 299014 URL: https://svnweb.freebsd.org/changeset/base/299014 Log: MFC r295575, r295576, r295578, r295579, r295580: Various NDP cleanups. No functional change intended. Modified: stable/10/sys/netinet6/nd6.c stable/10/sys/netinet6/nd6_nbr.c stable/10/sys/netinet6/nd6_rtr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/nd6.c ============================================================================== --- stable/10/sys/netinet6/nd6.c Tue May 3 23:39:41 2016 (r299013) +++ stable/10/sys/netinet6/nd6.c Tue May 3 23:46:01 2016 (r299014) @@ -112,11 +112,6 @@ VNET_DEFINE(int, nd6_debug) = 1; VNET_DEFINE(int, nd6_debug) = 0; #endif -/* for debugging? */ -#if 0 -static int nd6_inuse, nd6_allocated; -#endif - VNET_DEFINE(struct nd_drhead, nd_defrouter); VNET_DEFINE(struct nd_prhead, nd_prefix); @@ -175,7 +170,7 @@ nd6_ifattach(struct ifnet *ifp) { struct nd_ifinfo *nd; - nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK|M_ZERO); + nd = malloc(sizeof(*nd), M_IP6NDP, M_WAITOK | M_ZERO); nd->initialized = 1; nd->chlim = IPV6_DEFHLIM; @@ -2182,7 +2177,6 @@ clear_llinfo_pqueue(struct llentry *ln) } ln->la_hold = NULL; - return; } static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS); Modified: stable/10/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/10/sys/netinet6/nd6_nbr.c Tue May 3 23:39:41 2016 (r299013) +++ stable/10/sys/netinet6/nd6_nbr.c Tue May 3 23:46:01 2016 (r299014) @@ -623,7 +623,6 @@ nd6_ns_output_fib(struct ifnet *ifp, con RTFREE(ro.ro_rt); } m_freem(m); - return; } #ifndef BURN_BRIDGES @@ -901,12 +900,6 @@ nd6_na_input(struct mbuf *m, int off, in in6 = &L3_ADDR_SIN6(ln)->sin6_addr; - /* - * Lock to protect the default router list. - * XXX: this might be unnecessary, since this function - * is only called under the network software interrupt - * context. However, we keep it just for safety. - */ dr = defrouter_lookup(in6, ln->lle_tbl->llt_ifp); if (dr) defrtrlist_del(dr); @@ -1127,7 +1120,6 @@ nd6_na_output_fib(struct ifnet *ifp, con RTFREE(ro.ro_rt); } m_freem(m); - return; } #ifndef BURN_BRIDGES Modified: stable/10/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/10/sys/netinet6/nd6_rtr.c Tue May 3 23:39:41 2016 (r299013) +++ stable/10/sys/netinet6/nd6_rtr.c Tue May 3 23:46:01 2016 (r299014) @@ -501,7 +501,6 @@ defrouter_addreq(struct nd_defrouter *ne } if (error == 0) new->installed = 1; - return; } struct nd_defrouter * @@ -700,8 +699,6 @@ defrouter_select(void) defrouter_delreq(installed_dr); defrouter_addreq(selected_dr); } - - return; } /* @@ -735,53 +732,47 @@ static struct nd_defrouter * defrtrlist_update(struct nd_defrouter *new) { struct nd_defrouter *dr, *n; + int oldpref; if ((dr = defrouter_lookup(&new->rtaddr, new->ifp)) != NULL) { /* entry exists */ if (new->rtlifetime == 0) { defrtrlist_del(dr); - dr = NULL; - } else { - int oldpref = rtpref(dr); + return (NULL); + } - /* override */ - dr->flags = new->flags; /* xxx flag check */ - dr->rtlifetime = new->rtlifetime; - dr->expire = new->expire; + oldpref = rtpref(dr); - /* - * If the preference does not change, there's no need - * to sort the entries. Also make sure the selected - * router is still installed in the kernel. - */ - if (dr->installed && rtpref(new) == oldpref) - return (dr); + /* override */ + dr->flags = new->flags; /* xxx flag check */ + dr->rtlifetime = new->rtlifetime; + dr->expire = new->expire; - /* - * preferred router may be changed, so relocate - * this router. - * XXX: calling TAILQ_REMOVE directly is a bad manner. - * However, since defrtrlist_del() has many side - * effects, we intentionally do so here. - * defrouter_select() below will handle routing - * changes later. - */ - TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); - n = dr; - goto insert; - } - return (dr); + /* + * If the preference does not change, there's no need + * to sort the entries. Also make sure the selected + * router is still installed in the kernel. + */ + if (dr->installed && rtpref(new) == oldpref) + return (dr); + + /* + * The preferred router may have changed, so relocate this + * router. + */ + TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); + n = dr; + goto insert; } /* entry does not exist */ if (new->rtlifetime == 0) return (NULL); - n = (struct nd_defrouter *)malloc(sizeof(*n), M_IP6NDP, M_NOWAIT); + n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO); if (n == NULL) return (NULL); - bzero(n, sizeof(*n)); - *n = *new; + memcpy(n, new, sizeof(*n)); insert: /* @@ -824,10 +815,9 @@ pfxrtr_add(struct nd_prefix *pr, struct { struct nd_pfxrouter *new; - new = (struct nd_pfxrouter *)malloc(sizeof(*new), M_IP6NDP, M_NOWAIT); + new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO); if (new == NULL) return; - bzero(new, sizeof(*new)); new->router = dr; LIST_INSERT_HEAD(&pr->ndpr_advrtrs, new, pfr_entry); @@ -868,10 +858,9 @@ nd6_prelist_add(struct nd_prefixctl *pr, int i; char ip6buf[INET6_ADDRSTRLEN]; - new = (struct nd_prefix *)malloc(sizeof(*new), M_IP6NDP, M_NOWAIT); + new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO); if (new == NULL) - return(ENOMEM); - bzero(new, sizeof(*new)); + return (ENOMEM); new->ndpr_ifp = pr->ndpr_ifp; new->ndpr_prefix = pr->ndpr_prefix; new->ndpr_plen = pr->ndpr_plen; From owner-svn-src-stable-10@freebsd.org Wed May 4 00:14:52 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2A8AB2B665; Wed, 4 May 2016 00:14:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 BEFB910D1; Wed, 4 May 2016 00:14:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u440Eocc044343; Wed, 4 May 2016 00:14:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440Eokb044340; Wed, 4 May 2016 00:14:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040014.u440Eokb044340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:14:50 +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: r299016 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 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, 04 May 2016 00:14:52 -0000 Author: ngie Date: Wed May 4 00:14:50 2016 New Revision: 299016 URL: https://svnweb.freebsd.org/changeset/base/299016 Log: MFC r298451,r298452,r298507,r298750: r298451: Don't use `entry` after free in the "already in lists" case Return with 0 as it isn't an error. CID: 1006085 Obtained from: Isilon OneFS (part of r493633) r298452: Don't try to free `string` (stack allocated char[]) Fix minor style with warnx call while in the neighborhood CID: 1009683 r298507: Fix looking for "UTC" at start of ptr by using strnmp instead of improperly unrolled equivalent CID: 1347118 r298750: Use a better idiom for finding UTC prefixed timezones Instead of copy-pasting the string literal for "UTC" 3 times and using strlen, use a static char[3] buffer and sizeof(..). Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Tue May 3 23:56:52 2016 (r299015) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Wed May 4 00:14:50 2016 (r299016) @@ -693,6 +693,7 @@ snmp_import_table(struct snmp_toolinfo * /* Same entry already present in lists. */ free(entry->string); free(entry); + return (0); } (void) snmp_import_update_table(ENTRY_INDEX, entry); Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Tue May 3 23:56:52 2016 (r299015) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed May 4 00:14:50 2016 (r299016) @@ -338,8 +338,9 @@ static char * snmp_date2asn_oid(char *str, struct asn_oid *oid) { char *endptr, *ptr; - uint32_t v; + static const char UTC[3] = "UTC"; int32_t saved_errno; + uint32_t v; if (snmp_suboid_append(oid, (asn_subid_t) SNMP_DATETIME_OCTETS) < 0) return (NULL); @@ -440,8 +441,8 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'UTC' - optional */ ptr = endptr + 1; - if (*ptr == 'U' && *(ptr + 1) == 'T' && *(ptr + 1) == 'C') - ptr += 3; + if (strncmp(ptr, UTC, sizeof(UTC)) == 0) + ptr += sizeof(UTC); /* '+/-' */ if (*ptr == '-' || *ptr == '+') { Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Tue May 3 23:56:52 2016 (r299015) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed May 4 00:14:50 2016 (r299016) @@ -1079,10 +1079,9 @@ snmp_oid2asn_oid(struct snmp_toolinfo *s strlcpy(string, str, i + 1); string[i] = '\0'; if (snmp_lookup_enumoid(snmptoolctx, &obj, string) < 0) { - warnx("Unknown string - %s",string); + warnx("Unknown string - %s", string); return (NULL); } - free(string); } asn_append_oid(oid, &(obj.val.var)); From owner-svn-src-stable-10@freebsd.org Wed May 4 00:25:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AFA7B2B8D0; Wed, 4 May 2016 00:25:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 EBA26178D; Wed, 4 May 2016 00:25:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u440PL7S047415; Wed, 4 May 2016 00:25:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440PKvZ047412; Wed, 4 May 2016 00:25:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040025.u440PKvZ047412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:25: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: r299018 - stable/10/contrib/bsnmp/snmpd 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.22 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, 04 May 2016 00:25:22 -0000 Author: ngie Date: Wed May 4 00:25:20 2016 New Revision: 299018 URL: https://svnweb.freebsd.org/changeset/base/299018 Log: MFC r298448,r298464: r298448: Don't leak `string` in parse_define(..) when a macro has been found and the parser token != TOK_ASSIGN CID: 1007187, 1007188 Obtained from: Isilon OneFS (part of r445479) r298464: Use `sizeof(*uuser)` instead of `sizeof(struct usm_user)` for consistency with the rest of the users in the file No functional change Modified: stable/10/contrib/bsnmp/snmpd/config.c stable/10/contrib/bsnmp/snmpd/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/config.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/config.c Wed May 4 00:19:46 2016 (r299017) +++ stable/10/contrib/bsnmp/snmpd/config.c Wed May 4 00:25:20 2016 (r299018) @@ -1150,7 +1150,8 @@ parse_define(const char *varname) free(m->value); m->value = string; m->length = length; - } + } else + free(string); } token = TOK_EOL; Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Wed May 4 00:19:46 2016 (r299017) +++ stable/10/contrib/bsnmp/snmpd/main.c Wed May 4 00:25:20 2016 (r299018) @@ -2813,7 +2813,7 @@ usm_new_user(uint8_t *eid, uint32_t elen if ((uuser = (struct usm_user *)malloc(sizeof(*uuser))) == NULL) return (NULL); - memset(uuser, 0, sizeof(struct usm_user)); + memset(uuser, 0, sizeof(*uuser)); strlcpy(uuser->suser.sec_name, uname, SNMP_ADM_STR32_SIZ); memcpy(uuser->user_engine_id, eid, elen); uuser->user_engine_len = elen; From owner-svn-src-stable-10@freebsd.org Wed May 4 00:29:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C132B2BA7E; Wed, 4 May 2016 00:29:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3C1DA1BE3; Wed, 4 May 2016 00:29:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u440T5eU047678; Wed, 4 May 2016 00:29:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440T5or047677; Wed, 4 May 2016 00:29:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040029.u440T5or047677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:29: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: r299020 - stable/10/contrib/netbsd-tests/lib/libc/ssp 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.22 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, 04 May 2016 00:29:06 -0000 Author: ngie Date: Wed May 4 00:29:05 2016 New Revision: 299020 URL: https://svnweb.freebsd.org/changeset/base/299020 Log: MFC r298368,r298660: r298368: Fix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.c Ensure opening /dev/zero succeeds. Abort the test if it doesn't. Also, use _PATH_DEVZERO instead of hardcoding "/dev/zero" CID: 1251410 r298660: Fix up r298368 Remove the semicolon accidentally added after the new conditional that tests that /dev/zero is opened successfully. CID: 1354980 Modified: stable/10/contrib/netbsd-tests/lib/libc/ssp/h_read.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/ssp/h_read.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/ssp/h_read.c Wed May 4 00:26:47 2016 (r299019) +++ stable/10/contrib/netbsd-tests/lib/libc/ssp/h_read.c Wed May 4 00:29:05 2016 (r299020) @@ -38,6 +38,7 @@ __RCSID("$NetBSD: h_read.c,v 1.1 2010/12 #ifdef __FreeBSD__ #include +#include int main(int argc, char *argv[]) @@ -46,7 +47,8 @@ main(int argc, char *argv[]) int fd, n; size_t len = atoi(argv[1]); - fd = open("/dev/zero", O_RDONLY); + if ((fd = open(_PATH_DEVZERO, O_RDONLY)) == -1) + abort(); if ((n = read(fd, b, len)) == -1) abort(); (void)printf("%s\n", b); From owner-svn-src-stable-10@freebsd.org Wed May 4 00:30:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AC2BB2BB30; Wed, 4 May 2016 00:30:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C2E391D99; Wed, 4 May 2016 00:30:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u440UaYJ047810; Wed, 4 May 2016 00:30:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440UaUQ047808; Wed, 4 May 2016 00:30:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040030.u440UaUQ047808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:30:36 +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: r299021 - stable/10/lib/libc/tests/stdio 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.22 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, 04 May 2016 00:30:38 -0000 Author: ngie Date: Wed May 4 00:30:36 2016 New Revision: 299021 URL: https://svnweb.freebsd.org/changeset/base/299021 Log: MFC r298311,r298312: r298311: Make sure fmemopen succeeds in :test_append_binary_pos before calling ftell on the FILE object This fixes potential null pointer dereferences on failure CID: 1254952 r298312: Fix double fclose of `fp1` when freopen fails freopen handles closing file descriptors on error, with the exception of fdopen'ed descriptors, so closing an already fclose'd file descriptor is incorrect CID: 1338525 Modified: stable/10/lib/libc/tests/stdio/fmemopen2_test.c stable/10/lib/libc/tests/stdio/freopen_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/stdio/fmemopen2_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/fmemopen2_test.c Wed May 4 00:29:05 2016 (r299020) +++ stable/10/lib/libc/tests/stdio/fmemopen2_test.c Wed May 4 00:30:36 2016 (r299021) @@ -249,12 +249,14 @@ ATF_TC_BODY(test_append_binary_pos, tc) FILE *fp; fp = fmemopen(NULL, 16, "ab+"); + ATF_REQUIRE(fp != NULL); ATF_REQUIRE(ftell(fp) == 0L); fclose(fp); /* Make sure that a pre-allocated buffer behaves correctly. */ char buf[] = "Hello"; fp = fmemopen(buf, sizeof(buf), "ab+"); + ATF_REQUIRE(fp != NULL); ATF_REQUIRE(ftell(fp) == strlen(buf)); fclose(fp); } Modified: stable/10/lib/libc/tests/stdio/freopen_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/freopen_test.c Wed May 4 00:29:05 2016 (r299020) +++ stable/10/lib/libc/tests/stdio/freopen_test.c Wed May 4 00:30:36 2016 (r299021) @@ -48,7 +48,6 @@ runtest(const char *fname1, const char * "fopen(\"%s\", \"%s\") failed; errno=%d", fname1, mode1, errno); fp2 = freopen(fname2, mode2, fp1); if (fp2 == NULL) { - fclose(fp1); ATF_REQUIRE_MSG(success == false, "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) succeeded " "unexpectedly", fname2_print, mode2, fname1, mode1); From owner-svn-src-stable-10@freebsd.org Wed May 4 00:34:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CA31B2BC85; Wed, 4 May 2016 00:34:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2DBB5117D; Wed, 4 May 2016 00:34:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u440YjJ0050656; Wed, 4 May 2016 00:34:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440YjQi050655; Wed, 4 May 2016 00:34:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040034.u440YjQi050655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:34: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: r299022 - stable/10/contrib/bsnmp/gensnmptree 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.22 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, 04 May 2016 00:34:46 -0000 Author: ngie Date: Wed May 4 00:34:45 2016 New Revision: 299022 URL: https://svnweb.freebsd.org/changeset/base/299022 Log: MFC r298450: Simplify always evaluated branch (`e != NULL`) - xalloc(..) ensures that e will be non-null via malloc + err. - `e` is already dereferenced above, so logically it's impossible to hit the lower test without crashing if it was indeed NULL. CID: 1007408 Modified: stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 4 00:30:36 2016 (r299021) +++ stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 4 00:34:45 2016 (r299022) @@ -743,10 +743,8 @@ parse_type(enum tok *tok, struct type *t report("need value for ENUM/BITS"); if (gettoken() != TOK_STR) report("need string in ENUM/BITS"); - if (e != NULL) { - e->name = savetok(); - TAILQ_INSERT_TAIL(&t->enums, e, link); - } + e->name = savetok(); + TAILQ_INSERT_TAIL(&t->enums, e, link); if ((*tok = gettoken()) == TOK_EOF) report("unexpected EOF in ENUM/BITS"); } while (*tok != ')'); From owner-svn-src-stable-10@freebsd.org Wed May 4 00:39:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AC2FB2BE22; Wed, 4 May 2016 00:39:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 DA92E1676; Wed, 4 May 2016 00:39:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u440d4JB050939; Wed, 4 May 2016 00:39:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440d4F5050938; Wed, 4 May 2016 00:39:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040039.u440d4F5050938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:39: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: r299024 - stable/10/lib/libcam 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.22 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, 04 May 2016 00:39:05 -0000 Author: ngie Date: Wed May 4 00:39:03 2016 New Revision: 299024 URL: https://svnweb.freebsd.org/changeset/base/299024 Log: MFC r298753: Fix va_list handling - Add missing va_end's after corresponding va_start's to cleanup state - Eliminate questionable bzero'ing of va_list passed in to do_buff_decode(..) and do_encode(..) from buff_{de,en}code_visit(..) and csio_{de,en}code_visit(..). Make va_list a pointer instead and pass NULL into the underlying functions to handler this in a portable way. - Do some minor style(9) clean up in affected functions. CID: 1018500-1018503 Modified: stable/10/lib/libcam/scsi_cmdparse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/scsi_cmdparse.c ============================================================================== --- stable/10/lib/libcam/scsi_cmdparse.c Wed May 4 00:35:41 2016 (r299023) +++ stable/10/lib/libcam/scsi_cmdparse.c Wed May 4 00:39:03 2016 (r299024) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); static int do_buff_decode(u_int8_t *databuf, size_t len, void (*arg_put)(void *, int , void *, int, char *), - void *puthook, const char *fmt, va_list ap) + void *puthook, const char *fmt, va_list *ap) { int assigned = 0; int width; @@ -128,7 +128,7 @@ do_buff_decode(u_int8_t *databuf, size_t (void *)((long)(ARG)), width, \ field_name); \ else \ - *(va_arg(ap, int *)) = (ARG); \ + *(va_arg(*ap, int *)) = (ARG); \ assigned++; \ } \ field_name[0] = 0; \ @@ -255,7 +255,7 @@ do_buff_decode(u_int8_t *databuf, size_t databuf, width, field_name); else { char *dest; - dest = va_arg(ap, char *); + dest = va_arg(*ap, char *); bcopy(databuf, dest, width); if (letter == 'z') { char *p; @@ -287,7 +287,7 @@ do_buff_decode(u_int8_t *databuf, size_t * can't have a variable seek when you are using * "arg_put". */ - width = (arg_put) ? 0 : va_arg(ap, int); + width = (arg_put) ? 0 : va_arg(*ap, int); fmt++; } else { width = strtol(fmt, &intendp, 10); @@ -539,7 +539,7 @@ next_field(const char **pp, char *fmt, i static int do_encode(u_char *buff, size_t vec_max, size_t *used, int (*arg_get)(void *, char *), void *gethook, const char *fmt, - va_list ap) + va_list *ap) { int ind; int shift; @@ -564,7 +564,7 @@ do_encode(u_char *buff, size_t vec_max, else value = arg_get ? (*arg_get)(gethook, field_name) : - va_arg(ap, int); + va_arg(*ap, int); } #if 0 @@ -662,11 +662,16 @@ int csio_decode(struct ccb_scsiio *csio, const char *fmt, ...) { va_list ap; + int retval; va_start(ap, fmt); - return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, - 0, 0, fmt, ap)); + retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, 0, 0, + fmt, &ap); + + va_end(ap); + + return (retval); } int @@ -674,29 +679,31 @@ csio_decode_visit(struct ccb_scsiio *csi void (*arg_put)(void *, int, void *, int, char *), void *puthook) { - va_list ap; /* * We need some way to output things; we can't do it without * the arg_put function. */ if (arg_put == NULL) - return(-1); - - bzero(&ap, sizeof(ap)); + return (-1); - return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, - arg_put, puthook, fmt, ap)); + return (do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, + arg_put, puthook, fmt, NULL)); } int buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...) { va_list ap; + int retval; va_start(ap, fmt); - return(do_buff_decode(buff, len, 0, 0, fmt, ap)); + retval = do_buff_decode(buff, len, 0, 0, fmt, &ap); + + va_end(ap); + + return (retval); } int @@ -704,7 +711,6 @@ buff_decode_visit(u_int8_t *buff, size_t void (*arg_put)(void *, int, void *, int, char *), void *puthook) { - va_list ap; /* * We need some way to output things; we can't do it without @@ -713,9 +719,7 @@ buff_decode_visit(u_int8_t *buff, size_t if (arg_put == NULL) return(-1); - bzero(&ap, sizeof(ap)); - - return(do_buff_decode(buff, len, arg_put, puthook, fmt, ap)); + return (do_buff_decode(buff, len, arg_put, puthook, fmt, NULL)); } /* @@ -732,15 +736,15 @@ csio_build(struct ccb_scsiio *csio, u_in va_list ap; if (csio == NULL) - return(0); + return (0); bzero(csio, sizeof(struct ccb_scsiio)); va_start(ap, cmd_spec); if ((retval = do_encode(csio->cdb_io.cdb_bytes, SCSI_MAX_CDBLEN, - &cmdlen, NULL, NULL, cmd_spec, ap)) == -1) - return(retval); + &cmdlen, NULL, NULL, cmd_spec, &ap)) == -1) + goto done; cam_fill_csio(csio, /* retries */ retry_count, @@ -753,7 +757,10 @@ csio_build(struct ccb_scsiio *csio, u_in /* cdb_len */ cmdlen, /* timeout */ timeout ? timeout : 5000); - return(retval); +done: + va_end(ap); + + return (retval); } int @@ -762,7 +769,6 @@ csio_build_visit(struct ccb_scsiio *csio int timeout, const char *cmd_spec, int (*arg_get)(void *hook, char *field_name), void *gethook) { - va_list ap; size_t cmdlen; int retval; @@ -776,12 +782,10 @@ csio_build_visit(struct ccb_scsiio *csio if (arg_get == NULL) return(-1); - bzero(&ap, sizeof(ap)); - bzero(csio, sizeof(struct ccb_scsiio)); if ((retval = do_encode(csio->cdb_io.cdb_bytes, SCSI_MAX_CDBLEN, - &cmdlen, arg_get, gethook, cmd_spec, ap)) == -1) + &cmdlen, arg_get, gethook, cmd_spec, NULL)) == -1) return(retval); cam_fill_csio(csio, @@ -802,20 +806,24 @@ int csio_encode(struct ccb_scsiio *csio, const char *fmt, ...) { va_list ap; + int retval; if (csio == NULL) - return(0); + return (0); va_start(ap, fmt); - return(do_encode(csio->data_ptr, csio->dxfer_len, 0, 0, 0, fmt, ap)); + retval = do_encode(csio->data_ptr, csio->dxfer_len, 0, 0, 0, fmt, &ap); + + va_end(ap); + + return (retval); } int buff_encode_visit(u_int8_t *buff, size_t len, const char *fmt, int (*arg_get)(void *hook, char *field_name), void *gethook) { - va_list ap; /* * We need something to encode, but we can't get it without the @@ -824,16 +832,13 @@ buff_encode_visit(u_int8_t *buff, size_t if (arg_get == NULL) return(-1); - bzero(&ap, sizeof(ap)); - - return(do_encode(buff, len, 0, arg_get, gethook, fmt, ap)); + return (do_encode(buff, len, 0, arg_get, gethook, fmt, NULL)); } int csio_encode_visit(struct ccb_scsiio *csio, const char *fmt, int (*arg_get)(void *hook, char *field_name), void *gethook) { - va_list ap; /* * We need something to encode, but we can't get it without the @@ -842,8 +847,6 @@ csio_encode_visit(struct ccb_scsiio *csi if (arg_get == NULL) return(-1); - bzero(&ap, sizeof(ap)); - - return(do_encode(csio->data_ptr, csio->dxfer_len, 0, arg_get, - gethook, fmt, ap)); + return (do_encode(csio->data_ptr, csio->dxfer_len, 0, arg_get, + gethook, fmt, NULL)); } From owner-svn-src-stable-10@freebsd.org Wed May 4 07:33:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60534B2C1DB; Wed, 4 May 2016 07:33:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2CF211F79; Wed, 4 May 2016 07:33:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u447Xw8i080424; Wed, 4 May 2016 07:33:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u447XwAK080423; Wed, 4 May 2016 07:33:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040733.u447XwAK080423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 07:33:58 +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: r299056 - stable/10/sbin/camcontrol 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.22 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, 04 May 2016 07:33:59 -0000 Author: ngie Date: Wed May 4 07:33:58 2016 New Revision: 299056 URL: https://svnweb.freebsd.org/changeset/base/299056 Log: MFC r298758: Remove logically impossible test in scsidoinquiry(..) It was already done 4 lines prior and the value of error didn't change CID: 1011236 Modified: stable/10/sbin/camcontrol/camcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Wed May 4 07:06:48 2016 (r299055) +++ stable/10/sbin/camcontrol/camcontrol.c Wed May 4 07:33:58 2016 (r299056) @@ -814,9 +814,6 @@ scsidoinquiry(struct cam_device *device, if (arglist & CAM_ARG_GET_SERIAL) scsiserial(device, retry_count, timeout); - if (error != 0) - return(error); - if (arglist & CAM_ARG_GET_XFERRATE) error = camxferrate(device); From owner-svn-src-stable-10@freebsd.org Wed May 4 07:35:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69A56B2C265; Wed, 4 May 2016 07:35:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 278B71102; Wed, 4 May 2016 07:35:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u447Zh9K080570; Wed, 4 May 2016 07:35:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u447ZheQ080569; Wed, 4 May 2016 07:35:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040735.u447ZheQ080569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 07:35:43 +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: r299057 - stable/10/tests/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.22 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, 04 May 2016 07:35:44 -0000 Author: ngie Date: Wed May 4 07:35:43 2016 New Revision: 299057 URL: https://svnweb.freebsd.org/changeset/base/299057 Log: MFC r298301: Fix leaks and test for getpagesize() returning == -1 - close file descriptors after use. - Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3). CID: 1331374-1331377, 1331653-1331662 Modified: stable/10/tests/sys/vm/mmap_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/vm/mmap_test.c ============================================================================== --- stable/10/tests/sys/vm/mmap_test.c Wed May 4 07:33:58 2016 (r299056) +++ stable/10/tests/sys/vm/mmap_test.c Wed May 4 07:35:43 2016 (r299057) @@ -91,8 +91,10 @@ static void checked_mmap(int prot, int flags, int fd, int error, const char *msg) { void *p; + int pagesize; - p = mmap(NULL, getpagesize(), prot, flags, fd, 0); + ATF_REQUIRE((pagesize = getpagesize()) > 0); + p = mmap(NULL, pagesize, prot, flags, fd, 0); if (p == MAP_FAILED) { if (error == 0) ATF_CHECK_MSG(0, "%s failed with errno %d", msg, @@ -103,18 +105,19 @@ checked_mmap(int prot, int flags, int fd errno, error); } else { ATF_CHECK_MSG(error == 0, "%s succeeded", msg); - munmap(p, getpagesize()); + munmap(p, pagesize); } } ATF_TC_WITHOUT_HEAD(mmap__bad_arguments); ATF_TC_BODY(mmap__bad_arguments, tc) { - int devstatfd, shmfd, zerofd; + int devstatfd, pagesize, shmfd, zerofd; + ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((devstatfd = open("/dev/devstat", O_RDONLY)) >= 0); ATF_REQUIRE((shmfd = shm_open(SHM_ANON, O_RDWR, 0644)) >= 0); - ATF_REQUIRE(ftruncate(shmfd, getpagesize()) == 0); + ATF_REQUIRE(ftruncate(shmfd, pagesize) == 0); ATF_REQUIRE((zerofd = open("/dev/zero", O_RDONLY)) >= 0); /* These should work. */ @@ -179,6 +182,10 @@ ATF_TC_BODY(mmap__bad_arguments, tc) */ checked_mmap(PROT_READ, MAP_PRIVATE, devstatfd, EINVAL, "MAP_PRIVATE of /dev/devstat"); + + close(devstatfd); + close(shmfd); + close(zerofd); } ATF_TC_WITHOUT_HEAD(mmap__dev_zero_private); @@ -186,22 +193,21 @@ ATF_TC_BODY(mmap__dev_zero_private, tc) { char *p1, *p2, *p3; size_t i; - int fd; + int fd, pagesize; + ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0); - p1 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, - 0); + p1 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ATF_REQUIRE(p1 != MAP_FAILED); - p2 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, - 0); + p2 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ATF_REQUIRE(p2 != MAP_FAILED); - for (i = 0; i < getpagesize(); i++) + for (i = 0; i < pagesize; i++) ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); - ATF_REQUIRE(memcmp(p1, p2, getpagesize()) == 0); + ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); p1[0] = 1; @@ -211,11 +217,15 @@ ATF_TC_BODY(mmap__dev_zero_private, tc) ATF_REQUIRE(p1[0] == 1); - p3 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, - 0); + p3 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ATF_REQUIRE(p3 != MAP_FAILED); ATF_REQUIRE(p3[0] == 0); + + munmap(p1, pagesize); + munmap(p2, pagesize); + munmap(p3, pagesize); + close(fd); } ATF_TC_WITHOUT_HEAD(mmap__dev_zero_shared); @@ -223,22 +233,21 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc) { char *p1, *p2, *p3; size_t i; - int fd; + int fd, pagesize; + ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0); - p1 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + p1 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ATF_REQUIRE(p1 != MAP_FAILED); - p2 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + p2 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ATF_REQUIRE(p2 != MAP_FAILED); - for (i = 0; i < getpagesize(); i++) + for (i = 0; i < pagesize; i++) ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); - ATF_REQUIRE(memcmp(p1, p2, getpagesize()) == 0); + ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); p1[0] = 1; @@ -248,11 +257,16 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc) ATF_REQUIRE(p1[0] == 1); - p3 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, + p3 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ATF_REQUIRE(p3 != MAP_FAILED); ATF_REQUIRE(p3[0] == 0); + + munmap(p1, pagesize); + munmap(p2, pagesize); + munmap(p3, pagesize); + close(fd); } ATF_TP_ADD_TCS(tp) From owner-svn-src-stable-10@freebsd.org Wed May 4 07:37:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9731FB2C2F3; Wed, 4 May 2016 07:37:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 58DA5128E; Wed, 4 May 2016 07:37:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u447b2f0080679; Wed, 4 May 2016 07:37:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u447b2r8080678; Wed, 4 May 2016 07:37:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040737.u447b2r8080678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 07:37: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: r299058 - stable/10/tests/sys/posixshm 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.22 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, 04 May 2016 07:37:03 -0000 Author: ngie Date: Wed May 4 07:37:02 2016 New Revision: 299058 URL: https://svnweb.freebsd.org/changeset/base/299058 Log: MFC r298304: Fix issues identified by Coverity - Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3). - Remove intermediate variable for assigning from $TMPDIR if set in the environment to eliminate warnings about pointer conversions with "/tmp", and to mute an invalid buffer overflow concern from Coverity (snprintf and tacking on a NUL terminator was alleviating that concern before). - Remove useless self-test of psize before it's initialized. - Check the return values of getrlimit/setrlimit. Cosmetic changes: - Replace a `(void*)0` with NULL. - Do some minor whitespace clean up. - Remove an unnecessary cast to mmap. - Make all munmap calls use ATF_REQUIRE_MSG instead of using the: > if (munmap(..) == -1) > atf_tc_fail(..) idiom. Employ the new idiom consistently when calling munmap. CID: 1331351, 1331382-1331386, 1331513, 1331514, 1331565, 1331583, 1331694 Modified: stable/10/tests/sys/posixshm/posixshm_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/posixshm/posixshm_test.c ============================================================================== --- stable/10/tests/sys/posixshm/posixshm_test.c Wed May 4 07:35:43 2016 (r299057) +++ stable/10/tests/sys/posixshm/posixshm_test.c Wed May 4 07:37:02 2016 (r299058) @@ -50,12 +50,9 @@ static char test_path[TEST_PATH_LEN]; static void gen_test_path(void) { - char *tmpdir = getenv("TMPDIR"); - if (tmpdir == NULL) - tmpdir = "/tmp"; - - snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", tmpdir); + snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", + getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); test_path[sizeof(test_path) - 1] = '\0'; ATF_REQUIRE_MSG(mkstemp(test_path) != -1, "mkstemp failed; errno=%d", errno); @@ -99,10 +96,12 @@ static int scribble_object(void) { char *page; - int fd; + int fd, pagesize; gen_test_path(); + ATF_REQUIRE(0 < (pagesize = getpagesize())); + fd = shm_open(test_path, O_CREAT|O_EXCL|O_RDWR, 0777); if (fd < 0 && errno == EEXIST) { if (shm_unlink(test_path) < 0) @@ -111,17 +110,16 @@ scribble_object(void) } if (fd < 0) atf_tc_fail("shm_open failed; errno=%d", errno); - if (ftruncate(fd, getpagesize()) < 0) + if (ftruncate(fd, pagesize) < 0) atf_tc_fail("ftruncate failed; errno=%d", errno); - page = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap failed; errno=%d", errno); page[0] = '1'; - if (munmap(page, getpagesize()) < 0) - atf_tc_fail("munmap failed; errno=%d", errno); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); return (fd); } @@ -130,12 +128,13 @@ ATF_TC_WITHOUT_HEAD(remap_object); ATF_TC_BODY(remap_object, tc) { char *page; - int fd; + int fd, pagesize; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); fd = scribble_object(); - page = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(2) failed; errno=%d", errno); @@ -143,8 +142,8 @@ ATF_TC_BODY(remap_object, tc) atf_tc_fail("missing data ('%c' != '1')", page[0]); close(fd); - if (munmap(page, getpagesize()) < 0) - atf_tc_fail("munmap failed; errno=%d", errno); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); ATF_REQUIRE_MSG(shm_unlink(test_path) != -1, "shm_unlink failed; errno=%d", errno); @@ -154,7 +153,9 @@ ATF_TC_WITHOUT_HEAD(reopen_object); ATF_TC_BODY(reopen_object, tc) { char *page; - int fd; + int fd, pagesize; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); fd = scribble_object(); close(fd); @@ -163,14 +164,15 @@ ATF_TC_BODY(reopen_object, tc) if (fd < 0) atf_tc_fail("shm_open(2) failed; errno=%d", errno); - page = mmap(0, getpagesize(), PROT_READ, MAP_SHARED, fd, 0); + page = mmap(0, pagesize, PROT_READ, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(2) failed; errno=%d", errno); if (page[0] != '1') atf_tc_fail("missing data ('%c' != '1')", page[0]); - munmap(page, getpagesize()); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); close(fd); ATF_REQUIRE_MSG(shm_unlink(test_path) != -1, "shm_unlink failed; errno=%d", errno); @@ -180,7 +182,9 @@ ATF_TC_WITHOUT_HEAD(readonly_mmap_write) ATF_TC_BODY(readonly_mmap_write, tc) { char *page; - int fd; + int fd, pagesize; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); gen_test_path(); @@ -188,8 +192,7 @@ ATF_TC_BODY(readonly_mmap_write, tc) ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno); /* PROT_WRITE should fail with EACCES. */ - page = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page != MAP_FAILED) atf_tc_fail("mmap(PROT_WRITE) succeeded unexpectedly"); @@ -359,49 +362,49 @@ ATF_TC_BODY(object_resize, tc) { pid_t pid; struct stat sb; - char err_buf[1024], *page; - int fd, status; + char *page; + int fd, pagesize, status; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); /* Start off with a size of a single page. */ fd = shm_open(SHM_ANON, O_CREAT|O_RDWR, 0777); if (fd < 0) atf_tc_fail("shm_open failed; errno=%d", errno); - if (ftruncate(fd, getpagesize()) < 0) + if (ftruncate(fd, pagesize) < 0) atf_tc_fail("ftruncate(1) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(1) failed; errno=%d", errno); - if (sb.st_size != getpagesize()) + if (sb.st_size != pagesize) atf_tc_fail("first resize failed (%d != %d)", - (int)sb.st_size, getpagesize()); + (int)sb.st_size, pagesize); /* Write a '1' to the first byte. */ - page = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(1)"); page[0] = '1'; - if (munmap(page, getpagesize()) < 0) - atf_tc_fail("munmap(1) failed; errno=%d", errno); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); /* Grow the object to 2 pages. */ - if (ftruncate(fd, getpagesize() * 2) < 0) + if (ftruncate(fd, pagesize * 2) < 0) atf_tc_fail("ftruncate(2) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(2) failed; errno=%d", errno); - if (sb.st_size != getpagesize() * 2) + if (sb.st_size != pagesize * 2) atf_tc_fail("second resize failed (%d != %d)", - (int)sb.st_size, getpagesize() * 2); + (int)sb.st_size, pagesize * 2); /* Check for '1' at the first byte. */ - page = mmap(0, getpagesize() * 2, PROT_READ|PROT_WRITE, MAP_SHARED, - fd, 0); + page = mmap(0, pagesize * 2, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(2) failed; errno=%d", errno); @@ -409,18 +412,18 @@ ATF_TC_BODY(object_resize, tc) atf_tc_fail("'%c' != '1'", page[0]); /* Write a '2' at the start of the second page. */ - page[getpagesize()] = '2'; + page[pagesize] = '2'; /* Shrink the object back to 1 page. */ - if (ftruncate(fd, getpagesize()) < 0) + if (ftruncate(fd, pagesize) < 0) atf_tc_fail("ftruncate(3) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(3) failed; errno=%d", errno); - if (sb.st_size != getpagesize()) + if (sb.st_size != pagesize) atf_tc_fail("third resize failed (%d != %d)", - (int)sb.st_size, getpagesize()); + (int)sb.st_size, pagesize); /* * Fork a child process to make sure the second page is no @@ -435,16 +438,16 @@ ATF_TC_BODY(object_resize, tc) char c; /* Don't generate a core dump. */ - getrlimit(RLIMIT_CORE, &lim); + ATF_REQUIRE(getrlimit(RLIMIT_CORE, &lim) == 0); lim.rlim_cur = 0; - setrlimit(RLIMIT_CORE, &lim); + ATF_REQUIRE(setrlimit(RLIMIT_CORE, &lim) == 0); /* * The previous ftruncate(2) shrunk the backing object * so that this address is no longer valid, so reading * from it should trigger a SIGSEGV. */ - c = page[getpagesize()]; + c = page[pagesize]; fprintf(stderr, "child: page 1: '%c'\n", c); exit(0); } @@ -456,15 +459,15 @@ ATF_TC_BODY(object_resize, tc) atf_tc_fail("child terminated with status %x", status); /* Grow the object back to 2 pages. */ - if (ftruncate(fd, getpagesize() * 2) < 0) + if (ftruncate(fd, pagesize * 2) < 0) atf_tc_fail("ftruncate(2) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(2) failed; errno=%d", errno); - if (sb.st_size != getpagesize() * 2) + if (sb.st_size != pagesize * 2) atf_tc_fail("fourth resize failed (%d != %d)", - (int)sb.st_size, getpagesize()); + (int)sb.st_size, pagesize); /* * Note that the mapping at 'page' for the second page is @@ -475,9 +478,9 @@ ATF_TC_BODY(object_resize, tc) * object was shrunk and the new pages when an object are * grown are zero-filled. */ - if (page[getpagesize()] != 0) + if (page[pagesize] != 0) atf_tc_fail("invalid data at %d: %x != 0", - getpagesize(), (int)page[getpagesize()]); + pagesize, (int)page[pagesize]); close(fd); } @@ -524,7 +527,7 @@ ATF_TC_BODY(shm_functionality_across_for scval = sysconf(_SC_PAGESIZE); if (scval == -1 && errno != 0) { atf_tc_fail("sysconf(_SC_PAGESIZE) failed; errno=%d", errno); - } else if (scval <= 0 || (size_t)psize != psize) { + } else if (scval <= 0) { fprintf(stderr, "bogus return from sysconf(_SC_PAGESIZE): %ld", scval); psize = 4096; @@ -542,8 +545,7 @@ ATF_TC_BODY(shm_functionality_across_for ATF_REQUIRE_MSG(ftruncate(desc, (off_t)psize) != -1, "ftruncate failed; errno=%d", errno); - region = mmap((void *)0, psize, PROT_READ | PROT_WRITE, MAP_SHARED, - desc, (off_t)0); + region = mmap(NULL, psize, PROT_READ | PROT_WRITE, MAP_SHARED, desc, 0); ATF_REQUIRE_MSG(region != MAP_FAILED, "mmap failed; errno=%d", errno); memset(region, '\377', psize); @@ -601,6 +603,10 @@ ATF_TC_BODY(shm_functionality_across_for strsignal(WTERMSIG(status))); } } + + ATF_REQUIRE_MSG(munmap(region, psize) == 0, "munmap failed; errno=%d", + errno); + shm_unlink(test_path); } ATF_TP_ADD_TCS(tp) From owner-svn-src-stable-10@freebsd.org Wed May 4 07:39:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D217B2C3A5; Wed, 4 May 2016 07:39:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 EE2D31454; Wed, 4 May 2016 07:39:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u447dO6A080811; Wed, 4 May 2016 07:39:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u447dO12080810; Wed, 4 May 2016 07:39:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040739.u447dO12080810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 07:39: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: r299059 - stable/10/contrib/netbsd-tests/lib/libc/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.22 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, 04 May 2016 07:39:25 -0000 Author: ngie Date: Wed May 4 07:39:23 2016 New Revision: 299059 URL: https://svnweb.freebsd.org/changeset/base/299059 Log: MFC r298366: Fix coverity issues with contrib/netbsd-tests/lib/libc/sys/t_connect.c - Ensure socket(2) calls succeed - Don't leak slist allocated by earlier socket(2) call CID: 976773, 1251405 Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c Wed May 4 07:37:02 2016 (r299058) +++ stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c Wed May 4 07:39:23 2016 (r299059) @@ -56,6 +56,11 @@ ATF_TC_BODY(connect_low_port, tc) slist = socket(AF_INET, SOCK_STREAM, 0); sd = socket(AF_INET, SOCK_STREAM, 0); +#ifdef __FreeBSD__ + ATF_REQUIRE(sd > 0); + ATF_REQUIRE(slist > 0); +#endif + /* bind listening socket */ memset(&sinlist, 0, sizeof(sinlist)); sinlist.sin_family = AF_INET; @@ -92,6 +97,9 @@ ATF_TC_BODY(connect_low_port, tc) ATF_REQUIRE(ntohs(sin.sin_port) <= IPPORT_RESERVEDMAX); close(sd); +#ifdef __FreeBSD__ + close(slist); +#endif } ATF_TP_ADD_TCS(tp) From owner-svn-src-stable-10@freebsd.org Wed May 4 11:40:14 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76E92B2CA23; Wed, 4 May 2016 11:40:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 482321720; Wed, 4 May 2016 11:40:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44BeDBi053285; Wed, 4 May 2016 11:40:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44BeDNB053284; Wed, 4 May 2016 11:40:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605041140.u44BeDNB053284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 4 May 2016 11:40:13 +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: r299061 - 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.22 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, 04 May 2016 11:40:14 -0000 Author: avg Date: Wed May 4 11:40:13 2016 New Revision: 299061 URL: https://svnweb.freebsd.org/changeset/base/299061 Log: MFC r297812: zio: align use of "no dump" flag between use_uma and !use_uma cases Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed May 4 08:57:40 2016 (r299060) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed May 4 11:40:13 2016 (r299061) @@ -133,11 +133,13 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass boolean_t zio_requeue_io_start_cut_in_line = B_TRUE; +#ifdef illumos #ifdef ZFS_DEBUG int zio_buf_debug_limit = 16384; #else int zio_buf_debug_limit = 0; #endif +#endif void zio_init(void) @@ -159,7 +161,7 @@ zio_init(void) size_t size = (c + 1) << SPA_MINBLOCKSHIFT; size_t p2 = size; size_t align = 0; - size_t cflags = (size > zio_buf_debug_limit) ? KMC_NODEBUG : 0; + int cflags = zio_exclude_metadata ? KMC_NODEBUG : 0; while (!ISP2(p2)) p2 &= p2 - 1; From owner-svn-src-stable-10@freebsd.org Wed May 4 11:53:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94913B2CD42; Wed, 4 May 2016 11:53:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5098F1E60; Wed, 4 May 2016 11:53:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44BrVCn058926; Wed, 4 May 2016 11:53:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44BrU15058920; Wed, 4 May 2016 11:53:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605041153.u44BrU15058920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 4 May 2016 11:53:30 +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: r299062 - in stable/10/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86 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.22 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, 04 May 2016 11:53:32 -0000 Author: avg Date: Wed May 4 11:53:30 2016 New Revision: 299062 URL: https://svnweb.freebsd.org/changeset/base/299062 Log: MFC r297857: re-enable AMD Topology extension on certain models if disabled by BIOS Modified: stable/10/sys/amd64/amd64/mp_machdep.c stable/10/sys/amd64/include/md_var.h stable/10/sys/i386/i386/mp_machdep.c stable/10/sys/i386/include/md_var.h stable/10/sys/x86/include/specialreg.h stable/10/sys/x86/x86/identcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/amd64/amd64/mp_machdep.c Wed May 4 11:53:30 2016 (r299062) @@ -682,7 +682,7 @@ init_secondary(void) wrmsr(MSR_FSBASE, 0); /* User value */ wrmsr(MSR_GSBASE, (u_int64_t)pc); wrmsr(MSR_KGSBASE, (u_int64_t)pc); /* XXX User value while we're in the kernel */ - intel_fix_cpuid(); + fix_cpuid(); lidt(&r_idt); Modified: stable/10/sys/amd64/include/md_var.h ============================================================================== --- stable/10/sys/amd64/include/md_var.h Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/amd64/include/md_var.h Wed May 4 11:53:30 2016 (r299062) @@ -112,7 +112,7 @@ void dump_drop_page(vm_paddr_t); void identify_cpu(void); void initializecpu(void); void initializecpucache(void); -bool intel_fix_cpuid(void); +bool fix_cpuid(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fpstate_drop(struct thread *td); int is_physical_memory(vm_paddr_t addr); Modified: stable/10/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/10/sys/i386/i386/mp_machdep.c Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/i386/i386/mp_machdep.c Wed May 4 11:53:30 2016 (r299062) @@ -684,7 +684,7 @@ init_secondary(void) pc->pc_prvspace = pc; pc->pc_curthread = 0; - intel_fix_cpuid(); + fix_cpuid(); gdt_segs[GPRIV_SEL].ssd_base = (int) pc; gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss; Modified: stable/10/sys/i386/include/md_var.h ============================================================================== --- stable/10/sys/i386/include/md_var.h Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/i386/include/md_var.h Wed May 4 11:53:30 2016 (r299062) @@ -116,7 +116,7 @@ void fillw(int /*u_short*/ pat, void *ba void fill_based_sd(struct segment_descriptor *sdp, uint32_t base); void initializecpu(void); void initializecpucache(void); -bool intel_fix_cpuid(void); +bool fix_cpuid(void); void i686_pagezero(void *addr); void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); Modified: stable/10/sys/x86/include/specialreg.h ============================================================================== --- stable/10/sys/x86/include/specialreg.h Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/x86/include/specialreg.h Wed May 4 11:53:30 2016 (r299062) @@ -821,6 +821,7 @@ #define MSR_P_STATE_CONFIG(n) (0xc0010064 + (n)) /* P-state Config */ #define MSR_SMM_ADDR 0xc0010112 /* SMM TSEG base address */ #define MSR_SMM_MASK 0xc0010113 /* SMM TSEG address mask */ +#define MSR_EXTFEATURES 0xc0011005 /* Extended CPUID Features override */ #define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #define MSR_MC0_CTL_MASK 0xc0010044 Modified: stable/10/sys/x86/x86/identcpu.c ============================================================================== --- stable/10/sys/x86/x86/identcpu.c Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/x86/x86/identcpu.c Wed May 4 11:53:30 2016 (r299062) @@ -1304,23 +1304,22 @@ identify_hypervisor(void) } #endif -/* - * Clear "Limit CPUID Maxval" bit and return true if the caller should - * get the largest standard CPUID function number again if it is set - * from BIOS. It is necessary for probing correct CPU topology later - * and for the correct operation of the AVX-aware userspace. - */ bool -intel_fix_cpuid(void) +fix_cpuid(void) { uint64_t msr; - if (cpu_vendor_id != CPU_VENDOR_INTEL) - return (false); - if ((CPUID_TO_FAMILY(cpu_id) == 0xf && + /* + * Clear "Limit CPUID Maxval" bit and return true if the caller should + * get the largest standard CPUID function number again if it is set + * from BIOS. It is necessary for probing correct CPU topology later + * and for the correct operation of the AVX-aware userspace. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL && + ((CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x3) || (CPUID_TO_FAMILY(cpu_id) == 0x6 && - CPUID_TO_MODEL(cpu_id) >= 0xe)) { + CPUID_TO_MODEL(cpu_id) >= 0xe))) { msr = rdmsr(MSR_IA32_MISC_ENABLE); if ((msr & IA32_MISC_EN_LIMCPUID) != 0) { msr &= ~IA32_MISC_EN_LIMCPUID; @@ -1328,6 +1327,22 @@ intel_fix_cpuid(void) return (true); } } + + /* + * Re-enable AMD Topology Extension that could be disabled by BIOS + * on some notebook processors. Without the extension it's really + * hard to determine the correct CPU cache topology. + * See BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 15h + * Models 60h-6Fh Processors, Publication # 50742. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && CPUID_TO_FAMILY(cpu_id) == 0x15) { + msr = rdmsr(MSR_EXTFEATURES); + if ((msr & ((uint64_t)1 << 54)) == 0) { + msr |= (uint64_t)1 << 54; + wrmsr(MSR_EXTFEATURES, msr); + return (true); + } + } return (false); } @@ -1367,7 +1382,7 @@ identify_cpu(void) #endif cpu_vendor_id = find_cpu_vendor_id(); - if (intel_fix_cpuid()) { + if (fix_cpuid()) { do_cpuid(0, regs); cpu_high = regs[0]; } From owner-svn-src-stable-10@freebsd.org Wed May 4 17:27:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D61D4B2CA02; Wed, 4 May 2016 17:27:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 94E351ECB; Wed, 4 May 2016 17:27:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44HRngn059670; Wed, 4 May 2016 17:27:49 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44HRntK059668; Wed, 4 May 2016 17:27:49 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605041727.u44HRntK059668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 4 May 2016 17:27:49 +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: r299079 - in stable/10: . release 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.22 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, 04 May 2016 17:27:50 -0000 Author: glebius Date: Wed May 4 17:27:49 2016 New Revision: 299079 URL: https://svnweb.freebsd.org/changeset/base/299079 Log: Merge r299077, which provides ability to override NO_INSTALLEXTRAKERNELS. Override NO_INSTALLEXTRAKERNELS for the release build. Historically, in the stable/10 branch the regular 'installkernel' target DID NOT install extra kernels, while the release build DID. This change finally restores POLA, I hope. Reported by: Fedor Reviewed by: gjb Modified: stable/10/Makefile.inc1 stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Wed May 4 17:22:35 2016 (r299078) +++ stable/10/Makefile.inc1 Wed May 4 17:27:49 2016 (r299079) @@ -1110,7 +1110,7 @@ reinstallkernel reinstallkernel.debug: _ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${_kernel}" @@ -1141,7 +1141,7 @@ distributekernel distributekernel.debug: ${DESTDIR}/${DISTDIR}/kernel.meta .endif .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta @@ -1167,7 +1167,7 @@ packagekernel: tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ @@ -1180,7 +1180,7 @@ packagekernel: tar cvf - . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Wed May 4 17:22:35 2016 (r299078) +++ stable/10/release/Makefile Wed May 4 17:27:49 2016 (r299079) @@ -70,6 +70,8 @@ VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${B .endfor .endif +NO_INSTALLEXTRAKERNELS=no + .if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL) VOLUME_LABEL= FreeBSD_Install .endif From owner-svn-src-stable-10@freebsd.org Thu May 5 01:29:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 951A0B2CE31; Thu, 5 May 2016 01:29:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 66A6F18F2; Thu, 5 May 2016 01:29:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u451TrhV008467; Thu, 5 May 2016 01:29:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u451Trow008466; Thu, 5 May 2016 01:29:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605050129.u451Trow008466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 5 May 2016 01:29: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: r299103 - stable/10/sys/compat/ndis 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.22 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, 05 May 2016 01:29:54 -0000 Author: pfg Date: Thu May 5 01:29:53 2016 New Revision: 299103 URL: https://svnweb.freebsd.org/changeset/base/299103 Log: MFC r298731, r298734: ndis(4): unsign some indexes to prevent overflows. The "len" parameter is uint32_t, indexing it with an int may end up in a signed integer overflow. strlen(3) returns an integer of size_t but a correponding index of type u_int is more than enough. Modified: stable/10/sys/compat/ndis/subr_ndis.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/ndis/subr_ndis.c ============================================================================== --- stable/10/sys/compat/ndis/subr_ndis.c Thu May 5 01:09:30 2016 (r299102) +++ stable/10/sys/compat/ndis/subr_ndis.c Thu May 5 01:29:53 2016 (r299103) @@ -895,7 +895,7 @@ NdisReadPciSlotInformation(adapter, slot uint32_t len; { ndis_miniport_block *block; - int i; + uint32_t i; char *dest; device_t dev; @@ -938,7 +938,7 @@ NdisWritePciSlotInformation(adapter, slo uint32_t len; { ndis_miniport_block *block; - int i; + uint32_t i; char *dest; device_t dev; @@ -2431,7 +2431,7 @@ NdisReadPcmciaAttributeMemory(handle, of bus_space_handle_t bh; bus_space_tag_t bt; char *dest; - int i; + uint32_t i; if (handle == NULL) return (0); @@ -2461,7 +2461,7 @@ NdisWritePcmciaAttributeMemory(handle, o bus_space_handle_t bh; bus_space_tag_t bt; char *src; - int i; + uint32_t i; if (handle == NULL) return (0); @@ -2669,7 +2669,7 @@ ndis_find_sym(lf, filename, suffix, sym) { char *fullsym; char *suf; - int i; + u_int i; fullsym = ExAllocatePoolWithTag(NonPagedPool, MAXPATHLEN, 0); if (fullsym == NULL) From owner-svn-src-stable-10@freebsd.org Thu May 5 01:34:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BBF4B2D0A4; Thu, 5 May 2016 01:34:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0D39A1F8E; Thu, 5 May 2016 01:34:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u451YwqY011398; Thu, 5 May 2016 01:34:58 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u451YwO9011397; Thu, 5 May 2016 01:34:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605050134.u451YwO9011397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 5 May 2016 01:34:58 +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: r299106 - stable/10/sys/fs/devfs 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.22 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, 05 May 2016 01:34:59 -0000 Author: pfg Date: Thu May 5 01:34:58 2016 New Revision: 299106 URL: https://svnweb.freebsd.org/changeset/base/299106 Log: MFC r298732: sys/devfs: unsign an index to prevent signed integer overflow. cdp_maxdirent in struct:cdev_priv is of type u_int. Use the same type for the corresponding index in devfs_revoke(). Modified: stable/10/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/10/sys/fs/devfs/devfs_vnops.c Thu May 5 01:30:53 2016 (r299105) +++ stable/10/sys/fs/devfs/devfs_vnops.c Thu May 5 01:34:58 2016 (r299106) @@ -1409,7 +1409,7 @@ devfs_revoke(struct vop_revoke_args *ap) struct cdev *dev; struct cdev_priv *cdp; struct devfs_dirent *de; - int i; + u_int i; KASSERT((ap->a_flags & REVOKEALL) != 0, ("devfs_revoke !REVOKEALL")); From owner-svn-src-stable-10@freebsd.org Thu May 5 08:11:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56362B2D337; Thu, 5 May 2016 08:11:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 18BCD1BF1; Thu, 5 May 2016 08:11:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u458BbUR030242; Thu, 5 May 2016 08:11:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u458BbXa030240; Thu, 5 May 2016 08:11:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605050811.u458BbXa030240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 5 May 2016 08:11: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: r299111 - stable/10/lib/libcam 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.22 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, 05 May 2016 08:11:38 -0000 Author: ngie Date: Thu May 5 08:11:36 2016 New Revision: 299111 URL: https://svnweb.freebsd.org/changeset/base/299111 Log: MFC r297999: Clean up trailing whitespace in lib/libcam; no functional change Modified: stable/10/lib/libcam/camlib.c stable/10/lib/libcam/camlib.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/camlib.c ============================================================================== --- stable/10/lib/libcam/camlib.c Thu May 5 07:04:38 2016 (r299110) +++ stable/10/lib/libcam/camlib.c Thu May 5 08:11:36 2016 (r299111) @@ -102,7 +102,7 @@ cam_freeccb(union ccb *ccb) * /dev/foo0 * foo0 * nfoo0 - * + * * Some peripheral drivers create separate device nodes with 'n' prefix for * non-rewind operations. Currently only sa(4) tape driver has this feature. * We extract pure peripheral name as device name for this special case. @@ -194,7 +194,7 @@ cam_get_device(const char *path, char *d /* * At this point, if the last character of the string isn't a - * number, we know the user either didn't give us a device number, + * number, we know the user either didn't give us a device number, * or he gave us a device name/number format we don't recognize. */ if (!isdigit(tmpstr[strlen(tmpstr) - 1])) { @@ -275,7 +275,7 @@ cam_open_btl(path_id_t path_id, target_i int fd, bufsize; if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, func_name, strerror(errno)); return(NULL); @@ -292,7 +292,7 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.match_buf_len = bufsize; ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); if (ccb.cdm.matches == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc match buffer", func_name); close(fd); return(NULL); @@ -305,14 +305,14 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.patterns = (struct dev_match_pattern *)malloc( sizeof(struct dev_match_pattern)); if (ccb.cdm.patterns == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc pattern buffer", func_name); free(ccb.cdm.matches); close(fd); return(NULL); } ccb.cdm.patterns[0].type = DEV_MATCH_PERIPH; - match_pat = &ccb.cdm.patterns[0].pattern.periph_pattern; + match_pat = &ccb.cdm.patterns[0].pattern.periph_pattern; /* * We're looking for the passthrough device associated with this @@ -421,7 +421,7 @@ cam_lookup_pass(const char *dev_name, in * passthrough device. */ if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, func_name, strerror(errno)); return(NULL); @@ -435,7 +435,7 @@ cam_lookup_pass(const char *dev_name, in ccb.cgdl.unit_number = unit; /* - * Attempt to get the passthrough device. This ioctl will fail if + * Attempt to get the passthrough device. This ioctl will fail if * the device name is null, if the device doesn't exist, or if the * passthrough driver isn't in the kernel. */ @@ -512,7 +512,7 @@ cam_real_open_device(const char *path, i } device->fd = -1; malloced_device = 1; - } + } /* * If the user passed in a path, save it for him. @@ -551,7 +551,7 @@ cam_real_open_device(const char *path, i * we don't have to set any fields. */ ccb.ccb_h.func_code = XPT_GDEVLIST; - + /* * We're only doing this to get some information on the device in * question. Otherwise, we'd have to pass in yet another @@ -611,7 +611,7 @@ cam_real_open_device(const char *path, i goto crod_bailout; } device->pd_type = SID_TYPE(&ccb.cgd.inq_data); - bcopy(&ccb.cgd.inq_data, &device->inq_data, + bcopy(&ccb.cgd.inq_data, &device->inq_data, sizeof(struct scsi_inquiry_data)); device->serial_num_len = ccb.cgd.serial_num_len; bcopy(&ccb.cgd.serial_num, &device->serial_num, device->serial_num_len); @@ -719,7 +719,7 @@ cam_device_dup(struct cam_device *device newdev = malloc(sizeof(struct cam_device)); if (newdev == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc CAM device structure", func_name); return(NULL); } Modified: stable/10/lib/libcam/camlib.h ============================================================================== --- stable/10/lib/libcam/camlib.h Thu May 5 07:04:38 2016 (r299110) +++ stable/10/lib/libcam/camlib.h Thu May 5 08:11:36 2016 (r299111) @@ -83,7 +83,7 @@ extern char cam_errbuf[]; struct cam_device { char device_path[MAXPATHLEN];/* - * Pathname of the device + * Pathname of the device * given by the user. This * may be null if the * user states the device @@ -98,15 +98,15 @@ struct cam_device { * Unit number given by * the user. */ - char device_name[DEV_IDLEN+1];/* - * Name of the device, - * e.g. 'pass' + char device_name[DEV_IDLEN+1];/* + * Name of the device, + * e.g. 'pass' */ u_int32_t dev_unit_num; /* Unit number of the passthrough * device associated with this * particular device. */ - + char sim_name[SIM_IDLEN+1]; /* Controller name, e.g. 'ahc' */ u_int32_t sim_unit_number; /* Controller unit number */ u_int32_t bus_id; /* Controller bus number */ @@ -142,7 +142,7 @@ int cam_send_ccb(struct cam_device *de char * cam_path_string(struct cam_device *dev, char *str, int len); struct cam_device * cam_device_dup(struct cam_device *device); -void cam_device_copy(struct cam_device *src, +void cam_device_copy(struct cam_device *src, struct cam_device *dst); int cam_get_device(const char *path, char *dev_name, int devnamelen, int *unit); From owner-svn-src-stable-10@freebsd.org Thu May 5 19:44:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93949B2F693; Thu, 5 May 2016 19:44:07 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4C3F51B45; Thu, 5 May 2016 19:44:07 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u45Ji6LJ044167; Thu, 5 May 2016 19:44:06 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u45Ji63J044166; Thu, 5 May 2016 19:44:06 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201605051944.u45Ji63J044166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Thu, 5 May 2016 19:44:06 +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: r299132 - stable/10/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.22 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, 05 May 2016 19:44:07 -0000 Author: wblock (doc committer) Date: Thu May 5 19:44:06 2016 New Revision: 299132 URL: https://svnweb.freebsd.org/changeset/base/299132 Log: MFC r298759: Clarify build(7) instructions for alternate object directory. Modified: stable/10/share/man/man7/build.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/build.7 ============================================================================== --- stable/10/share/man/man7/build.7 Thu May 5 19:40:26 2016 (r299131) +++ stable/10/share/man/man7/build.7 Thu May 5 19:44:06 2016 (r299132) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2015 +.Dd April 28, 2016 .Dt BUILD 7 .Os .Sh NAME @@ -179,6 +179,12 @@ Build everything but the kernel, configu .Pa etc , and .Pa release . +The object directory can be changed from the default +.Pa /usr/obj +by setting the +.Pa MAKEOBJDIRPREFIX +.Xr make 1 +variable. The actual build location prefix used is .Pa ${MAKEOBJDIRPREFIX}${.CURDIR} for native builds, and @@ -262,6 +268,12 @@ are: .Bl -tag -width ".Cm distributekernel" .It Cm buildkernel Rebuild the kernel and the kernel modules. +The object directory can be changed from the default +.Pa /usr/obj +by setting the +.Pa MAKEOBJDIRPREFIX +.Xr make 1 +variable. .It Cm installkernel Install the kernel and the kernel modules to directory .Pa ${DESTDIR}/boot/kernel , @@ -331,7 +343,7 @@ should be set as with .Dq Li "make installworld" . .It Cm delete-old-libs Delete obsolete base system libraries interactively. -This target should only be used if no 3rd party software uses these +This target should only be used if no third party software uses these libraries. When .Li -DBATCH_DELETE_OLD_FILES @@ -525,7 +537,7 @@ on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share -subdirectory (i.e., manpages, locale data files, timezone data files and +subdirectory (i.e., manual pages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). From owner-svn-src-stable-10@freebsd.org Thu May 5 23:06:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD67EB2EAA3; Thu, 5 May 2016 23:06:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9EB971D1A; Thu, 5 May 2016 23:06:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u45N6dWB006231; Thu, 5 May 2016 23:06:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u45N6dJY006226; Thu, 5 May 2016 23:06:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605052306.u45N6dJY006226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 5 May 2016 23:06:39 +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: r299145 - stable/10/sys/netinet6 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.22 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, 05 May 2016 23:06:41 -0000 Author: markj Date: Thu May 5 23:06:39 2016 New Revision: 299145 URL: https://svnweb.freebsd.org/changeset/base/299145 Log: MFC r295583, r295584, r295729, r295730: NDP code cleanup changes. MFC r295732: Fix an IPv6 DAD reference count leak. Modified: stable/10/sys/netinet6/nd6.c stable/10/sys/netinet6/nd6.h stable/10/sys/netinet6/nd6_nbr.c stable/10/sys/netinet6/nd6_rtr.c stable/10/sys/netinet6/scope6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/nd6.c ============================================================================== --- stable/10/sys/netinet6/nd6.c Thu May 5 22:40:07 2016 (r299144) +++ stable/10/sys/netinet6/nd6.c Thu May 5 23:06:39 2016 (r299145) @@ -2215,7 +2215,7 @@ nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) error = sa6_recoverscope(&d.rtaddr); if (error != 0) return (error); - d.flags = dr->flags; + d.flags = dr->raflags; d.rtlifetime = dr->rtlifetime; d.expire = dr->expire + (time_second - time_uptime); d.if_index = dr->ifp->if_index; Modified: stable/10/sys/netinet6/nd6.h ============================================================================== --- stable/10/sys/netinet6/nd6.h Thu May 5 22:40:07 2016 (r299144) +++ stable/10/sys/netinet6/nd6.h Thu May 5 23:06:39 2016 (r299145) @@ -235,13 +235,13 @@ struct in6_ndifreq { ((MAX_RANDOM_FACTOR - MIN_RANDOM_FACTOR) * (x >> 10)))) /1000) TAILQ_HEAD(nd_drhead, nd_defrouter); -struct nd_defrouter { +struct nd_defrouter { TAILQ_ENTRY(nd_defrouter) dr_entry; - struct in6_addr rtaddr; - u_char flags; /* flags on RA message */ + struct in6_addr rtaddr; + u_char raflags; /* flags on RA message */ u_short rtlifetime; u_long expire; - struct ifnet *ifp; + struct ifnet *ifp; int installed; /* is installed into kernel routing table */ }; @@ -445,7 +445,6 @@ void nd6_dad_stop(struct ifaddr *); /* nd6_rtr.c */ void nd6_rs_input(struct mbuf *, int, int); void nd6_ra_input(struct mbuf *, int, int); -void prelist_del(struct nd_prefix *); void defrouter_reset(void); void defrouter_select(void); void defrtrlist_del(struct nd_defrouter *); Modified: stable/10/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/10/sys/netinet6/nd6_nbr.c Thu May 5 22:40:07 2016 (r299144) +++ stable/10/sys/netinet6/nd6_nbr.c Thu May 5 23:06:39 2016 (r299145) @@ -1315,9 +1315,10 @@ nd6_dad_start(struct ifaddr *ifa, int de } if ((dp = nd6_dad_find(ifa, NULL)) != NULL) { /* - * DAD already in progress. Let the existing entry - * to finish it. + * DAD is already in progress. Let the existing entry + * finish it. */ + nd6_dad_rele(dp); return; } Modified: stable/10/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/10/sys/netinet6/nd6_rtr.c Thu May 5 22:40:07 2016 (r299144) +++ stable/10/sys/netinet6/nd6_rtr.c Thu May 5 23:06:39 2016 (r299145) @@ -270,7 +270,7 @@ nd6_ra_input(struct mbuf *m, int off, in bzero(&dr0, sizeof(dr0)); dr0.rtaddr = saddr6; - dr0.flags = nd_ra->nd_ra_flags_reserved; + dr0.raflags = nd_ra->nd_ra_flags_reserved; /* * Effectively-disable routes from RA messages when * ND6_IFF_NO_RADR enabled on the receiving interface or @@ -708,7 +708,7 @@ defrouter_select(void) static int rtpref(struct nd_defrouter *dr) { - switch (dr->flags & ND_RA_FLAG_RTPREF_MASK) { + switch (dr->raflags & ND_RA_FLAG_RTPREF_MASK) { case ND_RA_FLAG_RTPREF_HIGH: return (RTPREF_HIGH); case ND_RA_FLAG_RTPREF_MEDIUM: @@ -722,7 +722,7 @@ rtpref(struct nd_defrouter *dr) * serious bug of kernel internal. We thus always bark here. * Or, can we even panic? */ - log(LOG_ERR, "rtpref: impossible RA flag %x\n", dr->flags); + log(LOG_ERR, "rtpref: impossible RA flag %x\n", dr->raflags); return (RTPREF_INVALID); } /* NOTREACHED */ @@ -744,7 +744,7 @@ defrtrlist_update(struct nd_defrouter *n oldpref = rtpref(dr); /* override */ - dr->flags = new->flags; /* xxx flag check */ + dr->raflags = new->raflags; /* XXX flag check */ dr->rtlifetime = new->rtlifetime; dr->expire = new->expire; @@ -937,9 +937,9 @@ prelist_remove(struct nd_prefix *pr) /* unlink ndpr_entry from nd_prefix list */ LIST_REMOVE(pr, ndpr_entry); - /* free list of routers that adversed the prefix */ + /* free list of routers that advertised the prefix */ LIST_FOREACH_SAFE(pfr, &pr->ndpr_advrtrs, pfr_entry, next) { - free(pfr, M_IP6NDP); + pfxrtr_del(pfr); } free(pr, M_IP6NDP); Modified: stable/10/sys/netinet6/scope6.c ============================================================================== --- stable/10/sys/netinet6/scope6.c Thu May 5 22:40:07 2016 (r299144) +++ stable/10/sys/netinet6/scope6.c Thu May 5 23:06:39 2016 (r299145) @@ -416,7 +416,7 @@ sa6_recoverscope(struct sockaddr_in6 *si zoneid != sin6->sin6_scope_id) { log(LOG_NOTICE, "%s: embedded scope mismatch: %s%%%d. " - "sin6_scope_id was overridden.", __func__, + "sin6_scope_id was overridden\n", __func__, ip6_sprintf(ip6buf, &sin6->sin6_addr), sin6->sin6_scope_id); } From owner-svn-src-stable-10@freebsd.org Fri May 6 01:26:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4090B2E67E; Fri, 6 May 2016 01:26:59 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 77745169B; Fri, 6 May 2016 01:26:59 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u461QwjN047754; Fri, 6 May 2016 01:26:58 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u461QwKA047753; Fri, 6 May 2016 01:26:58 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201605060126.u461QwKA047753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 6 May 2016 01:26:58 +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: r299146 - 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.22 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, 06 May 2016 01:26:59 -0000 Author: jtl Date: Fri May 6 01:26:58 2016 New Revision: 299146 URL: https://svnweb.freebsd.org/changeset/base/299146 Log: MFC r298408: Prevent underflows in tp->snd_wnd if the remote side ACKs more than tp->snd_wnd. This can happen, for example, when the remote side responds to a window probe by ACKing the one byte it contains. Modified: stable/10/sys/netinet/tcp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Thu May 5 23:06:39 2016 (r299145) +++ stable/10/sys/netinet/tcp_input.c Fri May 6 01:26:58 2016 (r299146) @@ -2733,6 +2733,9 @@ process_ACK: INP_WLOCK_ASSERT(tp->t_inpcb); acked = BYTES_THIS_ACK(tp, th); + KASSERT(acked >= 0, ("%s: acked unexepectedly negative " + "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__, + tp->snd_una, th->th_ack, tp, m)); TCPSTAT_INC(tcps_rcvackpack); TCPSTAT_ADD(tcps_rcvackbyte, acked); @@ -2802,13 +2805,19 @@ process_ACK: SOCKBUF_LOCK(&so->so_snd); if (acked > so->so_snd.sb_cc) { - tp->snd_wnd -= so->so_snd.sb_cc; + if (tp->snd_wnd >= so->so_snd.sb_cc) + tp->snd_wnd -= so->so_snd.sb_cc; + else + tp->snd_wnd = 0; mfree = sbcut_locked(&so->so_snd, (int)so->so_snd.sb_cc); ourfinisacked = 1; } else { mfree = sbcut_locked(&so->so_snd, acked); - tp->snd_wnd -= acked; + if (tp->snd_wnd >= (u_long) acked) + tp->snd_wnd -= acked; + else + tp->snd_wnd = 0; ourfinisacked = 0; } /* NB: sowwakeup_locked() does an implicit unlock. */ From owner-svn-src-stable-10@freebsd.org Fri May 6 01:37:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD119B2E94C; Fri, 6 May 2016 01:37:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8E0341C92; Fri, 6 May 2016 01:37:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u461b6ha050823; Fri, 6 May 2016 01:37:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u461b6Lv050821; Fri, 6 May 2016 01:37:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605060137.u461b6Lv050821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 01:37:06 +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: r299148 - stable/10/sbin/restore 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.22 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, 06 May 2016 01:37:07 -0000 Author: pfg Date: Fri May 6 01:37:06 2016 New Revision: 299148 URL: https://svnweb.freebsd.org/changeset/base/299148 Log: MFC r298868, r298874: restore: fix memory and resource handle leaks. CID: 272297, 1007784 Modified: stable/10/sbin/restore/main.c stable/10/sbin/restore/symtab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/restore/main.c ============================================================================== --- stable/10/sbin/restore/main.c Fri May 6 01:27:01 2016 (r299147) +++ stable/10/sbin/restore/main.c Fri May 6 01:37:06 2016 (r299148) @@ -366,7 +366,8 @@ obsolete(int *argcp, char **argvp[]) if (flags) { *p = '\0'; *nargv++ = flagsp; - } + } else + free(flagsp); /* Copy remaining arguments. */ while ((*nargv++ = *argv++)); Modified: stable/10/sbin/restore/symtab.c ============================================================================== --- stable/10/sbin/restore/symtab.c Fri May 6 01:27:01 2016 (r299147) +++ stable/10/sbin/restore/symtab.c Fri May 6 01:37:06 2016 (r299148) @@ -560,6 +560,7 @@ initsymtable(char *filename) fprintf(stderr, "read: %s\n", strerror(errno)); panic("cannot read symbol table file %s\n", filename); } + (void)close(fd); switch (command) { case 'r': /* From owner-svn-src-stable-10@freebsd.org Fri May 6 05:16:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 519BDB2FEEF; Fri, 6 May 2016 05:16:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 072AD1322; Fri, 6 May 2016 05:16:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u465GhCw017056; Fri, 6 May 2016 05:16:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u465Ghd9017055; Fri, 6 May 2016 05:16:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605060516.u465Ghd9017055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 6 May 2016 05:16:43 +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: r299153 - stable/10/sys/dev/hyperv/storvsc 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.22 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, 06 May 2016 05:16:44 -0000 Author: sephe Date: Fri May 6 05:16:42 2016 New Revision: 299153 URL: https://svnweb.freebsd.org/changeset/base/299153 Log: MFC r298038 hyperv/stor: Temporary disable the wrongly done command timeout. It will be reenabled once the request processing is corrected. Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri May 6 03:18:51 2016 (r299152) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri May 6 05:16:42 2016 (r299153) @@ -1273,6 +1273,7 @@ storvsc_timeout_test(struct hv_storvsc_r } #endif /* HVS_TIMEOUT_TEST */ +#ifdef notyet /** * @brief timeout handler for requests * @@ -1320,6 +1321,7 @@ storvsc_timeout(void *arg) storvsc_timeout_test(reqp, MODE_SELECT_10, 1); #endif } +#endif /** * @brief StorVSC device poll function @@ -1472,6 +1474,7 @@ storvsc_action(struct cam_sim *sim, unio return; } +#ifdef notyet if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { callout_init(&reqp->callout, CALLOUT_MPSAFE); callout_reset_sbt(&reqp->callout, @@ -1491,6 +1494,7 @@ storvsc_action(struct cam_sim *sim, unio } #endif /* HVS_TIMEOUT_TEST */ } +#endif if ((res = hv_storvsc_io_request(sc->hs_dev, reqp)) != 0) { xpt_print(ccb->ccb_h.path, @@ -2039,6 +2043,7 @@ storvsc_io_done(struct hv_storvsc_reques mtx_unlock(&sc->hs_lock); } +#ifdef notyet /* * callout_drain() will wait for the timer handler to finish * if it is running. So we don't need any lock to synchronize @@ -2049,6 +2054,7 @@ storvsc_io_done(struct hv_storvsc_reques if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { callout_drain(&reqp->callout); } +#endif ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; From owner-svn-src-stable-10@freebsd.org Fri May 6 05:44:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFAA9B30562; Fri, 6 May 2016 05:44:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7F6891866; Fri, 6 May 2016 05:44:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u465iCdE025941; Fri, 6 May 2016 05:44:12 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u465iCNk025940; Fri, 6 May 2016 05:44:12 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605060544.u465iCNk025940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 6 May 2016 05:44: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: r299156 - stable/10/sbin/dhclient 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.22 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, 06 May 2016 05:44:14 -0000 Author: sephe Date: Fri May 6 05:44:12 2016 New Revision: 299156 URL: https://svnweb.freebsd.org/changeset/base/299156 Log: MFC r298385 dhclient: Log a warning instead of bailing upon "illegal" options In Azure, the DHCP servers add private option (id 0xf5), which contains binary form of an IPv4 address. Once this option is converted to string form, it could contain '$', e.g. IPv4 address: 100.72.36.54 binary form: 0x64 0x48 0x24 0x36 string form: "dH$6" dhclient bails upon "illegal" options like the above example, thus the VM bring-up will fail. Also as a side note, this "illegal" option detection was added in OpenBSD ~11years ago: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.50&content-type=text/x-cvsweb-markup And it was removed along with the removal of script support in OpenBSD ~3years ago: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.159&content-type=text/x-cvsweb-markup Reported by: Hongxiong Xian Reviewed by: jhb, Dexuan Cui Tested by: Hongxiong Xian Analyzed by: Dong Liu Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5853 Modified: stable/10/sbin/dhclient/dhclient.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/dhclient/dhclient.c ============================================================================== --- stable/10/sbin/dhclient/dhclient.c Fri May 6 05:24:10 2016 (r299155) +++ stable/10/sbin/dhclient/dhclient.c Fri May 6 05:44:12 2016 (r299156) @@ -2277,6 +2277,17 @@ script_set_env(struct client_state *clie { int i, j, namelen; + /* No `` or $() command substitution allowed in environment values! */ + for (j=0; j < strlen(value); j++) + switch (value[j]) { + case '`': + case '$': + warning("illegal character (%c) in value '%s'", + value[j], value); + /* Ignore this option */ + return; + } + namelen = strlen(name); for (i = 0; client->scriptEnv[i]; i++) @@ -2313,16 +2324,6 @@ script_set_env(struct client_state *clie strlen(value) + 1); if (client->scriptEnv[i] == NULL) error("script_set_env: no memory for variable assignment"); - - /* No `` or $() command substitution allowed in environment values! */ - for (j=0; j < strlen(value); j++) - switch (value[j]) { - case '`': - case '$': - error("illegal character (%c) in value '%s'", value[j], - value); - /* not reached */ - } snprintf(client->scriptEnv[i], strlen(prefix) + strlen(name) + 1 + strlen(value) + 1, "%s%s=%s", prefix, name, value); } From owner-svn-src-stable-10@freebsd.org Fri May 6 17:55:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69980B314B0; Fri, 6 May 2016 17:55:12 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 1DF8613C1; Fri, 6 May 2016 17:55:12 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46HtBRM050654; Fri, 6 May 2016 17:55:11 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46HtBEQ050653; Fri, 6 May 2016 17:55:11 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201605061755.u46HtBEQ050653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Fri, 6 May 2016 17:55: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: r299190 - stable/10/lib/libc/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.22 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, 06 May 2016 17:55:12 -0000 Author: bcr (doc committer) Date: Fri May 6 17:55:11 2016 New Revision: 299190 URL: https://svnweb.freebsd.org/changeset/base/299190 Log: MFC r298893: Provide an example to the kqueue man page, showing a basic usage example. Although it is an untypical example for the use of kqueue, it is better than nothing and should get people started. PR: 196844 Submitted by: fernando.apesteguia@gmail.com Reviewed by: kib Approved by: kib Differential Revision: https://reviews.freebsd.org/D6082 Modified: stable/10/lib/libc/sys/kqueue.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Fri May 6 17:39:12 2016 (r299189) +++ stable/10/lib/libc/sys/kqueue.2 Fri May 6 17:55:11 2016 (r299190) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2015 +.Dd May 1, 2016 .Dt KQUEUE 2 .Os .Sh NAME @@ -577,6 +577,57 @@ will be set to indicate the error condit If the time limit expires, then .Fn kevent returns 0. +.Sh EXAMPLES +.Bd -literal -compact +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) +{ + struct kevent event; /* Event we want to monitor */ + struct kevent tevent; /* Event triggered */ + int kq, fd, ret; + + if (argc != 2) + err(EXIT_FAILURE, "Usage: %s path\en", argv[0]); + fd = open(argv[1], O_RDONLY); + if (fd == -1) + err(EXIT_FAILURE, "Failed to open '%s'", argv[1]); + + /* Create kqueue. */ + kq = kqueue(); + if (kq == -1) + err(EXIT_FAILURE, "kqueue() failed"); + + /* Initialize kevent structure. */ + EV_SET(&event, fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_WRITE, + 0, NULL); + /* Attach event to the kqueue. */ + ret = kevent(kq, &event, 1, NULL, 0, NULL); + if (ret == -1) + err(EXIT_FAILURE, "kevent register"); + if (event.flags & EV_ERROR) + errx(EXIT_FAILURE, "Event error: %s", strerror(event.data)); + + for (;;) { + /* Sleep until something happens. */ + ret = kevent(kq, NULL, 0, &tevent, 1, NULL); + if (ret == -1) { + err(EXIT_FAILURE, "kevent wait"); + } else if (ret > 0) { + printf("Something was written in '%s'\en", argv[1]); + } + } +} +.Ed .Sh ERRORS The .Fn kqueue From owner-svn-src-stable-10@freebsd.org Fri May 6 19:11:49 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 279CDB315C4; Fri, 6 May 2016 19:11:49 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 EBAE61BAF; Fri, 6 May 2016 19:11:48 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46JBmeN075260; Fri, 6 May 2016 19:11:48 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46JBmHB075259; Fri, 6 May 2016 19:11:48 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605061911.u46JBmHB075259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 May 2016 19:11: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: r299191 - stable/10/sys/cam/ctl 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.22 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, 06 May 2016 19:11:49 -0000 Author: sbruno Date: Fri May 6 19:11:47 2016 New Revision: 299191 URL: https://svnweb.freebsd.org/changeset/base/299191 Log: MFC r298279 Plug memory leak in ctl(4) when ctl_copyin_args() is called with a non- null terminated ASCII string. PR: 207626 Submitted by: cturt@hardenedbsd.org Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri May 6 17:55:11 2016 (r299190) +++ stable/10/sys/cam/ctl/ctl.c Fri May 6 19:11:47 2016 (r299191) @@ -2447,6 +2447,7 @@ ctl_copyin_args(int num_args, struct ctl && (tmpptr[args[i].vallen - 1] != '\0')) { snprintf(error_str, error_str_len, "Argument " "%d value is not NUL-terminated", i); + free(tmpptr, M_CTL); goto bailout; } args[i].kvalue = tmpptr; From owner-svn-src-stable-10@freebsd.org Fri May 6 19:14:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46B34B316CE; Fri, 6 May 2016 19:14:59 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 F1DAF1FA7; Fri, 6 May 2016 19:14:58 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46JEw2Y076049; Fri, 6 May 2016 19:14:58 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46JEvZr076045; Fri, 6 May 2016 19:14:57 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605061914.u46JEvZr076045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 May 2016 19:14: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: r299192 - in stable/10/sys/dev: e1000 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.22 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, 06 May 2016 19:14:59 -0000 Author: sbruno Date: Fri May 6 19:14:57 2016 New Revision: 299192 URL: https://svnweb.freebsd.org/changeset/base/299192 Log: MFC r298224 Correct possible underflow conditions when checking for available space in the tx h/w ring buffer. Sponsored by: Limelight Networks Modified: stable/10/sys/dev/e1000/if_em.c stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/e1000/if_lem.c stable/10/sys/dev/ixgbe/ix_txrx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Fri May 6 19:11:47 2016 (r299191) +++ stable/10/sys/dev/e1000/if_em.c Fri May 6 19:14:57 2016 (r299192) @@ -2099,7 +2099,7 @@ retry: txr->tx_tso = FALSE; } - if (nsegs > (txr->tx_avail - EM_MAX_SCATTER)) { + if (txr->tx_avail < (nsegs + EM_MAX_SCATTER)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Fri May 6 19:11:47 2016 (r299191) +++ stable/10/sys/dev/e1000/if_igb.c Fri May 6 19:14:57 2016 (r299192) @@ -1843,7 +1843,7 @@ retry: } /* Make certain there are enough descriptors */ - if (nsegs > txr->tx_avail - 2) { + if (txr->tx_avail < (nsegs + 2)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); Modified: stable/10/sys/dev/e1000/if_lem.c ============================================================================== --- stable/10/sys/dev/e1000/if_lem.c Fri May 6 19:11:47 2016 (r299191) +++ stable/10/sys/dev/e1000/if_lem.c Fri May 6 19:14:57 2016 (r299192) @@ -1694,7 +1694,7 @@ lem_xmit(struct adapter *adapter, struct return (error); } - if (nsegs > (adapter->num_tx_desc_avail - 2)) { + if (adapter->num_tx_desc_avail < (nsegs + 2)) { adapter->no_tx_desc_avail2++; bus_dmamap_unload(adapter->txtag, map); return (ENOBUFS); Modified: stable/10/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- stable/10/sys/dev/ixgbe/ix_txrx.c Fri May 6 19:11:47 2016 (r299191) +++ stable/10/sys/dev/ixgbe/ix_txrx.c Fri May 6 19:14:57 2016 (r299192) @@ -401,7 +401,7 @@ retry: } /* Make certain there are enough descriptors */ - if (nsegs > txr->tx_avail - 2) { + if (txr->tx_avail < (nsegs + 2)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); From owner-svn-src-stable-10@freebsd.org Fri May 6 19:18:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14C2CB31910; Fri, 6 May 2016 19:18:46 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E49681226; Fri, 6 May 2016 19:18:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46JIjnn076344; Fri, 6 May 2016 19:18:45 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46JIjDH076342; Fri, 6 May 2016 19:18:45 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605061918.u46JIjDH076342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 May 2016 19:18: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: r299193 - in stable/10/sys/dev: aac aacraid 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.22 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, 06 May 2016 19:18:46 -0000 Author: sbruno Date: Fri May 6 19:18:44 2016 New Revision: 299193 URL: https://svnweb.freebsd.org/changeset/base/299193 Log: MFC r298280 aacraid(4): Sanely copyin userland pointers and ensure that we don't get anything janky from a user. (cturt) aac(4) landergriffith+freebsdbugzilla@gmail.com pointed out that aac(4) had the same issue and handling of pointers, so let's change that too. PR: 206573 Submitted by: cturt@hardenedbsd.org Modified: stable/10/sys/dev/aac/aac.c stable/10/sys/dev/aacraid/aacraid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aac/aac.c ============================================================================== --- stable/10/sys/dev/aac/aac.c Fri May 6 19:14:57 2016 (r299192) +++ stable/10/sys/dev/aac/aac.c Fri May 6 19:18:44 2016 (r299193) @@ -3103,18 +3103,30 @@ aac_ioctl_send_raw_srb(struct aac_softc /* Retrieve correct SG entries. */ if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) { + struct aac_sg_entry sg; + sge = srbcmd->sg_map.SgEntry; sge64 = NULL; - srb_sg_bytecount = sge->SgByteCount; - srb_sg_address = (void *)(uintptr_t)sge->SgAddress; + + if ((error = copyin(sge, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = (void *)(uintptr_t)sg.SgAddress; } #ifdef __amd64__ else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { + struct aac_sg_entry64 sg; + sge = NULL; sge64 = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; - srb_sg_bytecount = sge64->SgByteCount; - srb_sg_address = (void *)sge64->SgAddress; + + if ((error = copyin(sge64, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = (void *)sg.SgAddress; if (sge64->SgAddress > 0xffffffffull && (sc->flags & AAC_FLAGS_SG_64BIT) == 0) { error = EINVAL; Modified: stable/10/sys/dev/aacraid/aacraid.c ============================================================================== --- stable/10/sys/dev/aacraid/aacraid.c Fri May 6 19:14:57 2016 (r299192) +++ stable/10/sys/dev/aacraid/aacraid.c Fri May 6 19:18:44 2016 (r299193) @@ -2873,15 +2873,25 @@ aac_ioctl_send_raw_srb(struct aac_softc if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) { struct aac_sg_entry *sgp = srbcmd->sg_map.SgEntry; - srb_sg_bytecount = sgp->SgByteCount; - srb_sg_address = (u_int64_t)sgp->SgAddress; + struct aac_sg_entry sg; + + if ((error = copyin(sgp, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = (u_int64_t)sg.SgAddress; } else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { #ifdef __LP64__ struct aac_sg_entry64 *sgp = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; - srb_sg_bytecount = sgp->SgByteCount; - srb_sg_address = sgp->SgAddress; + struct aac_sg_entry64 sg; + + if ((error = copyin(sgp, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = sg.SgAddress; if (srb_sg_address > 0xffffffffull && !(sc->flags & AAC_FLAGS_SG_64BIT)) #endif From owner-svn-src-stable-10@freebsd.org Fri May 6 23:44:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D228FB31FDE; Fri, 6 May 2016 23:44:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 88DC81BCC; Fri, 6 May 2016 23:44:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46NiOnx058226; Fri, 6 May 2016 23:44:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46NiO5e058224; Fri, 6 May 2016 23:44:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605062344.u46NiO5e058224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 6 May 2016 23:44: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: r299204 - in stable/10/sys/fs: nfs nfsclient 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.22 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, 06 May 2016 23:44:25 -0000 Author: rmacklem Date: Fri May 6 23:44:24 2016 New Revision: 299204 URL: https://svnweb.freebsd.org/changeset/base/299204 Log: MFC: r297837 Bruce Evans reported that there was a performance regression between the old and new NFS clients. He did a good job of isolating the problem which was caused by the new NFS client not setting the post write mtime correctly. The new NFS client code was cloned from the old client, but was incorrect, because the mtime in the nfs vnode's cache wasn't yet updated. This patch fixes this problem. The patch also adds missing mutex locking. Modified: stable/10/sys/fs/nfs/nfsport.h stable/10/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfsport.h ============================================================================== --- stable/10/sys/fs/nfs/nfsport.h Fri May 6 23:40:37 2016 (r299203) +++ stable/10/sys/fs/nfs/nfsport.h Fri May 6 23:44:24 2016 (r299204) @@ -787,12 +787,14 @@ MALLOC_DECLARE(M_NEWNFSDSESSION); /* * Set the n_time in the client write rpc, as required. */ -#define NFSWRITERPC_SETTIME(w, n, v4) \ +#define NFSWRITERPC_SETTIME(w, n, a, v4) \ do { \ if (w) { \ - (n)->n_mtime = (n)->n_vattr.na_vattr.va_mtime; \ + mtx_lock(&((n)->n_mtx)); \ + (n)->n_mtime = (a)->na_mtime; \ if (v4) \ - (n)->n_change = (n)->n_vattr.na_vattr.va_filerev; \ + (n)->n_change = (a)->na_filerev; \ + mtx_unlock(&((n)->n_mtx)); \ } \ } while (0) Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clrpcops.c Fri May 6 23:40:37 2016 (r299203) +++ stable/10/sys/fs/nfsclient/nfs_clrpcops.c Fri May 6 23:44:24 2016 (r299204) @@ -1731,7 +1731,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio * } if (error) goto nfsmout; - NFSWRITERPC_SETTIME(wccflag, np, (nd->nd_flag & ND_NFSV4)); + NFSWRITERPC_SETTIME(wccflag, np, nap, (nd->nd_flag & ND_NFSV4)); mbuf_freem(nd->nd_mrep); nd->nd_mrep = NULL; tsiz -= len; From owner-svn-src-stable-10@freebsd.org Sat May 7 00:02:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B80FB31736; Sat, 7 May 2016 00:02:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4A56C19F4; Sat, 7 May 2016 00:02:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4702STn064379; Sat, 7 May 2016 00:02:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4702S7o064378; Sat, 7 May 2016 00:02:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605070002.u4702S7o064378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 May 2016 00:02:28 +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: r299208 - stable/10/sys/fs/nfsserver 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.22 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, 07 May 2016 00:02:29 -0000 Author: rmacklem Date: Sat May 7 00:02:28 2016 New Revision: 299208 URL: https://svnweb.freebsd.org/changeset/base/299208 Log: MFC: r297869 If the VOP_SETATTR() call that saves the exclusive create verifier failed, the NFS server would leave the newly created vnode locked. This could result in a file system that would not unmount and processes wedged, waiting for the file to be unlocked. Since this VOP_SETATTR() never fails for most file systems, this bug doesn't normally manifest itself. I found it during testing of an exported GlusterFS file system, which can fail. This patch adds the vput() and changes the error to the correct NFS one. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdport.c Fri May 6 23:55:28 2016 (r299207) +++ stable/10/sys/fs/nfsserver/nfs_nfsdport.c Sat May 7 00:02:28 2016 (r299208) @@ -794,6 +794,11 @@ nfsvno_createsub(struct nfsrv_descript * nvap->na_atime.tv_nsec = cverf[1]; error = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, nd->nd_cred); + if (error != 0) { + vput(ndp->ni_vp); + ndp->ni_vp = NULL; + error = NFSERR_NOTSUPP; + } } } /* @@ -1422,6 +1427,11 @@ nfsvno_open(struct nfsrv_descript *nd, s nvap->na_atime.tv_nsec = cverf[1]; nd->nd_repstat = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, cred); + if (nd->nd_repstat != 0) { + vput(ndp->ni_vp); + ndp->ni_vp = NULL; + nd->nd_repstat = NFSERR_NOTSUPP; + } } else { nfsrv_fixattr(nd, ndp->ni_vp, nvap, aclp, p, attrbitp, exp); From owner-svn-src-stable-10@freebsd.org Sat May 7 08:30:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45CB0B310AA; Sat, 7 May 2016 08:30:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 20DBE134A; Sat, 7 May 2016 08:30:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u478UMAh020417; Sat, 7 May 2016 08:30:22 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u478ULX6020410; Sat, 7 May 2016 08:30:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605070830.u478ULX6020410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 7 May 2016 08:30:21 +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: r299215 - in stable/10/sys: compat/svr4 dev/streams modules/streams modules/svr4 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.22 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, 07 May 2016 08:30:23 -0000 Author: dchagin Date: Sat May 7 08:30:21 2016 New Revision: 299215 URL: https://svnweb.freebsd.org/changeset/base/299215 Log: MFC r298519: Fix streams and svr4 module dependency. Both modules are complaining about undefined symbol svr4_delete_socket which was moved from streams to the svr4 module in r160558 that created a two-way dependency between them. MFC r298520: Allow to build svr4 module with SYSV support separatelly from the kernel build. PR: 208464 Reported by: Kristoffer Eriksson Modified: stable/10/sys/compat/svr4/svr4_ipc.c stable/10/sys/compat/svr4/svr4_socket.c stable/10/sys/compat/svr4/svr4_sysvec.c stable/10/sys/dev/streams/streams.c stable/10/sys/modules/streams/Makefile stable/10/sys/modules/svr4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/svr4/svr4_ipc.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_ipc.c Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/compat/svr4/svr4_ipc.c Sat May 7 08:30:21 2016 (r299215) @@ -86,14 +86,10 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(const struct svr4_ipc_perm *, struct ipc_perm *); static void bsd_to_svr4_ipc_perm(const struct ipc_perm *, struct svr4_ipc_perm *); -#endif - -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(const struct semid_ds *, struct svr4_semid_ds *); static void svr4_to_bsd_semid_ds(const struct svr4_semid_ds *, @@ -101,9 +97,6 @@ static void svr4_to_bsd_semid_ds(const s static int svr4_semop(struct thread *, void *); static int svr4_semget(struct thread *, void *); static int svr4_semctl(struct thread *, void *); -#endif - -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(const struct msqid_ds *, struct svr4_msqid_ds *); static void svr4_to_bsd_msqid_ds(const struct svr4_msqid_ds *, @@ -112,9 +105,6 @@ static int svr4_msgsnd(struct thread *, static int svr4_msgrcv(struct thread *, void *); static int svr4_msgget(struct thread *, void *); static int svr4_msgctl(struct thread *, void *); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(const struct shmid_ds *, struct svr4_shmid_ds *); static void svr4_to_bsd_shmid_ds(const struct svr4_shmid_ds *, @@ -123,9 +113,6 @@ static int svr4_shmat(struct thread *, v static int svr4_shmdt(struct thread *, void *); static int svr4_shmget(struct thread *, void *); static int svr4_shmctl(struct thread *, void *); -#endif - -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(spp, bpp) @@ -154,9 +141,7 @@ bsd_to_svr4_ipc_perm(bpp, spp) spp->mode = bpp->mode; spp->seq = bpp->seq; } -#endif -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(bds, sds) const struct semid_ds *bds; @@ -331,10 +316,7 @@ svr4_sys_semsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); -#endif -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(bds, sds) const struct msqid_ds *bds; @@ -421,7 +403,7 @@ svr4_msgrcv(td, v) return sys_msgrcv(td, &ap); } - + struct svr4_sys_msgget_args { int what; svr4_key_t key; @@ -504,10 +486,6 @@ svr4_sys_msgsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(bds, sds) @@ -657,7 +635,7 @@ svr4_shmctl(td, v) default: return (EINVAL); } - + error = kern_shmctl(td, uap->shmid, cmd, &bs, &bufsize); if (error) return (error); @@ -697,4 +675,5 @@ svr4_sys_shmsys(td, uap) } MODULE_DEPEND(svr4elf, sysvshm, 1, 1, 1); -#endif /* SYSVSHM */ +MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); +MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); Modified: stable/10/sys/compat/svr4/svr4_socket.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_socket.c Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/compat/svr4/svr4_socket.c Sat May 7 08:30:21 2016 (r299215) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct svr4_sockcache_entry { struct proc *p; /* Process for the socket */ @@ -168,6 +169,19 @@ svr4_delete_socket(p, fp) mtx_unlock(&svr4_sockcache_lock); } +struct svr4_strm * +svr4_stream_get(fp) + struct file *fp; +{ + struct socket *so; + + if (fp == NULL || fp->f_type != DTYPE_SOCKET) + return NULL; + + so = fp->f_data; + return so->so_emuldata; +} + void svr4_purge_sockcache(arg, p) void *arg; Modified: stable/10/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_sysvec.c Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/compat/svr4/svr4_sysvec.c Sat May 7 08:30:21 2016 (r299215) @@ -313,4 +313,4 @@ static moduledata_t svr4_elf_mod = { 0 }; DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_DEPEND(svr4elf, streams, 1, 1, 1); +MODULE_VERSION(svr4elf, 1); Modified: stable/10/sys/dev/streams/streams.c ============================================================================== --- stable/10/sys/dev/streams/streams.c Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/dev/streams/streams.c Sat May 7 08:30:21 2016 (r299215) @@ -176,6 +176,7 @@ static moduledata_t streams_mod = { }; DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); MODULE_VERSION(streams, 1); +MODULE_DEPEND(streams, svr4elf, 1, 1, 1); /* * We only need open() and close() routines. open() calls socreate() @@ -329,19 +330,6 @@ svr4_ptm_alloc(td) } -struct svr4_strm * -svr4_stream_get(fp) - struct file *fp; -{ - struct socket *so; - - if (fp == NULL || fp->f_type != DTYPE_SOCKET) - return NULL; - - so = fp->f_data; - return so->so_emuldata; -} - static int svr4_soo_close(struct file *fp, struct thread *td) { Modified: stable/10/sys/modules/streams/Makefile ============================================================================== --- stable/10/sys/modules/streams/Makefile Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/modules/streams/Makefile Sat May 7 08:30:21 2016 (r299215) @@ -5,10 +5,6 @@ KMOD= streams SRCS= streams.c -EXPORT_SYMS= svr4_str_initialized \ - svr4_stream_get \ - svr4_delete_socket - .if defined(DEBUG) CFLAGS+= -DDEBUG_SVR4 .endif Modified: stable/10/sys/modules/svr4/Makefile ============================================================================== --- stable/10/sys/modules/svr4/Makefile Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/modules/svr4/Makefile Sat May 7 08:30:21 2016 (r299215) @@ -8,6 +8,7 @@ SRCS= svr4_sysent.c svr4_sysvec.c opt_co svr4_termios.c svr4_stream.c svr4_socket.c svr4_sockio.c \ svr4_machdep.c svr4_resource.c svr4_ipc.c OBJS= svr4_locore.o +EXPORT_SYMS= svr4_delete_socket SRCS+= opt_ktrace.h opt_sysvipc.h From owner-svn-src-stable-10@freebsd.org Sat May 7 18:54:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E062FB31844; Sat, 7 May 2016 18:54:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B0F871A6A; Sat, 7 May 2016 18:54:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u47IsZ5M010351; Sat, 7 May 2016 18:54:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47IsZ8V010350; Sat, 7 May 2016 18:54:35 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605071854.u47IsZ8V010350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 7 May 2016 18:54: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: r299219 - stable/10/sys/compat/linprocfs 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.22 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, 07 May 2016 18:54:37 -0000 Author: dchagin Date: Sat May 7 18:54:35 2016 New Revision: 299219 URL: https://svnweb.freebsd.org/changeset/base/299219 Log: MFC r285394 (by mjg@): vref the vnode passed to vn_fullpath. Modified: stable/10/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat May 7 18:48:48 2016 (r299218) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat May 7 18:54:35 2016 (r299219) @@ -858,10 +858,20 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) static int linprocfs_doproccwd(PFS_FILL_ARGS) { + struct filedesc *fdp; + struct vnode *vp; char *fullpath = "unknown"; char *freepath = NULL; - vn_fullpath(td, p->p_fd->fd_cdir, &fullpath, &freepath); + fdp = p->p_fd; + FILEDESC_SLOCK(fdp); + vp = fdp->fd_cdir; + if (vp != NULL) + VREF(vp); + FILEDESC_SUNLOCK(fdp); + vn_fullpath(td, vp, &fullpath, &freepath); + if (vp != NULL) + vrele(vp); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); @@ -874,12 +884,20 @@ linprocfs_doproccwd(PFS_FILL_ARGS) static int linprocfs_doprocroot(PFS_FILL_ARGS) { - struct vnode *rvp; + struct filedesc *fdp; + struct vnode *vp; char *fullpath = "unknown"; char *freepath = NULL; - rvp = jailed(p->p_ucred) ? p->p_fd->fd_jdir : p->p_fd->fd_rdir; - vn_fullpath(td, rvp, &fullpath, &freepath); + fdp = p->p_fd; + FILEDESC_SLOCK(fdp); + vp = jailed(p->p_ucred) ? fdp->fd_jdir : fdp->fd_rdir; + if (vp != NULL) + VREF(vp); + FILEDESC_SUNLOCK(fdp); + vn_fullpath(td, vp, &fullpath, &freepath); + if (vp != NULL) + vrele(vp); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); From owner-svn-src-stable-10@freebsd.org Sat May 7 19:05:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E832B31BA0; Sat, 7 May 2016 19:05:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3DB0511AD; Sat, 7 May 2016 19:05:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u47J5dJS013588; Sat, 7 May 2016 19:05:39 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47J5dgG013586; Sat, 7 May 2016 19:05:39 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605071905.u47J5dgG013586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 7 May 2016 19:05:39 +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: r299221 - in stable/10/sys/compat: linprocfs linux 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.22 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, 07 May 2016 19:05:40 -0000 Author: dchagin Date: Sat May 7 19:05:39 2016 New Revision: 299221 URL: https://svnweb.freebsd.org/changeset/base/299221 Log: MFC r295856 (by des@): Implement /proc/$$/limits. MFC r297781 (by dchagin@): More complete implementation of /proc/self/limits. Fix the way the code accesses process limits struct - pointed out by mjg@. MFC r298318, 298319 (by cem@): Don't print uninitialized values and initialize error return before use. PR: 207386 Modified: stable/10/sys/compat/linprocfs/linprocfs.c stable/10/sys/compat/linux/linux_misc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat May 7 18:58:07 2016 (r299220) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat May 7 19:05:39 2016 (r299221) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1350,6 +1351,97 @@ linprocfs_dofdescfs(PFS_FILL_ARGS) return (0); } +/* + * Filler function for proc/pid/limits + */ +static const struct linux_rlimit_ident { + const char *desc; + const char *unit; + unsigned int rlim_id; +} linux_rlimits_ident[] = { + { "Max cpu time", "seconds", RLIMIT_CPU }, + { "Max file size", "bytes", RLIMIT_FSIZE }, + { "Max data size", "bytes", RLIMIT_DATA }, + { "Max stack size", "bytes", RLIMIT_STACK }, + { "Max core file size", "bytes", RLIMIT_CORE }, + { "Max resident set", "bytes", RLIMIT_RSS }, + { "Max processes", "processes", RLIMIT_NPROC }, + { "Max open files", "files", RLIMIT_NOFILE }, + { "Max locked memory", "bytes", RLIMIT_MEMLOCK }, + { "Max address space", "bytes", RLIMIT_AS }, + { "Max file locks", "locks", LINUX_RLIMIT_LOCKS }, + { "Max pending signals", "signals", LINUX_RLIMIT_SIGPENDING }, + { "Max msgqueue size", "bytes", LINUX_RLIMIT_MSGQUEUE }, + { "Max nice priority", "", LINUX_RLIMIT_NICE }, + { "Max realtime priority", "", LINUX_RLIMIT_RTPRIO }, + { "Max realtime timeout", "us", LINUX_RLIMIT_RTTIME }, + { 0, 0, 0 } +}; + +static int +linprocfs_doproclimits(PFS_FILL_ARGS) +{ + const struct linux_rlimit_ident *li; + struct plimit *limp; + struct rlimit rl; + ssize_t size; + int res, error; + + error = 0; + + PROC_LOCK(p); + limp = lim_hold(p->p_limit); + PROC_UNLOCK(p); + size = sizeof(res); + sbuf_printf(sb, "%-26s%-21s%-21s%-21s\n", "Limit", "Soft Limit", + "Hard Limit", "Units"); + for (li = linux_rlimits_ident; li->desc != NULL; ++li) { + switch (li->rlim_id) + { + case LINUX_RLIMIT_LOCKS: + /* FALLTHROUGH */ + case LINUX_RLIMIT_RTTIME: + rl.rlim_cur = RLIM_INFINITY; + break; + case LINUX_RLIMIT_SIGPENDING: + error = kernel_sysctlbyname(td, + "kern.sigqueue.max_pending_per_proc", + &res, &size, 0, 0, 0, 0); + if (error != 0) + goto out; + rl.rlim_cur = res; + rl.rlim_max = res; + break; + case LINUX_RLIMIT_MSGQUEUE: + error = kernel_sysctlbyname(td, + "kern.ipc.msgmnb", &res, &size, 0, 0, 0, 0); + if (error != 0) + goto out; + rl.rlim_cur = res; + rl.rlim_max = res; + break; + case LINUX_RLIMIT_NICE: + /* FALLTHROUGH */ + case LINUX_RLIMIT_RTPRIO: + rl.rlim_cur = 0; + rl.rlim_max = 0; + break; + default: + rl = limp->pl_rlimit[li->rlim_id]; + break; + } + if (rl.rlim_cur == RLIM_INFINITY) + sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", + li->desc, "unlimited", "unlimited", li->unit); + else + sbuf_printf(sb, "%-26s%-21llu%-21llu%-10s\n", + li->desc, (unsigned long long)rl.rlim_cur, + (unsigned long long)rl.rlim_max, li->unit); + } +out: + lim_free(limp); + return (error); +} /* * Filler function for proc/sys/kernel/random/uuid @@ -1488,6 +1580,8 @@ linprocfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, 0); pfs_create_file(dir, "auxv", &linprocfs_doauxv, NULL, &procfs_candebug, NULL, PFS_RD|PFS_RAWRD); + pfs_create_file(dir, "limits", &linprocfs_doproclimits, + NULL, NULL, NULL, PFS_RD); /* /proc/scsi/... */ dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0); Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat May 7 18:58:07 2016 (r299220) +++ stable/10/sys/compat/linux/linux_misc.h Sat May 7 19:05:39 2016 (r299221) @@ -141,6 +141,13 @@ extern int stclohz; #define LINUX_P_PID 1 #define LINUX_P_PGID 2 +#define LINUX_RLIMIT_LOCKS RLIM_NLIMITS + 1 +#define LINUX_RLIMIT_SIGPENDING RLIM_NLIMITS + 2 +#define LINUX_RLIMIT_MSGQUEUE RLIM_NLIMITS + 3 +#define LINUX_RLIMIT_NICE RLIM_NLIMITS + 4 +#define LINUX_RLIMIT_RTPRIO RLIM_NLIMITS + 5 +#define LINUX_RLIMIT_RTTIME RLIM_NLIMITS + 6 + #define LINUX_RLIM_INFINITY (~0UL) int linux_common_wait(struct thread *td, int pid, int *status, From owner-svn-src-stable-10@freebsd.org Sat May 7 20:09:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD45AB32910; Sat, 7 May 2016 20:09:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8CE051D03; Sat, 7 May 2016 20:09:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u47K9FZS032275; Sat, 7 May 2016 20:09:15 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47K9FJv032273; Sat, 7 May 2016 20:09:15 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605072009.u47K9FJv032273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 May 2016 20:09: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: r299222 - in stable/10/sys/fs: nfs nfsserver 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.22 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, 07 May 2016 20:09:17 -0000 Author: rmacklem Date: Sat May 7 20:09:15 2016 New Revision: 299222 URL: https://svnweb.freebsd.org/changeset/base/299222 Log: MFC: r298495 Fix a LOR in the NFSv4.1 server. The ordering of acquisition of the state and session mutexes was reversed in two cases executed when an NFSv4.1 client created/freed a session. Since clients will typically do this only when mounting and dismounting, the likelyhood of causing a deadlock was low but possible. This can only occur for NFSv4.1 mounts, since the others do not use sessions. This was detected while testing the pNFS server/client where the client crashed during dismounting. The patch also reorders the unlocks, although that isn't necessary for correct operation. Modified: stable/10/sys/fs/nfs/nfsrvstate.h stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfsrvstate.h ============================================================================== --- stable/10/sys/fs/nfs/nfsrvstate.h Sat May 7 19:05:39 2016 (r299221) +++ stable/10/sys/fs/nfs/nfsrvstate.h Sat May 7 20:09:15 2016 (r299222) @@ -113,7 +113,7 @@ struct nfsclient { * Structure for an NFSv4.1 session. * Locking rules for this structure. * To add/delete one of these structures from the lists, you must lock - * both: NFSLOCKSESSION(session hashhead) and NFSLOCKSTATE() in that order. + * both: NFSLOCKSTATE() and NFSLOCKSESSION(session hashhead) in that order. * To traverse the lists looking for one of these, you must hold one * of these two locks. * The exception is if the thread holds the exclusive root sleep lock. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sat May 7 19:05:39 2016 (r299221) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sat May 7 20:09:15 2016 (r299222) @@ -629,13 +629,13 @@ nfsrv_getclient(nfsquad_t clientid, int NFSBCOPY(sessid, nsep->sess_cbsess.nfsess_sessionid, NFSX_V4SESSIONID); shp = NFSSESSIONHASH(nsep->sess_sessionid); + NFSLOCKSTATE(); NFSLOCKSESSION(shp); LIST_INSERT_HEAD(&shp->list, nsep, sess_hash); - NFSLOCKSTATE(); LIST_INSERT_HEAD(&clp->lc_session, nsep, sess_list); nsep->sess_clp = clp; - NFSUNLOCKSTATE(); NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); } } } else if (clp->lc_flags & LCL_NEEDSCONFIRM) { @@ -5915,6 +5915,7 @@ nfsrv_freesession(struct nfsdsession *se struct nfssessionhash *shp; int i; + NFSLOCKSTATE(); if (sep == NULL) { shp = NFSSESSIONHASH(sessionid); NFSLOCKSESSION(shp); @@ -5924,18 +5925,17 @@ nfsrv_freesession(struct nfsdsession *se NFSLOCKSESSION(shp); } if (sep != NULL) { - NFSLOCKSTATE(); sep->sess_refcnt--; if (sep->sess_refcnt > 0) { - NFSUNLOCKSTATE(); NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); return (0); } LIST_REMOVE(sep, sess_hash); LIST_REMOVE(sep, sess_list); - NFSUNLOCKSTATE(); } NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); if (sep == NULL) return (NFSERR_BADSESSION); for (i = 0; i < NFSV4_SLOTS; i++) From owner-svn-src-stable-10@freebsd.org Sat May 7 20:17:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 398D3B32B1D; Sat, 7 May 2016 20:17:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0261E118A; Sat, 7 May 2016 20:17:24 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u47KHOPX035187; Sat, 7 May 2016 20:17:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47KHOJu035186; Sat, 7 May 2016 20:17:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605072017.u47KHOJu035186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 May 2016 20:17: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: r299223 - stable/10/sys/fs/nfsserver 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.22 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, 07 May 2016 20:17:25 -0000 Author: rmacklem Date: Sat May 7 20:17:23 2016 New Revision: 299223 URL: https://svnweb.freebsd.org/changeset/base/299223 Log: MFC: r298523 Allow the NFSv4 server to reply NFSERR_WRONGSEC for the SetClientID operation. It was reported via email that a Linux client couldn't do a Kerberized NFS mount when only "sec=krb5" was specified for the exports. The Linux client attempted a mount via krb5i and the server replied NFSERR_SERVERFAULT. Although NFSERR_WRONGSEC isn't listed as an error for SetClientID, I think it is the correct reply, so this patch enables that. I do not know if this fixes the mount attempt, but adding "krb5i" to the list of allowed security flavours does allow the mount to work. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c Sat May 7 20:09:15 2016 (r299222) +++ stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c Sat May 7 20:17:23 2016 (r299223) @@ -1144,6 +1144,7 @@ static short nfsv4err_setclientid[] = { NFSERR_INVAL, NFSERR_RESOURCE, NFSERR_SERVERFAULT, + NFSERR_WRONGSEC, 0, };