]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
8 years agoMFC r283929: Correct grdc(1) 12-hour display between 12:00 and 13:00
emaste [Thu, 24 Sep 2015 19:37:34 +0000 (19:37 +0000)]
MFC r283929: Correct grdc(1) 12-hour display between 12:00 and 13:00

PM starts at 12:00, not 13:00.

PR: 194291, 200133
Submitted by: Nick Price

git-svn-id: svn://svn.freebsd.org/base/stable/10@288185 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r256692: Fix .debug_line prologue header length calculation for 64-bit DWARF
emaste [Thu, 24 Sep 2015 19:33:35 +0000 (19:33 +0000)]
MFC r256692: Fix .debug_line prologue header length calculation for 64-bit DWARF

The header_length field is the number of bytes following the field to
the first byte of the line number program.  The hard-coded constants
previously here (4 + 2 + 4) were correct only for 32-bit DWARF.

Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/10@288184 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r256643: makesyscalls.sh: Error on failure to open specified config file
emaste [Thu, 24 Sep 2015 19:32:08 +0000 (19:32 +0000)]
MFC r256643: makesyscalls.sh: Error on failure to open specified config file

git-svn-id: svn://svn.freebsd.org/base/stable/10@288183 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r284551: Import libcxxrt master e64e93f.
emaste [Thu, 24 Sep 2015 19:28:53 +0000 (19:28 +0000)]
MFC r284551: Import libcxxrt master e64e93f.

This includes a number of demangler fixes obtained from upstream
ELF Tool Chain.

PR: 200913
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@288182 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287340: vtfontcvt: fix buffer overflow for non-default size .hex fonts
emaste [Thu, 24 Sep 2015 13:06:19 +0000 (13:06 +0000)]
MFC r287340: vtfontcvt: fix buffer overflow for non-default size .hex fonts

And r287336 which introduced xmalloc.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@288174 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r282916: Add ELF machine EM_IAMCU, 32-bit Intel MCU
emaste [Thu, 24 Sep 2015 12:54:50 +0000 (12:54 +0000)]
MFC r282916: Add ELF machine EM_IAMCU, 32-bit Intel MCU

It is e_machine 6, which was previously reserved for 486.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288173 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287327: ar: Deobfuscate a while loop
emaste [Thu, 24 Sep 2015 12:47:31 +0000 (12:47 +0000)]
MFC r287327: ar: Deobfuscate a while loop

git-svn-id: svn://svn.freebsd.org/base/stable/10@288172 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285841: Add RISC-V ELF machine type definition
emaste [Thu, 24 Sep 2015 12:44:02 +0000 (12:44 +0000)]
MFC r285841: Add RISC-V ELF machine type definition

EM_RISCV is now officially registered as e_machine 243.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@288171 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287886:
smh [Thu, 24 Sep 2015 08:42:08 +0000 (08:42 +0000)]
MFC r287886:

Fix kqueue write events for files > 2GB

Sponsored by: Multiplay

git-svn-id: svn://svn.freebsd.org/base/stable/10@288167 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287634:
delphij [Thu, 24 Sep 2015 00:54:46 +0000 (00:54 +0000)]
MFC r287634:

login.c doesn't really need libutil.h, don't include it.

login_fbtab.c includes paths.h and pathnames.h, and pathnames.h includes
paths.h.  Eliminate the paths.h inclusion in login_fbtab.c.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287633:
delphij [Thu, 24 Sep 2015 00:50:17 +0000 (00:50 +0000)]
MFC r287633:

 - Avoid accessing window properties directly, instead, use accessors.
   This should be no-op for now, but allows the code to work if we
   move to NCURSES_OPAQUE.
 - Use calloc() instead of malloc+bzero.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288163 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287866: Fix fixed sense writing when passed more data then it can fit.
mav [Wed, 23 Sep 2015 05:14:48 +0000 (05:14 +0000)]
MFC r287866: Fix fixed sense writing when passed more data then it can fit.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288142 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287590:
delphij [Wed, 23 Sep 2015 01:07:45 +0000 (01:07 +0000)]
MFC r287590:

w(1) is not setgid binary since r53279, so remove the setgid() call.

Reviewed By: wollman

git-svn-id: svn://svn.freebsd.org/base/stable/10@288139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287541:
dim [Tue, 22 Sep 2015 22:35:42 +0000 (22:35 +0000)]
MFC r287541:

In libz's inflateMark(), avoid left-shifting a negative integer, which
is undefined.

Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D3344

git-svn-id: svn://svn.freebsd.org/base/stable/10@288136 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286733:
dim [Tue, 22 Sep 2015 22:27:45 +0000 (22:27 +0000)]
MFC r286733:

Avoid left-shifting negative signed values in bxe(4).

Reviewed by: davidcs

git-svn-id: svn://svn.freebsd.org/base/stable/10@288135 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286702:
dim [Tue, 22 Sep 2015 22:18:36 +0000 (22:18 +0000)]
MFC r286702:

In ipfw2, avoid left-shifting negative integers, which is undefined.
While here, make some other arguments to htonl(3) unsigned too.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286699:
dim [Tue, 22 Sep 2015 22:07:42 +0000 (22:07 +0000)]
MFC r286699:

In gcc's libcpp, stop using the INTTYPE_MAXIMUM() macro, which relies on
undefined behavior.  The code used this macro to avoid problems on some
broken systems which define SSIZE_MAX incorrectly, but this is not
needed on FreeBSD, obviously.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRemove extra space introduced in r287734. This is a stable/10 only fix
garga [Tue, 22 Sep 2015 14:33:43 +0000 (14:33 +0000)]
Remove extra space introduced in r287734. This is a stable/10 only fix
since original commit (r287094) is correct.

Approved by: loos
Sponsored by: Rubicon Communications (Netgate)

git-svn-id: svn://svn.freebsd.org/base/stable/10@288109 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoLong overdue MFC r285444:
jlh [Tue, 22 Sep 2015 11:38:58 +0000 (11:38 +0000)]
Long overdue MFC r285444:
  Allow again periodic scripts to be run from command-line.

  PR:           188109
  Submitted by: Jason Unovitch

git-svn-id: svn://svn.freebsd.org/base/stable/10@288107 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoLong overdue MFC r284378:
jlh [Tue, 22 Sep 2015 11:25:37 +0000 (11:25 +0000)]
Long overdue MFC r284378:
  nit: Rename racct_alloc_resource to racct_adjust_resource.

  This is more accurate as the amount can be negative.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288106 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoLong overdue MFC r284377:
jlh [Tue, 22 Sep 2015 10:48:28 +0000 (10:48 +0000)]
Long overdue MFC r284377:
  NetBSD commit log:
    Use a constant array for the MIB. Newer LLVM decided that mib[] warranted
    stack protections, with the obvious crash after the setup was done.
    As a positive side effect, code size shrinks a bit.

  I'm not sure why this hasn't bitten us yes, but it is certainly possible and
  there are no real drawbacks to this change anyway.

  Submitted by: pfg
  Obtained from:        NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/10@288105 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoThe stable/10 branch uses mutex for vfs_hash. Fix build.
kib [Tue, 22 Sep 2015 10:31:48 +0000 (10:31 +0000)]
The stable/10 branch uses mutex for vfs_hash.  Fix build.

Submitted by: Jukka Ukkonen <jau789@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@288103 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287828:
garga [Tue, 22 Sep 2015 09:57:35 +0000 (09:57 +0000)]
MFC r287828:

Add support for Sierra MC7355 card

Submitted by: Jeremy Porter <jporter@netgate.com>
Approved by: loos
Obtained from: pfSense
Sponsored by: Rubicon Communications (Netgate)

git-svn-id: svn://svn.freebsd.org/base/stable/10@288101 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287807:
markj [Tue, 22 Sep 2015 00:45:16 +0000 (00:45 +0000)]
MFC r287807:
Remove an unneeded typedef of ip6_t from the DTrace ip provider library.

PR: 203092

git-svn-id: svn://svn.freebsd.org/base/stable/10@288080 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC of 281677:
mckusick [Tue, 22 Sep 2015 00:43:05 +0000 (00:43 +0000)]
MFC of 281677:

More accurately collect name-cache statistics in sysctl functions
sysctl_debug_hashstat_nchash() and sysctl_debug_hashstat_rawnchash().
These changes are in preparation for allowing changes in the size
of the vnode hash tables driven by increases and decreases in the
maximum number of vnodes in the system.

Reviewed by: kib@
Phabric:     D2265

MFC of 287497:

Track changes to kern.maxvnodes and appropriately increase or decrease
the size of the name cache hash table (mapping file names to vnodes)
and the vnode hash table (mapping mount point and inode number to vnode).
An appropriate locking strategy is the key to changing hash table sizes
while they are in active use.

Reviewed by: kib
Tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D2265

git-svn-id: svn://svn.freebsd.org/base/stable/10@288079 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoFix a panic in SIOCSLAGG and SIOCGLAGGOPTS. This was caused by a
hrs [Mon, 21 Sep 2015 18:32:43 +0000 (18:32 +0000)]
Fix a panic in SIOCSLAGG and SIOCGLAGGOPTS.  This was caused by a
wrongly-MFC'd patch in r287723.

Pointy hat to: hrs

git-svn-id: svn://svn.freebsd.org/base/stable/10@288072 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRe-add deprecated options as no-op to prevent breakage of backward
hrs [Mon, 21 Sep 2015 03:03:57 +0000 (03:03 +0000)]
Re-add deprecated options as no-op to prevent breakage of backward
compatibility.

Spotted by: ume

git-svn-id: svn://svn.freebsd.org/base/stable/10@288055 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 281734-281736,287997-287998:
hrs [Sun, 20 Sep 2015 22:27:19 +0000 (22:27 +0000)]
MFC 281734-281736,287997-287998:

- Fix a crash on a rpc entry when an IPv6 address is explicitly
  specified in -a flag.

- Fix a bug that sockaddr_in was used where sockaddr_in6 should have
  been used.  This was not actually harmful because offsetof(struct
  sockaddr_in, sin_port) is equal to offsetof(struct sockaddr_in6,
  sin6_port).

- Remove unused union p_un.

- Use NI_MAXHOST-long buffer for getnameinfo().
  Although INET6_ADDRSTRLEN was designed to hold the longest
  IPv6 address in IPv4-mapped address format a long time ago,
  getnameinfo() can return scope identifier in addition to it.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288048 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287651, r287652, r287653.
cy [Sat, 19 Sep 2015 03:58:31 +0000 (03:58 +0000)]
MFC r287651, r287652, r287653.

Fix mutex errors, fixup typos in comments.

Obtained from: NetBSD r1.4.
-This lie, anr those below, will be ignored--
> Description of fields to fill in above:                     76 columns --|
> PR:                       If a GNATS PR is affected by the change.
> Submitted by:             If someone else sent in the change.
> Reviewed by:              If someone else reviewed your modification.
> Approved by:              If you needed approval for this commit.
> Obtained from:            If the change is from a third party.
> MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
> MFH:                      Ports tree branch name.  Request approval for merge.
> Relnotes:                 Set to 'yes' for mention in release notes.
> Security:                 Vulnerability reference (one per line) or description.
> Sponsored by:             If the change was sponsored by an organization.
> Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
> Empty fields above will be automatically removed.

_M   .
M    sys/contrib/ipfilter/netinet/ip_state.c

git-svn-id: svn://svn.freebsd.org/base/stable/10@287984 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r266310
melifaro [Fri, 18 Sep 2015 17:29:24 +0000 (17:29 +0000)]
MFC r266310

  Fix wrong formatting of 0.0.0.0/X table records in ipfw(8).

  Add `flags` u16 field to the hole in ipfw_table_xentry structure.
  Kernel has been guessing address family for supplied record based
  on xent length size.
  Userland, however, has been getting fixed-size ipfw_table_xentry structures
  guessing address family by checking address by IN6_IS_ADDR_V4COMPAT().

  Fix this behavior by providing specific IPFW_TCF_INET flag for IPv4 records.

PR: bin/189471,kern/200169

git-svn-id: svn://svn.freebsd.org/base/stable/10@287963 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r280957
rstone [Thu, 17 Sep 2015 23:31:44 +0000 (23:31 +0000)]
MFC r280957

  Fix integer truncation bug in malloc(9)

  A couple of internal functions used by malloc(9) and uma truncated
  a size_t down to an int.  This could cause any number of issues
  (e.g. indefinite sleeps, memory corruption) if any kernel
  subsystem tried to allocate 2GB or more through malloc.  zfs would
  attempt such an allocation when run on a system with 2TB or more
  of RAM.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287945 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r279410:
rstone [Thu, 17 Sep 2015 18:21:47 +0000 (18:21 +0000)]
MFC r279410:

  Correct the use of an unitialized variable in sendfind_getobj()

  When sendfile_getobj() is called on a DTYPE_SHM file, it never
  initializes error, which is eventually returned to the caller.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287929 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r279413:
rstone [Thu, 17 Sep 2015 18:19:55 +0000 (18:19 +0000)]
MFC r279413:

  Add a missing include of an options header.

  watchdog.c does an #ifdef DDB but does not #include "opt_ddb.h".
  Fixing this turned up a missing include file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287928 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r263109
rstone [Thu, 17 Sep 2015 17:56:23 +0000 (17:56 +0000)]
MFC r263109

  Add MSI support to puc(9)

  Add support for MSI interrupts in the puc(9) driver.  By default the driver
  will prefer MSI interrupts to legacy interrupts.  A tunable,
  hw.puc.msi_disable, has been added to force the allocation of legacy
  interrupts.

  Reviewed by:  jhb@
  MFC after:    2 weeks
  Sponsored by: Sandvine Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287926 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286970:
rstone [Thu, 17 Sep 2015 17:09:03 +0000 (17:09 +0000)]
MFC r286970:

  Prevent ticks rollover from preventing vm_lowmem event

  Currently vm_pageout_scan() uses a ticks-based scheme to rate-limit
  the number of times that the vm_lowmem event will happen.  However
  if no events happen for long enough for ticks to roll over, this
  leaves us in a long window in which vm_lowmem events will not
  happen.

  Replace the use of ticks with time_t to prevent rollover from ever
  being an issue.

  Reviewed by:  ian
  MFC after:    3 weeks
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:        https://reviews.freebsd.org/D3439

git-svn-id: svn://svn.freebsd.org/base/stable/10@287922 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286891, r286893:
pfg [Thu, 17 Sep 2015 00:36:18 +0000 (00:36 +0000)]
MFC r286891, r286893:
calendar(1): add a few more dates to the Christian calendar

Bring some well established holidays that also happen to be legal
holidays in many Catholic countries.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287890 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287436:
bdrewery [Thu, 17 Sep 2015 00:24:50 +0000 (00:24 +0000)]
MFC r287436:

  Avoid sub-shell for realpath(1) for bmake by using its built-in :tA.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287889 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoDocument EN-15:16, EN-15:17, EN-15:18.
gjb [Wed, 16 Sep 2015 23:33:12 +0000 (23:33 +0000)]
Document EN-15:16, EN-15:17, EN-15:18.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@287881 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 281310, 287567:
imp [Wed, 16 Sep 2015 04:38:07 +0000 (04:38 +0000)]
MFC 281310, 287567:

r287567 | imp | 2015-09-08 11:47:56 -0600 (Tue, 08 Sep 2015) | 16 lines

Mark the swap pager as direct dispatch compatible.

r281310 | mav | 2015-04-09 07:09:05 -0600 (Thu, 09 Apr 2015) | 4 lines

Remove sleeps from geom_up thread on device destruction.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287850 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287366:
kib [Wed, 16 Sep 2015 04:35:23 +0000 (04:35 +0000)]
MFC r287366:
Use SLIST_FOREACH_SAFE() to fix iteration.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287849 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287599:
kib [Wed, 16 Sep 2015 04:23:08 +0000 (04:23 +0000)]
MFC r287599:
Correct handling of open("name", O_DIRECTORY | O_CREAT).

PR: 202892

git-svn-id: svn://svn.freebsd.org/base/stable/10@287847 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287591:
kib [Wed, 16 Sep 2015 04:20:39 +0000 (04:20 +0000)]
MFC r287591:
There is no reason in the current kernel to disallow write access to
the COW wired entry if the entry permissions allow it.  Remove the check.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287846 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287361:
kib [Wed, 16 Sep 2015 04:15:46 +0000 (04:15 +0000)]
MFC r287361:
Handle excess of D_NEWBLK in the same way as excess of D_INODEDEP and
D_DIRREM, by scheduling ast to flush dependencies.

For 32bit arches, reduce the total amount of allowed dependencies by two.

MFC r287479:
Declare the writes around the call to VFS_SYNC() in
softdep_ast_cleanup_proc().

MFC r287483:
Do not consume extra reference.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287845 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287238:
yongari [Wed, 16 Sep 2015 00:25:40 +0000 (00:25 +0000)]
MFC r287238:
  Set DMA alignment constraint of status, TX and RX LEs(List Elements
  in Marvell terms) to 32768.  32768 looks overkill but it will
  ensure correct DMAed update.  This change addresses occasional
  watchdog timeouts reported on 10.2-RELEASE.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287839 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r287580
bapt [Tue, 15 Sep 2015 05:56:16 +0000 (05:56 +0000)]
MFC: r287580

Remove extra debug that crept in

git-svn-id: svn://svn.freebsd.org/base/stable/10@287810 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r287579
bapt [Tue, 15 Sep 2015 05:46:55 +0000 (05:46 +0000)]
MFC: r287579

Implement pubkey support for the bootstrap

Note that to not interfer with finger print it expects a signature on pkg itself
which is named pkg.txz.pubkeysign

To genrate it:
echo -n "$(sha256 -q pkg.txz)" | openssl dgst -sha256 -sign /thekey \
    -binary -out ./pkg.txz.pubkeysig

Note the "echo -n" which prevent signing the '\n' one would get otherwise

PR: 202622

git-svn-id: svn://svn.freebsd.org/base/stable/10@287809 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286700
hiren [Tue, 15 Sep 2015 05:19:10 +0000 (05:19 +0000)]
MFC r286700

Make LAG LACP fast timeout tunable through IOCTL.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287808 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286062, r286063
cperciva [Mon, 14 Sep 2015 19:37:51 +0000 (19:37 +0000)]
MFC r286062, r286063

Add support to blkfront for blkif indirect segment I/Os.

Turn this support off by default in EC2 builds due to performance issues
on some EC2 instance types.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287802 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r284618, r284663, r284664, r284670, r284723
cperciva [Mon, 14 Sep 2015 19:35:33 +0000 (19:35 +0000)]
MFC r284618, r284663, r284664, r284670, r284723

Reorganization of blkfront code and updates to comments.  No functional
changes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287801 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r284615, r284662
cperciva [Mon, 14 Sep 2015 19:32:04 +0000 (19:32 +0000)]
MFC r284615, r284662

Code cleanup; fix an error code; add a KASSERT.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287800 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287320:
delphij [Mon, 14 Sep 2015 18:57:50 +0000 (18:57 +0000)]
MFC r287320:
 - uri is expected to be nul-terminated (strchr used later),
   so use strlcpy instead of strncpy.
 - replace the other two cases of strncpy+\0 with strlcpy.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287795 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287319:
delphij [Mon, 14 Sep 2015 18:52:41 +0000 (18:52 +0000)]
MFC r287319:

Constify opt_f and opt_t and eliminate unneeded copying.  This fixes
memory leaks.

Reported by: clang static analyzer

git-svn-id: svn://svn.freebsd.org/base/stable/10@287794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287247: Plug memory leaks when running out of memory.
delphij [Mon, 14 Sep 2015 18:05:27 +0000 (18:05 +0000)]
MFC r287247: Plug memory leaks when running out of memory.

Reported by: clang scan-build

git-svn-id: svn://svn.freebsd.org/base/stable/10@287792 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287237: Respect locale settings.
delphij [Mon, 14 Sep 2015 17:57:01 +0000 (17:57 +0000)]
MFC r287237: Respect locale settings.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287791 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287236:
delphij [Mon, 14 Sep 2015 17:40:57 +0000 (17:40 +0000)]
MFC r287236:

Use exit() instead of return in main().  The difference in practice
is subtle: C standard requires the language runtime to make return
of int from main() behave like calling exit(), and in FreeBSD we do:

exit(main(argc, argv, env))

In lib/csu/${ARCH}/crt1.c, so the real difference is using exit()
explicitly would use an additional stack frame.

Note however, if there is a on stack pointer is the last reference
of an allocated memory block, returning from the function would,
technically, result in a memory leak because we lost the last
reference to the memory block, and calling exit() from C runtime
could potentionally overwrite that stack frame that used to belong
to the main() function.

In practice, this is normally Okay because eventually the kernel
would tear down the whole address space that belongs to the process
in the _exit(2) system call, but the difference could confuse
compilers (which may want to do stack overflow checks) and static
analyzers.

Replacing return with exit() in main() allows compilers/static
analyzers to correctly omit or generate the right warnings when
they do not treat main() specifically.  With the current version
of clang on FreeBSD/amd64, use of exit() would result in slightly
smaller code being generated and eliminated a false positive
warning of memory leak.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r272715
ray [Mon, 14 Sep 2015 14:42:06 +0000 (14:42 +0000)]
MFC: r272715
Allow vt(4) to disable terminal bell with `sysctl kern.vt.bell_enable=0`,
similar as syscons(4) do.

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@287782 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286798 and r286827:
ed [Mon, 14 Sep 2015 09:12:28 +0000 (09:12 +0000)]
MFC r286798 and r286827:

  Stop parsing digits if the value already exceeds UINT_MAX / 100.

  There is no need for us to support parsing values that are larger than
  the maximum terminal window size. In this case that would be the maximum
  of unsigned short.

  The problem with parsing larger values is that they can cause integer
  overflows when adjusting the cursor position, leading to all sorts of
  failing assertions.

MFC r286981 and r287098:

  Don't truncate cursor arithmetic to 16 bits.

  When updating the row number when the cursor position escape sequence is
  issued, we should make sure to store the intermediate result in a 32-bit
  integer. If we fail to do this, the cursor may be set above the origin
  region, which is bad.

  This could cause libteken to crash when INVARIANTS is enabled, due to
  the strict set of assertions that libteken has.

PR: 202326, 202540, 202612
Submitted by: kwcu csie org

git-svn-id: svn://svn.freebsd.org/base/stable/10@287776 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r287701
bapt [Mon, 14 Sep 2015 05:37:32 +0000 (05:37 +0000)]
MFC: r287701

Regression: fix pw usermod -d

Mark the user has having been edited if -d option is passed to usermod and
so the request change of home directory actually happen

PR: 203052
Reported by: lenzi.sergio@gmail.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@287769 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r268436,273243,278806,280920,286971: sh: Add various tests.
jilles [Sun, 13 Sep 2015 14:24:12 +0000 (14:24 +0000)]
MFC r268436,273243,278806,280920,286971: sh: Add various tests.

These new tests from head pass with unmodified stable/10 sh.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287755 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287148: sh: Fix out of bounds read when there is no ] after a [:class:].
jilles [Sun, 13 Sep 2015 13:58:46 +0000 (13:58 +0000)]
MFC r287148: sh: Fix out of bounds read when there is no ] after a [:class:].

The initial check for a matching ] was incorrect if a ] may be consumed by a
[:class:]. The subsequent loop assumed that there must be a ].

Remove the initial check and make the loop cope with a missing ].

Found with afl-fuzz.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287752 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r278826,279330: sh: Various cleanups to expand.c:
jilles [Sun, 13 Sep 2015 13:52:54 +0000 (13:52 +0000)]
MFC r278826,279330: sh: Various cleanups to expand.c:

* Remove some gotos.
* Remove unused parameter.
* Remove duplicate code.

This MFC is to avoid conflicts in the MFC of r287148.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287751 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r272575: sh: Eliminate some gotos.
jilles [Sun, 13 Sep 2015 13:43:08 +0000 (13:43 +0000)]
MFC r272575: sh: Eliminate some gotos.

This MFC is to avoid conflicts in the MFC of r287148.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287750 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287081: sh: Don't create bad parse result when postponing a bad
jilles [Sun, 13 Sep 2015 13:31:51 +0000 (13:31 +0000)]
MFC r287081: sh: Don't create bad parse result when postponing a bad
substitution error.

An invalid substitution like ${var@} does not cause a parse error but is
stored in the intermediate representation, to be written as part of the
error message. If there is a CTL* byte in the stored part, this confuses
some code such as the code to skip an unused alternative such as in
${var-alternative}.

To keep things simple, do not store CTL* bytes.

Found with afl-fuzz.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287749 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r287522
bapt [Sun, 13 Sep 2015 07:15:45 +0000 (07:15 +0000)]
MFC: r287522

Prefer pciids database from ports if present

Given the pciids database on ports is updated more often than the one in base
prefer this version if present, otherwise read the one from base.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D3391

git-svn-id: svn://svn.freebsd.org/base/stable/10@287746 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287615:
hrs [Sun, 13 Sep 2015 04:05:27 +0000 (04:05 +0000)]
MFC 287615:

Use read to parse a line instead of set.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287739 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287614:
hrs [Sun, 13 Sep 2015 04:02:52 +0000 (04:02 +0000)]
MFC 287614:

- Add uid check.
- Report delay<0 as a warning.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287738 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287613:
hrs [Sun, 13 Sep 2015 03:59:29 +0000 (03:59 +0000)]
MFC 287613:

Update only static routes when an interface is specified.  This fixed
a bad side-effect reported in PR 202144.

PR: 202144

git-svn-id: svn://svn.freebsd.org/base/stable/10@287737 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287349,287404:
hrs [Sun, 13 Sep 2015 03:15:37 +0000 (03:15 +0000)]
MFC 287349,287404:

- Print sdl->sdl_data when sdl->sdl_nlen > 0 && sdl->sdl_alen == 0
  as link_ntoa(3) does.

- snprintf() returns at most size-1 of the chars printed into
  the buffer.  (n == hostlen) also means the buffer length was
  too short.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287736 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 259169, 259176, 287097:
hrs [Sun, 13 Sep 2015 03:09:21 +0000 (03:09 +0000)]
MFC 259169, 259176, 287097:

- Ansify function definitions.

- Change the type of addr argument in dump() function to be able
  disambiguate link-local addresses from different zones.

- Add static and remove unused variables.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287735 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287094:
hrs [Sun, 13 Sep 2015 02:09:06 +0000 (02:09 +0000)]
MFC 287094:

- Deprecate IN6_IFF_NODAD.  It was used to prevent DAD on a loopback
  interface but in6if_do_dad() already had a check for IFF_LOOPBACK.

- Remove in6if_do_dad() check in in6_broadcast_ifa().  An address
  which needs DAD always has IN6_IFF_TENTATIVE there.

- in6if_do_dad() now returns EAGAIN when the interface is not ready
  since DAD callout handler ignores such an interface.

- In DAD callout handler, mark an address as IN6_IFF_TENTATIVE
  when the interface has ND6_IFF_IFDISABLED.  And Do IFF_UP and
  IFF_DRV_RUNNING check consistently when DAD is required.

- draft-ietf-6man-enhanced-dad is now published as RFC 7527.

- Fix some typos.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287734 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287095, 287610, 287611, 287617:
hrs [Sun, 13 Sep 2015 01:59:50 +0000 (01:59 +0000)]
MFC 287095, 287610, 287611, 287617:

Remove obsolete API (SIOCGDRLST_IN6 and SIOCGPRLST_IN6) support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287733 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287609:
hrs [Sun, 13 Sep 2015 01:44:30 +0000 (01:44 +0000)]
MFC 287609:

Do not add IN6_IFF_TENTATIVE when ND6_IFF_NO_DAD.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287732 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287608:
hrs [Sun, 13 Sep 2015 01:39:37 +0000 (01:39 +0000)]
MFC 287608:

Remove IN6_IFF_NOPFX.  This flag was no longer used.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287731 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287607:
hrs [Sun, 13 Sep 2015 01:35:40 +0000 (01:35 +0000)]
MFC 287607:

- Remove GIF_{SEND,ACCEPT}_REVETHIP.
- Simplify EADDRNOTAVAIL and EAFNOSUPPORT conditions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287730 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287595:
hrs [Sun, 13 Sep 2015 01:31:17 +0000 (01:31 +0000)]
MFC 287595:

- Fix SIGSEGV when sa == NULL.  NULL check in getnameinfo_inet()
  did not work as expected.

- Simplify afdl table lookup.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287729 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 272159,272161,272386,272446,272547,272548,273210:
hrs [Sat, 12 Sep 2015 20:36:39 +0000 (20:36 +0000)]
MFC 272159,272161,272386,272446,272547,272548,273210:

- Make lagg protos a enum.

- When reconfiguring protocol on a lagg, first set it to LAGG_PROTO_NONE,
  then drop lock, run the attach routines, and then set it to specific
  proto. This removes tons of WITNESS warnings.

- Make lagg protocol attach handlers not failing and allocate memory
  with M_WAITOK.

- Virtualize lagg(4) cloner.  This change fixes a panic when tearing down
  if_lagg(4) interfaces which were cloned in a vnet jail.

  Sysctl nodes which are dynamically generated for each cloned interface
  (net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift
  ifconfig(8) parameters have been added instead.  Flags and per-interface
  statistics counters are displayed in "ifconfig -v".

- Separate option handling from SIOC[SG]LAGG to SIOC[SG]LAGGOPTS for
  backward compatibility with old ifconfig(8).

- Move L2 addr configuration for the primary port to a taskqueue.  This fixes
  LOR of softc rmlock in iflladdr_event handlers.

- Call if_delmulti_ifma() after LACP_UNLOCK().  This fixes another LOR.

- Fix a panic in lacp_transit_expire().

- Fix a panic in lagg_input() upon shutting down a port.

- Use printb() for boolean flags in ro_opts and actor_state for LACP.

- Fix lladdr configuration which could prevent LACP mode from working.

- Fix LORs when a laggport interface has an IPv6 LLA.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287723 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287468, turn on RAWDCF by default.
cy [Sat, 12 Sep 2015 02:36:17 +0000 (02:36 +0000)]
MFC r287468, turn on RAWDCF by default.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287700 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287376
kp [Fri, 11 Sep 2015 17:19:24 +0000 (17:19 +0000)]
MFC r287376

pf: Fix misdetection of forwarding when net.link.bridge.pfil_bridge is set

If net.link.bridge.pfil_bridge is set we can end up thinking we're forwarding
in pf_test6() because the rcvif and the ifp (output interface) are different.
In that case we're bridging though, and the rcvif the the bridge member on
which the packet was received and ifp is the bridge itself.
If we'd set dir to PF_FWD we'd end up calling ip6_forward() which is
incorrect.

Instead check if the rcvif is a member of the ifp bridge. (In other words, the
if_bridge is the ifp's softc). If that's the case we're not forwarding but
bridging.

PR:   202351

git-svn-id: svn://svn.freebsd.org/base/stable/10@287680 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287564:
jimharris [Fri, 11 Sep 2015 17:06:57 +0000 (17:06 +0000)]
MFC r287564:

  isci: check return value of pci_alloc_msix()

  Certain VM guest types (VMware, Xen) do not support MSI, so pci_alloc_msix()
  always fails.  isci(4) was not properly detecting the allocation failure,
  and would try to proceed with MSIx resource initialization rather than
  reverting to INTx.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/10@287678 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287563:
jimharris [Fri, 11 Sep 2015 17:01:01 +0000 (17:01 +0000)]
MFC r287563:

  isci: explicitly enable/disable PCI busmaster

  BIOS always enables PCI busmaster on the isci device, which effectively
  worked around this omission.  But when passing the isci device through
  to a guest VM, the hypervisor will disable busmaster and isci will not
  work without calling pci_enable_busmaster().

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/10@287677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286043:
jimharris [Fri, 11 Sep 2015 16:59:04 +0000 (16:59 +0000)]
MFC r286043:

  nvme: do not notify a consumer about failures that occur during initialization

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/10@287676 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287100: spa_import_rootpool: prevent lock and resource leak
avg [Fri, 11 Sep 2015 13:32:19 +0000 (13:32 +0000)]
MFC r287100: spa_import_rootpool: prevent lock and resource leak

PR: 198563

git-svn-id: svn://svn.freebsd.org/base/stable/10@287667 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287099: account for ashift when gathering buffers to be written to l2arc device
avg [Fri, 11 Sep 2015 12:58:41 +0000 (12:58 +0000)]
MFC r287099: account for ashift when gathering buffers to be written to l2arc device

The change differs from that in head because of other changes that have not
been MFC-ed yet.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287665 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287354: callout_reset: fix a reversed check for cc_exec_cancel
avg [Fri, 11 Sep 2015 12:45:56 +0000 (12:45 +0000)]
MFC r287354: callout_reset: fix a reversed check for cc_exec_cancel

Relnotes: potential erratum

git-svn-id: svn://svn.freebsd.org/base/stable/10@287663 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285021: zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls
avg [Fri, 11 Sep 2015 12:41:59 +0000 (12:41 +0000)]
MFC r285021: zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls

git-svn-id: svn://svn.freebsd.org/base/stable/10@287661 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock
avg [Fri, 11 Sep 2015 12:39:13 +0000 (12:39 +0000)]
MFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock

git-svn-id: svn://svn.freebsd.org/base/stable/10@287660 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock
avg [Fri, 11 Sep 2015 12:37:50 +0000 (12:37 +0000)]
MFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock

git-svn-id: svn://svn.freebsd.org/base/stable/10@287658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r284513: l2arc: pass correct size to trim requests
avg [Fri, 11 Sep 2015 12:34:23 +0000 (12:34 +0000)]
MFC r284513: l2arc: pass correct size to trim requests

git-svn-id: svn://svn.freebsd.org/base/stable/10@287656 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287574:
garga [Fri, 11 Sep 2015 10:45:28 +0000 (10:45 +0000)]
MFC r287574:

- Fix Sierra MC7354 ID from a bad copy/paste, correct ID is 68C0

MFC r287575:

- Remove duplicate entry for Sierra Wireless Aircard 875

Approved by: loos
Obtained from: pfSense (r287574)
Sponsored by: Rubicon Communications (Netgate)

git-svn-id: svn://svn.freebsd.org/base/stable/10@287655 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r274569, r276848, r287234:
markj [Fri, 11 Sep 2015 02:53:22 +0000 (02:53 +0000)]
MFC r274569, r276848, r287234:
Only compare visitation counters if they've both been set for the current
type graph walk.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287639 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287440:
jhb [Fri, 11 Sep 2015 00:20:15 +0000 (00:20 +0000)]
MFC 287440:
Currently the Linux character device mmap handling only supports mmap
operations that map a single page that has an associated vm_page_t.
This does not permit mapping larger regions (such as a PCI memory
BAR) and it does not permit mapping addresses beyond the top of RAM
(such as a 64-bit BAR located above the top of RAM).

Instead of using a single OBJT_DEVICE object and passing the physaddr via
the offset as a hack, create a new sglist and OBJT_SG object for each
mmap request. The requested memory attribute is applied to the object
thus affecting all pages mapped by the request.

Sponsored by: Chelsio

git-svn-id: svn://svn.freebsd.org/base/stable/10@287637 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 283281,283282,283562,283647,283836,284000,286158:
jhb [Wed, 9 Sep 2015 23:39:30 +0000 (23:39 +0000)]
MFC 283281,283282,283562,283647,283836,284000,286158:
Various fixes to orphan handling which also fix issues with following
forks.

283281:
Always set p_oppid when attaching to an existing process via procfs
tracing.  This matches the behavior of ptrace(PT_ATTACH).  Also,
the procfs detach request assumes p_oppid is always set.

283282:
Only reparent a traced process to its old parent if the tracing process is
not the old parent. Otherwise, proc_reap() will leave the zombie in place
resulting in the process' status being returned twice to its parent.

Add test cases for PT_TRACE_ME and PT_ATTACH which are fixed by
this change.

283562:
Do not allow a process to reap an orphan (a child currently being
traced by another process such as a debugger). The parent process does
need to check for matching orphan pids to avoid returning ECHILD if an
orphan has exited, but it should not return the exited status for the
child until after the debugger has detached from the orphan process
either explicitly or implicitly via wait().

Add two tests for for this case: one where the debugger is the direct
child (thus the parent has a non-empty children list) and one where
the debugger is not a direct child (so the only "child" of the parent
is the orphan).

283647:
Tweak the description of when waitpid() doesn't return any status for a
non-blocking wait to avoid the word "empty".

283836:
Consistently only use one end of the pipe in the parent and debugger
processes and do not rely on EOF due to a close() in the debugger.

284000:
Add a CHILD_REQUIRE macro similar to ATF_REQUIRE for use in child processes
of the main test process.

286158:
Clear P_TRACED before reparenting a detached process back to its
original parent. Otherwise the debugee will be set as an orphan of
the debugger.

Add tests for tracing forks via PT_FOLLOW_FORK.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287604 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287151,r287152,r287153,r287155:
bdrewery [Wed, 9 Sep 2015 17:15:13 +0000 (17:15 +0000)]
MFC r287151,r287152,r287153,r287155:

  r287151:
    Move common locking for filemon_inuse and struct filemon* to
    filemon_pid_check().
  r287152:
    Remove unneeded inuse list locking in filemon_comment().
  r287153:
    Avoid taking proctree_lock and searching parents in wrappers if not needed.
  r287155:
    Fix filemon locking races.

 Relnotes: yes (race fixes)
 Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@287598 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r272889 and r287402:
hrs [Wed, 9 Sep 2015 08:52:39 +0000 (08:52 +0000)]
MFC r272889 and r287402:

- Virtualize if_epair(4).  An if_xname check for both "a" and "b" interfaces
  is added to return EEXIST when only "b" interface exists---this can happen
  when epair<N>b is moved to a vnet jail and then "ifconfig epair<N> create"
  is invoked there.

- Fix a panic which was reproducible by an infinite loop of
  "ifconfig epair0 create && ifconfig epair0a destroy".
  This was caused by an uninitialized function pointer in
  softc->media.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287594 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287406:
hrs [Wed, 9 Sep 2015 08:40:17 +0000 (08:40 +0000)]
MFC r287406:

Divide statistics in the number of packets with 1000 instead of 1024
in human-readable form.

PR: 183598

git-svn-id: svn://svn.freebsd.org/base/stable/10@287593 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r287405:
imp [Tue, 8 Sep 2015 18:37:16 +0000 (18:37 +0000)]
MFC: r287405:

Make out of memory behavior less pathological.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMerge r286649:
rodrigc [Tue, 8 Sep 2015 17:54:31 +0000 (17:54 +0000)]
Merge r286649:

Fix and re-enable UTF-8 tests.

X-Merge with: r287393

git-svn-id: svn://svn.freebsd.org/base/stable/10@287568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287437
sbruno [Tue, 8 Sep 2015 17:20:12 +0000 (17:20 +0000)]
MFC r287437

r249170 was just plain wrong.  The effect of the change is to always
delete a logic volume on status change which is NOT what we want here.

The original code is correct in that when the volume changes status
the driver will only delete the volume if the status is one of the
fatal errors.  A drive failure in a mirrored volume is NOT a situtation
where the volume should dissapear.

Reported on freebsd-scsi@:
https://lists.freebsd.org/pipermail/freebsd-scsi/2015-September/006800.html

git-svn-id: svn://svn.freebsd.org/base/stable/10@287566 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287369:
andrew [Tue, 8 Sep 2015 12:00:13 +0000 (12:00 +0000)]
MFC r287369:
Ensure we use calculate_first_tls_offset, even if the main program doesn't
have TLS program header. This is needed on architectures with Variant I
tls, that is arm, arm64, mips, and powerpc. These place the thread control
block at the start of the buffer and, without this, this data may be
trashed.

This appears to not be an issue on mips or powerpc as they include a second
adjustment to move the thread local data, however this is on arm64 (with a
future change to fix placing this data), and should be on arm. I am unable
to trigger this on arm, even after changing the code to move the data
around to make it more likely to be hit. This is most likely because my
tests didn't use the variable in offset 0.

Reviewed by: kib
MFC after: 1 week
Sponsored by: ABT Systems Ltd

git-svn-id: svn://svn.freebsd.org/base/stable/10@287560 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287360:
kib [Tue, 8 Sep 2015 07:15:10 +0000 (07:15 +0000)]
MFC r287360:
Fix t_spawnattr test for attributes handling by posix_spawn(3).
Connect it to the build.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287551 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f