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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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 = &np[1])); /* XXX: overlapping string copy */ ___ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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(&exp); + + if (exp.X_op != O_constant) + as_bad("constant expression required"); + else + emit_expr(&exp, 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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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, &ioat_channel_index, 0, +static unsigned ioat_channel_index = 0; +SYSCTL_UINT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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 ntb_softc { /* Memo
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(&ifilist, 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(&ifilist, 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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, 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, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } ___ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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, &linelen); 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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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", &oldmaxfiles) == 1) { oldlen = sizeof(oldmaxfiles); (void) sysctlbyname("kern.maxfiles", NULL, 0, ___ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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->so_rcv); return (xprt); + cleanup_svc_vc_create: - if (xprt) { - sx_destroy(&xprt->xp_lock); - svc_xprt_free(xprt); - } + sx_destroy(&xprt->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(&xprt->xp_lock); - svc_xprt_free(xprt); - } - if (cd) - mem_free(cd, sizeof(*cd)); + sx_destroy(&xprt->xp_lock); + svc_xprt_free(xprt); + mem_free(cd, sizeof(*cd)); + return (NULL); } ___ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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, - &w->wclass.pin.newconf, sizeof(&w->wclass.pin.newconf), - hdaa_sysctl_config, "A", "Current pin configuration"); + &w->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, - &w->wclass.pin.original, sizeof(&w->wclass.pin.original), - hdaa_sysctl_config, "A", "Original pin configuration"); + &w->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, - &devinfo->newquirks, sizeof(&devinfo->newquirks), - hdaa_sysctl_quirks, "A", "Configuration options"); + &devinfo->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", "G
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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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, &tmp_creds.server, tgt_inst, KRB5_TGS_NAME, server_realm, NULL); if(ret) { ___ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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, &msize, NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; ___ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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 = &mntbuf[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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"