]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoFix a buffer overflow in bootparamd(8)
Alan Somers [Wed, 24 May 2017 16:30:38 +0000 (16:30 +0000)]
Fix a buffer overflow in bootparamd(8)

If /etc/bootparams contains a line with an excessively long pathname, and a
client asks for that path, then bootparamd will overflow a buffer and crash
while parsing that line.  This is not remotely exploitable since it requires
a malformed /etc/bootparams file.

Reported by: Coverity
CID: 1305954
MFC after: 1 week
Sponsored by: Spectra Logic Corp

7 years agoIfdef out a redundant if statement when LARGE_NAT is disabled.
Cy Schubert [Wed, 24 May 2017 14:36:51 +0000 (14:36 +0000)]
Ifdef out a redundant if statement when LARGE_NAT is disabled.

MFC after: 1 week

7 years agobhyvegc_resize: make use of reallocarray(3) for bounds-checking.
Pedro F. Giffuni [Wed, 24 May 2017 14:24:47 +0000 (14:24 +0000)]
bhyvegc_resize: make use of reallocarray(3) for bounds-checking.

Also add __FBSDID.

Reviewed by: grehan

This file lacks a license(!) so for this change the following declaration
applies:

To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably
and unconditionally waives, abandons, and surrenders all of Affirmer's
Copyright and Related Rights and associated claims and causes of action,
whether now known or unknown (including existing as well as future claims
and causes of action).

7 years agoAdd BIT_OR2(), BIT_AND2(), BIT_NAND2(), BIT_XOR() and BIT_XOR2().
Konstantin Belousov [Wed, 24 May 2017 10:09:54 +0000 (10:09 +0000)]
Add BIT_OR2(), BIT_AND2(), BIT_NAND2(), BIT_XOR() and BIT_XOR2().

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 2 weeks

7 years agoUse __BSD_VISIBLE test instead checking for absense of _POSIX_SOURCE.
Konstantin Belousov [Wed, 24 May 2017 09:25:13 +0000 (09:25 +0000)]
Use __BSD_VISIBLE test instead checking for absense of _POSIX_SOURCE.

The Termios headers <termios.h> and <sys/_termios.h> used sometimes
_POSIX_SOURCE directly to determine if a thing should be exposed to
the user.  This circumvented the feature mechanisms of <sys/cdefs.h>.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 2 weeks

7 years agocxgbe/iw_cxgbe: sodisconnect failures are harmless and should not be
Navdeep Parhar [Wed, 24 May 2017 04:48:09 +0000 (04:48 +0000)]
cxgbe/iw_cxgbe: sodisconnect failures are harmless and should not be
treated as fatal errors.

MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoAdd missing MLINKS for functions decribed in iflibdd(9), iflibdi(9), and
Kevin Lo [Wed, 24 May 2017 01:03:30 +0000 (01:03 +0000)]
Add missing MLINKS for functions decribed in iflibdd(9), iflibdi(9), and
iflibtxrx(9).

7 years ago[ath] begin migration of AHB support to use the PCI style board data API for calibrat...
Adrian Chadd [Wed, 24 May 2017 01:02:35 +0000 (01:02 +0000)]
[ath] begin migration of AHB support to use the PCI style board data API for calibration data.

This brings the AHB support in line with the PCI support - now other "things"
can wrap up the calibration / board data into a firmware blob and have them
probe/attach after the system has finished booting.

Note that this change requires /all/ of the AHB using kernel configurations
to change - so until I drop those changes in, this breaks AHB.

Fear not, I'll do that soon.

TODO:

* the above stuff.

Tested:

* AR9331, carambola 2, loading if_ath / wlan as modules at run time

7 years agoFollowup to r318765 (capsicumize cpuset_*affinity)
Allan Jude [Wed, 24 May 2017 01:01:57 +0000 (01:01 +0000)]
Followup to r318765 (capsicumize cpuset_*affinity)

Update *sysent files

7 years agoRemove duplicate definition of iflib_led_create().
Kevin Lo [Wed, 24 May 2017 01:01:43 +0000 (01:01 +0000)]
Remove duplicate definition of iflib_led_create().

7 years agoAllow cpuset_{get,set}affinity in capabilities mode
Allan Jude [Wed, 24 May 2017 00:58:30 +0000 (00:58 +0000)]
Allow cpuset_{get,set}affinity in capabilities mode

bhyve was recently sandboxed with capsicum, and needs to be able to
control the CPU sets of its vcpu threads

Reviewed by: emaste, oshogbo, rwatson
MFC after: 2 weeks
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D10170

7 years agocxgbe(4): Update the T4, T5, and T6 firmwares to 1.16.45.0.
Navdeep Parhar [Tue, 23 May 2017 23:40:17 +0000 (23:40 +0000)]
cxgbe(4): Update the T4, T5, and T6 firmwares to 1.16.45.0.

The latest firmware has a number of link related fixes, support for a
new custom card, and the fix for a bug that affected rate limiting on
FreeBSD.

Obtained from: Chelsio Communications
MFC after: 1 week
Sponsored by: Chelsio Communications

7 years agoRemove the BSD/OS 2.1 system call gate LDT entry.
John Baldwin [Tue, 23 May 2017 22:34:18 +0000 (22:34 +0000)]
Remove the BSD/OS 2.1 system call gate LDT entry.

An extra copy of the system call gate was added to the default LDT back
in 1996 (r18513 / r18514).  However, the ability to run BSD/OS 2.1
i386 binaries under FreeBSD's native ABI is most likely no longer
needed.

Discussed with: kib

7 years agobhnd(4): Fix a SPROM identification regression introduced in r315866
Landon J. Fuller [Tue, 23 May 2017 22:30:15 +0000 (22:30 +0000)]
bhnd(4): Fix a SPROM identification regression introduced in r315866

In r315866, we introduced a direct read of the 8-bit sromrev field from the
memory mapped SPROM/OTP device. On OTP devices that require 16-bit access
alignment, this read fails, preventing identification of the SPROM layout.

So, let's perform an aligned read of the combined 16-bit sromrev/crc field
instead.

Approved by: adrian (mentor, implicit)

7 years agoUPDATING: ino64 upgrade should include COMPAT_FREEBSD11
Ed Maste [Tue, 23 May 2017 20:51:48 +0000 (20:51 +0000)]
UPDATING: ino64 upgrade should include COMPAT_FREEBSD11

The upgrade process requires COMPAT_FREEBSD11 to support the combination
of "old" userland and "new" kernel that exists after "make kernel" and
reboot.  Mention this explicitly for those using custom kernel configs.
Once the "new" world is installed the COMPAT_FREEBSD11 could be removed
again, but that does not seem necessary to mention in UPDATING.

Reported by: kib
Sponsored by: The FreeBSD Foundation

7 years agoAdd note to UPDATING for ino64 to follow the standard upgrade process
Ed Maste [Tue, 23 May 2017 20:25:49 +0000 (20:25 +0000)]
Add note to UPDATING for ino64 to follow the standard upgrade process

The existing upgrade process documented in UPDATING is both necessary
and sufficient for upgrading across the ino64 change.  However, the
shortcut of installing both kernel + world before a single reboot has
been possible for quite some time, and several developers and users
were surprised by fallout from ino64.  Add an explicit entry pointing
out that the full process must be followed.

Reviewed by: allanjude, gjb, vangyzen
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10877

7 years agoExtend libblacklist support with new action types
Kurt Lidl [Tue, 23 May 2017 19:03:07 +0000 (19:03 +0000)]
Extend libblacklist support with new action types

The original blacklist library supported two notification types:
 - failed auth attempt, which incremented the failed login count
   by one for the remote address
 - successful auth attempt, which reset the failed login count
   to zero for that remote address

When the failed login count reached the limit in the configuration
file, the remote address would be blocked by a packet filter.

This patch implements a new notification type, "abusive behavior",
and accepts, but does not act on an additional type, "bad username".
It is envisioned that a system administrator will configure a small
list of "known bad usernames" that should be blocked immediately.

Reviewed by: emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10604

7 years agoPass -N directly to ld via -Wl rather than passing it to the compiler driver.
John Baldwin [Tue, 23 May 2017 17:41:09 +0000 (17:41 +0000)]
Pass -N directly to ld via -Wl rather than passing it to the compiler driver.

In particular, clang doesn't accept -N.

Obtained from: CheriBSD
Sponsored by: DARPA / AFRL

7 years agodirectory(3): add trailing comma after e.g., missed in r318699
Enji Cooper [Tue, 23 May 2017 17:34:10 +0000 (17:34 +0000)]
directory(3): add trailing comma after e.g., missed in r318699

Submitted by: bjk
MFC after: 2 weeks
MFC with: r318699
Sponsored by: Dell EMC Isilon

7 years agoAdd security.bsd.see_jail_proc
Steve Wills [Tue, 23 May 2017 16:59:24 +0000 (16:59 +0000)]
Add security.bsd.see_jail_proc

Add security.bsd.see_jail_proc sysctl to hide jail processes from non-root
users

Reviewed by: jamie
Approved by: allanjude
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D10770

7 years agoBring some rough support for FreeBSD S/390 to the GNU toolchain.
Pedro F. Giffuni [Tue, 23 May 2017 16:38:10 +0000 (16:38 +0000)]
Bring some rough support for FreeBSD S/390 to the GNU toolchain.

This is no-op and only for reference: the S/390 port seems to be elusive
in the BSDs so it is convenient to keep some trace from past efforts.
It is likely newer attempts will focus on a newer toolchain using clang
instead.

Obtained from: Perforce depot/projects/s390

7 years agolibthr: fix warnings from GCC when WARNS=6
Eric van Gyzen [Tue, 23 May 2017 16:12:50 +0000 (16:12 +0000)]
libthr: fix warnings from GCC when WARNS=6

Fix warnings about:
- redundant declarations
- a local variable shadowing a global function (dlinfo)
- an old-style function definition (with an empty parameter list)
- a variable that is possibly used uninitialized

"make tinderbox" passes this time, except for a few unrelated
kernel failures.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10870

7 years agoHonor WITHOUT_TFTP for check-old* and delete-old* targets.
Glen Barber [Tue, 23 May 2017 15:46:21 +0000 (15:46 +0000)]
Honor WITHOUT_TFTP for check-old* and delete-old* targets.

Submitted by: philippe dot michel7 at sfr dot fr
PR: 217949
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoRemove redundant variable declaration.
Cy Schubert [Tue, 23 May 2017 14:38:59 +0000 (14:38 +0000)]
Remove redundant variable declaration.

MFC after: 3 days

7 years agoAdd COMPAT_FREEBSD11 on arm64, the arch is almost tier-1.
Konstantin Belousov [Tue, 23 May 2017 13:57:55 +0000 (13:57 +0000)]
Add COMPAT_FREEBSD11 on arm64, the arch is almost tier-1.

Discussed with: andrew, emaste
Sponsored by: The FreeBSD Foundation

7 years agoRemove superfluous parentheses.
Edward Tomasz Napierala [Tue, 23 May 2017 12:00:08 +0000 (12:00 +0000)]
Remove superfluous parentheses.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoRemove unneccessary call to mtree, which, when building as an unprivileged
Edward Tomasz Napierala [Tue, 23 May 2017 11:08:36 +0000 (11:08 +0000)]
Remove unneccessary call to mtree, which, when building as an unprivileged
user (with -DNO_ROOT), resulted in warnings looking like these:

share/man/cat8:
        user (9, 3819, not modified: Operation not permitted)
        permissions (0755, 0700, modified)

The BSD.usr.mk is already taken care of in etc/Makefile.

Submitted by: Alex Richardson <alr48@cl.cam.ac.uk>
Reviewed by: bdrewery
MFC after: 1 month
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9212

7 years agoFor ld.so direct execution mode, implement -p option: search for the
Konstantin Belousov [Tue, 23 May 2017 10:00:52 +0000 (10:00 +0000)]
For ld.so direct execution mode, implement -p option: search for the
binary in $PATH.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D10790

7 years agoFix possible double releasing for SA and SP references.
Andrey V. Elsukov [Tue, 23 May 2017 09:32:26 +0000 (09:32 +0000)]
Fix possible double releasing for SA and SP references.

There are two possible ways how crypto callback are called: directly from
caller and deffered from crypto thread.

For outbound packets the direct call chain is the following:
 IPSEC_OUTPUT() method -> ipsec[46]_common_output() ->
 -> ipsec[46]_perform_request() -> xform_output() ->
 -> crypto_dispatch() -> crypto_invoke() -> crypto_done() ->
 -> xform_output_cb() -> ipsec_process_done() -> ip[6]_output().

The SA and SP references are held while crypto processing is not finished.
The error handling code wrongly expected that crypto callback always called
from the crypto thread context, and it did references releasing in
xform_output_cb(). But when the crypto callback called directly, in case of
error the error handling code in ipsec[46]_perform_request() also did
references releasing.

To fix this, remove error handling from ipsec[46]_perform_request() and do it
in xform_output() before crypto_dispatch().

MFC after: 10 days

7 years agoRegen.
Konstantin Belousov [Tue, 23 May 2017 09:30:42 +0000 (09:30 +0000)]
Regen.

7 years agoCommit the 64-bit inode project.
Konstantin Belousov [Tue, 23 May 2017 09:29:05 +0000 (09:29 +0000)]
Commit the 64-bit inode project.

Extend the ino_t, dev_t, nlink_t types to 64-bit ints.  Modify
struct dirent layout to add d_off, increase the size of d_fileno
to 64-bits, increase the size of d_namlen to 16-bits, and change
the required alignment.  Increase struct statfs f_mntfromname[] and
f_mntonname[] array length MNAMELEN to 1024.

ABI breakage is mitigated by providing compatibility using versioned
symbols, ingenious use of the existing padding in structures, and
by employing other tricks.  Unfortunately, not everything can be
fixed, especially outside the base system.  For instance, third-party
APIs which pass struct stat around are broken in backward and
forward incompatible ways.

Kinfo sysctl MIBs ABI is changed in backward-compatible way, but
there is no general mechanism to handle other sysctl MIBS which
return structures where the layout has changed. It was considered
that the breakage is either in the management interfaces, where we
usually allow ABI slip, or is not important.

Struct xvnode changed layout, no compat shims are provided.

For struct xtty, dev_t tty device member was reduced to uint32_t.
It was decided that keeping ABI compat in this case is more useful
than reporting 64-bit dev_t, for the sake of pstat.

Update note: strictly follow the instructions in UPDATING.  Build
and install the new kernel with COMPAT_FREEBSD11 option enabled,
then reboot, and only then install new world.

Credits: The 64-bit inode project, also known as ino64, started life
many years ago as a project by Gleb Kurtsou (gleb).  Kirk McKusick
(mckusick) then picked up and updated the patch, and acted as a
flag-waver.  Feedback, suggestions, and discussions were carried
by Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles),
and Rick Macklem (rmacklem).  Kris Moore (kris) performed an initial
ports investigation followed by an exp-run by Antoine Brodin (antoine).
Essential and all-embracing testing was done by Peter Holm (pho).
The heavy lifting of coordinating all these efforts and bringing the
project to completion were done by Konstantin Belousov (kib).

Sponsored by: The FreeBSD Foundation (emaste, kib)
Differential revision: https://reviews.freebsd.org/D10439

7 years agoFix possible double releasing for SA reference.
Andrey V. Elsukov [Tue, 23 May 2017 09:01:48 +0000 (09:01 +0000)]
Fix possible double releasing for SA reference.

There are two possible ways how crypto callback are called: directly from
caller and deffered from crypto thread.

For inbound packets the direct call chain is the following:
 IPSEC_INPUT() method -> ipsec_common_input() -> xform_input() ->
 -> crypto_dispatch() -> crypto_invoke() -> crypto_done() ->
 -> xform_input_cb() -> ipsec[46]_common_input_cb() -> netisr_queue().

The SA reference is held while crypto processing is not finished.
The error handling code wrongly expected that crypto callback always called
from the crypto thread context, and it did SA reference releasing in
xform_input_cb(). But when the crypto callback called directly, in case of
error (e.g. data authentification failed) the error handling in
ipsec_common_input() also did SA reference releasing.

To fix this, remove error handling from ipsec_common_input() and do it
in xform_input() before crypto_dispatch().

PR: 219356
MFC after: 10 days

7 years agobsdinstall(8): fix manpage issues
Enji Cooper [Tue, 23 May 2017 08:01:11 +0000 (08:01 +0000)]
bsdinstall(8): fix manpage issues

- Start new sentences on new lines.
- Separate e.g. (more of an igor thing) with commas, and rewrite some examples
  not to be enclosed in parentheses.

Reported by: igor, make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agosade(8): start new sentence on new line
Enji Cooper [Tue, 23 May 2017 07:50:42 +0000 (07:50 +0000)]
sade(8): start new sentence on new line

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agokill(2): add missing section for sysctl(9)
Enji Cooper [Tue, 23 May 2017 07:46:10 +0000 (07:46 +0000)]
kill(2): add missing section for sysctl(9)

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoptrace(2): clean up trailing whitespace
Enji Cooper [Tue, 23 May 2017 07:45:29 +0000 (07:45 +0000)]
ptrace(2): clean up trailing whitespace

Reviewed by: make manlint
MFC after: 2 weeks

7 years agoopen(2): fix manlint warnings
Enji Cooper [Tue, 23 May 2017 07:44:43 +0000 (07:44 +0000)]
open(2): fix manlint warnings

- Sort SEE ALSO .Xr entries.
- Sort sections (HISTORY comes after STANDARDS).

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agorctl_add_rule(2): fix manlint warnings
Enji Cooper [Tue, 23 May 2017 07:32:57 +0000 (07:32 +0000)]
rctl_add_rule(2): fix manlint warnings

- Fix commas (either missing or misused) after .Nm entries in SYNOPSIS

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agocap_enter(2): fix manlint issues
Enji Cooper [Tue, 23 May 2017 07:31:03 +0000 (07:31 +0000)]
cap_enter(2): fix manlint issues

- Sort SEE ALSO section appropriately.
- Correct section for sysctl(9).

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years ago_umtx_op(2): fix minor manlint issues
Enji Cooper [Tue, 23 May 2017 07:26:45 +0000 (07:26 +0000)]
_umtx_op(2): fix minor manlint issues

- Sort .Xr entries in SEE ALSO section.
- Sort SEE ALSO and STANDARDS sections properly, in terms of the
  entire document.

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoLet vmstat -o recognize OBJT_MGTDEVICE objects.
Mark Johnston [Tue, 23 May 2017 07:20:29 +0000 (07:20 +0000)]
Let vmstat -o recognize OBJT_MGTDEVICE objects.

MFC after: 1 week

7 years agoxdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS
Enji Cooper [Tue, 23 May 2017 07:17:52 +0000 (07:17 +0000)]
xdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS

This unbreaks the .Nm declaration

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agofopencookie(3): declare function pointers in SYNOPSIS correctly
Enji Cooper [Tue, 23 May 2017 07:15:57 +0000 (07:15 +0000)]
fopencookie(3): declare function pointers in SYNOPSIS correctly

Add obligatory `*` in declarations.

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoquick_exit(3): delete trailing whitespace in licensing tort
Enji Cooper [Tue, 23 May 2017 07:14:46 +0000 (07:14 +0000)]
quick_exit(3): delete trailing whitespace in licensing tort

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoacl_to_text(3): start sentences on new lines
Enji Cooper [Tue, 23 May 2017 07:12:31 +0000 (07:12 +0000)]
acl_to_text(3): start sentences on new lines

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoacl_create_entry(3): separate .Nm entries with commas in SYNOPSIS
Enji Cooper [Tue, 23 May 2017 07:11:15 +0000 (07:11 +0000)]
acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agosctp_send(3): start sentences on new lines
Enji Cooper [Tue, 23 May 2017 07:10:20 +0000 (07:10 +0000)]
sctp_send(3): start sentences on new lines

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agolocaleconv(3): start sentences on new lines
Enji Cooper [Tue, 23 May 2017 07:09:26 +0000 (07:09 +0000)]
localeconv(3): start sentences on new lines

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agofopen(3): make manlint fixes
Enji Cooper [Tue, 23 May 2017 07:08:30 +0000 (07:08 +0000)]
fopen(3): make manlint fixes

- Break on new lines.
- Use .Dv with NULL.
- Rewrap lines as necessary/when possible.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoposix1e(3): reference using the section (3) when referencing libbsm with .Xr
Enji Cooper [Tue, 23 May 2017 07:05:34 +0000 (07:05 +0000)]
posix1e(3): reference using the section (3) when referencing libbsm with .Xr

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years ago__iconv_get_list: separate .Nm entries with commas
Enji Cooper [Tue, 23 May 2017 07:02:01 +0000 (07:02 +0000)]
__iconv_get_list: separate .Nm entries with commas

MFC after: 2 weeks
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agovis(3): delete spurious .Pp macro
Enji Cooper [Tue, 23 May 2017 07:00:46 +0000 (07:00 +0000)]
vis(3): delete spurious .Pp macro

MFC after: 2 weeks
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agotcsendbreak(3): delete spurious blank line at the end of the man page
Enji Cooper [Tue, 23 May 2017 06:58:08 +0000 (06:58 +0000)]
tcsendbreak(3): delete spurious blank line at the end of the man page

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agodirname(3): fix section ordering
Enji Cooper [Tue, 23 May 2017 06:56:57 +0000 (06:56 +0000)]
dirname(3): fix section ordering

IMPLEMENTATION NOTES come before RETURN VALUES

MFC after: 2 weeks
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agodirectory(3): delete trailing whitespace and rewrite `E.g.` as `e.g.`
Enji Cooper [Tue, 23 May 2017 06:55:51 +0000 (06:55 +0000)]
directory(3): delete trailing whitespace and rewrite `E.g.` as `e.g.`

Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agobasename(3): fix section ordering
Enji Cooper [Tue, 23 May 2017 06:53:31 +0000 (06:53 +0000)]
basename(3): fix section ordering

IMPLEMENTATION NOTES come before RETURN VALUES

MFC after: 2 weeks
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years ago[ar71xx] remove dead code!
Adrian Chadd [Tue, 23 May 2017 06:20:24 +0000 (06:20 +0000)]
[ar71xx] remove dead code!

7 years ago[ar71xx] add a very simple early boot driver called "caldata" to commit cross-layer...
Adrian Chadd [Tue, 23 May 2017 06:20:06 +0000 (06:20 +0000)]
[ar71xx] add a very simple early boot driver called "caldata" to commit cross-layer atrocities.

The (eventually) upcoming ath(4) changes will include being able to load
ath(4) devices on the AHB bus (ie the on-die wifi part of the SoC)
as modules.

In order for this to happen, a copy of the calibration data needs to be
copied away before the SPI driver runs or the memory map access hack
won't work.

Now, ideally (!) there'd be some driver that can come up after the MTD
pieces (eg, SPI, NAND, etc) and load into a firmware chunk the calibration
data.

(Or, really really nicely, would be an actual async firmware API that
would lead itself to having a driver schedule a file read - or a raw device
read - to get to the calibration data.)

Now, until all of the above is done - I'm going to perpetuate the layer
breaking atrocity here by simply doing the PCI bus fixup EEPROM/calibration
data hack here.  This will work for any AR71xx (and later on, AR231x/AR531x)
device, as well as the handful of QCA MIPS + QCA9880v2 802.11ac boards with
NOR flash.

To use, this goes into the kernel config:

# Enable EEPROM hacks
options AR71XX_ATH_EEPROM
device ar71xx_caldata
device firmware

# This enables the ath_ahb driver (when I commit the change!) to
# pull data out of the firmware hack.
options ATH_EEPROM_FIRMWARE

In the hints file:

# ART calibration data mapping device
hint.ar71xx_caldata.0.at="nexus0"
hint.ar71xx_caldata.0.order=0

# Where the ART is - last 64k in the first 8MB of flash
hint.ar71xx_caldata.0.map.0.ath_fixup_addr=0x1fff0000
hint.ar71xx_caldata.0.map.0.ath_fixup_size=16384

# And now tell the ath(4) driver where to look!
hint.ath.0.eeprom_firmware="ar71xx_caldata.0.map.0.eeprom_firmware"

Tested:

* carambola2, AR933x SoC, using a set of ath and ath_hal modules to load

TODO:

* unify this bit of firmware loading code, as I will definitely need
  to include both the PCI bus firmware version (for PCI ID fixups too!)
  as well as AHB/on-chip calibration data.

* Commit the ath_ahb bus code

* Convert .. everything over.  That'll take the majority of the time.

7 years agoerr(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0`
Enji Cooper [Tue, 23 May 2017 06:14:02 +0000 (06:14 +0000)]
err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0`

This is being done to aid humans and static analysis checkers.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agostyle(9): sort headers
Enji Cooper [Tue, 23 May 2017 06:05:54 +0000 (06:05 +0000)]
style(9): sort headers

MFC after: 2 weeks
MFC with: r318693
Sponsored by: Dell EMC Isilon

7 years agoSome minor style(9) fixes
Enji Cooper [Tue, 23 May 2017 06:04:38 +0000 (06:04 +0000)]
Some minor style(9) fixes

- Wrap at <80 columns.
- Sort by type

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years ago[arswitch] add phy debugging to the internal PHY read/write functions.
Adrian Chadd [Tue, 23 May 2017 03:48:42 +0000 (03:48 +0000)]
[arswitch] add phy debugging to the internal PHY read/write functions.

7 years agoAdd parent interface reference counting to if_vlan.
Alexander Motin [Tue, 23 May 2017 00:13:27 +0000 (00:13 +0000)]
Add parent interface reference counting to if_vlan.

Using plain ifunit() looks like a request for troubles.

MFC after: 1 week

7 years ago"struct ata_params" field "reserved206[2]" actually starts at offset 20*7*.
Ravi Pokala [Mon, 22 May 2017 23:31:28 +0000 (23:31 +0000)]
"struct ata_params" field "reserved206[2]" actually starts at offset 20*7*.

MFC after: 1 week
Sponsored by: Panasas

7 years agoEnsure that the mappings table is populated in proc_objname().
Mark Johnston [Mon, 22 May 2017 23:21:24 +0000 (23:21 +0000)]
Ensure that the mappings table is populated in proc_objname().

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agondbm.h: Add a comment pointing out our non-compliance with POSIX.
Pedro F. Giffuni [Mon, 22 May 2017 23:17:55 +0000 (23:17 +0000)]
ndbm.h: Add a comment pointing out our non-compliance with POSIX.

Changing it to full conformance breaks the ABI.

Reference:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/ndbm.h.html

Discussion at: https://reviews.freebsd.org/D10544

7 years agoAdd a little helper program for tst.exitcore.ksh.
Mark Johnston [Mon, 22 May 2017 20:34:51 +0000 (20:34 +0000)]
Add a little helper program for tst.exitcore.ksh.

sleep(1) is capsicumized, which means that we cannot rely on it to dump
core as required by the test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix powerpc compiler error.
Stephen McConnell [Mon, 22 May 2017 20:27:29 +0000 (20:27 +0000)]
Fix powerpc compiler error.

Approved by: ken

7 years agoReplacing iterating over rootpath by strsep(3).
Mariusz Zaborski [Mon, 22 May 2017 20:11:40 +0000 (20:11 +0000)]
Replacing iterating over rootpath by strsep(3).

Submitted by: kczekirda
Reviewed by: tsoome, bapt, jhb, oshogbo
MFC after: 3 weeks
Sponsored by: Oktawave
Differential Revision: https://reviews.freebsd.org/D10726

7 years agoFix regression in ndis(4) after r286410. This adds a bunch of checks for
Gleb Smirnoff [Mon, 22 May 2017 20:00:01 +0000 (20:00 +0000)]
Fix regression in ndis(4) after r286410. This adds a bunch of checks for
whether this is a Ethernet or 802.11 device and does proper dereferencing.

PR: 213237
Submitted by: <ota j.email.ne.jp>
MFC after: 2 weeks

7 years agoCheck for IPV6 TCP/UDP CSUM offload in pkt header during transmits.
David C Somayajulu [Mon, 22 May 2017 19:57:28 +0000 (19:57 +0000)]
Check for IPV6 TCP/UDP CSUM offload in pkt header during transmits.

Submitted by:Shminderjit.Singh@cavium.com

7 years agoPull in r302416 from upstream llvm trunk (by Martin Storsjö):
Dimitry Andric [Mon, 22 May 2017 16:16:48 +0000 (16:16 +0000)]
Pull in r302416 from upstream llvm trunk (by Martin Storsjö):

  [ARM] Clear the constant pool cache on explicit .ltorg directives

  Multiple ldr pseudoinstructions with the same constant value will
  reuse the same constant pool entry. However, if the constant pool is
  explicitly flushed with a .ltorg directive, we should not try to
  reference constants in the previous pool any longer, since they may
  be out of range.

  This fixes assembling hand-written assembler source which repeatedly
  loads the same constant value, across a binary size larger than the
  pc-relative fixup range for ldr instructions (4096 bytes). Such
  assembler source already uses explicit .ltorg instructions to emit
  constant pools with regular intervals. However if we try to reuse
  constants emitted in earlier pools, they end up out of range.

  This makes the output of the testcase match what binutils gas does
  (prior to this patch, it would fail to assemble).

  Differential Revision: https://reviews.llvm.org/D32847

This should fix "out of range pc-relative fixup value" errors, when
compiling certain ARM inline assembly for www/webkit-gtk[23].

Reported by: mmel
MFC after: 3 days

7 years agoFor now, disable building libc++experimental for arm, since there are a
Dimitry Andric [Mon, 22 May 2017 16:13:30 +0000 (16:13 +0000)]
For now, disable building libc++experimental for arm, since there are a
number of static assertion failures in the time_t related parts.

Reported by: mmel, kib

7 years agoRemove glimpse make target added in r181432
Enji Cooper [Mon, 22 May 2017 15:53:30 +0000 (15:53 +0000)]
Remove glimpse make target added in r181432

The textproc/glimpse port expired over 3 years ago because there weren't any
more publicly available distfiles, and because it lacked a maintainer. Remove
the target as it's no longer executable on FreeBSD.

Differential Revision: D10764
MFC after: 1 month
Reviewed by: imp
Sponsored by: Dell EMC Isilon

7 years agoThe connect() system call should return -1 and set errno to EAFNOSUPPORT
Michael Tuexen [Mon, 22 May 2017 15:29:10 +0000 (15:29 +0000)]
The connect() system call should return -1 and set errno to EAFNOSUPPORT
if it is called on a TCP socket
 * with an IPv6 address and the socket is bound to an
    IPv4-mapped IPv6 address.
 * with an IPv4-mapped IPv6 address and the socket is bound to an
   IPv6 address.
Thanks to Jonathan T. Leighton for reporting this issue.

Reviewed by: bz gnn
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9163

7 years agoAdd support for Amazon Elastic Network Adapter (ENA) NIC
Zbigniew Bodek [Mon, 22 May 2017 14:46:13 +0000 (14:46 +0000)]
Add support for Amazon Elastic Network Adapter (ENA) NIC

ENA is a networking interface designed to make good use of modern CPU
features and system architectures.

The ENA device exposes a lightweight management interface with a
minimal set of memory mapped registers and extendable command set
through an Admin Queue.

The driver supports a range of ENA devices, is link-speed independent
(i.e., the same driver is used for 10GbE, 25GbE, 40GbE, etc.), and has
a negotiated and extendable feature set.

Some ENA devices support SR-IOV. This driver is used for both the
SR-IOV Physical Function (PF) and Virtual Function (VF) devices.

ENA devices enable high speed and low overhead network traffic
processing by providing multiple Tx/Rx queue pairs (the maximum number
is advertised by the device via the Admin Queue), a dedicated MSI-X
interrupt vector per Tx/Rx queue pair, and CPU cacheline optimized
data placement.

The ENA driver supports industry standard TCP/IP offload features such
as checksum offload and TCP transmit segmentation offload (TSO).
Receive-side scaling (RSS) is supported for multi-core scaling.

The ENA driver and its corresponding devices implement health
monitoring mechanisms such as watchdog, enabling the device and driver
to recover in a manner transparent to the application, as well as
debug logs.

Some of the ENA devices support a working mode called Low-latency
Queue (LLQ), which saves several more microseconds. This feature will
be implemented for driver in future releases.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Jakub Palider <jpa@semihalf.com>
Jan Medala <jan@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon.com Inc.
Differential revision: https://reviews.freebsd.org/D10427

7 years agoAllow PORTSDIR to be overridden in the pkg-stage target.
Glen Barber [Mon, 22 May 2017 14:21:45 +0000 (14:21 +0000)]
Allow PORTSDIR to be overridden in the pkg-stage target.

Submitted by: Johannes Jost Meixner (original)
PR: 218393
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd 11.1 to the mdoc(7) mdoc.local.in.
Glen Barber [Mon, 22 May 2017 14:21:07 +0000 (14:21 +0000)]
Add 11.1 to the mdoc(7) mdoc.local.in.

Sponsored by: The FreeBSD Foundation

7 years agoCorrect the "first appeared in" version for efivar(8).
Glen Barber [Mon, 22 May 2017 13:55:59 +0000 (13:55 +0000)]
Correct the "first appeared in" version for efivar(8).

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoRevert r318583 (libthr: use default WARNS level of 6)
Eric van Gyzen [Mon, 22 May 2017 13:21:28 +0000 (13:21 +0000)]
Revert r318583 (libthr: use default WARNS level of 6)

Revert this while I fix RISC-V, SPARC, and probably all architectures
that use GCC.

Reported by: kib
Pointy hat to: vangyzen
Sponsored by: Dell EMC

7 years agoRegen sysent after r318634, no open(2) in capability mode
Ed Maste [Mon, 22 May 2017 11:45:45 +0000 (11:45 +0000)]
Regen sysent after r318634, no open(2) in capability mode

Sponsored by: The FreeBSD Foundation

7 years agodisallow open(2) in capability mode
Ed Maste [Mon, 22 May 2017 11:43:19 +0000 (11:43 +0000)]
disallow open(2) in capability mode

Previously open(2) was allowed in capability mode, with a comment that
suggested this was likely the case to facilitate debugging. The system
call would still fail later on, but it's better to disallow the syscall
altogether.

We now have the kern.trap_enotcap sysctl or PROC_TRAPCAP_CTL proccontrol
to aid in debugging.

In any case libc has translated open() to the openat syscall since
r277032.

Reviewed by: kib, rwatson
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10850

7 years agobsdinstall: do not use distextract in scripted mode
Roger Pau Monné [Mon, 22 May 2017 11:41:17 +0000 (11:41 +0000)]
bsdinstall: do not use distextract in scripted mode

It requires a tty, which might not be available in scripted installs. Instead
extract the sets manually using tar.

Reviewed by: tsoome
Sponsored by: Citrix Systems R&D
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D10736

7 years agobsdinstall: mount is not needed for the ZFS install case
Roger Pau Monné [Mon, 22 May 2017 11:38:39 +0000 (11:38 +0000)]
bsdinstall: mount is not needed for the ZFS install case

Because the datasets are already mounted by zfsboot, and the mount script
doesn't know anything about ZFS. Also do not execute the "umount" script for
ZFS for the same reasons.

Reviewed by: dteske, tsoome
Sponsored by: Citrix Systems R&D
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D10738

7 years agoxen/netfront: don't drop the RX lock in xn_rxeof
Roger Pau Monné [Mon, 22 May 2017 11:33:44 +0000 (11:33 +0000)]
xen/netfront: don't drop the RX lock in xn_rxeof

Since netfront uses different locks for the RX and TX paths there's no need to
drop the RX lock before calling if_input.

Suggested by: jhb
Tested by: cperciva
Sponsored by: Citrix Systems R&D
MFC with: r318523

7 years agoRefactor & compact struct i6addr_t #ifdef: remove redundant structure
Cy Schubert [Mon, 22 May 2017 03:01:35 +0000 (03:01 +0000)]
Refactor & compact struct i6addr_t #ifdef: remove redundant structure
definintion when USE_INET6 is false.

MFC after: 1 week

7 years agonm: document 'r' symbol type
Ed Maste [Mon, 22 May 2017 01:10:12 +0000 (01:10 +0000)]
nm: document 'r' symbol type

PR: 219245
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years ago[ar71xx] fix up dump space a la what jhb@ did elsewhere a while ago.
Adrian Chadd [Sun, 21 May 2017 23:55:58 +0000 (23:55 +0000)]
[ar71xx] fix up dump space a la what jhb@ did elsewhere a while ago.

7 years ago[libcompiler-rt] add bswapdi2/bswapsi2
Adrian Chadd [Sun, 21 May 2017 23:15:32 +0000 (23:15 +0000)]
[libcompiler-rt] add bswapdi2/bswapsi2

This is required for mips gcc 6.3 userland to build/run.

Reviewed by: emaste, dim
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D10838

7 years agoMake catman(1) use mandoc(1) by default
Baptiste Daroussin [Sun, 21 May 2017 22:28:28 +0000 (22:28 +0000)]
Make catman(1) use mandoc(1) by default

catman(1) checks if mandoc(1) do support the manpage before trying to generate
the catpage and falls back on nroff, using the same mechanism as man(1).

7 years agoUpdates for efivar.8
Benjamin Kaduk [Sun, 21 May 2017 22:10:08 +0000 (22:10 +0000)]
Updates for efivar.8

Fix spelling [1], appease igor and mandoc -Tlint, and adopt the
language style to be more consistent with our corpus.

PR: 219434 [1]
Submitted by: olgeni [1]

7 years agoAdd PICFLAG to build libc++experimental.a, so it can be used in all
Dimitry Andric [Sun, 21 May 2017 21:33:15 +0000 (21:33 +0000)]
Add PICFLAG to build libc++experimental.a, so it can be used in all
situations.

Noticed by: kib

7 years agomsdosfs: constify
Ed Maste [Sun, 21 May 2017 20:00:49 +0000 (20:00 +0000)]
msdosfs: constify

Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation

7 years agomsdosfs: correct constant and typo in comment
Ed Maste [Sun, 21 May 2017 19:48:16 +0000 (19:48 +0000)]
msdosfs: correct constant and typo in comment

Revisions:
fat.h 1.5 1.6

Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation

7 years agomsdosfs: capitalize FAT appropriately
Ed Maste [Sun, 21 May 2017 19:29:28 +0000 (19:29 +0000)]
msdosfs: capitalize FAT appropriately

Diff reduction with NetBSD, including some nearby minor whitespace or
style fixes.

Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation

7 years agoAdd libc++experimental.a for std::experimental support
Dimitry Andric [Sun, 21 May 2017 17:07:12 +0000 (17:07 +0000)]
Add libc++experimental.a for std::experimental support

This adds a separate library for supporting std::experimental features.
It is purposefully static, and must be explicitly linked into programs
using -lc++experimental.

PLEASE NOTE: there is NO WARRANTY as to any stability or continuing
existence of the features in the std::experimental parts of the C++
library!

Reviewed by: ed
Differential Revision: https://reviews.freebsd.org/D10840

7 years agoFix build of AIO tests with -DDEBUG
Alan Somers [Sun, 21 May 2017 15:37:08 +0000 (15:37 +0000)]
Fix build of AIO tests with -DDEBUG

Also, redefine some constants for clarity.  No functional change.

MFC after: 1 week

7 years agocompress: Allow uncompress -c with multiple pathnames, as required by POSIX.
Jilles Tjoelker [Sun, 21 May 2017 14:35:16 +0000 (14:35 +0000)]
compress: Allow uncompress -c with multiple pathnames, as required by POSIX.

Per POSIX, allow passing multiple pathnames to uncompress -c, concatenating
the uncompressed data.

Passing multiple pathnames to compress -c remains disallowed, since the
result cannot be decompressed.

PR: 219387
Reported by: Jörg Schilling

7 years agocompress: Add basic tests.
Jilles Tjoelker [Sun, 21 May 2017 14:05:32 +0000 (14:05 +0000)]
compress: Add basic tests.

7 years agoAdd get_cpu() and put_cpu().
Mark Johnston [Sun, 21 May 2017 00:06:36 +0000 (00:06 +0000)]
Add get_cpu() and put_cpu().

MFC after: 1 week