]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoFix arm stack frame walking support:
fabient [Tue, 14 Mar 2017 16:06:57 +0000 (16:06 +0000)]
Fix arm stack frame walking support:
- Adjust stack offset for Clang
- Correctly fill registers for fake stack frame (soft PMC)

MFC after: 1 week
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D7396

7 years agoFixup LINT by using uint64_t type as we do on all other calls to PNMB()
sbruno [Tue, 14 Mar 2017 15:08:56 +0000 (15:08 +0000)]
Fixup LINT by using uint64_t type as we do on all other calls to PNMB()

Found with Jenkins.

Reported by: lwshu
Sponsored by: Limelight Networks

7 years agoSet "current" pointer for LinuxKPI interrupts and timer callbacks.
hselasky [Tue, 14 Mar 2017 14:02:47 +0000 (14:02 +0000)]
Set "current" pointer for LinuxKPI interrupts and timer callbacks.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoRestore changes for RSS routing improvements made in 314369 that were
sbruno [Tue, 14 Mar 2017 13:54:18 +0000 (13:54 +0000)]
Restore changes for RSS routing improvements made in 314369 that were
reverted in the IFLIB update I made in 315217.

Submitted by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>

7 years agoFix late and noauto with geli swap
amdmi3 [Tue, 14 Mar 2017 12:39:19 +0000 (12:39 +0000)]
Fix late and noauto with geli swap

With the following in /etc/fstab:

/dev/gpt/swap.eli none swap sw,late 0 0

swap will not be enabled, with `swapon -aL' complaining:

swapon: Invalid option: late

This happens because swap_on_geli_args() which parses geli arguments
out of all mount options does not expect late or noauto among them.
Fix this by explicitly allowing these arguments.

Reviewed by: jilles
Approved by: jilles
MFC after: 2 weeks
Differential Revision: D9835

7 years agoUse designated initializers for kevent_copyops.
kib [Tue, 14 Mar 2017 09:25:01 +0000 (09:25 +0000)]
Use designated initializers for kevent_copyops.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoHide kev_iovlen() definition under #ifdef KTRACE, fixing build of
kib [Tue, 14 Mar 2017 08:45:52 +0000 (08:45 +0000)]
Hide kev_iovlen() definition under #ifdef KTRACE, fixing build of
kernel configs without KTRACE.

Reported by: rpokala
Sponsored by: The FreeBSD Foundation
MFC after: 4 days

7 years agoRemove dangerous and questionable isp_mboxcmd_qnw() call.
mav [Tue, 14 Mar 2017 08:45:33 +0000 (08:45 +0000)]
Remove dangerous and questionable isp_mboxcmd_qnw() call.

MFC after: 2 weeks

7 years agoloader.efi: use stricter check for Hyper-V
dexuan [Tue, 14 Mar 2017 08:12:14 +0000 (08:12 +0000)]
loader.efi: use stricter check for Hyper-V

Some other hypervisors like Xen can pretend to be Hyper-V but obviously
they can't implement all Hyper-V features. Let's make sure we're genuine
Hyper-V here.

Also fix some minor coding style issues.

PR: 211746
MFC after: 2 weeks
Sponsored by: Microsoft

7 years agoImprovements around attach, reset and detach.
mav [Tue, 14 Mar 2017 08:03:56 +0000 (08:03 +0000)]
Improvements around attach, reset and detach.

This change fixes DMA resource leak on driver unload.  Also it removes
DMA resources allocation for hardcoded number of requests before fetching
the real number from firmware.  Also it prepares ground for more flexible
IRQs allocation according to firmware capabilities.

MFC after: 2 weeks

7 years agoUse memset with structure size.
ae [Tue, 14 Mar 2017 07:57:33 +0000 (07:57 +0000)]
Use memset with structure size.

7 years agoRemove /usr/tests/sys/geom/eli/...
ngie [Tue, 14 Mar 2017 07:09:51 +0000 (07:09 +0000)]
Remove /usr/tests/sys/geom/eli/...

The path was elided with the existing geli tests under
/usr/tests/sys/geom/class/eli/... in r315230.

MFC after: 2 weeks (if r315230, etc isn't MFCed at once)
Sponsored by: Dell EMC Isilon

7 years agoMove .../sys/geom/eli/pbkdf2... to .../sys/geom/class/eli/...
ngie [Tue, 14 Mar 2017 07:00:22 +0000 (07:00 +0000)]
Move .../sys/geom/eli/pbkdf2... to .../sys/geom/class/eli/...

This change moves the tests added in r313962 to an existing directory
structure used by the geli TAP tests. It also, renames the test from
pbkdf2 to pbkdf2_test .

The changes to ObsoleteFiles.inc are being committed separately as they
aren't needed for the MFC to ^/stable/11, etc, if the MFC for the tests
is done all in one commit.

MFC after: 2 weeks
X-MFC with: r313962, r313972-r313973
Reviewed by: allanjude
Sponsored by: Dell EMC Isilon
Differential Revision: D9985

7 years agoRemove remnant of r315163.
mav [Tue, 14 Mar 2017 06:57:55 +0000 (06:57 +0000)]
Remove remnant of r315163.

MFC after: 13 days

7 years agoRedirect standard error from find /rescue to /dev/null
ngie [Tue, 14 Mar 2017 06:52:54 +0000 (06:52 +0000)]
Redirect standard error from find /rescue to /dev/null

This mutes noise from find when /rescue doesn't exist.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoDiscard first 3072 bytes of RC4 keystream, this is a bandaid
delphij [Tue, 14 Mar 2017 06:00:44 +0000 (06:00 +0000)]
Discard first 3072 bytes of RC4 keystream, this is a bandaid
that allows us to work on switching to a more modern PRNG.

Submitted by: Steven Chamberlain <steven pyro eu org>
Approved by: so

7 years agoDisconnect ipftest and ipresend from the build until it can be verified
cy [Tue, 14 Mar 2017 02:10:37 +0000 (02:10 +0000)]
Disconnect ipftest and ipresend from the build until it can be verified
that they still work. These utilities have become out of sync with the
code in the kernel and need work to bring them back into shape.
Most people test on real systems or VMs on real networks.

Suggested by: glebius

7 years agoRevert r315218 so that it may be committed together with r315219.
cy [Tue, 14 Mar 2017 02:06:12 +0000 (02:06 +0000)]
Revert r315218 so that it may be committed together with r315219.

7 years agoRevert r315219 so that it may be committed together with r315218.
cy [Tue, 14 Mar 2017 02:04:44 +0000 (02:04 +0000)]
Revert r315219 so that it may be committed together with r315218.

7 years agoTemporarily remove sbin/ipftest and sbin/ipresend until it can be
cy [Tue, 14 Mar 2017 01:15:14 +0000 (01:15 +0000)]
Temporarily remove sbin/ipftest and sbin/ipresend until it can be
verified that they still work. See r315218 for the reason why.

In support of: r315218

7 years agoDisconnect ipftest and ipresend from the build until it can be verified
cy [Tue, 14 Mar 2017 01:00:09 +0000 (01:00 +0000)]
Disconnect ipftest and ipresend from the build until it can be verified
that they still work. These utilities have become out of sync with the
code in the kernel and need work to bring them back into shape.
Most people test on real systems or VMs on real networks.

Sugested by: glebius

7 years agoIFLIB updates
sbruno [Mon, 13 Mar 2017 22:53:06 +0000 (22:53 +0000)]
IFLIB updates
- unconditionally enable BUS_DMA on non-x86 architectures
- speed up rxd zeroing via customized function
- support out of order updates to rxd's
- add prefetching to hardware descriptor rings
- only prefetch on 10G or faster hardware
- add seperate tx queue intr function
- preliminary rework of NETMAP interfaces, WIP

Submitted by: Matt Macy <mmacy@nextbsd.org>
Sponsored by: Limelight Networks

7 years agoypbind(8): let calloc(3) do the multiplying.
pfg [Mon, 13 Mar 2017 20:51:00 +0000 (20:51 +0000)]
ypbind(8): let calloc(3) do the multiplying.

7 years agompsutil(8): let calloc(3) do the multiplying.
pfg [Mon, 13 Mar 2017 20:49:31 +0000 (20:49 +0000)]
mpsutil(8): let calloc(3) do the multiplying.

7 years agonscd(8): let calloc(3) do the multiplying.
pfg [Mon, 13 Mar 2017 20:34:53 +0000 (20:34 +0000)]
nscd(8): let calloc(3) do the multiplying.

MFC after: 1 week

7 years agomkimg(1): let calloc(3) do the multiplication.
pfg [Mon, 13 Mar 2017 20:14:07 +0000 (20:14 +0000)]
mkimg(1): let calloc(3) do the multiplication.

Reviewed by: marcel
MFC after: 1 week

7 years agohier(7): Fix entry location for /usr/share/vt.
bdrewery [Mon, 13 Mar 2017 19:54:20 +0000 (19:54 +0000)]
hier(7): Fix entry location for /usr/share/vt.

MFC after: 2 weeks

7 years agoUpdate a comment to reflect reality.
markj [Mon, 13 Mar 2017 18:45:25 +0000 (18:45 +0000)]
Update a comment to reflect reality.

MFC after: 1 week

7 years agoFix a backwards comparison in the code to dump a DTrace debug buffer.
markj [Mon, 13 Mar 2017 18:43:00 +0000 (18:43 +0000)]
Fix a backwards comparison in the code to dump a DTrace debug buffer.

PR: 217739
MFC after: 1 week

7 years agoalias_proxy.c: Fix accidental error quashing
cem [Mon, 13 Mar 2017 18:05:31 +0000 (18:05 +0000)]
alias_proxy.c: Fix accidental error quashing

This was introduced on accident in r165243, when return sites were unified
to add a lock around LibAliasProxyRule().

PR: 217749
Submitted by: Svyatoslav <razmyslov at viva64.com>
Sponsored by: Viva64 (PVS-Studio)

7 years agobsnmpd: fix segfault when trans_insert_port(..) is called with multiple
ngie [Mon, 13 Mar 2017 18:01:01 +0000 (18:01 +0000)]
bsnmpd: fix segfault when trans_insert_port(..) is called with multiple
out of order addresses

Move `port->transport` initialization before the TAILQ_FOREACH(..) loop
to ensure that the value is properly initialized before it's inserted
into the TAILQ.

MFC after: 1 week
PR: 217760
Submitted by: eugen
Sponsored by: Dell EMC Isilon

7 years agoscif_sas_controller: Fix inverted logic range check
cem [Mon, 13 Mar 2017 17:58:08 +0000 (17:58 +0000)]
scif_sas_controller: Fix inverted logic range check

PR: 217742
Submitted by: Svyatoslav <razmyslov at viva64.com>
Sponsored by: Viva64 (PVS-Studio)

7 years agonat64lsn: Use memset() with structure, not pointer, size
cem [Mon, 13 Mar 2017 17:53:46 +0000 (17:53 +0000)]
nat64lsn: Use memset() with structure, not pointer, size

PR: 217738
Submitted by: Svyatoslav <razmyslov at viva64.com>
Sponsored by: Viva64 (PVS-Studio)

7 years agosbin/dhclient: fix `vendor` storage leak in parse_option_decl(..)
ngie [Mon, 13 Mar 2017 17:45:00 +0000 (17:45 +0000)]
sbin/dhclient: fix `vendor` storage leak in parse_option_decl(..)

This ensures the storage isn't leaked when non-NULL and the function
returns early, prior to the `free(vendor)` later on in the function.

MFC after: 1 week
Reported by: Coverity
CID: 1007111-1007113
Reviewed by: cem
Sponsored by: Dell EMC Isilon
Differential Revision: D9993

7 years agolib/libcam/cam_cdbparse.3: fix manpage warnings
ngie [Mon, 13 Mar 2017 17:35:55 +0000 (17:35 +0000)]
lib/libcam/cam_cdbparse.3: fix manpage warnings

- Add comma before and after 'e.g.'; remove surrounding parentheses
  that were unnecessary after this change [1].
- Add .Mt when referencing ken and Peter Dufault's email addresses
  [2].
- Sprinkle around .An use where proper [2].

Bump .Dd for the change

MFC after: 1 week
Reported by: igor [1], manlint [2]
Reviewed by: imp
Sponsored by: Dell EMC Isilon
Differential Revision: D9968

7 years agocxgbe(4): Fix an always-true assertion (reported by PVS-Studio).
np [Mon, 13 Mar 2017 17:16:29 +0000 (17:16 +0000)]
cxgbe(4):  Fix an always-true assertion (reported by PVS-Studio).

sys/dev/cxgbe/t4_main.c: PVS-Studio: Expression is Always True (CWE-571) (3)

PR: 217746
Submitted by: Svyatoslav (razmyslov at viva64 com)
MFC after: 1 week

7 years agoFix -Wunused-but-set-warning with `ret`
ngie [Mon, 13 Mar 2017 17:15:45 +0000 (17:15 +0000)]
Fix -Wunused-but-set-warning with `ret`

While here, resolve Coverity warnings by demonstrating that vfprintf's
return value is being explicitly ignored.

MFC after: 1 week
Reported by: gcc 6.3.0
Tested with: clang, gcc 4.2.1, gcc 6.3.0
Sponsored by: Dell EMC Isilon

7 years agosbin/dhclient: fix a memory leak in parse_client_lease_statement(..)
ngie [Mon, 13 Mar 2017 17:05:49 +0000 (17:05 +0000)]
sbin/dhclient: fix a memory leak in parse_client_lease_statement(..)

The memory stored by `lease` would have previously been leaked if an
unterminated lease declaration was found in an early-return code path.

MFC after: 1 week
Reported by: clang static analyzer, Coverity
CID: 1007114
Submitted by: Tom Rix <trix@juniper.net>
Sponsored by: Dell EMC Isilon; Juniper, Inc
Differential Revision: D9992

7 years ago[net80211] begin fleshing out per-VAP WME configurations.
adrian [Mon, 13 Mar 2017 16:44:06 +0000 (16:44 +0000)]
[net80211] begin fleshing out per-VAP WME configurations.

As part of (eventual) p2p/tdls/multi-STA support, a lot of global configuration
parameters (WME, ERP (slot, preamble), channel width, HT protmode, etc are the
biggest offenders) should be per-VAP.

For multi-BSS VAP operation they may be linked, but for p2p/TDLS
operation that can be off-channel they can definitely be different
(think: 2GHz STA, 5GHz p2p.)

The global configuration view of these is mostly a "configure the current
non-smart-firmware NIC" view.  This should be split up into per-VAP state,
then a global non-smart-firmware-NIC management layer to handle channel
changes and such in software.

This is step one in a loooong road for this.  It should be a big non-functional
change for everyone.

* create a per-VAP WME update call.
* call it if its set, and call the global callback if it isn't

This still uses global WME state - it's just preparation for a future change
which will make the WME state per-VAP and fall through to a shared WME
configuration for hostap operation.

Note: this requires a full kernel recompile; the internal net80211 ABI has changed.

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D9986

7 years agoDo not die if cap_rights_limit reports ENOSYS
bapt [Mon, 13 Mar 2017 15:34:21 +0000 (15:34 +0000)]
Do not die if cap_rights_limit reports ENOSYS

Reported by: mmel

7 years agoAfter r315112 I broke the tests with eli, instead to pass 0, I should pass
araujo [Mon, 13 Mar 2017 13:56:01 +0000 (13:56 +0000)]
After r315112 I broke the tests with eli, instead to pass 0, I should pass
M_NOWAIT to g_media_changed() that will call g_post_event() with this flag.

Reported by: lwhsu, ngie and ae

7 years agoReport disk flags via the sysctl tree
scottl [Mon, 13 Mar 2017 11:09:17 +0000 (11:09 +0000)]
Report disk flags via the sysctl tree

7 years agoIgnore ifnet renaming in the bpf ifnet departure handler.
ae [Mon, 13 Mar 2017 09:04:10 +0000 (09:04 +0000)]
Ignore ifnet renaming in the bpf ifnet departure handler.

PR: 213015
MFC after: 1 week

7 years agoAdd constants and descriptions for some new PCI class definitions
scottl [Mon, 13 Mar 2017 07:45:15 +0000 (07:45 +0000)]
Add constants and descriptions for some new PCI class definitions

7 years agoMinor libc cleanup: let calloc(3) do the multiplication.
pfg [Mon, 13 Mar 2017 04:14:03 +0000 (04:14 +0000)]
Minor libc cleanup: let calloc(3) do the multiplication.

MFC after: 3 days

7 years agolib/libcam/cam.3: note that cam_freeccb(3) with ccb == NULL is a no-op
ngie [Mon, 13 Mar 2017 02:12:33 +0000 (02:12 +0000)]
lib/libcam/cam.3: note that cam_freeccb(3) with ccb == NULL is a no-op

This allows me to accurately test this scenario, and for others to rely
on the behavior, instead of relying on knowledge obtained via code
inspection.

Wording borrowed from free(3).

MFC after: 1 week
Requested by: ken (D9928)
Reviewed by: imp
Sponsored by: Dell EMC Isilon
Differential Revision: D9969

7 years agoFix CFLAGS for including netipsec headers #includes
ngie [Mon, 13 Mar 2017 01:05:25 +0000 (01:05 +0000)]
Fix CFLAGS for including netipsec headers #includes

The netipsec headers are referenced via netipsec/..., not ./... .
Thus, assuming that the netipsec/... is nested under ${SRCTOP}/sys/netipsec
is wrong.

This tripped up some individuals building ^/head on systems pre-r314812.

MFC after: 1 week
Reported by: Roberto Rodriguez Jr <rob.rodz.jr9@gmail.com>
Sponsored by: Dell EMC Isilon

7 years agoReadd codes that creates a tmp file for diffing stdout or devices
bapt [Sun, 12 Mar 2017 20:19:37 +0000 (20:19 +0000)]
Readd codes that creates a tmp file for diffing stdout or devices

7 years ago[evdev] Fix Right Alt and Keypad Enter event codes for atkbd(4) and kbdmux(4) drivers
gonzo [Sun, 12 Mar 2017 19:28:44 +0000 (19:28 +0000)]
[evdev] Fix Right Alt and Keypad Enter event codes for atkbd(4) and kbdmux(4) drivers

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9320

7 years ago[evdev] Fix race condition between client's event queue reading and dropping
gonzo [Sun, 12 Mar 2017 19:27:44 +0000 (19:27 +0000)]
[evdev] Fix race condition between client's event queue reading and dropping

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9320

7 years ago[evdev] Do not ignore result evdev_register in UI_DEV_CREATE handler
gonzo [Sun, 12 Mar 2017 19:26:24 +0000 (19:26 +0000)]
[evdev] Do not ignore result evdev_register in UI_DEV_CREATE handler

Make sure that uinput state field reflects actual state by checking
evdev_register result for errors

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Differential Revision: https://reviews.freebsd.org/D9320

7 years agoConvert gnu to using SRCTOP
imp [Sun, 12 Mar 2017 18:59:16 +0000 (18:59 +0000)]
Convert gnu to using SRCTOP

Prefer SRCTOP over CURDIR/../../contrib, etc. However, retain the "up
one level" instances of ../ because they are really relative to this
part of the tree and not a means to find the root of the tree. As
such, it's better to leave them since that further the goal of being
able to move directories if watned to in the future.

Differential Revision: https://reviews.freebsd.org/D9932
Sponsored by: Netflix
Silence On: arch@ (twice)

7 years agoMake rescue use SRCTOP
imp [Sun, 12 Mar 2017 18:59:09 +0000 (18:59 +0000)]
Make rescue use SRCTOP

Transition to SRCTOP. Also, standardize of {} instead of () variable
deliminators while I'm here.

Differential Revision: https://reviews.freebsd.org/D9932
Sponsored by: Netflix
Silence On: arch@ (twice)

7 years agoFix two CURDIR references in comments that should be SRCTOP
imp [Sun, 12 Mar 2017 18:59:05 +0000 (18:59 +0000)]
Fix two CURDIR references in comments that should be SRCTOP
references.

Differential Revision: https://reviews.freebsd.org/D9932
Sponsored by: Netflix
Silence On: arch@ (twice)

7 years agoConvert include over to SRCTOP
imp [Sun, 12 Mar 2017 18:59:00 +0000 (18:59 +0000)]
Convert include over to SRCTOP

Use SRCTOP in place of .CURDIR/.. as appropriate. The hand-crafted
relative paths for the "links" option remain, though, since those are
relative to /usr/include/sys/<blah> not to the source tree.

Differential Revision: https://reviews.freebsd.org/D9932
Sponsored by: Netflix
Silence On: arch@ (twice)

7 years agoMove /etc/ to SRCTOP
imp [Sun, 12 Mar 2017 18:58:55 +0000 (18:58 +0000)]
Move /etc/ to SRCTOP

Prefer ${SRCTOP}/ to ${.CURDIR}/../ and ${.CURDIR}/../../ as appropriate.

Differential Revision:  https://reviews.freebsd.org/D9932
Sponsored by: Netflix
Silence On: arch@ (twice)

7 years agoAdopt SRCTOP in usr.bin
imp [Sun, 12 Mar 2017 18:58:44 +0000 (18:58 +0000)]
Adopt SRCTOP in usr.bin

Prefer ${SRCTOP}/foo over ${.CURDIR}/../../foo and ${SRCTOP}/usr.bin/foo
over ${.CURDIR}/../foo for paths in Makefiles.

Differential Revision: https://reviews.freebsd.org/D9932
Sponsored by: Netflix
Silence on: arch@ (twice)

7 years agoChange 'Hz' back to 'HZ'... it's referring to the kernel config option
ian [Sun, 12 Mar 2017 18:07:03 +0000 (18:07 +0000)]
Change 'Hz' back to 'HZ'... it's referring to the kernel config option
named HZ, not being used as an abbreviation of the unit of measure.

7 years agoExport the actual LID state via sysctl. This allows more complex
imp [Sun, 12 Mar 2017 18:00:02 +0000 (18:00 +0000)]
Export the actual LID state via sysctl. This allows more complex
policies about when to suspend based on other events happening AND the
lid being closed through the use of clever devd or other scripts.

7 years agoCorrect the abbreviations for microseconds (us, not ms), and for Hz (not HZ).
ian [Sun, 12 Mar 2017 17:43:45 +0000 (17:43 +0000)]
Correct the abbreviations for microseconds (us, not ms), and for Hz (not HZ).

7 years agoRevert r314780
pfg [Sun, 12 Mar 2017 17:41:51 +0000 (17:41 +0000)]
Revert r314780
libpam: extra bounds checking through reallocarray(3).

It appears to be causing brokenness when reporting PAM_* environment
variables. This requires more investigation.

Reported by: lstewart

7 years agoRemove strange config_intrhook_establish() magic.
mav [Sun, 12 Mar 2017 16:55:18 +0000 (16:55 +0000)]
Remove strange config_intrhook_establish() magic.

Interrupts are enabled as part of chip reset just during driver attach.
Later "enabling" of already enabled interrupts is useless.

MFC after: 2 weeks

7 years agolibc: provide some bounds-checking through reallocarray(3).
pfg [Sun, 12 Mar 2017 16:03:34 +0000 (16:03 +0000)]
libc: provide some bounds-checking through reallocarray(3).

reallocarray(3) is a non portable extension that originated in OpenBSD.
Given that it is already in FreeBSD's libc it is useful for the cases
where reallocation involves a multiplication.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9955

7 years agoTry to slight untangle I/O and loop status handling.
mav [Sun, 12 Mar 2017 15:36:07 +0000 (15:36 +0000)]
Try to slight untangle I/O and loop status handling.

MFC after: 2 weeks

7 years agoRemove code for unsupported FreeBSD versions.
mav [Sun, 12 Mar 2017 14:17:57 +0000 (14:17 +0000)]
Remove code for unsupported FreeBSD versions.

MFC after: 2 weeks

7 years agoAvoid reusing p_ksi while it is on queue.
kib [Sun, 12 Mar 2017 13:58:51 +0000 (13:58 +0000)]
Avoid reusing p_ksi while it is on queue.

When sending SIGCHLD informing reaper that a zombie was reparented to
it, we might race with the situation where the previous parent still
not finished delivering SIGCHLD and having its p_ksi structure on the
signal queue.  While on queue, the ksi should not be used for another
send.

Fix this by copying p_ksi into newly allocated ksi, which is directly
put onto reaper sigqueue.  The later ensures that siginfo for reaper
SIGCHLD is always present, similar to guarantees for siginfo of child.

Reported by: bdrewery
Discussed with: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFollow-up to r313690.
kib [Sun, 12 Mar 2017 13:53:13 +0000 (13:53 +0000)]
Follow-up to r313690.

Fix two missed places where vm_object offset to index calculation
should use unsigned shift, to allow handling of full range of unsigned
offsets used to create device mappings.

Reported and tested by: royger (previous version)
Reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAccept linkers representation for ELF segments with zero on-disk length.
kib [Sun, 12 Mar 2017 13:51:13 +0000 (13:51 +0000)]
Accept linkers representation for ELF segments with zero on-disk length.

For such segments, GNU bfd linker writes knowingly incorrect value
into the the file offset field of the program header entry, with the
motivation that file should not be mapped for creation of this segment
at all.

Relax checks for the ELF structure validity when on-disk segment
length is zero, and explicitely set mapping length to zero for such
segments to avoid validating rounding arithmetic.

PR: 217610
Reported by: Robert Clausecker <fuz@fuz.su>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoStyle.
kib [Sun, 12 Mar 2017 13:49:42 +0000 (13:49 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoKtracing kevent(2) calls with unusual arguments might leads to an
kib [Sun, 12 Mar 2017 13:48:24 +0000 (13:48 +0000)]
Ktracing kevent(2) calls with unusual arguments might leads to an
overly large allocation requests.

When ktrace-ing io, sys_kevent() allocates memory to copy the
requested changes and reported events.  Allocations are sized by the
incoming syscall lengths arguments, which are user-controlled, and
might cause overflow in calculations or too large allocations.

Since io trace chunks are limited by ktr_geniosize, there is no sense
it even trying to satisfy unbounded allocations.  Export ktr_geniosize
and clamp the buffers sizes in advance.

PR: 217435
Reported by: Tim Newsham <tim.newsham@nccgroup.trust>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoSome more polishing.
mav [Sun, 12 Mar 2017 12:38:16 +0000 (12:38 +0000)]
Some more polishing.

MFC after: 13 days

7 years agoAdd a __printflike() that would have caught the bug fixed in r314396.
des [Sun, 12 Mar 2017 11:54:35 +0000 (11:54 +0000)]
Add a __printflike() that would have caught the bug fixed in r314396.

7 years ago- Remove separate handling of /bin and /usr/bin in manpath. They are no
tijl [Sun, 12 Mar 2017 10:56:19 +0000 (10:56 +0000)]
- Remove separate handling of /bin and /usr/bin in manpath.  They are no
  longer a special case.
- Prefer PREFIX/share/man over PREFIX/man.
- Add /usr/local/share/man to man_default_path.
- Update manpath man page.

Reviewed by: bapt

7 years agoUse 'options EXT_RESOURCES' instead of 'device ext_resources' for FDT enabled
manu [Sun, 12 Mar 2017 07:09:50 +0000 (07:09 +0000)]
Use 'options EXT_RESOURCES' instead of 'device ext_resources' for FDT enabled
MIPS kernel config.

7 years agopf: Fix incorrect rw_sleep() in pf_unload()
kp [Sun, 12 Mar 2017 05:42:57 +0000 (05:42 +0000)]
pf: Fix incorrect rw_sleep() in pf_unload()

When we unload we don't hold the pf_rules_lock, so we cannot call rw_sleep()
with it, because it would release a lock we do not hold. There's no need for the
lock either, so we can just tsleep().

While here also make the same change in pf_purge_thread(), because it explicitly
takes the lock before rw_sleep() and then immediately releases it afterwards.

7 years agolib/libcam/cam.3: fix manpage warnings
ngie [Sun, 12 Mar 2017 05:20:49 +0000 (05:20 +0000)]
lib/libcam/cam.3: fix manpage warnings

- spelling: "mis-named" should be "misnamed".
- delete spaces interspersed in literal representation of
  `struct cam_device` as hard-tabs separate the types and fields.
- Add commas after `e.g.`.

Reported by: igor
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoUse .Dv when referencing NULL
ngie [Sun, 12 Mar 2017 05:07:33 +0000 (05:07 +0000)]
Use .Dv when referencing NULL

This is the correct markup macro, as opposed to .Va (variable names)

While here, annotate several bare references to `NULL` with .Dv.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agopf: Do not lose the VNET lock when ending the purge thread
kp [Sun, 12 Mar 2017 05:00:04 +0000 (05:00 +0000)]
pf: Do not lose the VNET lock when ending the purge thread

When the pf_purge_thread() exits it must make sure to release the
VNET_LIST_RLOCK it still holds.
kproc_exit() does not return.

7 years agoRemove /rescue/zdb if MK_ZFS == no
ngie [Sun, 12 Mar 2017 04:28:45 +0000 (04:28 +0000)]
Remove /rescue/zdb if MK_ZFS == no

Missed in r202452.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoConditionally compile [additional] programs into rescue(8) if requested
ngie [Sun, 12 Mar 2017 04:24:29 +0000 (04:24 +0000)]
Conditionally compile [additional] programs into rescue(8) if requested

Trivial oversight missed in r314240 cleanup because I enable these knobs on
my test machines.

MK_INET6_SUPPORT - rtsol
MK_NETCAT - nc

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoAdd the capability to refresh the gpart(8) label without need a reboot.
araujo [Sun, 12 Mar 2017 04:15:56 +0000 (04:15 +0000)]
Add the capability to refresh the gpart(8) label without need a reboot.

gpart(8) has functionality to change the label of an GPT partition.
This functionality works like it should, however, after a label change
the /dev/gpt/ entries remain unchanged. glabel(8) status output remains
unchanged. The change only takes effect after a reboot.

PR: 162690
Submitted by: sub.mesa@gmail, Ben RUBSON <ben.rubson@gmail.com>, ae
Reviewed by: allanjude, bapt, bcr
MFC after: 6 weeks.
Differential Revision: https://reviews.freebsd.org/D9935

7 years agoRemove /rescue/iscsictl and /rescue/iscsid if MK_ISCSI == no
ngie [Sun, 12 Mar 2017 04:14:21 +0000 (04:14 +0000)]
Remove /rescue/iscsictl and /rescue/iscsid if MK_ISCSI == no

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoRestore some of the error message text accidentally removed in r315098
ngie [Sun, 12 Mar 2017 04:08:36 +0000 (04:08 +0000)]
Restore some of the error message text accidentally removed in r315098

"unexpected symlink contents" is more pedantically correct than
"unexpected symlink".

MFC after: 1 week
X-MFC with: r315098
Sponsored by: Dell EMC Isilon

7 years agoFix building with recent gcc
bapt [Sun, 12 Mar 2017 04:04:16 +0000 (04:04 +0000)]
Fix building with recent gcc

Reported by: lwhsu, ngie

7 years agoAdd 3 more testcases demonstrating how install -l sr works
ngie [Sun, 12 Mar 2017 03:58:54 +0000 (03:58 +0000)]
Add 3 more testcases demonstrating how install -l sr works

The additional testcases use absolute paths for sources and targets,
as the other testcase which tested `-l sr` used flat relative paths in
the same directory.

Please note that these testcases do not test `-l a` -- that's already
addressed in the battery of tests.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix bad latest entry
bapt [Sun, 12 Mar 2017 03:53:41 +0000 (03:53 +0000)]
Fix bad latest entry

Reported by: ngie

7 years agolibc: small cleanup.
pfg [Sun, 12 Mar 2017 03:50:13 +0000 (03:50 +0000)]
libc: small cleanup.

Initialize newsize in the code section so we avoids asigning the
value if we exit early.

7 years agoImplement a stub --horizon-lines=NUM for compatibility with GNU diff3
bapt [Sun, 12 Mar 2017 03:49:05 +0000 (03:49 +0000)]
Implement a stub --horizon-lines=NUM for compatibility with GNU diff3

some options of GNU diff3 would call diff with --horizon-lines, rcs is depending
on that.

Reported by: antoine

7 years agoUse nitems() from sys/param.h.
araujo [Sun, 12 Mar 2017 03:43:28 +0000 (03:43 +0000)]
Use nitems() from sys/param.h.

Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D9943

7 years agoFix wrong date in diff(1)
bapt [Sun, 12 Mar 2017 03:36:33 +0000 (03:36 +0000)]
Fix wrong date in diff(1)

Reported by: rgrimes

7 years agoFinish removal of WITHOUT_MANDOCDB
bapt [Sun, 12 Mar 2017 03:35:01 +0000 (03:35 +0000)]
Finish removal of WITHOUT_MANDOCDB

7 years agoFix native-xtools after replacement of GNU diff
bapt [Sun, 12 Mar 2017 03:33:20 +0000 (03:33 +0000)]
Fix native-xtools after replacement of GNU diff

7 years agoClarify src vs dest path mismatch in :symbolic_link_{absolute,relative}_body
ngie [Sun, 12 Mar 2017 03:29:49 +0000 (03:29 +0000)]
Clarify src vs dest path mismatch in :symbolic_link_{absolute,relative}_body

Unfortunately kyua does not omit the path mismatch on failure, so it must be coded
into the error message.

Cache the values, run the test(1) call, then print out the values in an atf_fail
call to emit the required diagnostics to debug why things are failing.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agolibc: small cleanups.
pfg [Sun, 12 Mar 2017 03:29:23 +0000 (03:29 +0000)]
libc: small cleanups.

Remove unused initialization: "num" is properly defined before use.

Reviewed by: ngie
MFC after: 3 days

7 years agolibc: small cleanups.
pfg [Sun, 12 Mar 2017 03:26:25 +0000 (03:26 +0000)]
libc: small cleanups.

Unsign setlen: it is local and will never be negative. Having one more bit
for growth is beneficial and it avoids a cast when it's going to be used
for allocation.

Reviewed by: ngie
MFC after: 3 days

7 years agolibc: small cleanups.
pfg [Sun, 12 Mar 2017 03:22:18 +0000 (03:22 +0000)]
libc: small cleanups.

Rename nitems to numitems: it shares the anme with an existing macro in
sys/params.h. Also initialize the value later which avoids asigning the
value if we exit early.

Reviewed by: ngie
MFC after: 3 days

7 years agoDelete duplicate -I <SRCTOP>/lib/libipsec added in r171135
ngie [Sun, 12 Mar 2017 02:21:16 +0000 (02:21 +0000)]
Delete duplicate -I <SRCTOP>/lib/libipsec added in r171135

It's already handled earlier on in the Makefile, per the change made
in r80029.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoRemove i915drm and radeondrm from NOTES and conf.
manu [Sun, 12 Mar 2017 00:52:16 +0000 (00:52 +0000)]
Remove i915drm and radeondrm from NOTES and conf.
This unbreak LINT kernel.

Reported by: lwhsu

7 years agoRevert r314833 until the problem with INSTALL_RSYMLINKS can be found
rgrimes [Sun, 12 Mar 2017 00:37:45 +0000 (00:37 +0000)]
Revert r314833 until the problem with INSTALL_RSYMLINKS can be found
as it appears to break arm release builds.

PR: 217705
Reported by: cyclaero@gmail.com
Approved by: grehan (mentor) implict as reverting

7 years agoExtend the pl011 small-fifos fix to other SoCs that indicate rev 5
ian [Sat, 11 Mar 2017 22:34:02 +0000 (22:34 +0000)]
Extend the pl011 small-fifos fix to other SoCs that indicate rev 5
hardware but lack the larger fifos rev 5 hardware should have.

The linux world (where our FDT data comes from) solved this by adding
a new property to pl011 nodes, "arm,primecell-periphid".  When this
property is present, its values override the values in the hardware
periphid registers.  For pl011 rev 5 hardware with small fifos, they
override the id so that it appears to be rev 4 hardware.

The driver now uses the new property when present.  It also continues
to check the device compat string, to handle older fdt data that may
still be in use on existing systems (on RPi systems it is common to
update system software without updating fdt data which is part of the
boot firmware).

Reviewed by: imp