199923 Commits

Author SHA1 Message Date
avg
5be2a0f48e MFC r287100: spa_import_rootpool: prevent lock and resource leak
PR:		198563
2015-09-11 13:32:19 +00:00
avg
c83542f5e0 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.
2015-09-11 12:58:41 +00:00
avg
9671a17dd9 MFC r287354: callout_reset: fix a reversed check for cc_exec_cancel
Relnotes:	potential erratum
2015-09-11 12:45:56 +00:00
avg
423decf41a MFC r285021: zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls 2015-09-11 12:41:59 +00:00
avg
c26752881e MFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock 2015-09-11 12:37:50 +00:00
avg
fd504ef409 MFC r284513: l2arc: pass correct size to trim requests 2015-09-11 12:34:23 +00:00
garga
6c4fd09b74 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)
2015-09-11 10:45:28 +00:00
markj
16ff73dbec MFC r274569, r276848, r287234:
Only compare visitation counters if they've both been set for the current
type graph walk.
2015-09-11 02:53:22 +00:00
jhb
ffc8f26a94 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
2015-09-11 00:20:15 +00:00
jhb
4a069f68d7 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.
2015-09-09 23:39:30 +00:00
bdrewery
a7e2ef65e3 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
2015-09-09 17:15:13 +00:00
hrs
72c1e2950c 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.
2015-09-09 08:52:39 +00:00
hrs
c02639b794 MFC r287406:
Divide statistics in the number of packets with 1000 instead of 1024
in human-readable form.

PR:	183598
2015-09-09 08:40:17 +00:00
imp
bd8403067b MFC: r287405:
Make out of memory behavior less pathological.
2015-09-08 18:37:16 +00:00
rodrigc
12c2a2777a Merge r286649:
Fix and re-enable UTF-8 tests.

X-Merge with: r287393
2015-09-08 17:54:31 +00:00
sbruno
98a2a2e18e 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
2015-09-08 17:20:12 +00:00
andrew
c8580db746 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
2015-09-08 12:00:13 +00:00
kib
d894e2ffed MFC r287360:
Fix t_spawnattr test for attributes handling by posix_spawn(3).
Connect it to the build.
2015-09-08 07:15:10 +00:00
delphij
19493aa167 MFC r287123:
Finish r89633 and completely remove the remaining of VERSION.

PR:		bin/202308
Submitted by:	John Hein <z7dr6ut7gs snkmail com>
2015-09-08 02:02:08 +00:00
delphij
edf4da8597 MFC r287093:
Instead of doing an no-op (|= 0), actually clear the flags in
acl_clear_flags_np.

Reported by:	Pascal Drecker <pascal freebsd drecker com>
2015-09-08 01:44:37 +00:00
delphij
1b3405f899 MFC r287021:
Fix build when LEAPSECONDS is enabled.
2015-09-08 00:43:40 +00:00
delphij
5505c947f4 MFC r287020: MFV r287019: leapseconds from tzdata2015f. 2015-09-08 00:34:38 +00:00
kib
85e9470674 MFC r287310:
Use P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
scheduler types.
2015-09-06 17:36:09 +00:00
kib
72b37e4159 MFC r287309:
Remove single-use macros obfuscating malloc(9) and free(9) calls.
Style.
2015-09-06 17:32:33 +00:00
mav
280f5aeea6 MFC r287432: Fix copy-paste bug introduced in r275458. 2015-09-06 09:41:08 +00:00
kib
438719ab51 MFC r287292:
Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.

MFC r287300:
Use libthr interposed functions instead of syscalls, in posix_spawn()'
child.
2015-09-05 08:55:51 +00:00
sbruno
906861047e MFC r277853
Check for invalid length or more than max length for the interpreter, instead
of the validity of the string pointer holding the interpreter.

Submitted by:	sson
2015-09-04 15:45:42 +00:00
sbruno
c3f28072a7 MFC r276834
Update Features2 to display SDBG capability of processor.  This is
showing up on Haswell-class CPUs

From the Intel SDM, "Table 3-20. Feature Information Returned in the
ECX Register"

11 | SDBG | A value of 1 indicates the processor supports
IA32_DEBUG_INTERFACE MSR for silicon debug.

Submitted by:	jiashiun@gmail.com
2015-09-04 15:40:19 +00:00
sbruno
7179ae751d MFC r286238
A misplaced #endif in ixgbe_ioctl() causes interface MTU to become
zero when INET and INET6 are undefined.

PR:		162028
Submitted by:	hoomanfazaeli@gmail.com pluknet
2015-09-04 15:34:27 +00:00
gjb
d4feb69e90 MFC r287368:
Remove '-' separating OSRELEASE and SNAPSHOT_DATE for vagrant
 builds, and prepend it to SNAPSHOT_DATE to prevent a trailing '-'
 in the final box name for a release build.

Sponsored by:	The FreeBSD Foundation
2015-09-04 01:13:40 +00:00
delphij
1d0f985306 MFC r287345:
Drop group privileges after opening the kvm descriptor, otherwise, the code
would not drop privileges as expected.

While there also add checks for the drop and bail out immediately if we
failed.
2015-09-04 00:41:29 +00:00
rodrigc
77c678cefa Put timeout directory in correct place 2015-09-03 20:47:13 +00:00
asomers
60980f847d MFC r286964
Add ATF functional tests for fstyp(8).  No ZFS or GELI tests yet.
2015-09-03 19:42:56 +00:00
jhb
9c5fd1a68e MFC 283622:
Add <sys/user.h> to the SYNOPSIS of the kinfo_get*() functions since these
functions all return types that are defined in that header.
2015-09-03 18:23:07 +00:00
imp
4c2ee2f23d MFC: r287183, r287264, r287265
Export kern.features.invariants when kernel is compiled with invariants.
2015-09-03 18:14:31 +00:00
jhb
0f92293fc3 MFC 281941:
Watchdog drivers need to support rearming the watchdog in contexts which
are not permitted to sleep.  Only use the IPMI watchdog with backends
which poll driver-initiated requests to meet this requirement.

In practice this means that watchdogs will no longer be used on systems
that use the SSIF backend.
2015-09-03 16:43:35 +00:00
ume
a22a5bc394 MFC r287208, r287216:
Make it buildable with WITH_OPENLDAP, again.
2015-09-03 11:33:33 +00:00
bapt
88feb84264 MFC: r286490,r286491,r287125
Per rfc3629 value greater than 0x10ffff should be rejected (r286490,r286491)

Make UTF-8 parsing and generation more strict. (r287125  by ed)

- in mbrtowc() we need to disallow codepoints above 0x10ffff.
- In wcrtomb() we need to disallow codepoints between 0xd800 and 0xdfff.
2015-09-02 05:55:57 +00:00
bapt
326626fa22 MFC: r268745,r268746,r268747,r268748,r268749,r268861,r268750,r268751,r268763
r273769,r273771,r276771,r278810

New BSDL timeout(1) utility compatible with GNU timeout

Relnotes:	yes
2015-09-02 05:45:47 +00:00
avatar
49c820db70 MFC r286887: Using the error return code documented in the comment.
Though there is no direct midi_uninit() caller amongst existing drivers
at this moment, a quick experiment indicates that EBUSY gives users more
precise error message once drivers start to honour this result.  For example,
emu_midi_detach() should check the result of mpu401_uninit() and block
module unloading if there is any MIDI I/O in progress.
2015-09-01 22:35:53 +00:00
asomers
2fa34e5809 MFC r286892
Serve /etc/eui64 via NIS.

The C library already knows how to lookup eui64 entries from NIS. For
example, fwcontrol(8) does it. But /var/yp/Makefile.dist doesn't build the
eui64 maps, and ypinit(8) doesn't push them to slaves. This change fixes
that.
2015-09-01 18:57:57 +00:00
delphij
fc011ff3b1 MFC r286910:
- ANSIfy
 - Remove the redundant _PATH_RSH definition (paths.h at r96194);
 - Use pid_t for PIDs
 - Note that we are at the same level of OpenBSD's counterpart of
   revision 1.7 (r94757).
2015-09-01 01:03:45 +00:00
delphij
11ccde2814 MFC r286894:
Set curvnet context inside the RPC code in more places.

Reviewed by:	melifaro
2015-09-01 01:01:35 +00:00
bdrewery
9591838e19 MFC r272282,r272363,r272383:
r272282:
    Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR.
    This will only take effect if PORTSDIR is not set, as previously supported.

  r272363:
    Always resolve PORTSDIR to absolute paths using realpath(1).

  r272383:
    Revise r272363 by collapsing the tests into a for loop.

Relnotes:	yes
2015-08-31 20:44:52 +00:00
emaste
7b55f00a51 MFC r282551: Remove historical GNUC test
The requirement is for a GCC-compatible compiler and not necessarily
GCC itself. However, we currently expect any compiler used for building
the whole of FreeBSD to be GCC-compatible and many things will break if
not; there's no longer a need to have an explicit test for this in rtld.
2015-08-31 19:20:18 +00:00
delphij
fb04ebcd37 MFC r286836:
so_vnet is constant after creation and no locking is necessary,
document this fact.
2015-08-31 18:58:53 +00:00
delphij
edf242860f MFC r286834:
Use arc4random_buf().  While there, unifdef the code for !HAVE_ARC4RANDOM.
2015-08-31 18:53:41 +00:00
emaste
509a57d66e MFC r285844: ar: add -U (unique) option to disable -D (deterministic) mode
This is required in order for us to support deterministic mode by
default.  If multiple -D or -U options are specified on the command
line, the final one takes precedence.  GNU ar also uses -U for this.

PR:		196929
Sponsored by:	The FreeBSD Foundation
2015-08-31 17:30:13 +00:00
jilles
aae4ae4be6 MFC r279084,280713: setmode(): Use sysctl kern.proc.umask instead of umask()
if possible.

The kern.proc.umask.<pid> sysctl allows querying the umask without
temporarily modifying it.

r280713 is the actual change, while r279084 is a whitespace change.
2015-08-29 20:41:09 +00:00
avatar
fa56ab039e MFC r286888: Using consistent coding style to deal with error inside the loop. 2015-08-29 11:15:54 +00:00