]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r336957:
markj [Tue, 7 Aug 2018 15:04:53 +0000 (15:04 +0000)]
MFC r336957:
Add a regression test related to PR 131876.

PR: 131876

5 years agoDocument SA-18:08.
gjb [Tue, 7 Aug 2018 15:03:11 +0000 (15:03 +0000)]
Document SA-18:08.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r336761 & r336781:
dab [Tue, 7 Aug 2018 14:39:00 +0000 (14:39 +0000)]
MFC r336761 & r336781:

Allow a EVFILT_TIMER kevent to be updated.

If a timer is updated (re-added) with a different time period
(specified in the .data field of the kevent), the new time period has
no effect; the timer will not expire until the original time has
elapsed. This violates the documented behavior as the kqueue(2) man
page says (in part) "Re-adding an existing event will modify the
parameters of the original event, and not result in a duplicate
entry."

This modification, adapted from a patch submitted by cem@ to PR214987,
fixes the kqueue system to allow updating a timer entry. The kevent
timer behavior is changed to:

  * When a timer is re-added, update the timer parameters to and
    re-start the timer using the new parameters.
  * Allow updating both active and already expired timers.
  * When the timer has already expired, dequeue any undelivered events
    and clear the count of expirations.

All of these changes address the original PR and also bring the
FreeBSD and macOS kevent timer behaviors into agreement.

A few other changes were made along the way:

  * Update the kqueue(2) man page to reflect the new timer behavior.
  * Fix man page style issues in kqueue(2) diagnosed by igor.
  * Update the timer libkqueue system test to test for the updated
    timer behavior.
  * Fix the (test) libkqueue common.h file so that it includes
    config.h which defines various HAVE_* feature defines, before the
    #if tests for such variables in common.h. This enables the use of
    the actual err(3) family of functions.
  * Fix the usages of the err(3) functions in the tests for incorrect
    type of variables. Those were formerly undiagnosed due to the
    disablement of the err(3) functions (see previous bullet point).

PR: 214987
Relnotes: yes
Sponsored by: Dell EMC

5 years agoMFC r337323:
markj [Tue, 7 Aug 2018 14:09:29 +0000 (14:09 +0000)]
MFC r337323:
Fix a flag collision introduced in r327451.

PR: 230350

5 years agoMFC r337390: Bump date after r337384.
jtl [Mon, 6 Aug 2018 18:46:09 +0000 (18:46 +0000)]
MFC r337390: Bump date after r337384.

5 years agoMFC r337384:
jtl [Mon, 6 Aug 2018 17:41:53 +0000 (17:41 +0000)]
MFC r337384:

Address concerns about CPU usage while doing TCP reassembly.

Currently, the per-queue limit is a function of the receive buffer
size and the MSS.  In certain cases (such as connections with large
receive buffers), the per-queue segment limit can be quite large.
Because we process segments as a linked list, large queues may not
perform acceptably.

The better long-term solution is to make the queue more efficient.
But, in the short-term, we can provide a way for a system
administrator to set the maximum queue size.

We set the default queue limit to 100.  This is an effort to balance
performance with a sane resource limit.  Depending on their
environment, goals, etc., an administrator may choose to modify this
limit in either direction.

Reviewed by: jhb
Approved by: so
Security: FreeBSD-SA-18:08.tcp
Security: CVE-2018-6922

5 years agoMFC r336919, r336924
kevans [Mon, 6 Aug 2018 03:58:56 +0000 (03:58 +0000)]
MFC r336919, r336924

r336919:
efirt: Add tunable to allow disabling EFI Runtime Services

Leading up to enabling EFIRT in GENERIC, allow runtime services to be
disabled with a new tunable: efi.rt_disabled. This makes it so that EFIRT
can be disabled easily in case we run into some buggy UEFI implementation
and fail to boot.

r336924:
Follow up to r336919 and r336921: s/efi.rt_disabled/efi.rt.disabled/

The latter matches the rest of the tree better [0]. The UPDATING entry has
been updated to reflect this, and the new tunable is now documented in
loader(8) [1].

Reported by: imp [0], Shawn Webb [1]

5 years agoMFC r336926:
pfg [Mon, 6 Aug 2018 02:09:14 +0000 (02:09 +0000)]
MFC r336926:
sed: unsign some indexes to fix sign-compare warnings.

Hinted by: OpenBSD (CVS 1.32)

5 years agoMFH r336801,r336854:
mm [Sun, 5 Aug 2018 14:35:30 +0000 (14:35 +0000)]
MFH r336801,r336854:

MFH r336801 (cem):
Cherry-pick upstream 2c8c83b9

Relevant vendor changes:
  Fix issue #948: out-of-bounds read in lha_read_data_none()

MFH r336854:
Sync libarchive with vendor.

Important vendor changes:
  PR #993: Chdir to -C directory for metalog processing
  OSS-Fuzz #4969: Check size of the extended time field in zip archives
  PR #973: Record informational compression level in gzip header

amdbugs: 877
Security: CVE-2017-14503

5 years agoMFC r336152-r336154, r336157
kevans [Sat, 4 Aug 2018 22:15:05 +0000 (22:15 +0000)]
MFC r336152-r336154, r336157

r336152:
subr_hints: Use goto/label instead of series of conditionals

r336153:
subr_hints: Convert some bool-like ints to bools

r336154:
subr_hints: Skip static_env and static_hints if they don't contain hints

This is possible because, well, they're static. Both the dynamic environment
and the MD-environment (generally loader(8) environment) can potentially
have room for new variables to be set, and thus do not receive this
treatment.

r336157:
kern_environment: bool'itize dynamic_kenv; fix small style(9) nit

5 years agoMFC r336973-r336975
kevans [Sat, 4 Aug 2018 22:12:12 +0000 (22:12 +0000)]
MFC r336973-r336975

r336973:
config(8): Strip comments from env lines

Consolidates the small bits of logic required for preprocessing a line
before inclusion into a file or nvlist.

r336974:
Re-insert variable disappeared during mis-application of r336973

r336975:
Remove variable re-inserted during mis-application of r336973

5 years agokenv MFC: r335998, r336019, r336026, r336036, r336217, r336335, r336337,
kevans [Sat, 4 Aug 2018 21:57:17 +0000 (21:57 +0000)]
kenv MFC: r335998, r336019, r336026, r336036, r336217, r336335, r336337,
r336415-r336416, r336419

As an aside- this has been slightly altered from the version in head to keep
the MD and config-static environments mutually exclusive by default.

This difference is a one-line change in init_static_kenv to setup the MD
environment if the config-static environment is empty or if
loader_env.disabled is explicitly set to 0.

r335998:
kern_environment: use any provided environments, evict hintmode/envmode

At the moment, hintmode and envmode are used to indicate whether static
hints or static env have been provided in the kernel config(5) and the
static versions are mutually exclusive with loader(8)-provided environment.
hintmode *can* be reconfigured later to pull from the dynamic environment,
thus taking advantage of the loader(8) or post-kmem environment setting.

This changeset fixes both problems at once to move us from a semi-confusing
state to a consistent state: if an environment file, hints file, or
loader(8) environment are provided, we use them in a well-known order of
precedence:

- loader(8) environment
- static environment
- static hints file

Once the dynamic environment is setup this becomes a moot point. The
loader(8) and static environments are merged (respecting the above order of
precedence), and the static hints are merged in on an as-needed basis after
the dynamic environment has been setup.

Hints lookup are changed to respect all of the above. Before the dynamic
environment is setup, lookups use the above-mentioned order and fallback to
the next environment if a matching hint is not found. Once the dynamic
environment is setup, that is used on its own since it captures all of the
above information plus any dynamic kenv settings that came up later in boot.

The following tangentially related changes were made to res_find:

- A hintp cookie is now passed in so that related searches continue using
  the chain of environments (or dynamic environment) without relying on
  global state
- All three environments will be searched if they actually have valid hints
  to use, rather than just choosing the first environment that actually had
  a hint and rolling with that only

The hintmode sysctl has been ripped out. static_{env,hints}.disabled are
still honored and will disable their respective environments from being used
for hint lookups and from being merged into the dynamic environment, as
expected.

r336019:
config(8): De-dupe hint/env vars within a single file

r335653 flipped the order in which hints/env files are concatenated to match
the order in which vars are processed by the kernel. This is the other
hammer to drop.

Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the
latest value specified for a key. This leaves some duplicates if a variable
is specified in multiple hint/env files or via `envvar` in a kernel config,
but the reversed order of concatenation (from r335653) makes this a
non-issue as the latest-specified version will be seen first.

This change also silently rewrote hint bits to use the same sanitization
process that ian@ wrote for r335642. To the kernel, hints and env vars are
basically the same thing through early boot, then get merged into the
dynamic environment once kmem becomes available and the dynamic environment
is created. They should be subjected to the same restrictions.

libnv has been added to -legacy for the time being to support the build of
config(8) with the new cnvlist API.

r336026:
config(8): Fix broken ABI

r336019 introduced ${SRCTOP}/sys to the include paths in order to pull in a
new sys/{c,}nv.h. This is wrong, because the build tree's ABI isn't
guaranteed to match what's running on the host system.

Fix instead by removing -I${SRCTOP}/sys and installing the libnv headers
with `make -C lib/libnv includes`... this may or may not get re-worked in
the future so that a userland lib isn't installing includes from sys/.

r336036:
kern_environment: Fix SYSINIT ordering

The dynamic environment was being initialized at SI_SUB_KMEM, SI_ORDER_ANY.
I added the hint-merging at SI_SUB_KMEM, SI_ORDER_ANY as well in r335998 -
this can only work by coincidence.

Re-do both to operate at SI_SUB_KMEM + 1, SI_ORDER_FIRST and SI_ORDER_SECOND
respectively to be safe. It's sufficiently obfuscated away as to when in
SU_SUB_KMEM malloc will be available, and the dynamic environment cannot be
relied upon there anyways since it's initialized at SI_ORDER_ANY.

r336217:
kern_environment: Give the static environment a chance to disable MD env

This variable has been given the name "loader_env.disabled" as it's the
primary way most people will have an MD environment. This restores the
previously-default behavior of ignoring the loader(8) environment, which may
be useful for vendor distributions or other scenarios where inheriting the
loader environment may be considered a security issue or potentially
breaking of a more locked-down environment.

As the change to config(5) indicates, disabling the loader environment
should not be a choice made lightly since it may provide ACPI hints and
other useful things that the system can rely on to boot.

An UPDATING entry has been added to mention an upgrade path for those that
may have relied on the previous behavior.

r336335 by arichardson:
No longer install sys/nv.h and sys/cnv.h in lib/libnv/Makefile

Use tools/build/Makefile to install the headers into ${WORLDTMP}/legacy
instead. Compared to r336026 this has the minor advantage that it avoids
unncessary header installation when building the non-bootstrap libnv.

r336337:
Unconditionally build libnv in legacy

Rather than using a config(8) built from new tree linking libnv built on
host.

r336415:
config(8): Add compatibility shims for r335998

Plumb the %VERSREQ from Makefile.<arch> through to the rest of config(8).
We've recorded the config(8) version that we're calling "the end of
envmode and hintmode," and we'll write them out for earlier versions. Later
kernel version bumps will remove envmode/hintmode from the kernel as needed,
which is OK since the current kernel does not use them at all.

These compatibility shims really need to go away when the major version
rolls over...

r336416:
Fix GCC 4.2 build after r336415, proper declaration and prototype

r336419:
config(8): Invert checks; envmode/hintmode reflect "env provided"

Relnotes: yes (maybe) [The loader environment may now be used with
the config-static environment by specifying loader_env.disabled=0 in the
config-static environment]

5 years agoMFC r336577:
wulf [Sat, 4 Aug 2018 12:45:37 +0000 (12:45 +0000)]
MFC r336577:

Raise "Report Count" value limit in HID descriptor parser.

This fixes usage/report size calculation of Microsoft`s "Touch Hardware
Quality Assurance" certificate blob found in many touchscreens.

While here, join several "c->flags = dval" lines in to single line.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D16357

5 years agoMFC r334555:
wulf [Sat, 4 Aug 2018 12:40:59 +0000 (12:40 +0000)]
MFC r334555:

[evdev] Sync event codes with Linux kernel 4.16

5 years agoMFC r336590:
mav [Sat, 4 Aug 2018 00:34:15 +0000 (00:34 +0000)]
MFC r336590:
Stop further SCSI recovery attempts after one has failed.

We've got a set of probably damaged hard disks, reporting 0x04,0x02
("Logical unit not ready, initializing command required") in response
to READ CAPACITY(16), where attempts to use START STOP UNIT for recovery
results in 0x44,0x00 ("Internal target failure") after ~1 second delay.
As result of all recovery retries, device open attempt took ~3 seconds
before finally reporting to GEOM that device is opened, but has no media.
If the open was for writing and since it hasn't formally failed, following
close triggered GEOM retaste, opening device few more times with respective
delays.

This change reduces whole time of this cycle from ~12 seconds to ~3 by
giving up on recovery after the first failure.

5 years agoMFC r336997:
manu [Fri, 3 Aug 2018 21:59:01 +0000 (21:59 +0000)]
MFC r336997:

release: Restore copy of boot.scr for some board

This is not a problem for 12-CURRENT as EFI boot works but it doesn't
for 11.
While here some board arm_install_uboot also copy ubldr.bin et create
firstboot files but it's already done in arm_install_boot

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D16481

5 years agoFix a mismerge in r337262.
markj [Fri, 3 Aug 2018 17:14:52 +0000 (17:14 +0000)]
Fix a mismerge in r337262.

This is a direct commit to stable/11.

5 years agoMFC r337015:
markj [Fri, 3 Aug 2018 15:43:37 +0000 (15:43 +0000)]
MFC r337015:
COMPAT_LINUX32 has not depended on COMPAT_43 in some time.

5 years agoMFC r336505, r336764
markj [Fri, 3 Aug 2018 15:42:39 +0000 (15:42 +0000)]
MFC r336505, r336764
Have preload_delete_name() free pages backing preloaded data.

5 years agoMFC r336319:
asomers [Fri, 3 Aug 2018 14:06:08 +0000 (14:06 +0000)]
MFC r336319:

auditon(2): fix A_SETPOLICY with 64-bit values

A_SETPOLICY is supposed to work with either 64 or 32-bit values, but due to a
typo the 64-bit version has never worked correctly.

Submitted by: aniketp
Reviewed by: asomers, cem
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16222

5 years agoMFC r336205:
asomers [Fri, 3 Aug 2018 14:05:22 +0000 (14:05 +0000)]
MFC r336205:

Don't acquire evclass_lock with a spinlock held

When the "pc" audit class is enabled and auditd is running, witness will
panic during thread exit because au_event_class tries to lock an rwlock
while holding a spinlock acquired upstack by thread_exit.

To fix this, move AUDIT_SYSCALL_EXIT futher upstack, before the spinlock is
acquired. Of thread_exit's 16 callers, it's only necessary to call
AUDIT_SYSCALL_EXIT from two, exit1 (for exiting processes) and kern_thr_exit
(for exiting threads). The other callers are all kernel threads, which
needen't call AUDIT_SYSCALL_EXIT because since they can't make syscalls
there will be nothing to audit.  And exit1 already does call
AUDIT_SYSCALL_EXIT, making the second call in thread_exit redundant for that
case.

PR: 228444
Reported by: aniketp
Reviewed by: aniketp, kib
Differential Revision: https://reviews.freebsd.org/D16210

5 years agoMFC r335899:
asomers [Fri, 3 Aug 2018 14:03:50 +0000 (14:03 +0000)]
MFC r335899:

auditd(8): register signal handlers interrutibly

auditd_wait_for_events() relies on read(2) being interrupted by signals,
but it registers signal handlers with signal(3), which sets SA_RESTART.
That breaks asynchronous signal handling. It means that signals don't
actually get handled until after an audit(8) trigger is received.
Symptoms include:

* Sending SIGTERM to auditd doesn't kill it right away; you must send
  SIGTERM and then send a trigger with auditon(2).
* Same with SIGHUP
* Zombie child processes don't get reaped until auditd receives a trigger
  sent by auditon. This includes children created by expiring audit trails
  at auditd startup.

Fix by using sigaction(2) instead of signal(3).

Cherry pick https://github.com/openbsm/openbsm/commit/d060887

PR: 229381
Reviewed by: cem
Obtained from: OpenBSM
Differential Revision: https://github.com/openbsm/openbsm/pull/36

5 years agoMFC r332631:
asomers [Fri, 3 Aug 2018 14:01:32 +0000 (14:01 +0000)]
MFC r332631:

lio_listio: return EAGAIN instead of EIO when out of resources

This behavior is already documented by the man page, and suggested by POSIX.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D15099

5 years agoMFC r336763:
kib [Fri, 3 Aug 2018 11:36:37 +0000 (11:36 +0000)]
MFC r336763:
Add workarounds for several Ryzen erratas, on amd64.

5 years agoMFC r336922:
markj [Thu, 2 Aug 2018 15:16:59 +0000 (15:16 +0000)]
MFC r336922:
Remove a redundant check.

5 years agoMFC r336641: fix incorrect operator in the AUDITPIPE_SET_QLIMIT bounds check
avg [Thu, 2 Aug 2018 09:31:50 +0000 (09:31 +0000)]
MFC r336641: fix incorrect operator in the AUDITPIPE_SET_QLIMIT bounds check

5 years agoMFC r335934: remove unneeded inclusion of sys/interrupt.h from several files
avg [Thu, 2 Aug 2018 09:29:39 +0000 (09:29 +0000)]
MFC r335934: remove unneeded inclusion of sys/interrupt.h from several files

5 years agoMFC r337056:
hselasky [Thu, 2 Aug 2018 09:03:08 +0000 (09:03 +0000)]
MFC r337056:
Don't refer to non-existing atomic functions, even though not compiled,
in the LinuxKPI.

Found by: rpokala @
Sponsored by: Mellanox Technologies

5 years agoMFC r336453:
hselasky [Thu, 2 Aug 2018 09:02:19 +0000 (09:02 +0000)]
MFC r336453:
Use unspecified address family when connecting as a client in
libibverbs example utilities.

This allows connecting to both IPv4 and IPv6 and reverts
some FreeBSD only patches.

Sponsored by: Mellanox Technologies

5 years agoMFC r334786: x86: reorganize code that deals with unexpected NMI-s
avg [Thu, 2 Aug 2018 09:00:09 +0000 (09:00 +0000)]
MFC r334786: x86: reorganize code that deals with unexpected NMI-s

5 years agoMFC r334479: call AcpiLeaveSleepStatePrep after re-enabling interrupts
avg [Thu, 2 Aug 2018 08:58:33 +0000 (08:58 +0000)]
MFC r334479: call AcpiLeaveSleepStatePrep after re-enabling interrupts

5 years agoMFC r336452:
hselasky [Thu, 2 Aug 2018 08:57:40 +0000 (08:57 +0000)]
MFC r336452:
Add ability to parse sysfs paths under FreeBSD in libibumad.

Add the ability to to parse sysfs paths to sysctl nodes by replacing '/' with '.'

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r336451:
hselasky [Thu, 2 Aug 2018 08:56:27 +0000 (08:56 +0000)]
MFC r336451:
Update version information for the mlx5 and mlx5en(4) modules.

While at it bump some copyright dates.

Sponsored by: Mellanox Technologies

5 years agoMFC r336450:
hselasky [Thu, 2 Aug 2018 08:55:19 +0000 (08:55 +0000)]
MFC r336450:
Do not inline transmit headers and use HW VLAN tagging if supported by mlx5en(4).

Query the minimal inline mode supported by the card.
When creating a send queue, cache the queried mode and optimize the transmit
if no inlining is required.  In this case, we can avoid touching the headers
cache line and avoid dirtying several more lines by copying headers into
the send WQEs.  Also, if no inline headers are used, hardware assists in
the VLAN tag framing.

Submitted by: kib@, slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r336411:
hselasky [Thu, 2 Aug 2018 08:52:49 +0000 (08:52 +0000)]
MFC r336411:
Use a mbuf header instead of a mbuf cluster for debugging interrupts in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r336410:
hselasky [Thu, 2 Aug 2018 08:51:55 +0000 (08:51 +0000)]
MFC r336410:
Add module parameter to limit number of MSIX EQ vectors in mlx5en(4).

For setups having a large amount of PCI devices, it makes sense to limit the
number of MSIX vectors per PCI device, in order to avoid running out of IRQ
vectors.

Sponsored by: Mellanox Technologies

5 years agoMFC r336407:
hselasky [Thu, 2 Aug 2018 08:49:35 +0000 (08:49 +0000)]
MFC r336407:
Handle jumbo frames without requiring big clusters in mlx5en(4).

The scatter list is formed by the chunks of MCLBYTES each, and larger
than default packets are returned to the stack as the mbuf chain.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r336404:
hselasky [Thu, 2 Aug 2018 08:48:27 +0000 (08:48 +0000)]
MFC r336404:
Enable both receive and transmit pauseframes by default in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r336403:
hselasky [Thu, 2 Aug 2018 08:47:24 +0000 (08:47 +0000)]
MFC r336403:
Add context numbers for HW elements in mlx5en(4).

To access the data, set sysctl dev.mce.N.conf.debug_stats to 1.
This enables the sysctl node dev.mce.N.hw_ctx_debug.  Its content is
the mapping of each channel' number to used receive queue and associated
completion queue, set of the transmit queues numbers and corresponding
completion queues.

Trimmed example output:
channel 30 rq 188 cq 1085
channel 30 tc 0 sq 187 cq 1084
channel 31 rq 191 cq 1087
channel 31 tc 0 sq 190 cq 1086

Sponsored by: Mellanox Technologies

5 years agoMFC r336402:
hselasky [Thu, 2 Aug 2018 08:46:27 +0000 (08:46 +0000)]
MFC r336402:
Do not hint about 'trust both' mode when the mlx5en(4) hardware does not support it.

Sponsored by: Mellanox Technologies

5 years agoMFC r336401:
hselasky [Thu, 2 Aug 2018 08:45:32 +0000 (08:45 +0000)]
MFC r336401:
Correctly write atomic variable in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r336399:
hselasky [Thu, 2 Aug 2018 08:44:40 +0000 (08:44 +0000)]
MFC r336399:
Remove redundant call to mlx5_vsc_find_cap() in mlx5core.

Sponsored by: Mellanox Technologies

5 years agoMFC r336398:
hselasky [Thu, 2 Aug 2018 08:43:54 +0000 (08:43 +0000)]
MFC r336398:
Make sure the state variable is set atomically instead of using a mutex in mlx5core.

Device detach and setting error state may deadlock over the interface mutex
like this:

a) Detach code in mlx5en waits until error state is set while the interface
mutex is locked.
b) The set error handler needs to lock the interface mutex before it can
set the error state.

The solution is to use atomics to set the error state.

Sponsored by: Mellanox Technologies

5 years agoMFC r336397:
hselasky [Thu, 2 Aug 2018 08:42:40 +0000 (08:42 +0000)]
MFC r336397:
Refactor access to CR-space into using VSC APIs in mlx5core.

Remove no longer used files and APIs.

Sponsored by: Mellanox Technologies

5 years agoMFC r336396:
hselasky [Thu, 2 Aug 2018 08:40:46 +0000 (08:40 +0000)]
MFC r336396:
Remove redundant newline character in mlx5core.

Sponsored by: Mellanox Technologies

5 years agoMFC r336395:
hselasky [Thu, 2 Aug 2018 08:39:48 +0000 (08:39 +0000)]
MFC r336395:
Update version information for the mlx5ib module.

Sponsored by: Mellanox Technologies

5 years agoMFC r336394:
hselasky [Thu, 2 Aug 2018 08:38:37 +0000 (08:38 +0000)]
MFC r336394:
Don't pass unsupported events to ibcore from mlx5ib.

Sponsored by: Mellanox Technologies

5 years agoMFC r336393:
hselasky [Thu, 2 Aug 2018 08:37:44 +0000 (08:37 +0000)]
MFC r336393:
Use static device naming instead of dynamic one in mlx5ib.

When resetting mlx5core instances it can happen that the order of attach and
detach for mlx5ib instances is changed. Take the unit number for mlx5_%d from
the parent PCI device, similarly to what is done in mlx5en(4), so that there
is a direct relationship between mce<N> and mlx5_<N>.

Sponsored by: Mellanox Technologies

5 years agoMFC r336392:
hselasky [Thu, 2 Aug 2018 08:36:51 +0000 (08:36 +0000)]
MFC r336392:
Implement support for Differentiated Service Code Point, DSCP, in mlx5en(4).

The DSCP feature is controlled using a set of sysctl(8) fields under
the qos sysctl directory entry for mlx5en(4).

For Routable RoCE QPs, the DSCP should be set in the QP's address path.
The DSCP's value is derived from the traffic class.

Linux commit:
ed88451e1f2d400fd6a743d0a481631cf9f97550

Sponsored by: Mellanox Technologies

5 years agoMFC r336964:
hselasky [Thu, 2 Aug 2018 08:35:32 +0000 (08:35 +0000)]
MFC r336964:
Only NULL check the VNET pointer when VIMAGE is enabled in ibcore.
Else a NULL VNET pointer should be ignored. This fixes address resolving
when VIMAGE is disabled.

Sponsored by: Mellanox Technologies

5 years agoMFC r336391:
hselasky [Thu, 2 Aug 2018 08:33:51 +0000 (08:33 +0000)]
MFC r336391:
Use __FBSDID() for RCS tags in ibcore.

Sponsored by: Mellanox Technologies

5 years agoMFC r336389:
hselasky [Thu, 2 Aug 2018 08:31:34 +0000 (08:31 +0000)]
MFC r336389:
Add support for IPv6 multicast in ibcore.

This change allows us to join IPv6 multicast networks.

Sponsored by: Mellanox Technologies

5 years agoMFC r336388:
hselasky [Thu, 2 Aug 2018 08:30:44 +0000 (08:30 +0000)]
MFC r336388:
Add support for RoCEv2 multicast in ibcore.

When creating address handle from multicast GID, set MAC according to
the appropriate formula instead of searching for it in the GID table:
- For IPv4 multicast GID use ip_eth_mc_map().
- For IPv6 multicast GID use ipv6_eth_mc_map().

Linux commit:
9636a56fa864464896bf7d1272c701f2b9a57737

Sponsored by: Mellanox Technologies

5 years agoMFC r336387:
hselasky [Thu, 2 Aug 2018 08:29:40 +0000 (08:29 +0000)]
MFC r336387:
Honor return status of ib_init_ah_from_mcmember() in ibcore.

The return status of ib_init_ah_from_mcmember() is ignored by
cma_ib_mc_handler().  Honor it and return error event if ah attribute
initialization failed.

Linux commit:
6d337179f28cc50ddd7e224f677b4cda70b275fc

Sponsored by: Mellanox Technologies

5 years agoMFC r336386:
hselasky [Thu, 2 Aug 2018 08:28:49 +0000 (08:28 +0000)]
MFC r336386:
Honor port_num while resolving GID for IB link layer in ibcore.

ah_attr contains the port number to which cm_id is bound. However, while
searching for GID table for matching GID entry, the port number is
ignored.

This could cause the wrong GID to be used when the ah_attr is converted to
an AH.

Linux commit:
563c4ba3bd2b8b0b21c65669ec2226b1cfa1138b

Sponsored by: Mellanox Technologies

5 years agoMFC r336385:
hselasky [Thu, 2 Aug 2018 08:27:49 +0000 (08:27 +0000)]
MFC r336385:
Set IPv4 TOS and IPv6 traffic class field for RoCEv2 traffic in ibcore.

The current implementation assumes a static mapping between
the TOS bits and the priority code point, PCP bits.

Sponsored by: Mellanox Technologies

5 years agoMFC r336384:
hselasky [Thu, 2 Aug 2018 08:26:56 +0000 (08:26 +0000)]
MFC r336384:
Fix for loopback detection in address resolve logic in ibcore.

When a loopback address is detected use the network interface which
has the loopback flag set to trigger loopback logic in address resolve.

Sponsored by: Mellanox Technologies

5 years agoMFC r336383:
hselasky [Thu, 2 Aug 2018 08:25:48 +0000 (08:25 +0000)]
MFC r336383:
Check port number supplied by user verbs cmds in ibcore.

The ib_uverbs_create_ah() ind ib_uverbs_modify_qp() calls receive
the port number from user input as part of its attributes and assumes
it is valid. Down on the stack, that parameter is used to access kernel
data structures.  If the value is invalid, the kernel accesses memory
it should not.  To prevent this, verify the port number before using it.

Linux commit:
5ecce4c9b17bed4dc9cb58bfb10447307569b77b
a62ab66b13a0f9bcb17b7b761f6670941ed5cd62
5a7a88f1b488e4ee49eb3d5b82612d4d9ffdf2c3

Sponsored by: Mellanox Technologies

5 years agoMFC r336382:
hselasky [Thu, 2 Aug 2018 08:24:45 +0000 (08:24 +0000)]
MFC r336382:
Depend on IPv6 stack to resolve link local address for RoCEv2 in ibcore.

RoCEv1 does not use the IPv6 stack to resolve the link local DGID since it
uses GID address. It forms the DMAC directly from the DGID.

Linux commit:
56d0a7d9a0f045ee27a001762deac28c7d28e2e4

Sponsored by: Mellanox Technologies

5 years agoMFC r336381:
hselasky [Thu, 2 Aug 2018 08:23:54 +0000 (08:23 +0000)]
MFC r336381:
Fix kernel crash during fail to initialize device in ibcore.

This patch fixes the kernel crash that occurs during ib_dealloc_device()
called due to provider driver fails with an error after
ib_alloc_device() and before it can register using ib_register_device().

This crashed seen in tha lab as below which can occur with any IB device
which fails to perform its device initialization before invoking
ib_register_device().

This patch avoids touching cache and port immutable structures if device
is not yet initialized.
It also releases related memory when cache and port immutable data
structure initialization fails during register_device() state.

Linux commit:
4be3a4fa51f432ef045546d16f25c68a1ab525b9

Sponsored by: Mellanox Technologies

5 years agoMFC r336380:
hselasky [Thu, 2 Aug 2018 08:22:53 +0000 (08:22 +0000)]
MFC r336380:
Check AF family prior resolving address and introduce safer rdma_addr_size() variants in ibcore.

Garbage supplied by user will cause to UCMA module provide zero
memory size for memcpy(), because it wasn't checked, it will
produce unpredictable results in rdma_resolve_addr().

There are several places in the ucma ABI where userspace can pass in a
sockaddr but set the address family to AF_IB.  When that happens,
rdma_addr_size() will return a size bigger than sizeof struct sockaddr_in6,
and the ucma kernel code might end up copying past the end of a buffer
not sized for a struct sockaddr_ib.

Fix this by introducing new variants
    int rdma_addr_size_in6(struct sockaddr_in6 *addr);
    int rdma_addr_size_kss(struct __kernel_sockaddr_storage *addr);

that are type-safe for the types used in the ucma ABI and return 0 if the
size computed is bigger than the size of the type passed in.  We can use
these new variants to check what size userspace has passed in before
copying any addresses.

Linux commit:
2975d5de6428ff6d9317e9948f0968f7d42e5d74
09abfe7b5b2f442a85f4c4d59ecf582ad76088d7
84652aefb347297aa08e91e283adf7b18f77c2d5

Sponsored by: Mellanox Technologies

5 years agoMFC r336379:
hselasky [Thu, 2 Aug 2018 08:21:55 +0000 (08:21 +0000)]
MFC r336379:
Check for a cm_id->device in all user calls that need it in ibcore.

This was done by auditing all callers of ucma_get_ctx and switching the
ones that unconditionally touch ->device to ucma_get_ctx_dev. This covers
a little less than  half of the call sites.

The 11 remaining call sites to ucma_get_ctx() were manually audited.

Linux commit:
4b658d1bbc16605330694bb3ef2570c465ef383d
8b77586bd8fe600d97f922c79f7222c46f37c118

Sponsored by: Mellanox Technologies

5 years agoMFC r336377:
hselasky [Thu, 2 Aug 2018 08:21:04 +0000 (08:21 +0000)]
MFC r336377:
Fix kernel panic while using XRC_TGT QP type in ibcore.

Attempt to modify XRC_TGT QP type from the user space (ibv_xsrq_pingpong
invocation) will trigger the following kernel panic. It is caused by the
fact that such QPs missed uobject initialization.

Linux commit:
f45765872e7aae7b81feb3044aaf9886b21885ef

Sponsored by: Mellanox Technologies

5 years agoMFC r336376:
hselasky [Thu, 2 Aug 2018 08:20:11 +0000 (08:20 +0000)]
MFC r336376:
Fix NULL pointer dereference during device removal in ibcore.

As part of ib_uverbs_remove_one which might be triggered upon
reset flow, we trigger IB_EVENT_DEVICE_FATAL event to userspace
application.
If device was removed after uverbs fd was opened but before
ib_uverbs_get_context was called, the event file will be accessed
before it was allocated, result in NULL pointer dereference:

Linux commit:
870201f95fcbd19538aef630393fe9d583eff82e

Sponsored by: Mellanox Technologies

5 years agoMFC r336375:
hselasky [Thu, 2 Aug 2018 08:19:08 +0000 (08:19 +0000)]
MFC r336375:
Fix access to non-initialized CM_ID object in ibcore.

The attempt to join multicast group without ensuring that CMA device
exists will lead to the following crash reported by syzkaller.

Linux commit:
7688f2c3bbf55e52388e37ac5d63ca471a7712e1

Sponsored by: Mellanox Technologies

5 years agoMFC r336374:
hselasky [Thu, 2 Aug 2018 08:18:11 +0000 (08:18 +0000)]
MFC r336374:
Avoid that ib_drain_qp() triggers an out-of-bounds stack access in ibcore.

Linux commit:
a1ae7d0345edd593d6725d3218434d903a0af95d

Sponsored by: Mellanox Technologies

5 years agoMFC r336373:
hselasky [Thu, 2 Aug 2018 08:17:09 +0000 (08:17 +0000)]
MFC r336373:
Ensure that CM_ID exists prior to access it in ibcore.

Prior to access UCMA commands, the context should be initialized
and connected to CM_ID with ucma_create_id(). In case user skips
this step, he can provide non-valid ctx without CM_ID and cause
to multiple NULL dereferences.

Also there are situations where the create_id can be raced with
other user access, ensure that the context is only shared to
other threads once it is fully initialized to avoid the races.

Linux commit:
e8980d67d6017c8eee8f9c35f782c4bd68e004c9

Sponsored by: Mellanox Technologies

5 years agoMFC r336372:
hselasky [Thu, 2 Aug 2018 08:15:05 +0000 (08:15 +0000)]
MFC r336372:
Add support for prio-tagged traffic for RDMA in ibcore.

When receiving a PCP change all GID entries are reloaded.
This ensures the relevant GID entries use prio tagging,
by setting VLAN present and VLAN ID to zero.

The priority for prio tagged traffic is set using the regular
rdma_set_service_type() function.

Fake the real network device to have a VLAN ID of zero
when prio tagging is enabled. This is logic is hidden inside
the rdma_vlan_dev_vlan_id() function which must always be used
to retrieve the VLAN ID throughout all of ibcore and the
infiniband network drivers.

The VLAN presence information then propagates through all
of ibcore and so incoming connections will have the VLAN
bit set. The incoming VLAN ID is then checked against the
return value of rdma_vlan_dev_vlan_id().

Sponsored by: Mellanox Technologies

5 years agoMFC r336371:
hselasky [Thu, 2 Aug 2018 08:14:00 +0000 (08:14 +0000)]
MFC r336371:
Set default GID type as RoCE when resolving RoCE route in ibcore.

cma_iboe_set_mgid() is updated to reflect the RoCEv2 GID check.

Linux commit:
5c181bda77f409d89ad513528eccac5f3a416474

Sponsored by: Mellanox Technologies

5 years agoMFC r336370:
hselasky [Thu, 2 Aug 2018 08:12:52 +0000 (08:12 +0000)]
MFC r336370:
Set RoCEv2 MGID according to spec in ibcore.

RoCEv2 Annex states that for RoCEv2 over IPv4, the corresponding
IPv4 address is encoded into the GID according to the following rule:
GID= :ffff:<IPv4 address>

Remove the 0xff0e prefix for RoCEv2 packets with IPv4 and leave it
zeroed and change rdma_is_multicast_addr() to consider the new logic.

Linux commit:
be1d325a335840a86c133a56c6a911c368bac0fd
1c3aea2bc8f0b2e5b57375ead40457ff75a3a2ec

Sponsored by: Mellanox Technologies

5 years agoMFC r336369:
hselasky [Thu, 2 Aug 2018 08:12:01 +0000 (08:12 +0000)]
MFC r336369:
For multicast functions in ibcore, verify that LIDs are multicast LIDs.

The Infiniband spec defines "A multicast address is defined by a
MGID and a MLID" (section 10.5).

Add check to verify that the MLID value is in the correct address
range.

RoCE Annex (A16.9.10/11) declares that during attach (detach) QP to a
multicast group, if the QP is associated with a RoCE port, the
multicast group MLID is unused and is ignored.

During attach or detach multicast, when the QP is associated with a
port, it is enough to check the port's link layer and validate the
LID only if it is Infiniband. Otherwise, avoid validating the
multicast LID.

Linux commit:
8561eae60ff9417a50fa1fb2b83ae950dc5c1e21
5236333592244557a19694a51337df6ac018f0a7

Sponsored by: Mellanox Technologies

5 years agoMFC r336368:
hselasky [Thu, 2 Aug 2018 08:10:54 +0000 (08:10 +0000)]
MFC r336368:
Fix for RDMA loopback over VLAN in ibcore.

Implement a more generic solution for detecting loopback.
The problem was that the default netdevice was resolved
for loopback also when VLAN was used. Use real network
device instead of loopback device for bound device
interface.

How to test:
ucmatose -b 127.0.0.1 -p 20090
ucmatose -s 5.6.5.1 -p 20090

Note that RDMA treats the IPv4 and IPv6 loopback
addresses like any address.

Sponsored by: Mellanox Technologies

5 years agoMFC r336367:
hselasky [Thu, 2 Aug 2018 08:10:06 +0000 (08:10 +0000)]
MFC r336367:
Add native FreeBSD support for multicast in ibcore.

This change adds support for registering multicast addresses,
both IPv4 and IPv6.

Sponsored by: Mellanox Technologies

5 years agoMFC r336366:
hselasky [Thu, 2 Aug 2018 08:08:02 +0000 (08:08 +0000)]
MFC r336366:
If the MGID/MLID pair is not on the list return an error in ibcore.

A list of MGID/MLID pairs is built when doing a multicast attach.  When
the multicast detach is called, the list is searched, and regardless of
the search outcome, the driver detach is called.

If an MGID/MLID pair is not on the list, driver detach should not be
called, and an error should be returned.  Calling the driver without
removing an MGID/MLID pair from the list can leave the core and driver
out of sync.

Linux commit:
20c7840a77ddcb2ed2fbd66e8197db2868495751

Sponsored by: Mellanox Technologies

5 years agoMFC r336365:
hselasky [Thu, 2 Aug 2018 08:07:10 +0000 (08:07 +0000)]
MFC r336365:
Add lock to multicast handlers in ibcore.

When two handlers used the same object in the old schema, we blocked
the process in the kernel. The new schema just returns -EBUSY. This
could lead to different behaviour in applications between the old
schema and the new schema. In most cases, using such handlers
concurrently could lead to crashing the process. For example, if
thread A destroys a QP and thread B modifies it, we could have the
destruction happens before the modification. In this case, we are
accessing freed memory which could lead to crashing the process.
This is true for most cases. However, attaching and detaching
a multicast address from QP concurrently is safe. Therefore, we
preserve the original behaviour by adding a lock there.

Linux commit:
f48b726920d96dcd1860df06143bdea7d6d7dcc3

Sponsored by: Mellanox Technologies

5 years agoMFC r336364:
hselasky [Thu, 2 Aug 2018 08:06:17 +0000 (08:06 +0000)]
MFC r336364:
Only update source address when resolving is successful in ibcore.

When resolving an IP address in ibcore, only update the source address
upon normal completion. The ibcore address resolve function does not
care about the scope ID value of the IPv6 link-local addresses and expects
this information has already been extracted into the bound_dev_if field.
Because the same IPv6 link-local address can exist on multiple interfaces
the ibcore address resolver gets confused and returns ENETUNREACH.

Instead of updating both source address and bound_dev_if just keep the
address set to any address until resolving completes. For the sake of code
symmetry a similar change has been applied to the IPv4 address resolve path.

Sponsored by: Mellanox Technologies

5 years agoMFC r336363:
hselasky [Thu, 2 Aug 2018 08:05:20 +0000 (08:05 +0000)]
MFC r336363:
Process address resolve requests at least one time per second in ibcore.

When setting a large address resolve timeout it was observed that the
address resolving would succeed at the timeout and not when the address
was available. Make sure the address resolving requests are processed no
slower than one time every second.

While at it use "int" for jiffies instead of "unsigned long" to match
FreeBSD ticks.

Sponsored by: Mellanox Technologies

5 years agoMFC r335094 and r335123:
hselasky [Thu, 2 Aug 2018 08:04:21 +0000 (08:04 +0000)]
MFC r335094 and r335123:
Revert r335094 and properly fix OFED build after r335053.

Sponsored by: Mellanox Technologies

5 years agoMFC: r336357
rmacklem [Thu, 2 Aug 2018 03:13:59 +0000 (03:13 +0000)]
MFC: r336357
Modify the reasons for not issuing a delegation in the NFSv4.1 server.

The ESXi NFSv4.1 client will generate warning messages when the reason for
not issuing a delegation is two. Two refers to a resource limit and I do
not see why it would be considered invalid. However it probably was not the
best choice of reason for not issuing a delegation.
This patch changes the reasons used to ones that the ESXi client doesn't
complain about. This change does not affect the FreeBSD client and does
not appear to affect behaviour of the Linux NFSv4.1 client.
RFC5661 defines these "reasons" but does not give any guidance w.r.t. which
ones are more appropriate to return to a client.

5 years agoMFC 333416: Report TRAP_BRKPT for breakpoint traps on sparc64.
jhb [Wed, 1 Aug 2018 20:38:01 +0000 (20:38 +0000)]
MFC 333416: Report TRAP_BRKPT for breakpoint traps on sparc64.

5 years agoMFC 332782:
jhb [Wed, 1 Aug 2018 17:40:17 +0000 (17:40 +0000)]
MFC 332782:
Simplify the code to allocate stack for auxv, argv[], and environment vectors.

Remove auxarg_size as it was only used once right after a confusing
assignment in each of the variants of exec_copyout_strings().

5 years agoMFC 330823,332335: Cosmetic cleanups to some Linuxulator files.
jhb [Wed, 1 Aug 2018 00:41:02 +0000 (00:41 +0000)]
MFC 330823,332335: Cosmetic cleanups to some Linuxulator files.

330823:
Apply some style(9) to Linuxulator linux_sysvec.c comments

332335:
linuxulator: add else case braces to reduce diffs between archs

5 years agoMFC: r336215
rmacklem [Tue, 31 Jul 2018 20:57:31 +0000 (20:57 +0000)]
MFC: r336215
Ignore the cookie verifier for NFSv4.1 when the cookie is 0.

RFC5661 states that the cookie verifier should be 0 when the cookie is 0.
However, the wording is somewhat unclear and a recent discussion on the
nfsv4@ietf.org mailing list indicated that the NFSv4 server should ignore
the cookie verifier's value when the dirctory offset cookie is 0.
This patch deletes the check for this that would return NFSERR_BAD_COOKIE
when the verifier was not 0.
This was found during testing of the ESXi client against the NFSv4.1 server.

5 years agoMFC r336662,r336682
rpokala [Tue, 31 Jul 2018 16:08:38 +0000 (16:08 +0000)]
MFC r336662,r336682

r336662: Deprecate jedec_ts(4) and point users to jedec_dimm(4) instead

jedec_dimm(4) is a superset of the functionality of jedec_ts(4). Mark
jedec_ts(4) as removed in FreeBSD 12, and include a pointer to the migration
instructions in the jedec_dimm(4) manpage, in both the jedec_ts(4) code and
the jedec_ts(4) manpage. Add a note to the jedec_dimm(4) manpage about the
fact that it is a superset of jedec_ts(4).

r336682: Update .Dd in light of r336662.

5 years agoMFC r336721, r336750 [1]:
gjb [Tue, 31 Jul 2018 13:32:36 +0000 (13:32 +0000)]
MFC r336721, r336750 [1]:

 r336721 (manu):
  Add OL_DIR forgot in r336600.

 r336750:
  Fix OL_DIR definition following r336721.

[1] These commits were stated to have been merged in
    r336726, however are not present in context nor
    svn:mergeinfo.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r336683:
kib [Tue, 31 Jul 2018 10:18:30 +0000 (10:18 +0000)]
MFC r336683:
Extend ranges of the critical sections to ensure that context switch
code never sees FPU pcb flags not consistent with the hardware state.

5 years agoRevert r335693, r335694, r335695 by eadler.
markj [Tue, 31 Jul 2018 00:37:25 +0000 (00:37 +0000)]
Revert r335693, r335694, r335695 by eadler.

They cause mail(1) to crash in certain scenarios.

PR: 230196
Reported by: Pete French <petefrench@ingresso.co.uk>

5 years agoMFC r335526: Let -s actually work.
kevans [Mon, 30 Jul 2018 21:29:26 +0000 (21:29 +0000)]
MFC r335526: Let -s actually work.

5 years agoMFC r307967,324082,325955: config(8) fixes
kevans [Mon, 30 Jul 2018 21:24:27 +0000 (21:24 +0000)]
MFC r307967,324082,325955: config(8) fixes

r307967: Allow config to be compiled from another source directory, such as
one for building tools. This boils down to replacing ${.CURDIR} with
${SRCDIR}, where the latter is the directory in which this makefile
lives.

Also allow overriding where file2c comes from using ${FILE2C}.

r324082: Typo in filename in comment.

r325955: Fix 'local' to not look in the source tree for the file.

Usually 'local' is used along with other rules such as 'no-implicit-rule' or
'dependency' which avoids this problem.  It's possible to need to use
'local' while relying on the default rules though for a file which is not in
the source tree nor generated in the kernel.

5 years agoAs part of r336741, BOOTFILES needs special handling when
gjb [Mon, 30 Jul 2018 20:59:58 +0000 (20:59 +0000)]
As part of r336741, BOOTFILES needs special handling when
cross building on stable/11, where the path should be:

 /usr/obj/TARGET.TARGET_ARCH/[...]

The change in r336741, which was a direct commit to stable/11
was not complete enough to evaluate where BOOTFILES should be.

This, as was r336741, is a direct commit to stable/11.

Tested with: stable/11 BANANAPI build
Sponsored by: The FreeBSD Foundation

5 years agoMFC: r335866
rmacklem [Mon, 30 Jul 2018 19:23:52 +0000 (19:23 +0000)]
MFC: r335866
Fix the server side krpc so that the kernel nfsd threads terminate.

Occationally the kernel nfsd threads would not terminate when a SIGKILL
was posted for the kernel process (called nfsd (slave)). When this occurred,
the thread associated with the process (called "ismaster") had returned from
svc_run_internal() and was sleeping waiting for the other threads to terminate.
The other threads (created by kthread_start()) were still in svc_run_internal()
handling NFS RPCs.
The only way this could occur is for the "ismaster" thread to return from
svc_run_internal() without having called svc_exit().
There was only one place in the code where this could happen and this patch
stops that from happening.
Since the problem is intermittent, I cannot be sure if this has fixed the
problem, but I have not seen an occurrence of the problem with this patch
applied.

5 years agoMFC r335459: acpidump.8: include NFIT in the man page list of tables
emaste [Mon, 30 Jul 2018 17:49:47 +0000 (17:49 +0000)]
MFC r335459: acpidump.8: include NFIT in the man page list of tables

Was missed in r321298 [MFC'd in r322461].

Reported by: Ben Widawsky (in review D15931)
Sponsored by: The FreeBSD Foundation

5 years agoMFC r334318:
slavash [Mon, 30 Jul 2018 12:51:57 +0000 (12:51 +0000)]
MFC r334318:

Vendor import two upstream commits:
c1bb8784abd3ca978e376b0d10e324db0491237b
9c4af7213cc2543a1f5586d8f2c19f86aa0cbe72

Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

5 years agoMFC: r334966
rmacklem [Mon, 30 Jul 2018 12:10:23 +0000 (12:10 +0000)]
MFC: r334966
Add a couple of safety belt checks to the NFSv4.1 client related to sessions.

There were a couple of cases in newnfs_request() that it assumed that it
was an NFSv4.1 mount with a session. This should always be the case when
a Sequence operation is in the reply or the server replies NFSERR_BADSESSION.
However, if a server was broken and sent an erroneous reply, these safety
belt checks should avoid trouble.
The one check required a small tweak to nfsmnt_mdssession() so that it
returns NULL when there is no session instead of the offset of the field
in the structure (0x8 for i386).
This patch should have no effect on normal operation of the client.
Found by inspection during pNFS server development.

5 years agoMFC r336632:
hselasky [Mon, 30 Jul 2018 09:25:56 +0000 (09:25 +0000)]
MFC r336632:
Update modify counter when setting a mixer control.

PR: 229969

5 years agoMFC r335700:
hselasky [Mon, 30 Jul 2018 09:20:17 +0000 (09:20 +0000)]
MFC r335700:
Improve the kernel's USB descriptor reading function.
Some USB devices does not allow a partial descriptor readout.

Found by: bz@
Sponsored by: Mellanox Technologies

5 years agoMFC r335669:
hselasky [Mon, 30 Jul 2018 09:15:09 +0000 (09:15 +0000)]
MFC r335669:
Improve the userspace USB string reading function in LibUSB.
Some USB devices does not allow a partial descriptor readout.

Found by: bz @
Sponsored by: Mellanox Technologies

5 years agoMFC r336664: lld: fix addends with partial linking
emaste [Mon, 30 Jul 2018 00:08:36 +0000 (00:08 +0000)]
MFC r336664: lld: fix addends with partial linking

[ELF] Update addends in non-allocatable sections for REL targets when
creating a relocatable output.

LLVM PR: 37735
LLVM Differential Revision: https://reviews.llvm.org/D48929

PR: 225128, 228753
Obtained from: LLVM r336799 by Igor Kudrin

5 years agoMFC r336614:
markj [Sun, 29 Jul 2018 19:12:06 +0000 (19:12 +0000)]
MFC r336614:
Add a regression test for PR 131876.

PR: 131876

5 years agoMFC r336591:
markj [Sun, 29 Jul 2018 19:11:21 +0000 (19:11 +0000)]
MFC r336591:
Disable optimization of the libproc test program.