svn commit: r301825 - stable/9/release/scripts
Author: delphij Date: Sat Jun 11 05:58:51 2016 New Revision: 301825 URL: https://svnweb.freebsd.org/changeset/base/301825 Log: MFC r301584: Apply mergemaster r255428: Pass -n (do not emit comments) when saving mtree information for future mergemaster(8) runs. Modified: stable/9/release/scripts/mm-mtree.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/scripts/mm-mtree.sh == --- stable/9/release/scripts/mm-mtree.shSat Jun 11 05:53:50 2016 (r301824) +++ stable/9/release/scripts/mm-mtree.shSat Jun 11 05:58:51 2016 (r301825) @@ -142,7 +142,7 @@ find -d ${TEMPROOT} -type d -empty -dele # Build the mtree database in a temporary location. MTREENEW=`mktemp -t mergemaster.mtree` -mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null +mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301824 - stable/10/release/scripts
Author: delphij Date: Sat Jun 11 05:53:50 2016 New Revision: 301824 URL: https://svnweb.freebsd.org/changeset/base/301824 Log: MFC r301584: Apply mergemaster r255428: Pass -n (do not emit comments) when saving mtree information for future mergemaster(8) runs. Modified: stable/10/release/scripts/mm-mtree.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/scripts/mm-mtree.sh == --- stable/10/release/scripts/mm-mtree.sh Sat Jun 11 03:59:44 2016 (r301823) +++ stable/10/release/scripts/mm-mtree.sh Sat Jun 11 05:53:50 2016 (r301824) @@ -147,7 +147,7 @@ find -d ${TEMPROOT} -type d -empty -dele # Build the mtree database in a temporary location. MTREENEW=`mktemp -t mergemaster.mtree` -mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null +mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301823 - stable/9/gnu/lib/libsupc++
Author: pfg Date: Sat Jun 11 03:59:44 2016 New Revision: 301823 URL: https://svnweb.freebsd.org/changeset/base/301823 Log: MFC r301570: libsupc++: Fix typo in symbol map. This went mostly unnoticed with the deprecation of the GNU toolchain in tier 1 platforms. Fix it now for the rest. PR: 169901 Modified: stable/9/gnu/lib/libsupc++/Version.map Directory Properties: stable/9/gnu/lib/libsupc++/ (props changed) Modified: stable/9/gnu/lib/libsupc++/Version.map == --- stable/9/gnu/lib/libsupc++/Version.map Sat Jun 11 03:58:59 2016 (r301822) +++ stable/9/gnu/lib/libsupc++/Version.map Sat Jun 11 03:59:44 2016 (r301823) @@ -132,7 +132,7 @@ CXXABI_1.3 { GLIBCXX_3.4 { # operator new and new[] -_Znai[jm]; +_Zna[jm]; _Zna[jm]RKSt9nothrow_t; _Znw[jm]; _Znw[jm]RKSt9nothrow_t; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301822 - stable/10/gnu/lib/libsupc++
Author: pfg Date: Sat Jun 11 03:58:59 2016 New Revision: 301822 URL: https://svnweb.freebsd.org/changeset/base/301822 Log: MFC r301570: libsupc++: Fix typo in symbol map. This went mostly unnoticed with the deprecation of the GNU toolchain in tier 1 platforms. Fix it now for the rest. PR: 169901 Modified: stable/10/gnu/lib/libsupc++/Version.map Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/lib/libsupc++/Version.map == --- stable/10/gnu/lib/libsupc++/Version.map Sat Jun 11 01:44:27 2016 (r301821) +++ stable/10/gnu/lib/libsupc++/Version.map Sat Jun 11 03:58:59 2016 (r301822) @@ -132,7 +132,7 @@ CXXABI_1.3 { GLIBCXX_3.4 { # operator new and new[] -_Znai[jm]; +_Zna[jm]; _Zna[jm]RKSt9nothrow_t; _Znw[jm]; _Znw[jm]RKSt9nothrow_t; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301821 - stable/9/lib/libc/rpc
Author: ngie Date: Sat Jun 11 01:44:27 2016 New Revision: 301821 URL: https://svnweb.freebsd.org/changeset/base/301821 Log: MFstable/10 r301820: MFC r301704: Test for strchr(3) returning NULL, not 0 Modified: stable/9/lib/libc/rpc/getnetpath.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/getnetpath.c == --- stable/9/lib/libc/rpc/getnetpath.c Sat Jun 11 01:37:59 2016 (r301820) +++ stable/9/lib/libc/rpc/getnetpath.c Sat Jun 11 01:44:27 2016 (r301821) @@ -265,7 +265,7 @@ int token; /* char to parse string for *cp++ = '\0'; /* null-terminate token */ /* get rid of any backslash escapes */ ep = npp; -while ((np = strchr(ep, '\\')) != 0) { +while ((np = strchr(ep, '\\')) != NULL) { if (np[1] == '\\') np++; strcpy(np, (ep = [1])); /* XXX: overlapping string copy */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301820 - stable/10/lib/libc/rpc
Author: ngie Date: Sat Jun 11 01:37:59 2016 New Revision: 301820 URL: https://svnweb.freebsd.org/changeset/base/301820 Log: MFC r301704: Test for strchr(3) returning NULL, not 0 Modified: stable/10/lib/libc/rpc/getnetpath.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getnetpath.c == --- stable/10/lib/libc/rpc/getnetpath.c Sat Jun 11 01:35:34 2016 (r301819) +++ stable/10/lib/libc/rpc/getnetpath.c Sat Jun 11 01:37:59 2016 (r301820) @@ -264,7 +264,7 @@ int token; /* char to parse string for *cp++ = '\0'; /* null-terminate token */ /* get rid of any backslash escapes */ ep = npp; -while ((np = strchr(ep, '\\')) != 0) { +while ((np = strchr(ep, '\\')) != NULL) { if (np[1] == '\\') np++; strcpy(np, (ep = [1])); /* XXX: overlapping string copy */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301819 - stable/9/etc/defaults
Author: ngie Date: Sat Jun 11 01:35:34 2016 New Revision: 301819 URL: https://svnweb.freebsd.org/changeset/base/301819 Log: MFstable/10 r301818: MFC r301683: Fix typo with description for $ipv6_cpe_wanif (upstram -> upstream) PR: 210146 Modified: stable/9/etc/defaults/rc.conf Directory Properties: stable/9/ (props changed) stable/9/etc/ (props changed) Modified: stable/9/etc/defaults/rc.conf == --- stable/9/etc/defaults/rc.conf Sat Jun 11 01:34:41 2016 (r301818) +++ stable/9/etc/defaults/rc.conf Sat Jun 11 01:35:34 2016 (r301819) @@ -483,7 +483,7 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:::0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. -ipv6_cpe_wanif="NO"# Set to the upstram interface name if this +ipv6_cpe_wanif="NO"# Set to the upstream interface name if this # node will work as a router to forward IPv6 # packets not explicitly addressed to itself. ipv6_privacy="NO" # Use privacy address on RA-receiving IFs ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301818 - stable/10/etc/defaults
Author: ngie Date: Sat Jun 11 01:34:41 2016 New Revision: 301818 URL: https://svnweb.freebsd.org/changeset/base/301818 Log: MFC r301683: Fix typo with description for $ipv6_cpe_wanif (upstram -> upstream) PR: 210146 Modified: stable/10/etc/defaults/rc.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf == --- stable/10/etc/defaults/rc.conf Fri Jun 10 22:07:17 2016 (r301817) +++ stable/10/etc/defaults/rc.conf Sat Jun 11 01:34:41 2016 (r301818) @@ -485,7 +485,7 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:::0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. -ipv6_cpe_wanif="NO"# Set to the upstram interface name if this +ipv6_cpe_wanif="NO"# Set to the upstream interface name if this # node will work as a router to forward IPv6 # packets not explicitly addressed to itself. ipv6_privacy="NO" # Use privacy address on RA-receiving IFs ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301817 - stable/10/contrib/gcc
Author: pfg Date: Fri Jun 10 22:07:17 2016 New Revision: 301817 URL: https://svnweb.freebsd.org/changeset/base/301817 Log: MFC r300301, r300319: GCC: Add support for named initializers for anonymous structs/unions. This is a C11 feature that is starting to get used in places such as Mesa. This implementation takes a different approach to upstream and is therefore not covered by GPLv3. Obtained from:OpenBSD (CVS rev. 1.2) Modified: stable/10/contrib/gcc/c-typeck.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/c-typeck.c == --- stable/10/contrib/gcc/c-typeck.cFri Jun 10 21:47:37 2016 (r301816) +++ stable/10/contrib/gcc/c-typeck.cFri Jun 10 22:07:17 2016 (r301817) @@ -6041,6 +6041,7 @@ set_init_index (tree first, tree last) void set_init_label (tree fieldname) { + tree anon = NULL_TREE; tree tail; if (set_designator (0)) @@ -6058,19 +6059,39 @@ set_init_label (tree fieldname) for (tail = TYPE_FIELDS (constructor_type); tail; tail = TREE_CHAIN (tail)) { + if (DECL_NAME (tail) == NULL_TREE + && (TREE_CODE (TREE_TYPE (tail)) == RECORD_TYPE + || TREE_CODE (TREE_TYPE (tail)) == UNION_TYPE)) + { + anon = lookup_field (tail, fieldname); + if (anon) + break; + } + if (DECL_NAME (tail) == fieldname) break; } if (tail == 0) error ("unknown field %qE specified in initializer", fieldname); - else + + while (tail) { constructor_fields = tail; designator_depth++; designator_erroneous = 0; if (constructor_range_stack) push_range_stack (NULL_TREE); + + if (anon) + { + if (set_designator (0)) + return; + tail = TREE_VALUE(anon); + anon = TREE_CHAIN(anon); + } + else + tail = NULL_TREE; } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301816 - stable/10/contrib/binutils/gas/config
Author: pfg Date: Fri Jun 10 21:47:37 2016 New Revision: 301816 URL: https://svnweb.freebsd.org/changeset/base/301816 Log: MFC r300333: gas: Implement the .inst assembler directive for arm. We normally use the binutils from ports but on other systems this is required for building gcc 4.9. Obtained from:OpenBSD (CVS rev. 1.5) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c == --- stable/10/contrib/binutils/gas/config/tc-arm.c Fri Jun 10 19:29:55 2016(r301815) +++ stable/10/contrib/binutils/gas/config/tc-arm.c Fri Jun 10 21:47:37 2016(r301816) @@ -2284,6 +2284,37 @@ s_unreq (int a ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +static void +s_inst(int unused ATTRIBUTE_UNUSED) +{ + expressionS exp; + + if (thumb_mode) { + as_bad(".inst not implemented for Thumb mode"); + ignore_rest_of_line(); + return; + } + + if (is_it_end_of_statement()) { + demand_empty_rest_of_line(); + return; + } + + do { + expression(); + + if (exp.X_op != O_constant) + as_bad("constant expression required"); + else + emit_expr(, 4); + + } while (*input_line_pointer++ == ','); + + /* Put terminator back into stream. */ + input_line_pointer--; + demand_empty_rest_of_line(); +} + /* Directives: Instruction set selection. */ #ifdef OBJ_ELF @@ -3895,6 +3926,7 @@ const pseudo_typeS md_pseudo_table[] = { "object_arch", s_arm_object_arch, 0 }, { "fpu",s_arm_fpu, 0 }, { "arch_extension", s_arm_arch_extension, 0 }, + { "inst", s_inst,0 }, #ifdef OBJ_ELF { "word", s_arm_elf_cons, 4 }, { "long", s_arm_elf_cons, 4 }, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl
On Fri, Jun 10, 2016 at 09:17:45PM +0200, Mariusz Zaborski wrote: > On Fri, Jun 10, 2016 at 04:47:28PM +0200, Jilles Tjoelker wrote: > > On Wed, Jun 08, 2016 at 02:03:53AM +, Mariusz Zaborski wrote: > > > + if (setsid() == -1) > > > + errx(1, "Unable to detach from session"); > > There is an implicit assumption here that stdnull() is only called from > > a process that was forked off from here, since setsid() will not and > > cannot work when called from a process that is already a session leader. > > If the application is running from a shell, this setsid() will exclude > > the process from most signals, including terminal ^C/^\/^Z, kill % and > > hangups. More generally, this might make it more likely for the process > > to hang around indefinitely after the parent is gone. > I'm not sure but if the process descriptor not solve that? > If we close all process descriptor to the process it should die then, so you > need to kill just the process which is using service. Oh, right. For termination this is probably even better since terminating properly may require casper daemons, and for stopping it probably doesn't matter much. For opening files in utilities called from an interactive shell it is probably still bad since it breaks /dev/tty and obscures blocking opens such as fifos. -- Jilles Tjoelker ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301815 - head/sys/conf
Author: gjb Date: Fri Jun 10 19:29:55 2016 New Revision: 301815 URL: https://svnweb.freebsd.org/changeset/base/301815 Log: Update 11.0 to ALPHA3 in preparation for new snapshot builds. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shFri Jun 10 19:06:11 2016(r301814) +++ head/sys/conf/newvers.shFri Jun 10 19:29:55 2016(r301815) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="ALPHA2" +BRANCH="ALPHA3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl
On Fri, Jun 10, 2016 at 04:47:28PM +0200, Jilles Tjoelker wrote: > On Wed, Jun 08, 2016 at 02:03:53AM +, Mariusz Zaborski wrote: > > Author: oshogbo > > Date: Wed Jun 8 02:03:53 2016 > > New Revision: 301572 > > URL: https://svnweb.freebsd.org/changeset/base/301572 > > > Log: > > Add flags to the Casper services. > > > CASPER_SERVICE_STDIO - Casper will not close the first three descriptors > > (stdin, > >stdout and stderr) this can be helpful for debugging. > > CASPER_SERVICE_FD - Capser will not close all other descriptors, this can > > be useful for a filesystem service. > > This reminds me that there are some common cases where it is wrong to > close descriptors you don't know about. The non-POSIX command > diff <(cmd1) <(cmd2) > that compares the outputs of the two commands, when executed with bash > that was compiled with the full /dev/fd visible (as in poudriere), will > actually run something like > diff /dev/fd/63 /dev/fd/62 > passing two file descriptors to pipes. > > When created by a shell, these pathnames will start with /dev/fd/, but > people could create symlinks to these special files. This is why the CASPER_SERVICE_FD was added. :) > > [snip] > > +static void > > +stdnull(void) > > +{ > > + int fd; > > + > > + fd = open(_PATH_DEVNULL, O_RDWR); > > + if (fd == -1) > > + errx(1, "Unable to open %s", _PATH_DEVNULL); > > + > > + if (setsid() == -1) > > + errx(1, "Unable to detach from session"); > > There is an implicit assumption here that stdnull() is only called from > a process that was forked off from here, since setsid() will not and > cannot work when called from a process that is already a session leader. > > If the application is running from a shell, this setsid() will exclude > the process from most signals, including terminal ^C/^\/^Z, kill % and > hangups. More generally, this might make it more likely for the process > to hang around indefinitely after the parent is gone. I'm not sure but if the process descriptor not solve that? If we close all process descriptor to the process it should die then, so you need to kill just the process which is using service. > > + > > + if (dup2(fd, STDIN_FILENO) == -1) > > + errx(1, "Unable to cover stdin"); > > + if (dup2(fd, STDOUT_FILENO) == -1) > > + errx(1, "Unable to cover stdout"); > > + if (dup2(fd, STDERR_FILENO) == -1) > > + errx(1, "Unable to cover stderr"); > > + > > + close(fd); > > This was not broken by this commit, but fd should not be closed if it is > equal to STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO. Yes you are in 100% right. Thanks, I will fix that. Thanks, -- Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter| https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 signature.asc Description: PGP signature
svn commit: r301814 - in head/sys: conf modules
Author: jtl Date: Fri Jun 10 19:06:11 2016 New Revision: 301814 URL: https://svnweb.freebsd.org/changeset/base/301814 Log: Change the default build behavior so we don't compile extra TCP modules by default. At least initially, the feature to support multiple TCP stacks is aimed at supporting advanced use cases and TCP development, but it is not necessarily aimed at a wide audience. Therefore, there is no need to build and install the extra TCP stacks by default. Instead, the people who are using or developing this functionality can add the extra option to build/ install the extra TCP stacks. However, we do want to build the extra TCP stacks as part of test builds (e.g. LINT or tinderbox) to ensure that developers who are testing their changes will know that their changes do not break the additional TCP stack modules. After this change, a user will need to add WITH_EXTRA_TCP_STACKS=1 to make.conf or the kernel config in order to build the extra TCP modules. Differential Revision:https://reviews.freebsd.org/D6795 Reviewed by: sjg Approved by: re (kib) Modified: head/sys/conf/kern.opts.mk head/sys/conf/kern.post.mk head/sys/modules/Makefile Modified: head/sys/conf/kern.opts.mk == --- head/sys/conf/kern.opts.mk Fri Jun 10 18:47:11 2016(r301813) +++ head/sys/conf/kern.opts.mk Fri Jun 10 19:06:11 2016(r301814) @@ -45,6 +45,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EISA \ +EXTRA_TCP_STACKS \ NAND \ OFED Modified: head/sys/conf/kern.post.mk == --- head/sys/conf/kern.post.mk Fri Jun 10 18:47:11 2016(r301813) +++ head/sys/conf/kern.post.mk Fri Jun 10 19:06:11 2016(r301814) @@ -23,6 +23,10 @@ MKMODULESENV+= CONF_CFLAGS="${CONF_CFLAG MKMODULESENV+= WITH_CTF="${WITH_CTF}" .endif +.if defined(WITH_EXTRA_TCP_STACKS) +MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP_STACKS}" +.endif + # Allow overriding the kernel debug directory, so kernel and user debug may be # installed in different directories. Setting it to "" restores the historical # behavior of installing debug files in the kernel directory. Modified: head/sys/modules/Makefile == --- head/sys/modules/Makefile Fri Jun 10 18:47:11 2016(r301813) +++ head/sys/modules/Makefile Fri Jun 10 19:06:11 2016(r301814) @@ -353,7 +353,7 @@ SUBDIR= \ ${_syscons} \ sysvipc \ ${_ti} \ - tcp/fastpath \ + ${_tcp_fastpath} \ tests/framework \ tests/callout_test \ tl \ @@ -436,6 +436,10 @@ _random_other= random_other SUBDIR+= cuse .endif +.if ${MK_EXTRA_TCP_STACKS} != "no" || defined(ALL_MODULES) +_tcp_fastpath= tcp/fastpath +.endif + .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) _carp= carp ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301813 - stable/10
Author: ngie Date: Fri Jun 10 18:47:11 2016 New Revision: 301813 URL: https://svnweb.freebsd.org/changeset/base/301813 Log: Record mergeinfo for all complete commits done in the ioat(4) merge in r300661 This will make it easier for someone to determine what's missing when running `svn mergeinfo --show-revs eligible` r299353 wasn't recorded intentionally because it was only a "partial" merge Sponsored by: EMC / Isilon Storage Division Modified: Directory Properties: stable/10/ (props changed) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301812 - stable/10/sys/dev/ioat
Author: ngie Date: Fri Jun 10 18:40:03 2016 New Revision: 301812 URL: https://svnweb.freebsd.org/changeset/base/301812 Log: MFC r301296,r301297,r301300: r301296 (by cem): ioat(4): Make channel indices unsigned r301297 (by cem): ioat(4): Export the number of available channels r301300 (by cem): ioat(4): Always log capabilities on attach Different, relatively recent Intel Xeon hardware support radically different features. E.g., BDX support CRC32 while BDX-DE does not. Modified: stable/10/sys/dev/ioat/ioat.c stable/10/sys/dev/ioat/ioat.h stable/10/sys/dev/ioat/ioat_internal.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ioat/ioat.c == --- stable/10/sys/dev/ioat/ioat.c Fri Jun 10 18:34:31 2016 (r301811) +++ stable/10/sys/dev/ioat/ioat.c Fri Jun 10 18:40:03 2016 (r301812) @@ -152,8 +152,8 @@ MODULE_VERSION(ioat, 1); * Private data structures */ static struct ioat_softc *ioat_channel[IOAT_MAX_CHANNELS]; -static int ioat_channel_index = 0; -SYSCTL_INT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, _channel_index, 0, +static unsigned ioat_channel_index = 0; +SYSCTL_UINT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, _channel_index, 0, "Number of IOAT channels attached"); static struct _pcsid @@ -407,7 +407,7 @@ ioat3_attach(device_t device) ioat = DEVICE2SOFTC(device); ioat->capabilities = ioat_read_dmacapability(ioat); - ioat_log_message(1, "Capabilities: %b\n", (int)ioat->capabilities, + ioat_log_message(0, "Capabilities: %b\n", (int)ioat->capabilities, IOAT_DMACAP_STR); xfercap = ioat_read_xfercap(ioat); @@ -742,6 +742,13 @@ ioat_reset_hw_task(void *ctx, int pendin /* * User API functions */ +unsigned +ioat_get_nchannels(void) +{ + + return (ioat_channel_index); +} + bus_dmaengine_t ioat_get_dmaengine(uint32_t index, int flags) { Modified: stable/10/sys/dev/ioat/ioat.h == --- stable/10/sys/dev/ioat/ioat.h Fri Jun 10 18:34:31 2016 (r301811) +++ stable/10/sys/dev/ioat/ioat.h Fri Jun 10 18:40:03 2016 (r301812) @@ -85,6 +85,8 @@ typedef void *bus_dmaengine_t; struct bus_dmadesc; typedef void (*bus_dmaengine_callback_t)(void *arg, int error); +unsigned ioat_get_nchannels(void); + /* * Called first to acquire a reference to the DMA channel * Modified: stable/10/sys/dev/ioat/ioat_internal.h == --- stable/10/sys/dev/ioat/ioat_internal.h Fri Jun 10 18:34:31 2016 (r301811) +++ stable/10/sys/dev/ioat/ioat_internal.h Fri Jun 10 18:40:03 2016 (r301812) @@ -455,7 +455,7 @@ struct ioat_softc { }) int version; - int chan_idx; + unsignedchan_idx; struct mtx submit_lock; device_tdevice; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301811 - stable/10/sys/dev/ntb/ntb_hw
Author: ngie Date: Fri Jun 10 18:34:31 2016 New Revision: 301811 URL: https://svnweb.freebsd.org/changeset/base/301811 Log: MFC r295618,r300100,r300531: r295618 (by cem): NTB: workaround for high traffic hardware hang This patch comes from Dave Jiang's Linux tree, davejiang/ntb. It hasn't been accepted into Linus' tree, so I do not have an authoritative SHA1 to point at. Original commit log: = A hardware errata causes the NTB to hang when heavy bi-directional traffic in addition to the usage of BAR0/1 (where the registers reside, including the doorbell registers to trigger interrupts). This workaround is only available on Haswell and Broadwell platform. The workaround is to enable split BAR in the BIOS to allow the 64bit BAR4 to be split into two 32bit BAR4 and BAR5. The BAR4 shall be pointed to LAPIC region of the remote host. We will bypass the db mechanism and directly trigger the MSIX interrupts. The offsets and vectors are exchanged during transport scratch pad negotiation. The scratch pads are now overloaded in order to allow the exchange of the information. This gets around using the doorbell and prevents the lockup with additional pcode changes in BIOS. Signed-off-by:Dave Jiang= Notable changes in the FreeBSD version of this patch: * The MSIX BAR is configurable, like hw.ntb.b2b_mw_idx (msix_mw_idx). The Linux version of the patch only uses BAR4. * MSIX negotiation aborts if the link goes down. Obtained from:Linux (Dual BSD/GPL driver) r300100 (by cem): ntb_hw(4): Add sysctls for administrative/test link config, state dev.ntb_hw.0.admin_up=0/1: Like ifconfig UP/DOWN. dev.ntb_hw.0.active=0/1: Like ifconfig 'status' r300531 (by cem): ntb_hw(4): Only record the first three MSIX vectors Don't overrun the msix_data array by reading the (unused) link state interrupt information. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c == --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Fri Jun 10 18:22:21 2016 (r301810) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Fri Jun 10 18:34:31 2016 (r301811) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -42,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +73,19 @@ __FBSDID("$FreeBSD$"); #define DEVICE2SOFTC(dev) ((struct ntb_softc *) device_get_softc(dev)) +#defineNTB_MSIX_VER_GUARD 0xaabbccdd +#defineNTB_MSIX_RECEIVED 0xe0f0e0f0 +#defineONE_MB (1024u * 1024) + +/* + * PCI constants could be somewhere more generic, but aren't defined/used in + * pci.c. + */ +#definePCI_MSIX_ENTRY_SIZE 16 +#definePCI_MSIX_ENTRY_LOWER_ADDR 0 +#definePCI_MSIX_ENTRY_UPPER_ADDR 4 +#definePCI_MSIX_ENTRY_DATA 8 + enum ntb_device_type { NTB_XEON, NTB_ATOM @@ -95,6 +111,18 @@ enum ntb_bar { NTB_MAX_BARS }; +enum { + NTB_MSIX_GUARD = 0, + NTB_MSIX_DATA0, + NTB_MSIX_DATA1, + NTB_MSIX_DATA2, + NTB_MSIX_OFS0, + NTB_MSIX_OFS1, + NTB_MSIX_OFS2, + NTB_MSIX_DONE, + NTB_MAX_MSIX_SPAD +}; + /* Device features and workarounds */ #define HAS_FEATURE(feature) \ ((ntb->features & (feature)) != 0) @@ -131,6 +159,7 @@ struct ntb_int_info { struct ntb_vec { struct ntb_softc*ntb; uint32_tnum; + unsignedmasked; }; struct ntb_reg { @@ -169,6 +198,11 @@ struct ntb_b2b_addr { uint64_tbar5_addr32; }; +struct ntb_msix_data { + uint32_tnmd_ofs; + uint32_tnmd_data; +}; + struct ntb_softc { device_tdevice; enum ntb_device_typetype; @@ -178,6 +212,13 @@ struct ntb_softc { struct ntb_int_info int_info[MAX_MSIX_INTERRUPTS]; uint32_tallocated_interrupts; + struct ntb_msix_datapeer_msix_data[XEON_NONLINK_DB_MSIX_BITS]; + struct ntb_msix_datamsix_data[XEON_NONLINK_DB_MSIX_BITS]; + boolpeer_msix_good; + boolpeer_msix_done; + struct ntb_pci_bar_info *peer_lapic_bar; + struct callout peer_msix_work; + struct callout heartbeat_timer; struct callout lr_timer; @@ -198,6 +239,7 @@ struct
svn commit: r301810 - stable/9/usr.sbin/rtadvd
Author: ngie Date: Fri Jun 10 18:22:21 2016 New Revision: 301810 URL: https://svnweb.freebsd.org/changeset/base/301810 Log: MFstable/10 r301809: MFC r299513,r299515: r299513 (by cem): rtadvd(8): Don't use-after-free This whole block of code as committed fully formed in r224144. I'm not really sure what the intent was, but it seems plausible that !persist ifis could need other member cleanup. Don't free the object until after we've finished cleaning its members. CID: 1006079 r299515 (by cem): rtadvd(8): Fix use-after-close in cm_handler_client cm_send() closes 'fd' on error. In that case, bail out early without trying to recv from or close 'fd' again. CID: 1006078 Modified: stable/9/usr.sbin/rtadvd/config.c stable/9/usr.sbin/rtadvd/control_client.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/rtadvd/ (props changed) Modified: stable/9/usr.sbin/rtadvd/config.c == --- stable/9/usr.sbin/rtadvd/config.c Fri Jun 10 18:21:05 2016 (r301809) +++ stable/9/usr.sbin/rtadvd/config.c Fri Jun 10 18:22:21 2016 (r301810) @@ -229,7 +229,6 @@ rm_ifinfo(struct ifinfo *ifi) TAILQ_REMOVE(, ifi, ifi_next); syslog(LOG_DEBUG, "<%s>: ifinfo (idx=%d) removed.", __func__, ifi->ifi_ifindex); - free(ifi); } else { /* recreate an empty entry */ update_persist_ifinfo(, ifi->ifi_ifname); @@ -273,6 +272,8 @@ rm_ifinfo(struct ifinfo *ifi) } syslog(LOG_DEBUG, "<%s> leave (%s).", __func__, ifi->ifi_ifname); + if (!ifi->ifi_persist) + free(ifi); return (0); } Modified: stable/9/usr.sbin/rtadvd/control_client.c == --- stable/9/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:21:05 2016 (r301809) +++ stable/9/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:22:21 2016 (r301810) @@ -92,9 +92,11 @@ cm_handler_client(int fd, int state, cha case CM_STATE_MSG_DISPATCH: cm->cm_version = CM_VERSION; error = cm_send(fd, buf); - if (error) + if (error) { syslog(LOG_WARNING, "<%s> cm_send()", __func__); + return (-1); + } state = CM_STATE_ACK_WAIT; break; case CM_STATE_ACK_WAIT: ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301809 - stable/10/usr.sbin/rtadvd
Author: ngie Date: Fri Jun 10 18:21:05 2016 New Revision: 301809 URL: https://svnweb.freebsd.org/changeset/base/301809 Log: MFC r299513,r299515: r299513 (by cem): rtadvd(8): Don't use-after-free This whole block of code as committed fully formed in r224144. I'm not really sure what the intent was, but it seems plausible that !persist ifis could need other member cleanup. Don't free the object until after we've finished cleaning its members. CID: 1006079 r299515 (by cem): rtadvd(8): Fix use-after-close in cm_handler_client cm_send() closes 'fd' on error. In that case, bail out early without trying to recv from or close 'fd' again. CID: 1006078 Modified: stable/10/usr.sbin/rtadvd/config.c stable/10/usr.sbin/rtadvd/control_client.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtadvd/config.c == --- stable/10/usr.sbin/rtadvd/config.c Fri Jun 10 18:13:41 2016 (r301808) +++ stable/10/usr.sbin/rtadvd/config.c Fri Jun 10 18:21:05 2016 (r301809) @@ -229,7 +229,6 @@ rm_ifinfo(struct ifinfo *ifi) TAILQ_REMOVE(, ifi, ifi_next); syslog(LOG_DEBUG, "<%s>: ifinfo (idx=%d) removed.", __func__, ifi->ifi_ifindex); - free(ifi); } else { /* recreate an empty entry */ update_persist_ifinfo(, ifi->ifi_ifname); @@ -273,6 +272,8 @@ rm_ifinfo(struct ifinfo *ifi) } syslog(LOG_DEBUG, "<%s> leave (%s).", __func__, ifi->ifi_ifname); + if (!ifi->ifi_persist) + free(ifi); return (0); } Modified: stable/10/usr.sbin/rtadvd/control_client.c == --- stable/10/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:13:41 2016 (r301808) +++ stable/10/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:21:05 2016 (r301809) @@ -92,9 +92,11 @@ cm_handler_client(int fd, int state, cha case CM_STATE_MSG_DISPATCH: cm->cm_version = CM_VERSION; error = cm_send(fd, buf); - if (error) + if (error) { syslog(LOG_WARNING, "<%s> cm_send()", __func__); + return (-1); + } state = CM_STATE_ACK_WAIT; break; case CM_STATE_ACK_WAIT: ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301808 - stable/10/lib/libc/tests/stdio
Author: ngie Date: Fri Jun 10 18:13:41 2016 New Revision: 301808 URL: https://svnweb.freebsd.org/changeset/base/301808 Log: MFC r299511: r299511 (by cem): print_positional_test: Fix misuse of wchar APIs These APIs take unit length, not byte length parameters. CIDs: 1338543, 1338544, 1338545 Modified: stable/10/lib/libc/tests/stdio/print_positional_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/stdio/print_positional_test.c == --- stable/10/lib/libc/tests/stdio/print_positional_test.c Fri Jun 10 18:12:11 2016(r301807) +++ stable/10/lib/libc/tests/stdio/print_positional_test.c Fri Jun 10 18:13:41 2016(r301808) @@ -32,6 +32,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -94,7 +95,7 @@ ATF_TC_WITHOUT_HEAD(positional_wide); ATF_TC_BODY(positional_wide, tc) { - swprintf(wbuf1, sizeof wbuf1, + swprintf(wbuf1, nitems(wbuf1), L"|xx %1$s %2$s %3$s %4$s\n" "|xx %5$s %6$s %7$s %8$s\n" "|xx %9$s %10$s %11$s %12$s\n" @@ -117,7 +118,7 @@ ATF_TC_BODY(positional_wide, tc) "43", "44", 45, -1L, 1LL, -1, 1LL ); temp = correct; - mbsrtowcs(wbuf2, , sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, , nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } @@ -139,7 +140,7 @@ ATF_TC_BODY(positional_precision_wide, t swprintf(wbuf1, sizeof buf, L"%2$.*4$s %2$.*3$s %1$s", "BSD", "bsd", 2, 1); temp = correct2; - mbsrtowcs(wbuf2, , sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, , nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301807 - stable/9/lib/libmp
Author: ngie Date: Fri Jun 10 18:12:11 2016 New Revision: 301807 URL: https://svnweb.freebsd.org/changeset/base/301807 Log: MFstable/10 r301806: MFC r299510: r299510 (by cem): libmp: Fix trivial buffer overrun fgetln yields a non-NUL-terminated buffer and its length. This routine attempted to NUL-terminate it, but did not allocate space for the NUL. So, allocate space for the NUL. CID: 1017457 Modified: stable/9/lib/libmp/mpasbn.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) Modified: stable/9/lib/libmp/mpasbn.c == --- stable/9/lib/libmp/mpasbn.c Fri Jun 10 18:10:32 2016(r301806) +++ stable/9/lib/libmp/mpasbn.c Fri Jun 10 18:12:11 2016(r301807) @@ -286,10 +286,10 @@ mp_min(MINT *mp) line = fgetln(stdin, ); if (line == NULL) MPERR(("min")); - nline = malloc(linelen); + nline = malloc(linelen + 1); if (nline == NULL) MPERR(("min")); - strncpy(nline, line, linelen); + memcpy(nline, line, linelen); nline[linelen] = '\0'; rmp = _dtom("min", nline); _movem("min", rmp, mp); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301806 - stable/10/lib/libmp
Author: ngie Date: Fri Jun 10 18:10:32 2016 New Revision: 301806 URL: https://svnweb.freebsd.org/changeset/base/301806 Log: MFC r299510: r299510 (by cem): libmp: Fix trivial buffer overrun fgetln yields a non-NUL-terminated buffer and its length. This routine attempted to NUL-terminate it, but did not allocate space for the NUL. So, allocate space for the NUL. CID: 1017457 Modified: stable/10/lib/libmp/mpasbn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmp/mpasbn.c == --- stable/10/lib/libmp/mpasbn.cFri Jun 10 18:07:35 2016 (r301805) +++ stable/10/lib/libmp/mpasbn.cFri Jun 10 18:10:32 2016 (r301806) @@ -286,10 +286,10 @@ mp_min(MINT *mp) line = fgetln(stdin, ); if (line == NULL) MPERR(("min")); - nline = malloc(linelen); + nline = malloc(linelen + 1); if (nline == NULL) MPERR(("min")); - strncpy(nline, line, linelen); + memcpy(nline, line, linelen); nline[linelen] = '\0'; rmp = _dtom("min", nline); _movem("min", rmp, mp); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301805 - stable/10/tests/sys/kern
Author: ngie Date: Fri Jun 10 18:07:35 2016 New Revision: 301805 URL: https://svnweb.freebsd.org/changeset/base/301805 Log: MFC r299508: r299508 (by cem): kern_descrip_test: Fix trivial buffer overrun with readlink(2) CID: 1229965, 1229972 Modified: stable/10/tests/sys/kern/kern_descrip_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/kern_descrip_test.c == --- stable/10/tests/sys/kern/kern_descrip_test.cFri Jun 10 18:04:54 2016(r301804) +++ stable/10/tests/sys/kern/kern_descrip_test.cFri Jun 10 18:07:35 2016(r301805) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -170,7 +171,7 @@ ATF_TC_CLEANUP(kern_maxfiles__increase, char buf[80]; if ((n = readlink(VALUE, buf, sizeof(buf))) > 0) { - buf[n] = '\0'; + buf[MIN((size_t)n, sizeof(buf) - 1)] = '\0'; if (sscanf(buf, "%d", ) == 1) { oldlen = sizeof(oldmaxfiles); (void) sysctlbyname("kern.maxfiles", NULL, 0, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301804 - stable/9/usr.sbin/rtadvd
Author: ngie Date: Fri Jun 10 18:04:54 2016 New Revision: 301804 URL: https://svnweb.freebsd.org/changeset/base/301804 Log: MFstable/10 r301803: MFC r299507: r299507 (by cem): rtadvd(8): Fix a typo in full msg receive logic Check against the size of the struct, not the pointer. Previously, a message with a cm_len between 9 and 23 (inclusive) could cause int msglen to underflow and read(2) to be invoked with msglen size (implicitly cast to signed), overrunning the caller-provided buffer. All users of cm_recv() supply a stack buffer. On the other hand, the rtadvd control socket appears to only be writable by the owner, who is probably root. While here, correct some types to be size_t or ssize_t. CID: 1008477 Security: unix socket remotes may overflow stack in rtadvd Modified: stable/9/usr.sbin/rtadvd/control.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/rtadvd/ (props changed) Modified: stable/9/usr.sbin/rtadvd/control.c == --- stable/9/usr.sbin/rtadvd/control.c Fri Jun 10 18:02:51 2016 (r301803) +++ stable/9/usr.sbin/rtadvd/control.c Fri Jun 10 18:04:54 2016 (r301804) @@ -59,7 +59,7 @@ int cm_recv(int fd, char *buf) { - int n; + ssize_t n; struct ctrl_msg_hdr *cm; char *msg; struct pollfd pfds[1]; @@ -98,7 +98,7 @@ cm_recv(int fd, char *buf) } } - if (n != sizeof(*cm)) { + if (n != (ssize_t)sizeof(*cm)) { syslog(LOG_WARNING, "<%s> received a too small message.", __func__); goto cm_recv_err; @@ -123,11 +123,11 @@ cm_recv(int fd, char *buf) "<%s> ctrl msg received: type=%d", __func__, cm->cm_type); - if (cm->cm_len > sizeof(cm)) { - int msglen = cm->cm_len - sizeof(*cm); + if (cm->cm_len > sizeof(*cm)) { + size_t msglen = cm->cm_len - sizeof(*cm); syslog(LOG_DEBUG, - "<%s> ctrl msg has payload (len=%d)", __func__, + "<%s> ctrl msg has payload (len=%zu)", __func__, msglen); for (;;) { @@ -153,7 +153,7 @@ cm_recv(int fd, char *buf) } break; } - if (n != msglen) { + if (n != (ssize_t)msglen) { syslog(LOG_WARNING, "<%s> payload size mismatch.", __func__); goto cm_recv_err; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301803 - stable/10/usr.sbin/rtadvd
Author: ngie Date: Fri Jun 10 18:02:51 2016 New Revision: 301803 URL: https://svnweb.freebsd.org/changeset/base/301803 Log: MFC r299507: r299507 (by cem): rtadvd(8): Fix a typo in full msg receive logic Check against the size of the struct, not the pointer. Previously, a message with a cm_len between 9 and 23 (inclusive) could cause int msglen to underflow and read(2) to be invoked with msglen size (implicitly cast to signed), overrunning the caller-provided buffer. All users of cm_recv() supply a stack buffer. On the other hand, the rtadvd control socket appears to only be writable by the owner, who is probably root. While here, correct some types to be size_t or ssize_t. CID: 1008477 Security: unix socket remotes may overflow stack in rtadvd Modified: stable/10/usr.sbin/rtadvd/control.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtadvd/control.c == --- stable/10/usr.sbin/rtadvd/control.c Fri Jun 10 17:59:30 2016 (r301802) +++ stable/10/usr.sbin/rtadvd/control.c Fri Jun 10 18:02:51 2016 (r301803) @@ -59,7 +59,7 @@ int cm_recv(int fd, char *buf) { - int n; + ssize_t n; struct ctrl_msg_hdr *cm; char *msg; struct pollfd pfds[1]; @@ -98,7 +98,7 @@ cm_recv(int fd, char *buf) } } - if (n != sizeof(*cm)) { + if (n != (ssize_t)sizeof(*cm)) { syslog(LOG_WARNING, "<%s> received a too small message.", __func__); goto cm_recv_err; @@ -123,11 +123,11 @@ cm_recv(int fd, char *buf) "<%s> ctrl msg received: type=%d", __func__, cm->cm_type); - if (cm->cm_len > sizeof(cm)) { - int msglen = cm->cm_len - sizeof(*cm); + if (cm->cm_len > sizeof(*cm)) { + size_t msglen = cm->cm_len - sizeof(*cm); syslog(LOG_DEBUG, - "<%s> ctrl msg has payload (len=%d)", __func__, + "<%s> ctrl msg has payload (len=%zu)", __func__, msglen); for (;;) { @@ -153,7 +153,7 @@ cm_recv(int fd, char *buf) } break; } - if (n != msglen) { + if (n != (ssize_t)msglen) { syslog(LOG_WARNING, "<%s> payload size mismatch.", __func__); goto cm_recv_err; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301802 - stable/9/sys/rpc
Author: ngie Date: Fri Jun 10 17:59:30 2016 New Revision: 301802 URL: https://svnweb.freebsd.org/changeset/base/301802 Log: MFstable/10 r301801: MFC r300836: Quell false positives in svc_vc_create and svc_vc_create_conn with cd and xprt Both cd and xprt will be non-NULL after their respective malloc(9) wrappers are called (mem_alloc and svc_xprt_alloc, which calls mem_alloc) as mem_alloc always gets called with M_WAITOK|M_ZERO today. Thus, testing for them being non-NULL is incorrect -- it misleads Coverity and it misleads the reader. Remove some unnecessary NULL initializations as a follow up to help solidify the fact that these pointers will be initialized properly in sys/rpc/.. with the interfaces the way they are currently. CID: 1007338, 1007339, 1007340 Modified: stable/9/sys/rpc/svc_vc.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/rpc/svc_vc.c == --- stable/9/sys/rpc/svc_vc.c Fri Jun 10 17:57:50 2016(r301801) +++ stable/9/sys/rpc/svc_vc.c Fri Jun 10 17:59:30 2016(r301802) @@ -186,11 +186,11 @@ svc_vc_create(SVCPOOL *pool, struct sock SOCKBUF_UNLOCK(>so_rcv); return (xprt); + cleanup_svc_vc_create: - if (xprt) { - sx_destroy(>xp_lock); - svc_xprt_free(xprt); - } + sx_destroy(>xp_lock); + svc_xprt_free(xprt); + return (NULL); } @@ -200,8 +200,8 @@ cleanup_svc_vc_create: SVCXPRT * svc_vc_create_conn(SVCPOOL *pool, struct socket *so, struct sockaddr *raddr) { - SVCXPRT *xprt = NULL; - struct cf_conn *cd = NULL; + SVCXPRT *xprt; + struct cf_conn *cd; struct sockaddr* sa = NULL; struct sockopt opt; int one = 1; @@ -274,12 +274,10 @@ svc_vc_create_conn(SVCPOOL *pool, struct return (xprt); cleanup_svc_vc_create: - if (xprt) { - sx_destroy(>xp_lock); - svc_xprt_free(xprt); - } - if (cd) - mem_free(cd, sizeof(*cd)); + sx_destroy(>xp_lock); + svc_xprt_free(xprt); + mem_free(cd, sizeof(*cd)); + return (NULL); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301801 - stable/10/sys/rpc
Author: ngie Date: Fri Jun 10 17:57:50 2016 New Revision: 301801 URL: https://svnweb.freebsd.org/changeset/base/301801 Log: MFC r300836: Quell false positives in svc_vc_create and svc_vc_create_conn with cd and xprt Both cd and xprt will be non-NULL after their respective malloc(9) wrappers are called (mem_alloc and svc_xprt_alloc, which calls mem_alloc) as mem_alloc always gets called with M_WAITOK|M_ZERO today. Thus, testing for them being non-NULL is incorrect -- it misleads Coverity and it misleads the reader. Remove some unnecessary NULL initializations as a follow up to help solidify the fact that these pointers will be initialized properly in sys/rpc/.. with the interfaces the way they are currently. CID: 1007338, 1007339, 1007340 Modified: stable/10/sys/rpc/svc_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc_vc.c == --- stable/10/sys/rpc/svc_vc.c Fri Jun 10 17:53:28 2016(r301800) +++ stable/10/sys/rpc/svc_vc.c Fri Jun 10 17:57:50 2016(r301801) @@ -189,11 +189,11 @@ svc_vc_create(SVCPOOL *pool, struct sock SOCKBUF_UNLOCK(>so_rcv); return (xprt); + cleanup_svc_vc_create: - if (xprt) { - sx_destroy(>xp_lock); - svc_xprt_free(xprt); - } + sx_destroy(>xp_lock); + svc_xprt_free(xprt); + return (NULL); } @@ -203,8 +203,8 @@ cleanup_svc_vc_create: SVCXPRT * svc_vc_create_conn(SVCPOOL *pool, struct socket *so, struct sockaddr *raddr) { - SVCXPRT *xprt = NULL; - struct cf_conn *cd = NULL; + SVCXPRT *xprt; + struct cf_conn *cd; struct sockaddr* sa = NULL; struct sockopt opt; int one = 1; @@ -279,12 +279,10 @@ svc_vc_create_conn(SVCPOOL *pool, struct return (xprt); cleanup_svc_vc_create: - if (xprt) { - sx_destroy(>xp_lock); - svc_xprt_free(xprt); - } - if (cd) - mem_free(cd, sizeof(*cd)); + sx_destroy(>xp_lock); + svc_xprt_free(xprt); + mem_free(cd, sizeof(*cd)); + return (NULL); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301800 - head/sys/rpc
Author: ngie Date: Fri Jun 10 17:53:28 2016 New Revision: 301800 URL: https://svnweb.freebsd.org/changeset/base/301800 Log: Deobfuscate cleanup path in clnt_bck_create(..) Similar to r300836, cl and ct will always be non-NULL as they're allocated using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`. Deobfuscating the cleanup path fixes a leak where if cl was NULL and ct was not, ct would not be free'd, and also removes a duplicate test for cl not being NULL. Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D6801 MFC after: 1 week Reported by: Coverity CID: 122 Reviewed by: cem Sponsored by: EMC / Isilon Storage Division Modified: head/sys/rpc/clnt_bck.c Modified: head/sys/rpc/clnt_bck.c == --- head/sys/rpc/clnt_bck.c Fri Jun 10 15:47:20 2016(r301799) +++ head/sys/rpc/clnt_bck.c Fri Jun 10 17:53:28 2016(r301800) @@ -175,14 +175,9 @@ clnt_bck_create( return (cl); err: - if (cl) { - if (ct) { - mtx_destroy(>ct_lock); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); - } + mtx_destroy(>ct_lock); + mem_free(ct, sizeof (struct ct_data)); + mem_free(cl, sizeof (CLIENT)); return (NULL); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301799 - stable/10/sys/dev/sound/pci/hda
Author: ngie Date: Fri Jun 10 15:47:20 2016 New Revision: 301799 URL: https://svnweb.freebsd.org/changeset/base/301799 Log: MFC r299503,r299504: r299503 (by cem): snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter None of the sysctl handlers in hdaa use the arg2 parameter, so just pass zero instead. Additionally, the sizes being passed in were suspect (size of the pointer rather than the value). CIDs: 1007694, 1009679 r299504 (by cem): snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter (again) More of the same sort of issue as r299503, just missed some sysctls added in a different place than the others. CIDs: 1007692, 1009677, 1009678 Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c == --- stable/10/sys/dev/sound/pci/hda/hdaa.c Fri Jun 10 15:42:17 2016 (r301798) +++ stable/10/sys/dev/sound/pci/hda/hdaa.c Fri Jun 10 15:47:20 2016 (r301799) @@ -1553,20 +1553,20 @@ hdaa_widget_parse(struct hdaa_widget *w) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - w, sizeof(w), hdaa_sysctl_caps, "A", "Node capabilities"); + w, 0, hdaa_sysctl_caps, "A", "Node capabilities"); if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { snprintf(buf, sizeof(buf), "nid%d_config", w->nid); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - >wclass.pin.newconf, sizeof(>wclass.pin.newconf), - hdaa_sysctl_config, "A", "Current pin configuration"); + >wclass.pin.newconf, 0, hdaa_sysctl_config, "A", + "Current pin configuration"); snprintf(buf, sizeof(buf), "nid%d_original", w->nid); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - >wclass.pin.original, sizeof(>wclass.pin.original), - hdaa_sysctl_config, "A", "Original pin configuration"); + >wclass.pin.original, 0, hdaa_sysctl_config, "A", + "Original pin configuration"); } hdaa_lock(w->devinfo); } @@ -6641,38 +6641,32 @@ hdaa_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - >newquirks, sizeof(>newquirks), - hdaa_sysctl_quirks, "A", "Configuration options"); + >newquirks, 0, hdaa_sysctl_quirks, "A", + "Configuration options"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpi_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpi_state, "A", "GPI state"); + devinfo, 0, hdaa_sysctl_gpi_state, "A", "GPI state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpio_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpio_state, "A", "GPIO state"); + devinfo, 0, hdaa_sysctl_gpio_state, "A", "GPIO state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpio_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpio_config, "A", "GPIO configuration"); + devinfo, 0, hdaa_sysctl_gpio_config, "A", "GPIO configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpo_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpo_state, "A", "GPO state"); + devinfo, 0, hdaa_sysctl_gpo_state, "A", "GPO state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpo_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpo_config, "A", "GPO configuration"); + devinfo, 0, hdaa_sysctl_gpo_config, "A", "GPO configuration");
svn commit: r301798 - stable/10/lib/libc/tests/nss
Author: ngie Date: Fri Jun 10 15:42:17 2016 New Revision: 301798 URL: https://svnweb.freebsd.org/changeset/base/301798 Log: MFC r299502: r299502 (by cem): nss/gethostby_test: fix broken vector iteration of gethostbyaddr h_aliases h_aliases is a NULL-terminated rather than fixed-length array. nitems() is not a valid way to determine its end; instead, check for NULL. CID: 1346578 Modified: stable/10/lib/libc/tests/nss/gethostby_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/nss/gethostby_test.c == --- stable/10/lib/libc/tests/nss/gethostby_test.c Fri Jun 10 15:05:35 2016(r301797) +++ stable/10/lib/libc/tests/nss/gethostby_test.c Fri Jun 10 15:42:17 2016(r301798) @@ -893,7 +893,7 @@ hostent_test_getnameinfo_eq(struct hoste printf("matched official hostname\n"); #endif } else { - for (i = 0; i < nitems(result->h_aliases); i++) { + for (i = 0; result->h_aliases[i] != NULL; i++) { printf("[%d] resolved: %s\n", i, result->h_aliases[i]); if (strcmp(result->h_aliases[i], ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301797 - head/release/doc/en_US.ISO8859-1/relnotes
Author: lidl Date: Fri Jun 10 15:05:35 2016 New Revision: 301797 URL: https://svnweb.freebsd.org/changeset/base/301797 Log: Relnotes entries for blacklist project Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml == --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 10 15:03:45 2016(r301796) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 10 15:05:35 2016(r301797) @@ -608,6 +608,29 @@ OpenBSM has been updated to version 1.2 alpha 4. + The NetBSD + Project's library and applications + have been ported and integrated into the system. Packet + filtering support for the packet filtering systems + has been implemented. The blacklist + system provides the blacklistd + daemon, the helper script + blacklistd-helper to make changes + to the running packet filter system and the + blacklistctl control program. + A selection of system daemons, including: + fingerd, + ftpd, + rlogind, + rshd, and + sshd have been modified to support + sending notifications to the blacklistd + daemon. + + Support for + the packet filter has been added to the + blacklistd-helper script. + ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301796 - stable/9/etc/defaults
Author: cy Date: Fri Jun 10 15:03:45 2016 New Revision: 301796 URL: https://svnweb.freebsd.org/changeset/base/301796 Log: MFC r301295: Enable daily_ntpd_leapfile_enable by default. Otherwise an expired leapfile will be ignored and ntpd will behave as if it has no leapfile. While here, remove an extraneous blank line. Suggested by: ache Modified: stable/9/etc/defaults/periodic.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/defaults/periodic.conf == --- stable/9/etc/defaults/periodic.conf Fri Jun 10 15:03:18 2016 (r301795) +++ stable/9/etc/defaults/periodic.conf Fri Jun 10 15:03:45 2016 (r301796) @@ -143,7 +143,7 @@ daily_status_named_enable="YES" daily_status_named_usedns="YES"# DNS lookups are ok # 480.leapfile-ntpd -daily_ntpd_leapfile_enable="NO"# Fetch NTP leapfile +daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile daily_ntpd_avoid_congestion="YES" # Avoid congesting # 480.status-ntpd ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301795 - stable/10/etc/defaults
Author: cy Date: Fri Jun 10 15:03:18 2016 New Revision: 301795 URL: https://svnweb.freebsd.org/changeset/base/301795 Log: MFC r301295: Enable daily_ntpd_leapfile_enable by default. Otherwise an expired leapfile will be ignored and ntpd will behave as if it has no leapfile. While here, remove an extraneous blank line. Suggested by: ache Modified: stable/10/etc/defaults/periodic.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/periodic.conf == --- stable/10/etc/defaults/periodic.confFri Jun 10 14:59:11 2016 (r301794) +++ stable/10/etc/defaults/periodic.confFri Jun 10 15:03:18 2016 (r301795) @@ -139,9 +139,8 @@ daily_status_mail_rejects_logs=3# How daily_status_mail_rejects_shorten="NO" # Shorten output # 480.leapfile-ntpd -daily_ntpd_leapfile_enable="NO"# Fetch NTP leapfile +daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile daily_ntpd_avoid_congestion="YES" # Avoid congesting - # leapfile sources # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r301777 - head/lib/libc/stdio
On 10.06.2016 17:14, Pedro Giffuni wrote: >> Because now strcoll_l() is used as before and it is broken in wide char >> converting process. It is broken for _all_, not just for vfscanf() >> ranges. It should never fail with any args. >> Real fix should be in strcoll_l(). >> > > Yes, it is broken as before however the objective of r301461 was only > to address the ABI breakage. If I revert r301777 then I have to backout > r301461 too, and then we have again the ABI breakage. > > I understand you want to fix all but we are under code freeze and > I have to go back to a known working (although still broken) state. I can't make strcoll or vfscanf to drop core in my simple tests. Too little info in the bug report. In any case here is vfscanf.c fix attached (by removing collation range). >> It is dependent. vfscanf() and regcomp() use the same code for range >> collation. If we remove range collation from everywhere, we save >> vfscanf(), but strcoll_l() remains broken. >> >> > > We have had a broken regex for a very long time, and we new that > before collation was introduced. I didn't take that decision but > moving to libtre was a lot more work and we really had to have > collation now. No, we have perfectly working single byte regex with collation ranges for many years until those wchars was invaded the code very recently. Index: vfscanf.c === --- vfscanf.c (revision 301779) +++ vfscanf.c (working copy) @@ -816,9 +816,7 @@ static const u_char * __sccl(char *tab, const u_char *fmt) { - int c, n, v, i; - struct xlocale_collate *table = - (struct xlocale_collate*)__get_locale()->components[XLC_COLLATE]; + int c, n, v; /* first `clear' the whole table */ c = *fmt++; /* first char hat => negated scanset */ @@ -871,29 +869,15 @@ * we just stored in the table (c). */ n = *fmt; - if (n == ']' - || (table->__collate_load_error ? n < c : - __wcollate_range_cmp(table, n, c) < 0 - ) - ) { + if (n == ']' || n < c) { c = '-'; break; /* resume the for(;;) */ } fmt++; - /* fill in the range */ - if (table->__collate_load_error) { - do { - tab[++c] = v; - } while (c < n); - } else { - for (i = 0; i < 256; i ++) - if (__wcollate_range_cmp(table, c, i) < 0 && - __wcollate_range_cmp(table, i, n) <= 0 - ) - tab[i] = v; - } + do {/* fill in the range */ + tab[++c] = v; + } while (c < n); #if 1 /* XXX another disgusting compatibility hack */ - c = n; /* * Alas, the V7 Unix scanf also treats formats * such as [a-c-e] as `the letters a through e'. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301794 - head/usr.sbin/services_mkdb
Author: allanjude Date: Fri Jun 10 14:59:11 2016 New Revision: 301794 URL: https://svnweb.freebsd.org/changeset/base/301794 Log: Fix a miss merge in the services_mkdb(8) man page Restore the cross reference to getservent(3) to the correct line Approved by: re (gjb) Sponsored by: BSDCan Hacker Lounge Modified: head/usr.sbin/services_mkdb/services_mkdb.8 Modified: head/usr.sbin/services_mkdb/services_mkdb.8 == --- head/usr.sbin/services_mkdb/services_mkdb.8 Fri Jun 10 14:51:11 2016 (r301793) +++ head/usr.sbin/services_mkdb/services_mkdb.8 Fri Jun 10 14:59:11 2016 (r301794) @@ -75,6 +75,7 @@ Print the services file to stdout, omitt .El .Pp The databases are used by the C library services routines (see +.Xr getservent 3 ) . .Pp The .Fl b @@ -82,7 +83,6 @@ and .Fl l flags are mutually exclusive. The default byte ordering is the current host order. -.Xr getservent 3 ) . .Sh FILES .Bl -tag -width ".Pa /var/db/services.db.tmp" -compact .It Pa /var/db/services.db ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301793 - stable/10/contrib/atf/atf-c/detail
Author: ngie Date: Fri Jun 10 14:51:11 2016 New Revision: 301793 URL: https://svnweb.freebsd.org/changeset/base/301793 Log: MFC r299496: r299496 (by cem): atf map: Fix double-free in low memory error path If atf_list_append(, X, ) fails, X is freed. Don't free it again. CID: 979936 Modified: stable/10/contrib/atf/atf-c/detail/map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/atf/atf-c/detail/map.c == --- stable/10/contrib/atf/atf-c/detail/map.cFri Jun 10 14:48:10 2016 (r301792) +++ stable/10/contrib/atf/atf-c/detail/map.cFri Jun 10 14:51:11 2016 (r301793) @@ -360,7 +360,6 @@ atf_map_insert(atf_map_t *m, const char if (atf_is_error(err)) { if (managed) free(value); -free(me); } } } else { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301792 - stable/10/crypto/heimdal/lib/krb5
Author: ngie Date: Fri Jun 10 14:48:10 2016 New Revision: 301792 URL: https://svnweb.freebsd.org/changeset/base/301792 Log: MFC r299495: r299495 (by cem): libkrb5: Fix potential double-free If krb5_make_principal fails, tmp_creds.server may remain a pointer to freed memory and then be double-freed. After freeing it the first time, initialize it to NULL, which causes subsequent krb5_free_principal calls to do the right thing. CID: 1273430 Modified: stable/10/crypto/heimdal/lib/krb5/get_cred.c Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/heimdal/lib/krb5/get_cred.c == --- stable/10/crypto/heimdal/lib/krb5/get_cred.cFri Jun 10 14:45:20 2016(r301791) +++ stable/10/crypto/heimdal/lib/krb5/get_cred.cFri Jun 10 14:48:10 2016(r301792) @@ -831,6 +831,7 @@ get_cred_kdc_capath_worker(krb5_context if(strcmp(tgt_inst, server_realm) == 0) break; krb5_free_principal(context, tmp_creds.server); + tmp_creds.server = NULL; ret = krb5_make_principal(context, _creds.server, tgt_inst, KRB5_TGS_NAME, server_realm, NULL); if(ret) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl
On Wed, Jun 08, 2016 at 02:03:53AM +, Mariusz Zaborski wrote: > Author: oshogbo > Date: Wed Jun 8 02:03:53 2016 > New Revision: 301572 > URL: https://svnweb.freebsd.org/changeset/base/301572 > Log: > Add flags to the Casper services. > CASPER_SERVICE_STDIO - Casper will not close the first three descriptors > (stdin, > stdout and stderr) this can be helpful for debugging. > CASPER_SERVICE_FD - Capser will not close all other descriptors, this can > be useful for a filesystem service. This reminds me that there are some common cases where it is wrong to close descriptors you don't know about. The non-POSIX command diff <(cmd1) <(cmd2) that compares the outputs of the two commands, when executed with bash that was compiled with the full /dev/fd visible (as in poudriere), will actually run something like diff /dev/fd/63 /dev/fd/62 passing two file descriptors to pipes. When created by a shell, these pathnames will start with /dev/fd/, but people could create symlinks to these special files. > [snip] > +static void > +stdnull(void) > +{ > + int fd; > + > + fd = open(_PATH_DEVNULL, O_RDWR); > + if (fd == -1) > + errx(1, "Unable to open %s", _PATH_DEVNULL); > + > + if (setsid() == -1) > + errx(1, "Unable to detach from session"); There is an implicit assumption here that stdnull() is only called from a process that was forked off from here, since setsid() will not and cannot work when called from a process that is already a session leader. If the application is running from a shell, this setsid() will exclude the process from most signals, including terminal ^C/^\/^Z, kill % and hangups. More generally, this might make it more likely for the process to hang around indefinitely after the parent is gone. > + > + if (dup2(fd, STDIN_FILENO) == -1) > + errx(1, "Unable to cover stdin"); > + if (dup2(fd, STDOUT_FILENO) == -1) > + errx(1, "Unable to cover stdout"); > + if (dup2(fd, STDERR_FILENO) == -1) > + errx(1, "Unable to cover stderr"); > + > + close(fd); This was not broken by this commit, but fd should not be closed if it is equal to STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO. > [snip] -- Jilles Tjoelker ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301791 - stable/10/sys/kern
Author: ngie Date: Fri Jun 10 14:45:20 2016 New Revision: 301791 URL: https://svnweb.freebsd.org/changeset/base/301791 Log: MFC r299494: r299494 (by cem): subr_vmem: Fix double-free in error case of vmem_create If vmem_init() fails, 'vm' is already destroyed and freed. Don't free it again. CID: 1042110 Modified: stable/10/sys/kern/subr_vmem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_vmem.c == --- stable/10/sys/kern/subr_vmem.c Fri Jun 10 14:42:36 2016 (r301790) +++ stable/10/sys/kern/subr_vmem.c Fri Jun 10 14:45:20 2016 (r301791) @@ -1046,10 +1046,8 @@ vmem_create(const char *name, vmem_addr_ if (vm == NULL) return (NULL); if (vmem_init(vm, name, base, size, quantum, qcache_max, - flags) == NULL) { - free(vm, M_VMEM); + flags) == NULL) return (NULL); - } return (vm); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301790 - stable/9/usr.sbin/route6d
Author: ngie Date: Fri Jun 10 14:42:36 2016 New Revision: 301790 URL: https://svnweb.freebsd.org/changeset/base/301790 Log: MFstable/10 r301789: MFC r299491: r299491 (by cem): route6d(8): Fix potential double-free In the case that the subsequent sysctl(3) call failed, 'buf' could be free(3)ed repeatedly. It isn't clear to me that that case is possible, but be clear and do the right thing in case it is. CID: 272537 Modified: stable/9/usr.sbin/route6d/route6d.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/route6d/ (props changed) Modified: stable/9/usr.sbin/route6d/route6d.c == --- stable/9/usr.sbin/route6d/route6d.c Fri Jun 10 14:40:41 2016 (r301789) +++ stable/9/usr.sbin/route6d/route6d.c Fri Jun 10 14:42:36 2016 (r301790) @@ -2646,8 +2646,10 @@ krtread(int again) sleep(1); retry++; errmsg = NULL; - if (buf) + if (buf) { free(buf); + buf = NULL; + } if (sysctl(mib, 6, NULL, , NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301789 - stable/10/usr.sbin/route6d
Author: ngie Date: Fri Jun 10 14:40:41 2016 New Revision: 301789 URL: https://svnweb.freebsd.org/changeset/base/301789 Log: MFC r299491: r299491 (by cem): route6d(8): Fix potential double-free In the case that the subsequent sysctl(3) call failed, 'buf' could be free(3)ed repeatedly. It isn't clear to me that that case is possible, but be clear and do the right thing in case it is. CID: 272537 Modified: stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/route6d/route6d.c == --- stable/10/usr.sbin/route6d/route6d.cFri Jun 10 14:33:21 2016 (r301788) +++ stable/10/usr.sbin/route6d/route6d.cFri Jun 10 14:40:41 2016 (r301789) @@ -2602,8 +2602,10 @@ krtread(int again) sleep(1); retry++; errmsg = NULL; - if (buf) + if (buf) { free(buf); + buf = NULL; + } if (sysctl(mib, 6, NULL, , NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301788 - stable/10/sbin/camcontrol
Author: ngie Date: Fri Jun 10 14:33:21 2016 New Revision: 301788 URL: https://svnweb.freebsd.org/changeset/base/301788 Log: MFC r299490: r299490 (by cem): camcontrol(8): Fix another trivial double-free CID: 1331222 Modified: stable/10/sbin/camcontrol/fwdownload.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/fwdownload.c == --- stable/10/sbin/camcontrol/fwdownload.c Fri Jun 10 14:31:59 2016 (r301787) +++ stable/10/sbin/camcontrol/fwdownload.c Fri Jun 10 14:33:21 2016 (r301788) @@ -488,6 +488,7 @@ fw_validate_ibm(struct cam_device *dev, CAM_EPF_ALL, stderr); cam_freeccb(ccb); + ccb = NULL; goto bailout; } @@ -549,7 +550,8 @@ fw_validate_ibm(struct cam_device *dev, fprintf(stdout, "Firmware file is valid for this drive.\n"); retval = 0; bailout: - cam_freeccb(ccb); + if (ccb != NULL) + cam_freeccb(ccb); return (retval); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301787 - head/usr.sbin/bsdinstall/scripts
Author: allanjude Date: Fri Jun 10 14:31:59 2016 New Revision: 301787 URL: https://svnweb.freebsd.org/changeset/base/301787 Log: Fix bsdinstall for root-on-zfs with MBR partitioning Fix an error where vfs.root.mountfrom was not always set as required when creating a bootpool. After the recent geliboot changes, it was only set if the main pool was encrypted. Also resolve an error where the bootpool was unmounted twice causing bsdinstall to stop with an error message about the failed command. Approved by: re (gjb) Sponsored by: BSDCan Hacker Lounge Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot == --- head/usr.sbin/bsdinstall/scripts/zfsbootFri Jun 10 14:31:03 2016 (r301786) +++ head/usr.sbin/bsdinstall/scripts/zfsbootFri Jun 10 14:31:59 2016 (r301787) @@ -1194,11 +1194,6 @@ zfs_create_boot() f_eval_catch $funcname chmod "$CHMOD_MODE" \ go-wrx "$bootpool/$zroot_key" || return $FAILURE - else - # Clean up - f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ -"$bootpool_name" || return $FAILURE - f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi fi @@ -1409,6 +1404,11 @@ zfs_create_boot() "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ "$zroot_name" || return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_eval_catch $funcname printf "$PRINTF_CONF" \ + vfs.root.mountfrom "\"zfs:$zroot_name/$zroot_bootfs\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE + fi # # Set canmount=noauto so that the default Boot Environment (BE) does not # get mounted if a different BE is selected from the beastie menu @@ -1486,10 +1486,6 @@ zfs_create_boot() $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE done - f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - "\"zfs:$zroot_name/$zroot_bootfs\"" \ - $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE - return $SUCCESS } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301786 - stable/10/sbin/camcontrol
Author: ngie Date: Fri Jun 10 14:31:03 2016 New Revision: 301786 URL: https://svnweb.freebsd.org/changeset/base/301786 Log: MFC r299489: r299489 (by cem): camcontrol(8): Fix trival double-free CID: 1331223 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 Fri Jun 10 14:27:56 2016 (r301785) +++ stable/10/sbin/camcontrol/camcontrol.c Fri Jun 10 14:31:03 2016 (r301786) @@ -4992,6 +4992,7 @@ dev_has_vpd_page(struct cam_device *dev, if (cam_send_ccb(dev, ccb) < 0) { cam_freeccb(ccb); + ccb = NULL; retval = -1; goto bailout; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301785 - stable/9/usr.sbin/makefs/ffs
Author: ngie Date: Fri Jun 10 14:27:56 2016 New Revision: 301785 URL: https://svnweb.freebsd.org/changeset/base/301785 Log: MFstable/10 r301784: MFC r299461: r299461 (by cem): ffs_bswap: Copy one UFS dinode member at a time No functional change. CIDs: 974635, 974636, 977396, 977397, 977398, 977399 Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c == --- stable/9/usr.sbin/makefs/ffs/ffs_bswap.cFri Jun 10 14:13:24 2016 (r301784) +++ stable/9/usr.sbin/makefs/ffs/ffs_bswap.cFri Jun 10 14:27:56 2016 (r301785) @@ -135,7 +135,8 @@ ffs_dinode1_swap(struct ufs1_dinode *o, n->di_mtimensec = bswap32(o->di_mtimensec); n->di_ctime = bswap32(o->di_ctime); n->di_ctimensec = bswap32(o->di_ctimensec); - memcpy(n->di_db, o->di_db, (NDADDR + NIADDR) * sizeof(u_int32_t)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); n->di_flags = bswap32(o->di_flags); n->di_blocks = bswap32(o->di_blocks); n->di_gen = bswap32(o->di_gen); @@ -165,7 +166,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, n->di_kernflags = bswap32(o->di_kernflags); n->di_flags = bswap32(o->di_flags); n->di_extsize = bswap32(o->di_extsize); - memcpy(n->di_extb, o->di_extb, (NXADDR + NDADDR + NIADDR) * 8); + memcpy(n->di_extb, o->di_extb, sizeof(n->di_extb)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); } void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r301777 - head/lib/libc/stdio
On 06/10/16 07:19, Andrey Chernov wrote: On 10.06.2016 15:03, Pedro Giffuni wrote: (Sorry I have been offline/sleep for a while) Hello; I cannot back this out because of this report: http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454 This change only re-states what has been working before the ABI breakage fix in r301461. Because now strcoll_l() is used as before and it is broken in wide char converting process. It is broken for _all_, not just for vfscanf() ranges. It should never fail with any args. Real fix should be in strcoll_l(). Yes, it is broken as before however the objective of r301461 was only to address the ABI breakage. If I revert r301777 then I have to backout r301461 too, and then we have again the ABI breakage. I understand you want to fix all but we are under code freeze and I have to go back to a known working (although still broken) state. The fix to regex is completely independent. It is dependent. vfscanf() and regcomp() use the same code for range collation. If we remove range collation from everywhere, we save vfscanf(), but strcoll_l() remains broken. We have had a broken regex for a very long time, and we new that before collation was introduced. I didn't take that decision but moving to libtre was a lot more work and we really had to have collation now. Pedro. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301784 - stable/10/usr.sbin/makefs/ffs
Author: ngie Date: Fri Jun 10 14:13:24 2016 New Revision: 301784 URL: https://svnweb.freebsd.org/changeset/base/301784 Log: MFC r299461: r299461 (by cem): ffs_bswap: Copy one UFS dinode member at a time No functional change. CIDs: 974635, 974636, 977396, 977397, 977398, 977399 Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c == --- stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Fri Jun 10 14:10:51 2016 (r301783) +++ stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Fri Jun 10 14:13:24 2016 (r301784) @@ -135,7 +135,8 @@ ffs_dinode1_swap(struct ufs1_dinode *o, n->di_mtimensec = bswap32(o->di_mtimensec); n->di_ctime = bswap32(o->di_ctime); n->di_ctimensec = bswap32(o->di_ctimensec); - memcpy(n->di_db, o->di_db, (NDADDR + NIADDR) * sizeof(u_int32_t)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); n->di_flags = bswap32(o->di_flags); n->di_blocks = bswap32(o->di_blocks); n->di_gen = bswap32(o->di_gen); @@ -165,7 +166,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, n->di_kernflags = bswap32(o->di_kernflags); n->di_flags = bswap32(o->di_flags); n->di_extsize = bswap32(o->di_extsize); - memcpy(n->di_extb, o->di_extb, (NXADDR + NDADDR + NIADDR) * 8); + memcpy(n->di_extb, o->di_extb, sizeof(n->di_extb)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); } void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301783 - stable/9/sbin/fsck_ffs
Author: ngie Date: Fri Jun 10 14:10:51 2016 New Revision: 301783 URL: https://svnweb.freebsd.org/changeset/base/301783 Log: MFstable/10 r301782: MFC r299460: r299460 (by cem): fsck_ffs: Don't overrun mount device buffer Maybe this case is impossible. Either way, when attempting to "/dev/"-prefix a non-global device name, check that we do not overrun the f_mntfromname buffer. In this case, truncating (with strlcpy or similar) would not be useful, since the f_mntfromname result of getmntpt() is passed directly to open(2) later. CID: 1006789 Modified: stable/9/sbin/fsck_ffs/main.c Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/fsck_ffs/ (props changed) Modified: stable/9/sbin/fsck_ffs/main.c == --- stable/9/sbin/fsck_ffs/main.c Fri Jun 10 14:08:41 2016 (r301782) +++ stable/9/sbin/fsck_ffs/main.c Fri Jun 10 14:10:51 2016 (r301783) @@ -627,6 +627,9 @@ getmntpt(const char *name) statfsp = [i]; ddevname = statfsp->f_mntfromname; if (*ddevname != '/') { + if (strlen(_PATH_DEV) + strlen(ddevname) + 1 > + sizeof(statfsp->f_mntfromname)) + continue; strcpy(device, _PATH_DEV); strcat(device, ddevname); strcpy(statfsp->f_mntfromname, device); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301782 - stable/10/sbin/fsck_ffs
Author: ngie Date: Fri Jun 10 14:08:41 2016 New Revision: 301782 URL: https://svnweb.freebsd.org/changeset/base/301782 Log: MFC r299460: r299460 (by cem): fsck_ffs: Don't overrun mount device buffer Maybe this case is impossible. Either way, when attempting to "/dev/"-prefix a non-global device name, check that we do not overrun the f_mntfromname buffer. In this case, truncating (with strlcpy or similar) would not be useful, since the f_mntfromname result of getmntpt() is passed directly to open(2) later. CID: 1006789 Modified: stable/10/sbin/fsck_ffs/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_ffs/main.c == --- stable/10/sbin/fsck_ffs/main.c Fri Jun 10 14:06:16 2016 (r301781) +++ stable/10/sbin/fsck_ffs/main.c Fri Jun 10 14:08:41 2016 (r301782) @@ -644,6 +644,9 @@ getmntpt(const char *name) statfsp = [i]; ddevname = statfsp->f_mntfromname; if (*ddevname != '/') { + if (strlen(_PATH_DEV) + strlen(ddevname) + 1 > + sizeof(statfsp->f_mntfromname)) + continue; strcpy(device, _PATH_DEV); strcat(device, ddevname); strcpy(statfsp->f_mntfromname, device); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301781 - stable/9/sys/netipsec
Author: ngie Date: Fri Jun 10 14:06:16 2016 New Revision: 301781 URL: https://svnweb.freebsd.org/changeset/base/301781 Log: MFstable/10 r301780: MFC r299387: r299387 (by cem): netipsec: Fix minor style nit Coverity points out that 'continue' is equivalent to 'break' in a do {} while(false) loop. CID: 1354983 Modified: stable/9/sys/netipsec/key.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/key.c == --- stable/9/sys/netipsec/key.c Fri Jun 10 13:57:56 2016(r301780) +++ stable/9/sys/netipsec/key.c Fri Jun 10 14:06:16 2016(r301781) @@ -347,7 +347,7 @@ do { \ if ((head) != (sav)) { \ ipseclog((LOG_DEBUG, "%s: state mismatched (TREE=%d SA=%d)\n", \ (name), (head), (sav)));\ - continue; \ + break; \ } \ } while (0) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301780 - stable/10/sys/netipsec
Author: ngie Date: Fri Jun 10 13:57:56 2016 New Revision: 301780 URL: https://svnweb.freebsd.org/changeset/base/301780 Log: MFC r299387: r299387 (by cem): netipsec: Fix minor style nit Coverity points out that 'continue' is equivalent to 'break' in a do {} while(false) loop. CID: 1354983 Modified: stable/10/sys/netipsec/key.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/key.c == --- stable/10/sys/netipsec/key.cFri Jun 10 08:33:15 2016 (r301779) +++ stable/10/sys/netipsec/key.cFri Jun 10 13:57:56 2016 (r301780) @@ -346,7 +346,7 @@ do { \ if ((head) != (sav)) { \ ipseclog((LOG_DEBUG, "%s: state mismatched (TREE=%d SA=%d)\n", \ (name), (head), (sav)));\ - continue; \ + break; \ } \ } while (0) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r301777 - head/lib/libc/stdio
On 10.06.2016 15:03, Pedro Giffuni wrote: > (Sorry I have been offline/sleep for a while) > > Hello; > > I cannot back this out because of this report: > > http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454 > > This change only re-states what has been working before the ABI breakage > fix in r301461. Because now strcoll_l() is used as before and it is broken in wide char converting process. It is broken for _all_, not just for vfscanf() ranges. It should never fail with any args. Real fix should be in strcoll_l(). > The fix to regex is completely independent. It is dependent. vfscanf() and regcomp() use the same code for range collation. If we remove range collation from everywhere, we save vfscanf(), but strcoll_l() remains broken. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r301777 - head/lib/libc/stdio
(Sorry I have been offline/sleep for a while) Hello; I cannot back this out because of this report: http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454 This change only re-states what has been working before the ABI breakage fix in r301461. The fix to regex is completely independent. Pedro. On 06/10/16 03:20, Andrey Chernov wrote: Please back it out. __sccl() use plain chars, you can't just call wide chars __wcollate_range_cmp() from it. Never intermix plain chars and wide chars without conversion. The problem is somewhere else. The code used for [a-z] ranges in the format. Moreover, even if conversion added this code can't work with wchars by definition since uses the same loop as in regcomp() for (i = 0; i < 256; i ++) Counting completely broken regcomp, our locale quickly becomes intermixing junk of chars and wchars without any conversion. Please anybody stop hacking here, especially blindly adding wchars everywhere without analyzing rest of code. If you see 256 or UCHAR_MAX somewhere, this function can't be converted to wchars. On 10.06.2016 8:21, Pedro F. Giffuni wrote: Author: pfg Date: Fri Jun 10 05:21:52 2016 New Revision: 301777 URL: https://svnweb.freebsd.org/changeset/base/301777 Log: Fix regression from r301461. The fix to the __collate_range_cmp() ABI breakage missed some replacements in libc's vfscanf(). Replace them with __wcollate_range_cmp() which does what is expected. This was breaking applications like xterm and pidgin when using wide characters. Reported by: Vitalij Satanivskij Approved by: re Modified: head/lib/libc/stdio/vfscanf.c Modified: head/lib/libc/stdio/vfscanf.c == --- head/lib/libc/stdio/vfscanf.c Fri Jun 10 04:04:55 2016 (r301776) +++ head/lib/libc/stdio/vfscanf.c Fri Jun 10 05:21:52 2016 (r301777) @@ -873,7 +873,7 @@ doswitch: n = *fmt; if (n == ']' || (table->__collate_load_error ? n < c : - __collate_range_cmp (table, n, c) < 0 + __wcollate_range_cmp(table, n, c) < 0 ) ) { c = '-'; @@ -887,8 +887,8 @@ doswitch: } while (c < n); } else { for (i = 0; i < 256; i ++) - if ( __collate_range_cmp (table, c, i) < 0 - && __collate_range_cmp (table, i, n) <= 0 + if (__wcollate_range_cmp(table, c, i) < 0 && + __wcollate_range_cmp(table, i, n) <= 0 ) tab[i] = v; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301779 - head/share/misc
Author: tz (ports committer) Date: Fri Jun 10 08:33:15 2016 New Revision: 301779 URL: https://svnweb.freebsd.org/changeset/base/301779 Log: - Add myself (tz / Torsten Zuehlsdorff) to ports commiters - Add mentors junovitch, pi, swills Approved by: re (gjb), junovitch (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot == --- head/share/misc/committers-ports.dotFri Jun 10 06:04:53 2016 (r301778) +++ head/share/misc/committers-ports.dotFri Jun 10 08:33:15 2016 (r301779) @@ -226,6 +226,7 @@ tota [label="TAKATSU Tomonari\ntota@Free trasz [label="Edward Tomasz Napierala\ntr...@freebsd.org\n2007/04/12"] trhodes [label="Tom Rhodes\ntrho...@freebsd.org\n2004/07/06"] trociny [label="Mikolaj Golub\ntroc...@freebsd.org\n2013/10/17"] +tz [label="Torsten Zuehlsdorff\n...@freebsd.org\n2016/06/04"] uqs [label="Ulrich Spoerlein\n...@freebsd.org\n2012/01/19"] vd [label="Vasil Dimov\n...@freebsd.org\n2006/01/19"] vg [label="Veniamin Gvozdikov\n...@freebsd.org\n2013/06/11"] @@ -413,6 +414,8 @@ jadawin -> wen joerg -> netchild +junovitch -> tz + knu -> daichi knu -> maho knu -> nobutaka @@ -530,6 +533,8 @@ pgollucci -> swills philip -> koitsu +pi -> tz + rafan -> chinsan rakuco -> alonso @@ -573,6 +578,7 @@ swills -> milki swills -> pclin swills -> robak swills -> rpaulo +swills -> tz swills -> xmj tabthorpe -> ashish ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r301777 - head/lib/libc/stdio
Please back it out. __sccl() use plain chars, you can't just call wide chars __wcollate_range_cmp() from it. Never intermix plain chars and wide chars without conversion. The problem is somewhere else. The code used for [a-z] ranges in the format. Moreover, even if conversion added this code can't work with wchars by definition since uses the same loop as in regcomp() for (i = 0; i < 256; i ++) Counting completely broken regcomp, our locale quickly becomes intermixing junk of chars and wchars without any conversion. Please anybody stop hacking here, especially blindly adding wchars everywhere without analyzing rest of code. If you see 256 or UCHAR_MAX somewhere, this function can't be converted to wchars. On 10.06.2016 8:21, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Jun 10 05:21:52 2016 > New Revision: 301777 > URL: https://svnweb.freebsd.org/changeset/base/301777 > > Log: > Fix regression from r301461. > > The fix to the __collate_range_cmp() ABI breakage missed some replacements > in libc's vfscanf(). Replace them with __wcollate_range_cmp() which > does what is expected. > > This was breaking applications like xterm and pidgin when using wide > characters. > > Reported by:Vitalij Satanivskij > Approved by:re > > Modified: > head/lib/libc/stdio/vfscanf.c > > Modified: head/lib/libc/stdio/vfscanf.c > == > --- head/lib/libc/stdio/vfscanf.c Fri Jun 10 04:04:55 2016 > (r301776) > +++ head/lib/libc/stdio/vfscanf.c Fri Jun 10 05:21:52 2016 > (r301777) > @@ -873,7 +873,7 @@ doswitch: > n = *fmt; > if (n == ']' > || (table->__collate_load_error ? n < c : > - __collate_range_cmp (table, n, c) < 0 > + __wcollate_range_cmp(table, n, c) < 0 > ) > ) { > c = '-'; > @@ -887,8 +887,8 @@ doswitch: > } while (c < n); > } else { > for (i = 0; i < 256; i ++) > - if ( __collate_range_cmp (table, c, > i) < 0 > - && __collate_range_cmp (table, i, > n) <= 0 > + if (__wcollate_range_cmp(table, c, i) < > 0 && > + __wcollate_range_cmp(table, i, n) > <= 0 > ) > tab[i] = v; > } > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r301778 - in head: etc/mtree include sys/cam sys/cam/nvme sys/conf sys/dev/nvme
Author: imp Date: Fri Jun 10 06:04:53 2016 New Revision: 301778 URL: https://svnweb.freebsd.org/changeset/base/301778 Log: Commit the bits of nda that were missed. This should fix the build. Approved by: re@ Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/cam/cam_ccb.h head/sys/cam/nvme/nvme_xpt.c head/sys/conf/files head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_ns_cmd.c head/sys/dev/nvme/nvme_private.h Modified: head/etc/mtree/BSD.include.dist == --- head/etc/mtree/BSD.include.dist Fri Jun 10 05:21:52 2016 (r301777) +++ head/etc/mtree/BSD.include.dist Fri Jun 10 06:04:53 2016 (r301778) @@ -90,6 +90,8 @@ cam ata .. +nvme +.. scsi .. .. Modified: head/include/Makefile == --- head/include/Makefile Fri Jun 10 05:21:52 2016(r301777) +++ head/include/Makefile Fri Jun 10 06:04:53 2016(r301778) @@ -42,7 +42,7 @@ LHDRS=aio.h errno.h fcntl.h linker_set. LDIRS= bsm cam geom net net80211 netgraph netinet netinet6 \ netipsec netnatm netsmb nfs nfsclient nfsserver sys vm -LSUBDIRS= cam/ata cam/scsi \ +LSUBDIRS= cam/ata cam/nvme cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ dev/hwpmc \ dev/ic dev/iicbus dev/io dev/lmc dev/mfi dev/nvme \ Modified: head/sys/cam/cam_ccb.h == --- head/sys/cam/cam_ccb.h Fri Jun 10 05:21:52 2016(r301777) +++ head/sys/cam/cam_ccb.h Fri Jun 10 06:04:53 2016(r301778) @@ -359,6 +359,8 @@ struct ccb_getdev { u_int8_t serial_num[252]; u_int8_t inq_flags; u_int8_t serial_num_len; + const struct nvme_controller_data *nvme_cdata; + const struct nvme_namespace_data*nvme_data; }; /* Device Statistics CCB */ @@ -619,6 +621,11 @@ struct ccb_pathinq_settings_fc { struct ccb_pathinq_settings_sas { u_int32_t bitrate; /* Mbps */ }; + +struct ccb_pathinq_settings_nvme { + uint16_t nsid; /* Namespace ID for this path */ +}; + #definePATHINQ_SETTINGS_SIZE 128 struct ccb_pathinq { @@ -649,6 +656,7 @@ struct ccb_pathinq { struct ccb_pathinq_settings_spi spi; struct ccb_pathinq_settings_fc fc; struct ccb_pathinq_settings_sas sas; + struct ccb_pathinq_settings_nvme nvme; char ccb_pathinq_settings_opaque[PATHINQ_SETTINGS_SIZE]; } xport_specific; u_int maxio; /* Max supported I/O size, in bytes. */ @@ -975,6 +983,18 @@ struct ccb_trans_settings_sata { #defineCTS_SATA_CAPS_D_APST0x0002 }; +struct ccb_trans_settings_nvme +{ + u_int valid; /* Which fields to honor */ +#define CTS_NVME_VALID_SPEC0x01 +#define CTS_NVME_VALID_CAPS0x02 + u_int spec_major; /* Major version of spec supported */ + u_int spec_minor; /* Minor verison of spec supported */ + u_int spec_tiny; /* Tiny version of spec supported */ + u_int max_xfer; /* Max transfer size (0 -> unlimited */ + u_int caps; +}; + /* Get/Set transfer rate/width/disconnection/tag queueing settings */ struct ccb_trans_settings { structccb_hdr ccb_h; @@ -987,6 +1007,7 @@ struct ccb_trans_settings { u_int valid; /* Which fields to honor */ struct ccb_trans_settings_ata ata; struct ccb_trans_settings_scsi scsi; + struct ccb_trans_settings_nvme nvme; } proto_specific; union { u_int valid; /* Which fields to honor */ @@ -995,6 +1016,7 @@ struct ccb_trans_settings { struct ccb_trans_settings_sas sas; struct ccb_trans_settings_pata ata; struct ccb_trans_settings_sata sata; + struct ccb_trans_settings_nvme nvme; } xport_specific; }; Modified: head/sys/cam/nvme/nvme_xpt.c == --- head/sys/cam/nvme/nvme_xpt.cFri Jun 10 05:21:52 2016 (r301777) +++ head/sys/cam/nvme/nvme_xpt.cFri Jun 10 06:04:53 2016 (r301778) @@ -137,7 +137,7 @@ static cam_status nvme_probe_register(st static void nvme_probe_schedule(struct cam_periph *nvme_probe_periph); static void nvme_probe_start(struct cam_periph *periph, union ccb *start_ccb); static void nvme_probe_cleanup(struct cam_periph *periph); -static void nvme_find_quirk(struct cam_ed *device); +//static void nvme_find_quirk(struct