]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoAdd GRE-in-UDP encapsulation support as defined in RFC8086.
ae [Wed, 24 Apr 2019 09:05:45 +0000 (09:05 +0000)]
Add GRE-in-UDP encapsulation support as defined in RFC8086.

This GRE-in-UDP encapsulation allows the UDP source port field to be
used as an entropy field for load-balancing of GRE traffic in transit
networks. Also most of multiqueue network cards are able distribute
incoming UDP datagrams to different NIC queues, while very little are
able do this for GRE packets.

When an administrator enables UDP encapsulation with command
`ifconfig gre0 udpencap`, the driver creates kernel socket, that binds
to tunnel source address and after udp_set_kernel_tunneling() starts
receiving of all UDP packets destined to 4754 port. Each kernel socket
maintains list of tunnels with different destination addresses. Thus
when several tunnels use the same source address, they all handled by
single socket.  The IP[V6]_BINDANY socket option is used to be able bind
socket to source address even if it is not yet available in the system.
This may happen on system boot, when gre(4) interface is created before
source address become available. The encapsulation and sending of packets
is done directly from gre(4) into ip[6]_output() without using sockets.

Reviewed by: eugen
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D19921

5 years agoKeep two versions of the FreeBSD.conf pkg configuration file; one which
cperciva [Wed, 24 Apr 2019 06:25:21 +0000 (06:25 +0000)]
Keep two versions of the FreeBSD.conf pkg configuration file; one which
points at the "latest" branch and one which points at the "quarterly"
branch.  Install the "latest" version unless overridden via the newly
added PKGCONFBRANCH variable.

This does not change user-visible behaviour (assuming said vairable is
not set) but will make it easier to change the defaults in the future --
on stable branches we will want "latest" on x86 but "quarterly" elsewhere.

Discussed with: gjb
MFC after: 3 days
X-MFC: After MFCing this I'll make a direct commit to stable/* to
switch non-x86 architectures to "quarterly".

5 years agoUse `range` instead of `xrange`
ngie [Wed, 24 Apr 2019 05:52:24 +0000 (05:52 +0000)]
Use `range` instead of `xrange`

`xrange` is a pre-python 2.x compatible idiom. Use `range` instead. The values
being iterated over are sufficiently small that using range on python 2.x won't
be a noticeable issue.

MFC after: 2 months

5 years agoFix typo: `Plen` should be `plen`
ngie [Wed, 24 Apr 2019 05:49:48 +0000 (05:49 +0000)]
Fix typo: `Plen` should be `plen`

MFC after: 1 month
MFC with: r346617
Reported by: pylint -E

5 years agoDon't leak `fd` when manipulating the device via `_getdev()`
ngie [Wed, 24 Apr 2019 05:47:09 +0000 (05:47 +0000)]
Don't leak `fd` when manipulating the device via `_getdev()`

Close the file descriptor when done calling ioctl with a try-finally block so
it doesn't get leaked.

MFC after: 2 months

5 years agoRestore the -n flag parsing, but ignore it.
imp [Wed, 24 Apr 2019 05:24:10 +0000 (05:24 +0000)]
Restore the -n flag parsing, but ignore it.

Since D19668 was done, new users of the -n flag have surfaced. Parse
and ignore it on the command line until they can be updated.

Suggested by: rgrimes (in D19668).

5 years agoChase PEP-3110
ngie [Wed, 24 Apr 2019 04:50:03 +0000 (04:50 +0000)]
Chase PEP-3110

Replace `except Environment, e:` with `except Environment as e` for
compatibility between python 2.x and python 3.x.

While here, fix a bad indentation change from r346620 by reindenting the code
properly.

MFC after: 2 months

5 years agoReapply whitespace style changes from r346443 after recent changes to tests/sys/openc...
ngie [Wed, 24 Apr 2019 04:40:24 +0000 (04:40 +0000)]
Reapply whitespace style changes from r346443 after recent changes to tests/sys/opencrypto

From r346443:
"""
Replace hard tabs with four-character indentations, per PEP8.

This is being done to separate stylistic changes from the tests from functional
ones, as I accidentally introduced a bug to the tests when I used four-space
indentation locally.

No functional change.
"""

MFC after: 2 months
Discussed with: jhb

5 years agopowerpc: Add a couple missing isyncs
jhibbits [Wed, 24 Apr 2019 02:51:58 +0000 (02:51 +0000)]
powerpc: Add a couple missing isyncs

mtmsr and mtsr require context synchronizing instructions to follow.  Without
a CSI, there's a chance for a machine check exception.  This reportedly does
occur on a MPC750 (PowerMac G3).

Reported by: Mark Millard

5 years agofdt: stop installing FDT_DTS_FILE
kevans [Wed, 24 Apr 2019 01:11:50 +0000 (01:11 +0000)]
fdt: stop installing FDT_DTS_FILE

r346307 inadvertently started installing FDT_DTS_FILE along with the kernel.
While this isn't necessarily bad, it was not intended or discussed and it
actively breaks some current setups that don't anticipate any .dtb being
installed when it's using static fdt. This change could be reconsidered down
the line, but it needs to be done with prior discussion.

Fix it by pushing FDT_DTS_FILE build down into the raw dtb.build.mk bits.
This technically allows modules building DTS to accidentally specify an
FDT_DTS_FILE that gets built but isn't otherwise useful (since it's not
installed), but I suspect this isn't a big deal and would get caught with
any kind of testing -- and perhaps this might end up useful in some other
way, for example by some module wanting to embed fdt in some other way than
our current/normal mechanism.

Reported by: Mori Hiroki <yamori813@yahoo.co.jp>
MFC after: 3 days
X-MFC-With: r346307

5 years agoTest the AES-CCM test vectors from the NIST Known Answer Tests.
jhb [Wed, 24 Apr 2019 00:23:06 +0000 (00:23 +0000)]
Test the AES-CCM test vectors from the NIST Known Answer Tests.

The CCM test vectors use a slightly different file format in that
there are global key-value pairs as well as section key-value pairs
that need to be used in each test.  In addition, the sections can set
multiple key-value pairs in the section name.  The CCM KAT parser
class is an iterator that returns a dictionary once per test where the
dictionary contains all of the relevant key-value pairs for a given
test (global, section name, section, test-specific).

Note that all of the CCM decrypt tests use nonce and tag lengths that
are not supported by OCF (OCF only supports a 12 byte nonce and 16
byte tag), so none of the decryption vectors are actually tested.

Reviewed by: ngie
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D19978

5 years agoRun the plain SHA digest tests from NIST.
jhb [Wed, 24 Apr 2019 00:16:39 +0000 (00:16 +0000)]
Run the plain SHA digest tests from NIST.

Pass in an explicit digest length to the Crypto constructor since it
was assuming only sessions with a MAC key would have a MAC.  Passing
an explicit size allows us to test the full digest in HMAC tests as
well.

Reviewed by: cem
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D19884

5 years agoUse more descriptive algorithm names in skip messages.
jhb [Wed, 24 Apr 2019 00:14:37 +0000 (00:14 +0000)]
Use more descriptive algorithm names in skip messages.

Reviewed by: cem, ngie
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D19977

5 years agoSkip tests with missing test vectors instead of failing.
jhb [Wed, 24 Apr 2019 00:10:21 +0000 (00:10 +0000)]
Skip tests with missing test vectors instead of failing.

This copes more gracefully when older version of the nist-kat package
are intalled that don't have newer test vectors such as CCM or plain
SHA.

If the nist-kat package is not installed at all, this still fails with
an error.

Reviewed by: cem
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20034

5 years agoSkip test component_selection:run_latest_genid if gmirror/gnop GEOM classes
olivier [Tue, 23 Apr 2019 21:07:47 +0000 (21:07 +0000)]
Skip test component_selection:run_latest_genid if gmirror/gnop GEOM classes
aren't available

PR: 237051
Reviewed by: asomers, imp, ngie, emaste (IRC)
Approved by: ngie
MFC after:  1 month
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D19958

5 years agoAllow no_hash to appear in manifest.
sjg [Tue, 23 Apr 2019 20:25:25 +0000 (20:25 +0000)]
Allow no_hash to appear in manifest.

sbin/veriexec will ignore entries that have no hash anyway,
but loader needs to be explicitly told that such files are
ok to ignore (not verify).

We will report as Unverified depending on verbose level,
but with no reason - because we are not rejecting the file.

Reviewed by: imp, mindal_semihalf
Sponsored by:   Juniper Networks
MFC After: 1 week
Differential Revision: https://reviews.freebsd.org//D20018

5 years agoSince r339624 HEAD does not need for backslashes in syscalls.master,
dchagin [Tue, 23 Apr 2019 18:10:46 +0000 (18:10 +0000)]
Since r339624 HEAD does not need for backslashes in syscalls.master,
however to make a merge r345471 to the stable add backslashes
to the syscalls.master.

MFC after: 3 days

5 years agotun(4): Defer clearing TUN_OPEN until much later
kevans [Tue, 23 Apr 2019 17:28:28 +0000 (17:28 +0000)]
tun(4): Defer clearing TUN_OPEN until much later

tun destruction will not continue until TUN_OPEN is cleared. There are brief
moments in tunclose where the mutex is dropped and we've already cleared
TUN_OPEN, so tun_destroy would be able to proceed while we're in the middle
of cleaning up the tun still. tun_destroy should be blocked until these
parts (address/route purges, mostly) are complete.

PR: 233955
MFC after: 2 weeks

5 years agoip6_randomflowlabel: Avoid blocking if random(4) is not available
cem [Tue, 23 Apr 2019 17:18:20 +0000 (17:18 +0000)]
ip6_randomflowlabel: Avoid blocking if random(4) is not available

If kern.random.initial_seeding.bypass_before_seeding is disabled, random(4)
and arc4random(9) will block indefinitely until enough entropy is available
to initially seed Fortuna.

It seems that zero flowids are perfectly valid, so avoid blocking on random
until initial seeding takes place.

Discussed with: bz (earlier revision)
Reviewed by: thj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20011

5 years ago[PPC64] Fix wrong KASSERT in mphyp_pte_insert()
luporl [Tue, 23 Apr 2019 17:11:45 +0000 (17:11 +0000)]
[PPC64] Fix wrong KASSERT in mphyp_pte_insert()

As mphyp_pte_unset() can also remove PTE entries, and as this can
happen in parallel with PTEs evicted by mphyp_pte_insert(), there
is a (rare) chance the PTE being evicted gets removed before
mphyp_pte_insert() is able to do so. Thus, the KASSERT should
check wether the result is H_SUCCESS or H_NOT_FOUND, to avoid
panics if the situation described above occurs.

More details about this issue can be found in PR 237470.

PR: 237470
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D20012

5 years agonetdump: Fix !COMPAT_FREEBSD11 unused variable warning
cem [Tue, 23 Apr 2019 17:05:57 +0000 (17:05 +0000)]
netdump: Fix !COMPAT_FREEBSD11 unused variable warning

Reported by: Ralf Wenk <iz-rpi03_hs-karlsruhe.de>
Sponsored by: Dell EMC Isilon

5 years agoEnable Mellanox drivers (modules) on AArch64
emaste [Tue, 23 Apr 2019 15:11:01 +0000 (15:11 +0000)]
Enable Mellanox drivers (modules) on AArch64

Tested by Greg V with mlx5en on an Ampere eMAG instance at Packet.com on
c2.large.arm (with some additional uncommitted PCIe WIP).

PR: 237055
Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: hselasky
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19983

5 years agopoib: assign link-local address according to RFC
kib [Tue, 23 Apr 2019 12:23:44 +0000 (12:23 +0000)]
poib: assign link-local address according to RFC

RFC 4391 specifies that the IB interface GID should be re-used as IPv6
link-local address.  Since the code in in6_get_hw_ifid() ignored
IFT_INFINIBAND case, ibX interfaces ended up with the local address
borrowed from some other interface, which is non-compliant.

Use lowest eight bytes from GID for filling the link-local address,
same as Linux.

Reviewed by: bz (previous version), ae, hselasky, slavash,
Sponsored by: Mellanox Technologies
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20006

5 years agoiFix udp_output() lock inconsistency.
bz [Tue, 23 Apr 2019 10:12:33 +0000 (10:12 +0000)]
iFix udp_output() lock inconsistency.

In r297225 the initial INP_RLOCK() was replaced by an early
acquisition of an r- or w-lock depending on input variables
possibly extending the write locked area for reasons not entirely
clear but possibly to avoid a later case of unlock and relock
leading to a possible race condition and possibly in order to
allow the route cache to work for connected sockets.

Unfortunately the conditions were not 1:1 replicated (probably
because of the route cache needs). While this would not be a
problem the legacy IP code compared to IPv6 has an extra case
when dealing with IP_SENDSRCADDR. In a particular case we were
holding an exclusive inp lock and acquired the shared udbinfo
lock (now epoch).
When then running into an error case, the locking assertions
on release fired as the udpinfo and inp lock levels did not match.

Break up the special case and in that particular case acquire
and udpinfo lock depending on the exclusitivity of the inp lock.

MFC After: 9 days
Reported-by: syzbot+1f5c6800e4f99bdb1a48@syzkaller.appspotmail.com
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D19594

5 years agoAdd ATA power mode support to camcontrol
smh [Tue, 23 Apr 2019 07:46:38 +0000 (07:46 +0000)]
Add ATA power mode support to camcontrol

Add the ability to report ATA device power mode with the cmmand 'powermode'
to compliment the existing ability to set it using idle, standby and sleep
commands.

MFC after: 2 weeks
Sponsored by: Multiplay

5 years agoThis patch offers a workaround to buf_ring reordering
wma [Tue, 23 Apr 2019 06:36:32 +0000 (06:36 +0000)]
This patch offers a workaround to buf_ring reordering
visible on armv7 and armv8. Similar issue to rS302292.

Obtained from:         Semihalf
Authored by:           Michal Krawczyk <mk@semihalf.com>
Approved by:           wma
Differential Revision: https://reviews.freebsd.org/D19932

5 years agoMFV r346563:
cy [Tue, 23 Apr 2019 03:52:43 +0000 (03:52 +0000)]
MFV r346563:

Update wpa_supplicant/hostapd 2.7 --> 2.8

Upstream documents the following advisories:

- https://w1.fi/security/2019-1/sae-side-channel-attacks.txt
- https://w1.fi/security/2019-2/eap-pwd-side-channel-attack.txt
- https://w1.fi/security/2019-3/sae-confirm-missing-state-validation.txt
- https://w1.fi/security/2019-4/eap-pwd-missing-commit-validation.txt
- https://w1.fi/security/2019-5/eap-pwd-message-reassembly-issue-\
  with-unexpected-fragment.txt

Relnotes: yes
MFC after: 1 week (or less)
Security: CVE-2019-9494, VU#871675, CVE-2019-9495, CVE-2019-9496,
CVE-2019-9497, CVE-2019-9498, CVE-2019-9499

5 years ago[PowerPC64] pseries-llan: increment packet output counters on error and success
jhibbits [Tue, 23 Apr 2019 03:19:03 +0000 (03:19 +0000)]
[PowerPC64] pseries-llan: increment packet output counters on error and success

Summary: when using pseries-llan driver, Opkts and Oerrs counters (netstat
-i) are always zero. This patch adds an small error handling to increment
these counters.

Submitted by: alfredo.junior_eldorado.org.br
Differential Revision: https://reviews.freebsd.org/D20009

5 years agopowerpc64/pseries: Fix hypervisor call with extra arguments
jhibbits [Tue, 23 Apr 2019 03:05:26 +0000 (03:05 +0000)]
powerpc64/pseries: Fix hypervisor call with extra arguments

Some hypervisor calls, such as H_SEND_LOGICAL_LAN, take more arguments than
are traditionally passed in registers.  The HCALL ABI will accept these
arguments in r11 and r12.  With ELFv2 ABI, these arguments are 2
double-words lower than ELFv1 ABI, as two double-words in the stack frame
are no longer used, and therefore removed from the frame.  Fix the offsets
for loading the registers for the HCALL.  This fixes the phyp_llan driver
with ELFv2 kernel.

Submitted by: alfredo.junior_eldorado.org.br
Differential Revision: https://reviews.freebsd.org/D20008

5 years agopowerpc64: Rewrite strcmp in asm to take advantage of word size
jhibbits [Tue, 23 Apr 2019 02:53:53 +0000 (02:53 +0000)]
powerpc64: Rewrite strcmp in asm to take advantage of word size

Summary:
Optimize strcmp for powerpc64.
Data is loaded by double words and cmpb intruction is used to find '\0'.

Some performance gain rates between the current and the optimized solution:

String size (bytes) Gain rate
<=8 0.59%
<=16 1.92%
32 3.02%
64 5.60%
128 10.16%
256 18.05%
512 30.18%
1024 42.82%

Submitted by: alexandre.yamashita_eldorado.org.br,
leonardo.bianconi_eldorado.org.br
Differential Revision: https://reviews.freebsd.org/D15220

5 years agoar: shuffle symbol offsets during conversion for 32-bit ar archives
emaste [Mon, 22 Apr 2019 19:55:47 +0000 (19:55 +0000)]
ar: shuffle symbol offsets during conversion for 32-bit ar archives

During processing we maintain symbol offsets in the 64-bit s_so array,
and when writing the archive convert to 32-bit if no offsets are greater
than 4GB.  However, this was somewhat inefficient as we looped over the
array twice: first, converting to big endian and second, writing each
32-bit value one at a time (and incorrectly so on big-endian platforms).

Instead, when writing a 32-bit archive shuffle convert symbol data to
big endian (as required by the ar format) and shuffle to the beginning
of the allocation at the same time.

Also correct emission of the symbol count on big endian platforms.

Further changes are planned, but this should fix powerpc64.

Reported by: jhibbits, mlinimon
Reviewed by: jhibbits, Gerald Aryeetey (earlier)
Tested by: jhibbits
MFC after: 10 days
MFC with: r346079
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20007

5 years agoRevert r346530 until further.
hselasky [Mon, 22 Apr 2019 19:36:19 +0000 (19:36 +0000)]
Revert r346530 until further.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix mouse cursor coloring in depths > 8 (previously, a hack that only
bde [Mon, 22 Apr 2019 19:31:16 +0000 (19:31 +0000)]
Fix mouse cursor coloring in depths > 8 (previously, a hack that only
worked right for white interiors and black borders was used).  Advertise
this by changing the default colors to a red interior and a white
border (the same as the kernel default).  Add undocumented env variables
for changing these colors.  Also change to the larger and better-shaped
16x10 cursor sometimes used in the kernel.  The kernel choice is
fancier, but libvgl is closer to supporting the larger cursors needed
in newer modes.

The (n)and-or logic for the cursor doesn't work right for more than 2
colors.  The (n)and part only masks out all color bits for the pixel
under the cursor when all bits are set in the And mask.  With more
complicated logic, the non-masked bits could be used to implement
translucent cursors, but they actually just gave strange colors
(especially in packed and planar modes where the bits are indirect
through 1 or 2 palettes so it is hard to predict the final color).
They also gave a bug for writing pixels under the cursor.  The
non-masked bits under the cursor were not combined in this case.

Drop support for combining with bits under the cursor by making any nonzero
value in the And mask mean all bits set.

Convert the Or mask (which is represented as a half-initialized 256-color
bitmap) to a fully initialized bitmap with the correct number of colors.
The 256-color representation must be as in 3:3:2 direct mode iff the final
bitmap has more than 256 colors.  The conversion of colors is not very
efficient, so convert at initialization time.

5 years agoTrack device's NUMA domain in ifnet & alloc ifnet from NUMA local memory
gallatin [Mon, 22 Apr 2019 19:24:21 +0000 (19:24 +0000)]
Track device's NUMA domain in ifnet & alloc ifnet from NUMA local memory

This commit adds new if_alloc_domain() and if_alloc_dev() methods to
allocate ifnets.  When called with a domain on a NUMA machine,
ifalloc_domain() will record the NUMA domain in the ifnet, and it will
allocate the ifnet struct from memory which is local to that NUMA
node.  Similarly, if_alloc_dev() is a wrapper for if_alloc_domain
which uses a driver supplied device_t to call ifalloc_domain() with
the appropriate domain.

Note that the new if_numa_domain field fits in an alignment pad in
struct ifnet, and so does not alter the size of the structure.

Reviewed by: glebius, kib, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D19930

5 years agoBuild libclang_rt/profile on all clang-supported architectures
ngie [Mon, 22 Apr 2019 19:21:35 +0000 (19:21 +0000)]
Build libclang_rt/profile on all clang-supported architectures

There's no reason why a special case needs to be added specifically for amd64,
arm, and i386, as the code is written in machine architecture agnostic C/C++.

This will make it possible for all supporting clang architectures to produce
runtime coverage with `--coverage`.

MFC after: 2 weeks
Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D20003

5 years agoFix up CXXSTD support originally added in r345708
ngie [Mon, 22 Apr 2019 18:40:46 +0000 (18:40 +0000)]
Fix up CXXSTD support originally added in r345708

r345708 worked for the base system, but unfortunately, caused a lot of
disruption for third-party packages that relied on C++, since bsd.sys.mk is
used by applications outside the base system. The defaults picked didn't match
the compiler's defaults and broke some builds that didn't specify a standard,
as well as some that overrode the value by setting `-std=gnu++14` (for
example) manually.

This change takes a more relaxed approach to appending `-std=${CXXSTD}` to
CXXFLAGS, by only doing so when the value is specified, as opposed to
overriding the standard set by an end-user. This avoids the need for having
to bake NOP default into bsd.sys.mk for supported compiler-toolchain
versions.

In order to make this change possible, add CXXSTD to Makefile snippets which
relied on the default value (c++11) added in r345708.

MFC after:      2 weeks
MFC with:       r345708, r346574
Reviewed by:    emaste
Reported by:    jbeich
Differential Revision: https://reviews.freebsd.org/D19895 (as part of a larger change)

5 years agoCreate boot_img as a global variable
imp [Mon, 22 Apr 2019 18:40:24 +0000 (18:40 +0000)]
Create boot_img as a global variable

Get the information from the image that we're booting and store it in
a global variable. Prefer using this to passing it around. Remove the
special case for zfs that set the preferred boot handle by having it
uses this global variable diretly.

Reviewed by: kevans@
Differential Revision: https://reviews.freebsd.org/D20015

5 years agoRework CXXSTD setting via r345708
ngie [Mon, 22 Apr 2019 18:38:54 +0000 (18:38 +0000)]
Rework CXXSTD setting via r345708

This change allows the user to once again override the C++ standard, restoring
high-level pre-r345708 behavior.

This also unbreaks building lib/ofed/libibnetdisc/Makefile with a non-C++11
capable compiler, e.g., g++ 4.2.1, as the library supported being built with
older C++ standards.

MFC after: 2 weeks
MFC with: r345708
Reviewed by: emaste
Reported by: jbeich
Differential Revision: https://reviews.freebsd.org/D19895 (as part of a larger change)

5 years agoMove setting of console earlier in boot.
imp [Mon, 22 Apr 2019 18:33:32 +0000 (18:33 +0000)]
Move setting of console earlier in boot.

There's no reason we can't setup the console first thing after the
arch flags are setup. We set it undconditionally to efi. This is a
good default, and will get us error messages to at least the efi
console no matter what. This will also prime the pump so that as other
variables are set, they will take effect and the console will be
correct as soon as those env vars are set. Also remove the redundant
setting of the console to efi when we know the console is efi.

Differential Revision: https://reviews.freebsd.org/D20014

5 years agoUpdate the spelling of my name (continuation of r346571)
ngie [Mon, 22 Apr 2019 18:05:33 +0000 (18:05 +0000)]
Update the spelling of my name (continuation of r346571)

Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji
instead for clarity.

While here, remove "All Rights Reserved" from copyrights I "own".

MFC after: 1 week

5 years agoUpdate the spelling of my name
ngie [Mon, 22 Apr 2019 17:52:46 +0000 (17:52 +0000)]
Update the spelling of my name

Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji
instead for clarity.

While here, remove "All Rights Reserved" from copyrights I "own".

MFC after: 1 week

5 years agocxgbe/t4_tom: Add a "TCB history" feature that samples hardware state
np [Mon, 22 Apr 2019 17:48:10 +0000 (17:48 +0000)]
cxgbe/t4_tom: Add a "TCB history" feature that samples hardware state
for a tid and maintains a running history of some interesting events.

Service TCP_INFO queries from the history when the tid is being tracked
there.

5 years agoar: use array notation to access s_so
emaste [Mon, 22 Apr 2019 17:29:26 +0000 (17:29 +0000)]
ar: use array notation to access s_so

This is somewhat more readable than pointer arithmetic.  Also remove an
unnecessary cast while here.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoar: test for writing 64-bit format only if symbol count is nonzero
emaste [Mon, 22 Apr 2019 17:25:00 +0000 (17:25 +0000)]
ar: test for writing 64-bit format only if symbol count is nonzero

This is a minor simplification; if we do not have any symbols the empty
symbol table can be in 32-bit format.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agocxgbe(4): Make sure bundled_fw is always initialized before use.
np [Mon, 22 Apr 2019 17:00:30 +0000 (17:00 +0000)]
cxgbe(4): Make sure bundled_fw is always initialized before use.

This fixes a bug that prevented the driver from auto-flashing the
firmware when it didn't see one on the card.  This feature was
introduced in r321390 and this bug was introduced in r343269.

Reported by: gallatin@
MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agorandom.3: Remove obsolete BUGS section
cem [Mon, 22 Apr 2019 16:29:34 +0000 (16:29 +0000)]
random.3: Remove obsolete BUGS section

Relative performance to rand(3) is sort of irrelevant; they do different things
and a user with sensitivity to RNG performance won't use libc random(3) anyway.

The historical note about bad seeding is long obsolete, referring to a 1996 or
earlier version of FreeBSD.

Sponsored by: Dell EMC Isilon

5 years agorand.3: Match better recommendation language from random.3
cem [Mon, 22 Apr 2019 16:26:39 +0000 (16:26 +0000)]
rand.3: Match better recommendation language from random.3

Sponsored by: Dell EMC Isilon

5 years agoImport wpa_supplicant/hostapd 2.8
cy [Mon, 22 Apr 2019 15:42:53 +0000 (15:42 +0000)]
Import wpa_supplicant/hostapd 2.8

5 years agor297225 move the assignment of sin from add to the top of the function.
bz [Mon, 22 Apr 2019 14:53:53 +0000 (14:53 +0000)]
r297225 move the assignment of sin from add to the top of the function.
sin is not changed after the initial assignment, so no need to set it again.

MFC after: 10 days

5 years agoRemove some excessive brackets.
bz [Mon, 22 Apr 2019 14:20:49 +0000 (14:20 +0000)]
Remove some excessive brackets.

No functional change.

MFC after: 10 days

5 years agoUse separate descriptors in bhyve's stdio uart backend.
markj [Mon, 22 Apr 2019 13:57:52 +0000 (13:57 +0000)]
Use separate descriptors in bhyve's stdio uart backend.

bhyve was previously using stdin for both reading and writing to the
console, which made it difficult to redirect console output.  Use
stdin for reading and stdout for writing.  This makes it easier to use
bhyve as a backend for syzkaller.

As a side effect, the change fixes a minor bug which would cause bhyve
to fail with ENOTCAPABLE if configured to use nmdm for com1 and stdio
for com2.

bhyveload already uses separate descriptors, as does the bvmcons driver.

Reviewed by: jhb
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19788

5 years agolibbe(3): Add a test for be creation
kevans [Mon, 22 Apr 2019 13:45:08 +0000 (13:45 +0000)]
libbe(3): Add a test for be creation

Submitted by: Rob Fairbanks <rob.fx907 gmail com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18564

5 years agolibbe(3): allow creation of arbitrary depth boot environments
kevans [Mon, 22 Apr 2019 13:43:38 +0000 (13:43 +0000)]
libbe(3): allow creation of arbitrary depth boot environments

libbe currently only provides an API to create a recursive boot environment,
without any formal support for intentionally limiting the depth. This
changeset adds an API, be_create_depth, that may be used to arbitrarily
restrict the depth of the new BE.

Submitted by: Rob Fairbanks <rob.fx907 gmail com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18564

5 years agoClarify the relationship between INVARIANTS and DIAGNOSTIC a bit.
markj [Mon, 22 Apr 2019 11:31:13 +0000 (11:31 +0000)]
Clarify the relationship between INVARIANTS and DIAGNOSTIC a bit.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoDisable vm map consistency checking by default on INVARIANTS kernels.
markj [Mon, 22 Apr 2019 11:23:35 +0000 (11:23 +0000)]
Disable vm map consistency checking by default on INVARIANTS kernels.

The checks are too expensive for a general-purpose kernel.  Enable the
checks when DIAGNOSTIC is defined and provide a sysctl to enable the
checks in a non-DIAGNOSTIC INVARIANTS kernel.

Reviewed by: kib
Discussed with: Doug Moore <dougm@rice.edu>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19999

5 years agoFix sys.kern.coredump_phnum_test.coredump_phnum on i386
ngie [Mon, 22 Apr 2019 11:21:20 +0000 (11:21 +0000)]
Fix sys.kern.coredump_phnum_test.coredump_phnum on i386

The zero-padding when printing out the Size field is on 32-bit architectures is
5, not 15. Adjust the regular expression to work with both the 32-bit and
64-bit case.

MFC after: 1 week
Reviewed by: lwhsu, markj
Approved by: emaste (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D20005

5 years agoFix `get_int_via_sysctlbyname(..)` on Jenkins
ngie [Mon, 22 Apr 2019 11:09:24 +0000 (11:09 +0000)]
Fix `get_int_via_sysctlbyname(..)` on Jenkins

Initialize `oldlen` to the size of the value, instead of leaving the value
unitialized. Leaving it unitialized seems to work by accident on amd64 when
running 64-bit programs, but not on i386.

This matches patterns in use in other programs.

PR: 237458
Approved by: emaste (mentor; implicit)
MFC after: 1 week
Tested on: ^/head (amd64), ^/stable/11 (i386)

5 years agoFix build for mips and powerpc after r346530.
hselasky [Mon, 22 Apr 2019 08:32:00 +0000 (08:32 +0000)]
Fix build for mips and powerpc after r346530.

Need to include sys/kernel.h to define SYSINIT() which is used
by sys/eventhandler.h .

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix panic in network stack due to memory use after free in relation to
hselasky [Mon, 22 Apr 2019 07:27:24 +0000 (07:27 +0000)]
Fix panic in network stack due to memory use after free in relation to
fragmented packets.

When sending IPv4 and IPv6 fragmented packets and a fragment is lost,
the mbuf making up the fragment will remain in the temporary hashed
fragment list for a while. If the network interface departs before the
so-called slow timeout clears the packet, the fragment causes a panic
when the timeout kicks in due to accessing a freed network interface
structure.

Make sure that when a network device is departing, all hashed IPv4 and
IPv6 fragments belonging to it, get freed.

Backtrace:
panic()
icmp6_reflect()

hlim = ND_IFINFO(m->m_pkthdr.rcvif)->chlim;
^^^^ rcvif->if_afdata[AF_INET6] is NULL.

icmp6_error()
frag6_freef()
frag6_slowtimo()
pfslowtimo()
softclock_call_cc()
softclock()
ithread_loop()

Differential Revision: https://reviews.freebsd.org/D19622
Reviewed by: bz (network), adrian
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agognop(8): Nopify configuration as a kernel dump device
cem [Mon, 22 Apr 2019 03:25:49 +0000 (03:25 +0000)]
gnop(8): Nopify configuration as a kernel dump device

As a dummy / no-op dump device, to facilitate dumpon(8) testing.

Reviewed by: markj (earlier version)
Differential Revision: https://reviews.freebsd.org/D19991

5 years agoReport DIF protection type the disk is formatted with.
mav [Mon, 22 Apr 2019 01:08:14 +0000 (01:08 +0000)]
Report DIF protection type the disk is formatted with.

Some disks formatted with protection report errors if written without
protection used.  This should help to diagnose the problem.

MFC after: 2 weeks

5 years agoAdd #ifdef INET as requested by bz@.
rmacklem [Sun, 21 Apr 2019 22:53:51 +0000 (22:53 +0000)]
Add #ifdef INET as requested by bz@.

5 years agoPolish SCSI sense data validity checks.
mav [Sun, 21 Apr 2019 19:07:03 +0000 (19:07 +0000)]
Polish SCSI sense data validity checks.

According to specs and common sense, all sense data reported in descriptor
format should be valid.  But practice shows different, some devices return
descriptors with invalid data, resulting in error messages looking worse.

Decouple block/stream commands sense data and information field printing.
Looking on present specs, there are much more cases when those fields are
not related, and incomplete old code was not printing valid sense data and
leaving empty lines for invalid.

MFC after: 2 weeks

5 years agoTypo fix in ipfw.8: amd -> and
bcr [Sun, 21 Apr 2019 18:27:13 +0000 (18:27 +0000)]
Typo fix in ipfw.8: amd -> and

There is an (obvious) typo in the following sentence:

"Please note, that keep-state amd limit imply implicit check-state for ..."

Replace the "amd" with "and", bump .Dd.

PR: 237438
Submitted by: michael@galassi.us
MFC after: 3 days

5 years agoMove the reporting of spurious interrupts under bootverbose control, because
ian [Sun, 21 Apr 2019 17:39:01 +0000 (17:39 +0000)]
Move the reporting of spurious interrupts under bootverbose control, because
occasional spurious interrupts are a normal thing on this hardware.  Also,
change the name of the cpu-local interrupt controller driver from local_intc
to lintc, because the name gets built into interrupt names, which have to
fit into a 19-byte field for stats reporting (so this allows 5 more bytes
of the actual interrupt name to be displayed).

5 years agoUse a shadow buffer and never read from the frame buffer. Remove large slow
bde [Sun, 21 Apr 2019 16:17:35 +0000 (16:17 +0000)]
Use a shadow buffer and never read from the frame buffer.  Remove large slow
code for reading from the frame buffer.

Reading from the frame buffer is usually much slower than writing to
the frame buffer.  Typically 10 to 100 times slower.  It old modes,
it takes many more PIOs, and in newer modes with no PIOs writes are
often write-combined while reads remain uncached.

Reading from the frame buffer is not very common, so this change doesn't
give speedups of 10 to 100 times.  My main test case is a floodfill()
function that reads about as many pixels as it writes.  The speedups
are typically a factor of 2 to 4.

Duplicating writes to the shadow buffer is slower when no reads from the
frame buffer are done, but reads are often done for the pixels under the
mouse cursor, and doing these reads from the shadow buffer more than
compensates for the overhead of writing the shadow buffer in at least the
slower modes.  Management of the mouse cursor also becomes simpler.

The shadow buffer doesn't take any extra memory, except twice as much
in old 4-plane modes.  A buffer for holding a copy of the frame buffer
was allocated up front for use in the screen switching signal handler.
This wasn't changed when the handler was made async-signal safe.  Use
the same buffer the shadow (but make it twice as large in the 4-plane
modes), and remove large special code for writing it as well as large
special code for reading ut.  It used to have a rawer format in the
4-plane modes.  Now it has a bitmap format which takes twice as much
memory but can be written almost as fast without special code.

VIDBUFs that are not the whole frame buffer were never supported, and the
change depends on this.  Check for invalid VIDBUFs in some places and do
nothing.  The removed code did something not so good.

5 years agoFix missing restoring of the mouse cursor position, the border color and the
bde [Sun, 21 Apr 2019 10:33:09 +0000 (10:33 +0000)]
Fix missing restoring of the mouse cursor position, the border color and the
blank state after a screen switch.

5 years ago[ath] [ath_hal] [ath_hal_9300] Extend the start PCU receive to handle resetting ANI.
adrian [Sun, 21 Apr 2019 02:36:01 +0000 (02:36 +0000)]
[ath] [ath_hal] [ath_hal_9300] Extend the start PCU receive to handle resetting ANI.

One of the fun issues with scanning has been how the existing
ANI values were programmed into the hardware when channels were
changed.  If you're on a really crappy channel and ANI has made
you deaf then when you scan you continue to be deaf on all channels.

This code passes in a flag to startpcureceive which in AR5416 and later
is also used to enable ANI.  This allows it to know if it's a normal
operation or a scan operation.

This fixes my situation at home where a temporary spot of a device
going deaf due to interference starts scanning and .. can't hear
anything until I restart.

Now, this isn't the full fix - ideally:

(a) all the ANI config and per-channel information would be migrated
     to the shared HAL stuff and enabled for all of the NICs;
(b) when a station reassociates and some other error conditions
    (like missed beacons, NF calibration failures, etc) a knob
    to reset ANI parameters would likely help recovery.

But hey, I'm committing bits of code again! woo!

Tested:

* AR9344 (2G), STA operation

5 years agodtc(1): Pull in fix for segfault-upon-error condition
kevans [Sun, 21 Apr 2019 01:58:42 +0000 (01:58 +0000)]
dtc(1): Pull in fix for segfault-upon-error condition

Specifically, parse errors within a node would lead to a segfault due to
an unconditional dereference after emitting the error.

Obtained from: https://github.com/davidchisnall/dtc/commit/e5ecf9319fd3f
MFC after: 3 days

5 years agoMFV r346450:
cy [Sat, 20 Apr 2019 23:18:19 +0000 (23:18 +0000)]
MFV r346450:

Update sqlite3-3.27.1 (3270100) --> sqlite3-3.27.2 (3270200)

MFC after: 11 days

5 years agopsm(4): give names to synaptics commands
wulf [Sat, 20 Apr 2019 21:06:12 +0000 (21:06 +0000)]
psm(4): give names to synaptics commands

Submitted by: Ben LeMasurier <ben@crypt.ly>
MFC after: 2 weeks

5 years agopsm(4): respect tap_disabled configuration with enabled Extended support
wulf [Sat, 20 Apr 2019 21:04:56 +0000 (21:04 +0000)]
psm(4): respect tap_disabled configuration with enabled Extended support

This fixes a bug where, even when hw.psm.tap_enabled=0, touchpad taps
were processed.
tap_enabled has three states: unconfigured, disabled, and enabled (-1, 0, 1).
To respect PR kern/139272, taps are ignored only when explicity disabled.

Submitted by: Ben LeMasurier <ben@crypt.ly> (initial version)
MFC after: 2 weeks

5 years agopsm(4): do not process gestures when palm is present
wulf [Sat, 20 Apr 2019 21:02:41 +0000 (21:02 +0000)]
psm(4): do not process gestures when palm is present

Ignoring of gesture processing when the palm is detected helps to reduce
some of the erratic pointer behavior.

This fixes regression introduced in r317814

Reported by: Ben LeMasurier <ben@crypt.ly>
MFC after: 2 weeks

5 years agopsm(4): Add support for 4 and 5 finger touches in synaptics driver
wulf [Sat, 20 Apr 2019 21:00:44 +0000 (21:00 +0000)]
psm(4): Add support for 4 and 5 finger touches in synaptics driver

While 4-th and 5-th finger positions are not exported through PS/2
interface, total number of touches is reported by MT trackpads.

MFC after: 2 weeks

5 years agoMake libvgl mostly work without superuser privilege in direct modes by
bde [Sat, 20 Apr 2019 20:29:03 +0000 (20:29 +0000)]
Make libvgl mostly work without superuser privilege in direct modes by
not doing any unnecessary PIO instructions or refusing to start when the
i/o privilege needed for these instructions cannot be acquired.

This turns off useless palette management in direct modes.  Palette
management had no useful effect since the hardware palette is not used
in these modes.

This transiently acquires i/o privilege if possible as needed to give
VGLSetBorder() and VGLBlankDisplay() a chance of working.  Neither has
much chance of working.  I was going to drop support for them in direct
modes, but found that VGLBlankDisplay() still works with an old graphics
card on a not so old LCD monitor.

This has some good side effects: reduce glitches for managing the palette
for screen switches, and speed up and reduce async-signal-unsafeness in
mouse cursor drawing.

5 years agoRevert r346443
ngie [Sat, 20 Apr 2019 16:37:28 +0000 (16:37 +0000)]
Revert r346443

My wide sweeping stylistic change (while well intended) is impeding others from
working on `tests/sys/opencrypto`.

The plan is to revert the change in ^/head, then reintroduce the changes after
the other changes get merged into ^/head .

Approved by: emaste (mentor; implicit)
Requested by: jhb
MFC after: 2 months

5 years agonetdump: Fix 11 compatibility DIOCSKERNELDUMP ioctl
cem [Sat, 20 Apr 2019 16:07:29 +0000 (16:07 +0000)]
netdump: Fix 11 compatibility DIOCSKERNELDUMP ioctl

The logic was present for the 11 version of the DIOCSKERNELDUMP ioctl, but
had not been updated for the 12 ABI.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D19980

5 years agoEnable ioremap for aarch64 in the LinuxKPI
emaste [Sat, 20 Apr 2019 15:57:05 +0000 (15:57 +0000)]
Enable ioremap for aarch64 in the LinuxKPI

Required for Mellanox drivers (e.g. on Ampere eMAG at Packet.com).

PR: 237055
Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D19987

5 years agotests/sys/opencrypto: fix whitespace per PEP8
ngie [Sat, 20 Apr 2019 15:43:28 +0000 (15:43 +0000)]
tests/sys/opencrypto: fix whitespace per PEP8

Replace hard tabs with four-character indentations, per PEP8.

This is being done to separate stylistic changes from the tests from functional
ones, as I accidentally introduced a bug to the tests when I used four-space
indentation locally.

No functional change.

MFC after: 2 months
Approved by: emaste (mentor: implicit blanket approval for trivial fixes)

5 years agoUse symlinks for kernel modules rather than hardlinks
asomers [Sat, 20 Apr 2019 12:51:05 +0000 (12:51 +0000)]
Use symlinks for kernel modules rather than hardlinks

When aliasing a kernel module to a different name (ie if_igb for if_em),
it's better to use symlinks than hard links. kldxref will omit entries for
the links, ensuring that the loaded module has the correct name.

Reviewed by: imp
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19979

5 years agoExport cpu_core from opensolaris.ko.
markj [Sat, 20 Apr 2019 11:34:53 +0000 (11:34 +0000)]
Export cpu_core from opensolaris.ko.

It is referenced by dtrace*.ko.

PR: 191462
Submitted by: me.freebsd@cgf.cx
MFC after: 1 week

5 years agoSpecify using Python2, these .py files have not been converted to use Python3
lwhsu [Sat, 20 Apr 2019 07:32:29 +0000 (07:32 +0000)]
Specify using Python2, these .py files have not been converted to use Python3
yet, but the default Python version in ports has been switched to 3.

Sponsored by: The FreeBSD Foundation

5 years agoStart to reduce the number of #ifdef EFI_ZFS_BOOT
imp [Sat, 20 Apr 2019 05:31:56 +0000 (05:31 +0000)]
Start to reduce the number of #ifdef EFI_ZFS_BOOT

There's a number of EFI_ZFS_BOOT #ifdefs that aren't needed, or can be
eliminated with some trivial #defines. Remove the EFI_ZFS_BOOT ifdefs
that aren't needed. Replace libzfs.h include which is not safe to
include without EFI_ZFS_BOOT with efizfs.h which is and now
conditionally included libzfs.h. Define efizfs_set_preferred away
and define efi_zfs_probe to NULL when ZFS is compiled out.

5 years agoAdd SY8106A Buck Regulator and Allwinner CIR devices to GENERIC arm64 kernel.
ganbold [Sat, 20 Apr 2019 03:21:47 +0000 (03:21 +0000)]
Add SY8106A Buck Regulator and Allwinner CIR devices to GENERIC arm64 kernel.

5 years agocron(8): schedule interval jobs that get loaded during execution
kevans [Sat, 20 Apr 2019 02:54:20 +0000 (02:54 +0000)]
cron(8): schedule interval jobs that get loaded during execution

Jobs using the @<second> syntax currently only get executed if they exist
when cron is started. The simplest reproducer of this is:

echo '@20 root echo "Hello!"' >> /etc/cron.d/myjob

myjob will get loaded at the next second==0, but this echo job will not
run until cron restarts. These jobs are normally handled in
run_reboot_jobs(), which sets e->lastexit of INTERVAL jobs to the startup
time so they run 'n' seconds later.

Fix this by special-casing TargetTime > 0 in the database load. Preexisting
jobs will be handled at startup during run_reboot_jobs as normal, but if
we've reloaded a database during runtime we'll hit this case and set
e->lastexit to the current time when we process it. They will then run every
'n' seconds from that point, and a full restart of cron is no longer
required to make these jobs work.

Reported by: Juraj Lutter (otis_sk.freebsd.org)
Reviewed by: allanjude, bapt, bjk (earlier version), Juraj Lutter
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D19924

5 years agopowerpc64/powernv: Relax flash block write requirements
jhibbits [Sat, 20 Apr 2019 02:44:38 +0000 (02:44 +0000)]
powerpc64/powernv: Relax flash block write requirements

Since writes don't necessarily need to be on erase-block boundaries, we can
relax the block size and alignments down to sector size.  If it needs to be
erased, opalflash_erase() will check proper alignment and size.

5 years agoAdd support for the ModeSetMasked attribute to the NFSv4.1 server.
rmacklem [Fri, 19 Apr 2019 23:35:08 +0000 (23:35 +0000)]
Add support for the ModeSetMasked attribute to the NFSv4.1 server.

I do not know of an extant NFSv4.1 client that currently does a Setattr
operation for the ModeSetMasked, but it has been discussed on the linux-nfs
mailing list.
This patch adds support for doing a Setattr of ModeSetMasked, so that it
will work for any future NFSv4.1 client that chooses to do so.
Tested via a hacked FreeBSD NFSv4.1 client.

MFC after: 2 weeks

5 years agoReplace "vp" with NULL to make the code more readable.
rmacklem [Fri, 19 Apr 2019 23:27:23 +0000 (23:27 +0000)]
Replace "vp" with NULL to make the code more readable.

At the time of this nfsv4_sattr() call, "vp == NULL", so this patch doesn't
change the semantics, but I think it makes the code more readable.
It also makes it consistent with the nfsv4_sattr() call a few lines above
this one. Found during code inspection.

MFC after: 2 weeks

5 years agoTest SHA2-224-HMAC now that OCF supports it.
jhb [Fri, 19 Apr 2019 22:20:42 +0000 (22:20 +0000)]
Test SHA2-224-HMAC now that OCF supports it.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D19882

5 years agoRevert r346410 and r346411
cem [Fri, 19 Apr 2019 22:08:17 +0000 (22:08 +0000)]
Revert r346410 and r346411

libkern in .PATH has too many filename conflicts with libc and my -DNO_CLEAN
tinderbox didn't catch that ahead of time.  Mea culpa.

5 years agoSync cryptographic algorithm constants with current cryptodev.h.
jhb [Fri, 19 Apr 2019 21:58:51 +0000 (21:58 +0000)]
Sync cryptographic algorithm constants with current cryptodev.h.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D19881

5 years agoFix copying of overlapping bitmaps. The cases of copying within the
bde [Fri, 19 Apr 2019 20:29:49 +0000 (20:29 +0000)]
Fix copying of overlapping bitmaps.  The cases of copying within the
screen bitmap and within a single MEMBUF were broken when first source
line is before the first destination line and the sub-bitmaps overlap.

The fix just copies horizontal lines in reverse order when the first
source line is before the first destination line.  This switches
directions unnecessarily in some cases, but the switch is about as
fast as doing a precise detection of overlaps.  When the first lines
are the same, there can be undetected overlap in the horizontal
direction.  The old code already handles this mostly accidentally by
using bcopy() for MEMBUFs and by copying through a temporary buffer
for the screen bitmap although the latter is sub-optimal in direct
modes.

5 years agokernel build: Disable unhelpful GCC warning (tripped after r346352)
cem [Fri, 19 Apr 2019 20:08:45 +0000 (20:08 +0000)]
kernel build: Disable unhelpful GCC warning (tripped after r346352)

-Wformat-zero-length does not highlight any particularly wrong code and it
is especially meaningless for device_printf().  Turn it off entirely to
remove a source of false positives.

Sponsored by: Dell EMC Isilon

5 years agoBump __FreeBSD_version after r346410
cem [Fri, 19 Apr 2019 20:06:22 +0000 (20:06 +0000)]
Bump __FreeBSD_version after r346410

5 years agolibkern: Bring in arc4random_uniform(9) from libc
cem [Fri, 19 Apr 2019 20:05:47 +0000 (20:05 +0000)]
libkern: Bring in arc4random_uniform(9) from libc

It is a useful arc4random wrapper in the kernel for much the same reasons as
in userspace.  Move the source to libkern (because kernel build is
restricted to sys/, but userspace can include any file it likes) and build
kernel and libc versions from the same source file.

Copy the documentation from arc4random_uniform(3) to the section 9 page.

While here, add missing arc4random_buf(9) symlink.

Sponsored by: Dell EMC Isilon

5 years agoAdd wrapper functions to convert strings to EFI_DEVICE_PATH
imp [Fri, 19 Apr 2019 19:45:19 +0000 (19:45 +0000)]
Add wrapper functions to convert strings to EFI_DEVICE_PATH

In anticipation of new functionality, create routines to convert char *
and a CHAR16 * to a EFI_DEVICE_PATH
EFI_DEVICE_PATH *efi_name_to_devpath(const char *path);
EFI_DEVICE_PATH *efi_name_to_devpath16(CHAR16 *path);
void efi_devpath_free(EFI_DEVICE_PATH *dp);
The first two return an EFI_DEVICE_PATH for the passed in paths. The
third frees up the storage the first two return when the caller is
done with it.

Differential Revision: https://reviews.freebsd.org/D19971

5 years agoAdd UEFI definitions related to converting string to DEVICE_PATH
imp [Fri, 19 Apr 2019 19:45:15 +0000 (19:45 +0000)]
Add UEFI definitions related to converting string to DEVICE_PATH

Add definitions from UEFI 2.7 Errata B standards doc for converting a
text string to a device path. Added clearly missing 'e' at the end of
Device to resolve mismatch in that document in
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL element names.

Differential Revision: https://reviews.freebsd.org/D19971

5 years agoAdd define for CONST.
imp [Fri, 19 Apr 2019 19:44:59 +0000 (19:44 +0000)]
Add define for CONST.

Newer interfaces take CONST parameters, so define CONST to minimize
differences between our headers and the standards docs.

Differential Revision: https://reviews.freebsd.org/D19971

5 years agoWhen an IPv6 packet is received for a raw socket which has the
tuexen [Fri, 19 Apr 2019 18:09:37 +0000 (18:09 +0000)]
When an IPv6 packet is received for a raw socket which has the
IPPROTO_IPV6 level socket option IPV6_CHECKSUM enabled and the
checksum check fails, drop the message. Without this fix, an
ICMP6 message was sent indicating a parameter problem.

Thanks to bz@ for suggesting a way to simplify this fix.

Reviewed by: bz@
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D19969

5 years ago[ath] Fix return value check to not complain.
adrian [Fri, 19 Apr 2019 18:00:33 +0000 (18:00 +0000)]
[ath] Fix return value check to not complain.

Compilers complain more about things, so let's keep them happy.