svn commit: r287199 - in stable/10: lib/libc/sys sys/kern
Author: kib Date: Thu Aug 27 09:06:14 2015 New Revision: 287199 URL: https://svnweb.freebsd.org/changeset/base/287199 Log: MFC r286975: Remove the wrong asserts. Modified: stable/10/lib/libc/sys/procctl.2 stable/10/sys/kern/kern_procctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/procctl.2 == --- stable/10/lib/libc/sys/procctl.2Thu Aug 27 08:58:03 2015 (r287198) +++ stable/10/lib/libc/sys/procctl.2Thu Aug 27 09:06:14 2015 (r287199) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 29, 2014 +.Dd August 21, 2015 .Dt PROCCTL 2 .Os .Sh NAME @@ -148,7 +148,11 @@ The specified process is the root of the .El The .Fa rs_children -field returns the number of children of the reaper. +field returns the number of children of the reaper among the descendands. +It is possible to have a child which reaper is not the specified process, +since the reaper for the existing children is not reset on the +.Dv PROC_REAP_ACQUIRE +operation. The .Fa rs_descendants field returns the total number of descendants of the reaper(s), Modified: stable/10/sys/kern/kern_procctl.c == --- stable/10/sys/kern/kern_procctl.c Thu Aug 27 08:58:03 2015 (r287198) +++ stable/10/sys/kern/kern_procctl.c Thu Aug 27 09:06:14 2015 (r287199) @@ -187,8 +187,6 @@ reap_status(struct thread *td, struct pr } } else { rs->rs_pid = -1; - KASSERT(LIST_EMPTY(&reap->p_reaplist), ("reap children list")); - KASSERT(LIST_EMPTY(&reap->p_children), ("children list")); } return (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: r287203 - in stable/10: sbin/camcontrol sys/cam/scsi
Author: ken Date: Thu Aug 27 13:17:05 2015 New Revision: 287203 URL: https://svnweb.freebsd.org/changeset/base/287203 Log: MFC, r286965: r286965 | ken | 2015-08-20 10:07:51 -0600 (Thu, 20 Aug 2015) | 297 lines Revamp camcontrol(8) fwdownload support and add the opcodes subcommand. The significant changes and bugs fixed here are: 1. Fixed a bug in the progress display code: When the user's filename is too big, or his terminal width is too small, the progress code could wind up using a negative number for the length of the "stars" that it uses to indicate progress. This negative value was assigned to an unsigned variable, resulting in a very large positive value. The result is that we wound up writing garbage from memory to the user's terminal. With an 80 column terminal, a file name length of more than 35 characters would generate this problem. To address this, we now set a minimum progress bar length, and truncate the user's file name as needed. This has been tested with large filenames and small terminals, and at least produces reasonable results. If the terminal is too narrow, the progress display takes up an additional line with each update, but this is more user friendly than writing garbage to the tty. 2. SATA drives connected via a SATA controller didn't have SCSI Inquiry data populated in struct cam_device. This meant that the code in fw_get_vendor() in fwdownload.c would try to match a zero-length vendor ID, and so return the first entry in the vendor table. (Which used to be HITACHI.) Fixed by grabbing identify data, passing the identify buffer into fw_get_vendor(), and matching against the model name. 3. SATA drives connected via a SAS controller do have Inquiry data populated. The table included a couple of entries -- "ATA ST" and "ATA HDS", intended to handle Seagate and Hitachi SATA drives attached via a SAS controller. SCSI to ATA translation layers use a vendor ID of "ATA" (which is standard), and then the model name from the ATA identify data as the SCSI product name when they are returning data on SATA disks. The cam_strmatch code will match the first part of the string (because the length it is given is the length of the vendor, "ATA"), and return 0 (i.e. a match). So all SATA drives attached to a SAS controller would be programmed using the Seagate method (WRITE BUFFER mode 7) of SCSI firmware downloading. 4. Issue #2 above covered up a bug in fw_download_img() -- if the maximum packet size in the vendor table was 0, it tried to default to a packet size of 32K. But then it didn't actually succeed in doing that, because it set the packet size to the value that was in the vendor table (0). Now that we actually have ATA attached drives fall use the VENDOR_ATA case, we need a reasonable default packet size. So this is fixed to properly set the default packet size. 5. Add support for downloading firmware to IBM LTO drives, and add a firmware file validation method to make sure that the firmware file matches the drive type. IBM tape drives include a Load ID and RU name in their vendor-specific VPD page 0x3. Those should match the IDs in the header of the firmware file to insure that the proper firmware file is loaded. 6. This also adds a new -q option to the camcontrol fwdownload subcommand to suppress informational output. When -q is used in combination with -y, the firmware upgrade will happen without prompting and without output except if an error condition occurs. 7. Re-add support for printing out SCSI inquiry information when asking the user to confirm that they want to download firmware, and add printing of ATA Identify data if it is a SATA disk. This was removed in r237281 when support for flashing ATA disks was added. 8. Add a new camcontrol(8) "opcodes" subcommand, and use the underlying code to get recommended timeout values for drive firmware downloads. Many SCSI devices support the REPORT SUPPORTED OPERATION CODES command, and some support the optional timeout descriptor that specifies nominal and recommended timeouts for the commands supported by the device. The new camcontrol opcodes subcommand allows displaying all opcodes supported by a drive, information about which fields in a SCSI CDB are actually used by a given SCSI device, and the nominal and recommended timeout values for each command. Since firmware downloads can take a long time in some devices, and the
svn commit: r287207 - stable/10/sys/netpfil/pf
Author: loos Date: Thu Aug 27 14:07:28 2015 New Revision: 287207 URL: https://svnweb.freebsd.org/changeset/base/287207 Log: MFC r287119: Reapply r196551 which was accidentally reverted by r223637 (update to OpenBSD pf 4.5). Fix argument ordering to memcpy as well as the size of the copy in the (theoretical) case that pfi_buffer_cnt should be greater than ~_max. This fix the failure when you hit the self table size and force it to be resized. Sponsored by: Rubicon Communications (Netgate) Modified: stable/10/sys/netpfil/pf/pf_if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_if.c == --- stable/10/sys/netpfil/pf/pf_if.cThu Aug 27 14:00:23 2015 (r287206) +++ stable/10/sys/netpfil/pf/pf_if.cThu Aug 27 14:07:28 2015 (r287207) @@ -578,7 +578,7 @@ pfi_address_add(struct sockaddr *sa, int __func__, V_pfi_buffer_cnt, PFI_BUFFER_MAX); return; } - memcpy(V_pfi_buffer, p, V_pfi_buffer_cnt * sizeof(*V_pfi_buffer)); + memcpy(p, V_pfi_buffer, V_pfi_buffer_max * sizeof(*V_pfi_buffer)); /* no need to zero buffer */ free(V_pfi_buffer, PFI_MTYPE); V_pfi_buffer = p; ___ 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: r287210 - in stable: 10/release/doc/share/xml 9/release/doc/share/xml
Author: gjb Date: Thu Aug 27 15:21:58 2015 New Revision: 287210 URL: https://svnweb.freebsd.org/changeset/base/287210 Log: Document SA-15:21, SA-15:22, EN-15:15. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/errata.xml stable/10/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/9/release/doc/share/xml/errata.xml stable/9/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/errata.xml == --- stable/10/release/doc/share/xml/errata.xml Thu Aug 27 15:16:41 2015 (r287209) +++ stable/10/release/doc/share/xml/errata.xml Thu Aug 27 15:21:58 2015 (r287210) @@ -41,6 +41,14 @@ Allow size argument to &man.vidcontrol.1; for &man.syscons.4;. + + + FreeBSD-EN-15:15.pkg + 25 August 2015 + Insufficient check of supported &man.pkg.7; + signature methods. + Modified: stable/10/release/doc/share/xml/security.xml == --- stable/10/release/doc/share/xml/security.xmlThu Aug 27 15:16:41 2015(r287209) +++ stable/10/release/doc/share/xml/security.xmlThu Aug 27 15:21:58 2015(r287210) @@ -25,6 +25,13 @@ Fix multiple integer overflows in &man.libbsdxml.3;. + + + FreeBSD-SA-15:22.openssh + 25 August 2015 + Multiple vulnerabilities + ___ 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: r287215 - stable/10/share/man/man9
Author: bdrewery Date: Thu Aug 27 16:36:39 2015 New Revision: 287215 URL: https://svnweb.freebsd.org/changeset/base/287215 Log: MFC r286966: Add link for rw_unlock(9) to rwlock(9). Modified: stable/10/share/man/man9/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile == --- stable/10/share/man/man9/Makefile Thu Aug 27 16:27:51 2015 (r287214) +++ stable/10/share/man/man9/Makefile Thu Aug 27 16:36:39 2015 (r287215) @@ -1127,6 +1127,7 @@ MLINKS+=rwlock.9 rw_assert.9 \ rwlock.9 rw_initialized.9 \ rwlock.9 rw_rlock.9 \ rwlock.9 rw_runlock.9 \ + rwlock.9 rw_unlock.9 \ rwlock.9 rw_sleep.9 \ rwlock.9 RW_SYSINIT.9 \ rwlock.9 rw_try_rlock.9 \ ___ 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: r287223 - stable/10/usr.bin/patch
Author: delphij Date: Thu Aug 27 21:52:09 2015 New Revision: 287223 URL: https://svnweb.freebsd.org/changeset/base/287223 Log: MFC r281800 (pfg): patch(1): small include changes. Mostly to match OpenBSD, no functional change. MFC r286601 + 286617: use posix_spawn(3) instead of fork() and exec() manually as suggested by jmg@. Modified: stable/10/usr.bin/patch/inp.c stable/10/usr.bin/patch/pch.c stable/10/usr.bin/patch/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/inp.c == --- stable/10/usr.bin/patch/inp.c Thu Aug 27 21:27:47 2015 (r287222) +++ stable/10/usr.bin/patch/inp.c Thu Aug 27 21:52:09 2015 (r287223) @@ -36,8 +36,10 @@ #include #include #include -#include +#include +#include #include +#include #include #include #include @@ -134,14 +136,13 @@ reallocate_lines(size_t *lines_allocated static bool plan_a(const char *filename) { - int ifd, statfailed, devnull, pstat; + int ifd, statfailed, pstat; char*p, *s, lbuf[INITLINELEN]; struct stat filestat; ptrdiff_t sz; size_t i; size_t iline, lines_allocated; pid_t pid; - char*argp[4] = {NULL}; #ifdef DEBUGGING if (debug & 8) @@ -178,7 +179,9 @@ plan_a(const char *filename) ((filestat.st_mode & 0022) == 0 && filestat.st_uid != getuid())) { char*filebase, *filedir; struct stat cstat; - char *tmp_filename1, *tmp_filename2; + char*tmp_filename1, *tmp_filename2; + char*argp[4] = { NULL }; + posix_spawn_file_actions_t file_actions; tmp_filename1 = strdup(filename); tmp_filename2 = strdup(filename); @@ -188,6 +191,8 @@ plan_a(const char *filename) filebase = basename(tmp_filename1); filedir = dirname(tmp_filename2); + memset(argp, 0, sizeof(argp)); + #define try(f, a1, a2, a3) \ (snprintf(lbuf, sizeof(lbuf), f, a1, a2, a3), stat(lbuf, &cstat) == 0) @@ -213,50 +218,39 @@ plan_a(const char *filename) say("Comparing file %s to default " "RCS version...\n", filename); - switch (pid = fork()) { - case -1: - fatal("can't fork: %s\n", - strerror(errno)); - case 0: - devnull = open("/dev/null", O_RDONLY); - if (devnull == -1) { - fatal("can't open /dev/null: %s", - strerror(errno)); - } - (void)dup2(devnull, STDOUT_FILENO); - argp[0] = strdup(RCSDIFF); - argp[1] = strdup(filename); - execv(RCSDIFF, argp); - exit(127); - } - pid = waitpid(pid, &pstat, 0); - if (pid == -1 || WEXITSTATUS(pstat) != 0) { - fatal("can't check out file %s: " - "differs from default RCS version\n", - filename); - } + argp[0] = __DECONST(char *, RCSDIFF); + argp[1] = __DECONST(char *, filename); + posix_spawn_file_actions_init(&file_actions); + posix_spawn_file_actions_addopen(&file_actions, + STDOUT_FILENO, _PATH_DEVNULL, O_WRONLY, 0); + if (posix_spawn(&pid, RCSDIFF, &file_actions, + NULL, argp, NULL) == 0) { + pid = waitpid(pid, &pstat, 0); + if (pid == -1 || WEXITSTATUS(pstat) != 0) + fatal("can't check out file %s: " + "differs from default RCS version\n", + filename); + } else + fatal("posix_spawn: %s\n", strerror(errno)); + posix_spawn_file_actions_destroy(&file_actions); }
svn commit: r287226 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common
Author: markj Date: Thu Aug 27 23:46:11 2015 New Revision: 287226 URL: https://svnweb.freebsd.org/changeset/base/287226 Log: MFC r286169: Perform bounds checking when constructing a format string. PR: 201657 Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c == --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Thu Aug 27 23:33:38 2015(r287225) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Thu Aug 27 23:46:11 2015(r287226) @@ -1348,6 +1348,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE dtrace_aggdesc_t *agg; caddr_t lim = (caddr_t)buf + len, limit; char format[64] = "%"; + size_t ret; int i, aggrec, curagg = -1; uint64_t normal; @@ -1379,7 +1380,9 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE int prec = pfd->pfd_prec; int rval; + const char *start; char *f = format + 1; /* skip initial '%' */ + size_t fmtsz = sizeof(format) - 1; const dtrace_recdesc_t *rec; dt_pfprint_f *func; caddr_t addr; @@ -1536,6 +1539,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE break; } + start = f; if (pfd->pfd_flags & DT_PFCONV_ALT) *f++ = '#'; if (pfd->pfd_flags & DT_PFCONV_ZPAD) @@ -1548,6 +1552,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE *f++ = '\''; if (pfd->pfd_flags & DT_PFCONV_SPACE) *f++ = ' '; + fmtsz -= f - start; /* * If we're printing a stack and DT_PFCONV_LEFT is set, we @@ -1558,13 +1563,20 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE if (func == pfprint_stack && (pfd->pfd_flags & DT_PFCONV_LEFT)) width = 0; - if (width != 0) - f += snprintf(f, sizeof (format), "%d", ABS(width)); + if (width != 0) { + ret = snprintf(f, fmtsz, "%d", ABS(width)); + f += ret; + fmtsz = MAX(0, fmtsz - ret); + } - if (prec > 0) - f += snprintf(f, sizeof (format), ".%d", prec); + if (prec > 0) { + ret = snprintf(f, fmtsz, ".%d", prec); + f += ret; + fmtsz = MAX(0, fmtsz - ret); + } - (void) strcpy(f, pfd->pfd_fmt); + if (strlcpy(f, pfd->pfd_fmt, fmtsz) >= fmtsz) + return (dt_set_errno(dtp, EDT_COMPILER)); pfd->pfd_rec = rec; if (func(dtp, fp, format, pfd, addr, size, normal) < 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: r287229 - stable/10/sys/ofed/include/linux
Author: markj Date: Thu Aug 27 23:52:53 2015 New Revision: 287229 URL: https://svnweb.freebsd.org/changeset/base/287229 Log: MFC r286418: ipv4_is_zeronet() and ipv4_is_loopback() expect an address in network order, but IN_ZERONET and IN_LOOPBACK expect it in host order. Modified: stable/10/sys/ofed/include/linux/in.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/in.h == --- stable/10/sys/ofed/include/linux/in.h Thu Aug 27 23:46:45 2015 (r287228) +++ stable/10/sys/ofed/include/linux/in.h Thu Aug 27 23:52:53 2015 (r287229) @@ -37,7 +37,7 @@ #include #include -#defineipv4_is_zeronet IN_ZERONET -#defineipv4_is_loopbackIN_LOOPBACK +#defineipv4_is_zeronet(be) IN_ZERONET(ntohl(be)) +#defineipv4_is_loopback(be)IN_LOOPBACK(ntohl(be)) #endif /* _LINUX_IN_H_ */ ___ 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: r287230 - stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace
Author: markj Date: Thu Aug 27 23:55:46 2015 New Revision: 287230 URL: https://svnweb.freebsd.org/changeset/base/287230 Log: MFC r286167: Avoid dereferencing curthread->td_proc->p_cred in DTrace probe context. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c == --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Aug 27 23:52:53 2015(r287229) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Aug 27 23:55:46 2015(r287230) @@ -3510,7 +3510,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst */ if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU)) return ((uint64_t)p0.p_cred->cr_uid); -#endif /* * It is always safe to dereference one's own t_procp pointer: @@ -3522,6 +3521,9 @@ dtrace_dif_variable(dtrace_mstate_t *mst * credential, since this is never NULL after process birth. */ return ((uint64_t)curthread->t_procp->p_cred->cr_uid); +#else + return ((uint64_t)curthread->td_ucred->cr_uid); +#endif case DIF_VAR_GID: if (!dtrace_priv_proc(state)) @@ -3533,7 +3535,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst */ if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU)) return ((uint64_t)p0.p_cred->cr_gid); -#endif /* * It is always safe to dereference one's own t_procp pointer: @@ -3545,6 +3546,9 @@ dtrace_dif_variable(dtrace_mstate_t *mst * credential, since this is never NULL after process birth. */ return ((uint64_t)curthread->t_procp->p_cred->cr_gid); +#else + return ((uint64_t)curthread->td_ucred->cr_gid); +#endif case DIF_VAR_ERRNO: { #if defined(sun) ___ 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: r287231 - stable/10/sys/kern
Author: markj Date: Fri Aug 28 00:06:31 2015 New Revision: 287231 URL: https://svnweb.freebsd.org/changeset/base/287231 Log: MFC r285252: Fix an incorrect assertion in witness. Modified: stable/10/sys/kern/subr_witness.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_witness.c == --- stable/10/sys/kern/subr_witness.c Thu Aug 27 23:55:46 2015 (r287230) +++ stable/10/sys/kern/subr_witness.c Fri Aug 28 00:06:31 2015 (r287231) @@ -1221,7 +1221,7 @@ witness_checkorder(struct lock_object *l for (j = 0, lle = lock_list; lle != NULL; lle = lle->ll_next) { for (i = lle->ll_count - 1; i >= 0; i--, j++) { - MPASS(j < WITNESS_COUNT); + MPASS(j < LOCK_CHILDCOUNT * LOCK_NCHILDREN); lock1 = &lle->ll_children[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"