]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoRevert drm2 removal.
Warner Losh [Fri, 24 Aug 2018 00:02:00 +0000 (00:02 +0000)]
Revert drm2 removal.

Revert r338177, r338176, r338175, r338174, r338172

After long consultations with re@, core members and mmacy, revert
these changes. Followup changes will be made to mark them as
deprecated and prent a message about where to find the up-to-date
driver.  Followup commits will be made to make this clear in the
installer. Followup commits to reduce POLA in ways we're still
exploring.

It's anticipated that after the freeze, this will be removed in
13-current (with the residual of the drm2 code copied to
sys/arm/dev/drm2 for the TEGRA port's use w/o the intel or
radeon drivers).

Due to the impending freeze, there was no formal core vote for
this. I've been talking to different core members all day, as well as
Matt Macey and Glen Barber. Nobody is completely happy, all are
grudgingly going along with this. Work is in progress to mitigate
the negative effects as much as possible.

Requested by: re@ (gjb, rgrimes)

5 years agoFix comment. The actual meaning of ub_cnt is the opposite.
Gleb Smirnoff [Thu, 23 Aug 2018 23:24:28 +0000 (23:24 +0000)]
Fix comment. The actual meaning of ub_cnt is the opposite.

5 years agoFollowing r335259, don't copy boot1 from the running system for sparc64
Marius Strobl [Thu, 23 Aug 2018 22:57:42 +0000 (22:57 +0000)]
Following r335259, don't copy boot1 from the running system for sparc64
either.

5 years agobsdinstall/zfsboot: Enable new UEFI+GELI support
Allan Jude [Thu, 23 Aug 2018 22:50:11 +0000 (22:50 +0000)]
bsdinstall/zfsboot: Enable new UEFI+GELI support

After r336252 it is no longer necessary to have a separate bootpool when
booting from an encrypted disk with UEFI.

This change also switches the EFI System Partition contents from
the 800 KB boot1.efifat to a new 200 MB filesystem created with newfs_msdos
and uses loader.efi directly, instead of boot1.efi.

PR: 228916
Reviewed by: dteske
MFC after: 1 month
Relnotes: yes
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D12315

5 years agoProper spelling of consolidation.
Kirk McKusick [Thu, 23 Aug 2018 22:35:14 +0000 (22:35 +0000)]
Proper spelling of consolidation.

Submitted by: Dimitry Andric

5 years ago- Use le32dec(9) for decoding EXT_CSD values where it makes sense. [1]
Marius Strobl [Thu, 23 Aug 2018 21:26:58 +0000 (21:26 +0000)]
- Use le32dec(9) for decoding EXT_CSD values where it makes sense. [1]
- Locally cache some instance variable values in mmc_discover_cards()
  in order to improve the code readability a bit.

Obtained from: NetBSD [1]

5 years agoAdd a per-pagequeue pdpages counter.
Mark Johnston [Thu, 23 Aug 2018 21:03:45 +0000 (21:03 +0000)]
Add a per-pagequeue pdpages counter.

Expose these counters under the vm.domain sysctl node.  The existing
vm.stats.vm.v_pdpages sysctl is preserved.

Reviewed by: alc (previous version)
Differential Revision: https://reviews.freebsd.org/D14666

5 years agoReduce the log level of tcpd_warn calls from ERR to WARNING.
Bjoern A. Zeeb [Thu, 23 Aug 2018 20:44:26 +0000 (20:44 +0000)]
Reduce the log level of tcpd_warn calls from ERR to WARNING.
This matches the name and avoids logging of warnings to console with
default syslog.conf, esp. getting rid of:
  warning: /etc/hosts.allow, line ..: can't verify hostname: \
     getaddrinfo(.., AF_INET) failed

5 years agoEnsure that queue state is cleared when vm_page_dequeue() returns.
Mark Johnston [Thu, 23 Aug 2018 20:34:22 +0000 (20:34 +0000)]
Ensure that queue state is cleared when vm_page_dequeue() returns.

Per-page queue state is updated non-atomically, with either the page
lock or the page queue lock held.  When vm_page_dequeue() is called
without the page lock, in rare cases a different thread may be
concurrently dequeuing the page with the pagequeue lock held.  Because
of the non-atomic update, vm_page_dequeue() might return before queue
state is completely updated, which can lead to race conditions.

Restrict the vm_page_dequeue() interface so that it must be called
either with the page lock held or on a free page, and busy wait when
a different thread is concurrently updating queue state, which must
happen in a critical section.

While here, do some related cleanup: inline vm_page_dequeue_locked()
into its only caller and delete a prototype for the unimplemented
vm_page_requeue_locked().  Replace the volatile qualifier for "queue"
added in r333703 with explicit uses of atomic_load_8() where required.

Reported and tested by: pho
Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D15980

5 years agoObtain the bus mode (MMC or SD) from the directly superordinated
Marius Strobl [Thu, 23 Aug 2018 20:25:27 +0000 (20:25 +0000)]
Obtain the bus mode (MMC or SD) from the directly superordinated
bus rather than reaching up to the bridge and use the cached mode
in mmcsd_delete(), too.

5 years agoConfigure -zifunc-noplt for amd64 kernels.
Mark Johnston [Thu, 23 Aug 2018 19:58:24 +0000 (19:58 +0000)]
Configure -zifunc-noplt for amd64 kernels.

Per r338251, this ensures that ifunc calls have the same ordinary
function calls.

Reviewed by: emaste (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16750

5 years agoUse arc4rand() instead of read_random() in the SCTP and TCP code.
Michael Tuexen [Thu, 23 Aug 2018 19:10:45 +0000 (19:10 +0000)]
Use arc4rand() instead of read_random() in the SCTP and TCP code.

This was suggested by jmg@.

Reviewed by: delphij@, jmg@, jtl@
MFC after: 1 month
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16860

5 years agoa10_timer: Update the driver so we can use it on other SoC
Emmanuel Vadot [Thu, 23 Aug 2018 18:46:05 +0000 (18:46 +0000)]
a10_timer: Update the driver so we can use it on other SoC

a10_timer is currently use in UP allwinner SoC (A10 and A13).
Those don't have the generic arm timer.
The arm generic timecounter is broken in the A64 SoC, some attempts have
been made to fix the glitch but users still reported some minor ones.
Since the A64 (and all Allwinner SoC) still have this timer controller, rework
the driver so we can use it in any SoC.
Since it doesn't have the 64 bits counter on all SoC, use one of the
generic 32 bits counter as the timecounter source.

PR: 229644

5 years agoaw_mmc: Handle MMCBR_IVAR_RETUNE_REQ
Emmanuel Vadot [Thu, 23 Aug 2018 18:33:42 +0000 (18:33 +0000)]
aw_mmc: Handle MMCBR_IVAR_RETUNE_REQ

Without this the mmc stack sometimes think that we are in in a retune
operation and some command like switch the bus width to 4 bits failed.
We now switch correctly to 4 bits mode for sd card.

Reported by: jmg, others in pine64 irc channel

5 years agoDon't build skein_block_asm.s if we don't have an as binary
Alex Richardson [Thu, 23 Aug 2018 18:19:33 +0000 (18:19 +0000)]
Don't build skein_block_asm.s if we don't have an as binary

This fixes building libmd on MacOS/Linux. The real fix is probably to
build it as a .S file with $CC instead. It might also be better to just
compile the C file in userspace since the compiler can the use SSE/AVX.

Reviewed By: emaste, brooks
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16844

5 years agoOnly bootstrap localedef if ${MK_LOCALES} != "no"
Alex Richardson [Thu, 23 Aug 2018 18:19:21 +0000 (18:19 +0000)]
Only bootstrap localedef if ${MK_LOCALES} != "no"

During the build it is only used by share/ctypedef and share/colldef
which will not be built if ${MK_LOCALE} == "no". This saves a tiny bit
of time when building without locales.

Approved By: jhb (mentor)

5 years agoFix non-FreeBSD host lib32 build for TARGET=amd64
Alex Richardson [Thu, 23 Aug 2018 18:19:10 +0000 (18:19 +0000)]
Fix non-FreeBSD host lib32 build for TARGET=amd64

When building on non-FreeBSD systems we need to pass an explicit target
triple to clang otherwise it will attempt to build with the host triple.
This also has advantages when building on a FreeBSD host: we now tell
clang that we are targeting at least FreeBSD 12.0 instead of an older
version so it can enable newer features.

Reviewed By: brooks (mentor)
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16842

5 years agoAllow bootstrapping md5 on Linux, MacOS and FreeBSD < 12
Alex Richardson [Thu, 23 Aug 2018 18:19:01 +0000 (18:19 +0000)]
Allow bootstrapping md5 on Linux, MacOS and FreeBSD < 12

In order to build on a Linux host we need to bootstrap md5 since the Linux
md5sum command produces output in a different format.

Reviewed By: emaste
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16846

5 years agoHandle -DNO_ROOT for `make compat` in include/
Alex Richardson [Thu, 23 Aug 2018 18:18:52 +0000 (18:18 +0000)]
Handle -DNO_ROOT for `make compat` in include/

Otherwise this step will fail on a Linux host due to missing "wheel" group

Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16841

5 years agoDon't use absolute path to sed when building usr.bin/join
Alex Richardson [Thu, 23 Aug 2018 18:18:43 +0000 (18:18 +0000)]
Don't use absolute path to sed when building usr.bin/join

This is required to build sort on Linux hosts since sed is in /bin there.

Approved By: jhb (mentor)

5 years agoRemove a duplicated interface capability bit missed in r336313.
Marius Strobl [Thu, 23 Aug 2018 18:11:55 +0000 (18:11 +0000)]
Remove a duplicated interface capability bit missed in r336313.

5 years agoRemove hyper-v leftovers when WITHOUT_HYPERV is set
Kyle Evans [Thu, 23 Aug 2018 18:06:31 +0000 (18:06 +0000)]
Remove hyper-v leftovers when WITHOUT_HYPERV is set

hv_vss_daemon was missed.

Submitted by: Oliver Pinter
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16811

5 years agostand: fdt: Drop some write-only assignments/variables and leaked bits
Kyle Evans [Thu, 23 Aug 2018 18:01:34 +0000 (18:01 +0000)]
stand: fdt: Drop some write-only assignments/variables and leaked bits

Generally straightforward enough; a copy of argv[1] was being made in
command_fdt_internal, solely used for a comparison within the
handler-search, then promptly leaked.

Reported by: ports gcc and clang's static analyzer

5 years ago- According to section 2.2.5 of the SDHCI specification version 4.20,
Marius Strobl [Thu, 23 Aug 2018 17:50:41 +0000 (17:50 +0000)]
- According to section 2.2.5 of the SDHCI specification version 4.20,
  SDHCI_TRNS_ACMD12 is to be set only for multiple-block read/write
  commands without data length information, so don't unconditionally
  set this bit. The result matches what e. g. Linux does.
- Section 2.2.19 of the SDHCI specification version 4.20 states that
  SDHCI_ACMD12_ERR should be only valid if SDHCI_INT_ACMD12ERR is set
  and hardware may clear SDHCI_ACMD12_ERR when SDHCI_INT_ACMD12ERR is
  cleared (differing silicon behavior is specifically allowed, though).
  Thus, read SDHCI_ACMD12_ERR before clearing SDHCI_INT_ACMD12ERR.
  While at it, use the 16-bit accessor rather than the 32-bit one for
  reading the 16-bit SDHCI_ACMD12_ERR.
- SDHCI_INT_TUNEERR isn't one of the ROC bits in SDHCI_INT_STATUS so
  clear it explicitly.
- Add missing prototypes and sort them.

5 years agoFix warning about crossing INT32_MAX boundary in computation of constant value.
Patrick Kelsey [Thu, 23 Aug 2018 17:41:39 +0000 (17:41 +0000)]
Fix warning about crossing INT32_MAX boundary in computation of constant value.

5 years agolualoader: Accept that people use unquoted values in loader.conf
Kyle Evans [Thu, 23 Aug 2018 17:27:02 +0000 (17:27 +0000)]
lualoader: Accept that people use unquoted values in loader.conf

While loader.conf(5) suggests that all values should be quoted, reality is
that this was never strictly enforced and it is used. We already make some
concession to this in number values, which aren't strictly quoted either.

The compromise here is that multi-word values must be quoted. This lets
things like `foo_load=YES` work, while denying more complex expressions on
the right hand side. This likely catches the vast majority of current usage.

A bit of a kludge is needed to accomplish this since Lua regex doesn't
support branching. I had considered splitting up expressions and generating
the right-hand side of the expressions completely in config.parse, but
deemed this too large of an overhaul to take given the current timing. This
should be re-worked shortly after the thaw.

Reported by: royger

5 years agotftp(1): switch default transfer mode to binary
Alan Somers [Thu, 23 Aug 2018 17:00:07 +0000 (17:00 +0000)]
tftp(1): switch default transfer mode to binary

netascii is obsolete and inefficient. It isn't even supported by many
clients. Better to use binary mode by default.

Reviewed by: cem
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16869

5 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Thu, 23 Aug 2018 16:54:22 +0000 (16:54 +0000)]
MFp4 bz_ipv6_fast:

Migrate udp6_send() v4mapped code to udp6_output() saving us a re-lock and
further simplifying the address-family handling code by eliminating
AF_INET checks and almost all v4mapped handling right after the start
as cases could actually not happen anymore.

Rework output path locking similar to UDP4 allowing for better
parallelism (see r222488, and later versions).

Sponsored by: The FreeBSD Foundation (2012)
Sponsored by: iXsystems (2012)
Differential Revision: https://reviews.freebsd.org/D3721

5 years agoxen/netfront: Ensure curvnet is set
Kristof Provost [Thu, 23 Aug 2018 16:52:52 +0000 (16:52 +0000)]
xen/netfront: Ensure curvnet is set

netfront_backend_changed() is called from the xenwatch_thread(), which means
that the curvnet is not set. We have to set it before we can call things like
arp_ifinit().

PR: 230845

5 years agolualoader: Fix (add) Xen support
Kyle Evans [Thu, 23 Aug 2018 16:26:03 +0000 (16:26 +0000)]
lualoader: Fix (add) Xen support

lualoader was not respecting the 'xen_kernel' environment variable, which
hints to the interpreter that it should load a Xen kernel prior to loading
any other kernel that might be specified. If a Xen kernel is specified and
we fail to load it, we should not proceed to boot.

Reported by: royger
Tested by: royger

5 years agocxgbe(4): Use fcmpset instead of cmpset when appropriate.
Navdeep Parhar [Thu, 23 Aug 2018 16:24:27 +0000 (16:24 +0000)]
cxgbe(4): Use fcmpset instead of cmpset when appropriate.

Suggested by: mjg@
MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agoExtend tbrsize heuristic in pfctl(8) to provide a sensible value for
Patrick Kelsey [Thu, 23 Aug 2018 16:10:28 +0000 (16:10 +0000)]
Extend tbrsize heuristic in pfctl(8) to provide a sensible value for
higher bandwidth interfaces.  The new value is used above 2.5 Gbps,
which is the highest standard rate that could be used prior to
r338209, so the default behavior for all existing systems should
remain the same.

The value of 128 chosen is a balance between being big enough to
reduce potential precision/quantization effects stemming from frequent
bucket refills over small time intervals and being small enough to
prevent a greedy driver from burst dequeuing more packets than it has
available hardware ring slots for whenever altq transitions from idle
to backlogged.

Reviewed by: jmallett, kp
MFC after: 2 weeks
Sponsored by: RG Nets
Differential Revision: https://reviews.freebsd.org/D16852

5 years agoRemove a redundant #ifdef _KERNEL.
Mark Johnston [Thu, 23 Aug 2018 15:01:27 +0000 (15:01 +0000)]
Remove a redundant #ifdef _KERNEL.

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

5 years agoAdd an lld option to emit PC-relative relocations for ifunc calls.
Mark Johnston [Thu, 23 Aug 2018 14:58:19 +0000 (14:58 +0000)]
Add an lld option to emit PC-relative relocations for ifunc calls.

The current kernel ifunc implementation creates a PLT entry for each
ifunc definition.  ifunc calls therefore consist of a call to the
PLT entry followed by an indirect jump.  The jump target is written
during boot when the kernel linker resolves R_[*]_IRELATIVE relocations.
This implementation is defined by requirements for userland code, where
text relocations are avoided.  This requirement is not present for the
kernel, so the implementation has avoidable overhead (namely, an extra
indirect jump per call).

Address this for now by adding a special option to the static linker
to inhibit PLT creation for ifuncs.  Instead, relocations to ifunc call
sites are passed through to the output file, so the kernel linker can
enumerate such call sites and apply PC-relative relocations directly
to the text section.  Thus the overhead of an ifunc call becomes exactly
the same as that of an ordinary function call.  This option is only for
use by the kernel and will not work for regular programs.

The final form of this optimization is up for debate; for now, this
change is simple and static enough to be acceptable as an interim
solution.

Reviewed by: emaste
Discussed with: arichardson, dim
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16748

5 years agoefiloader: Setup FDT in autoload to fix overlays clobbering kenv
Kyle Evans [Thu, 23 Aug 2018 13:38:38 +0000 (13:38 +0000)]
efiloader: Setup FDT in autoload to fix overlays clobbering kenv

manu found in the noted PR that overlays seemed to be clobbering the kenv
and killing the boot. Further inspection revealed that one can `fdt ls` at
the loader prompt for a successful boot, but autoboot breaks it.

In the autoboot case, first setup of FDT is happening in the middle of
bi_load, which triggers loading of the DTBO from /boot.

This is bad, bad, bad. Files in the loader are loaded somewhere in the
middle of the address space one after another. bi_load starts building the
needed kernel bootinfo immediately after the highest-addr loaded file. File
loads in the middle of bi_load suddenly clobber bootinfo and everything goes
off the rails.

The solution to this is to use take advantage of arch_autoload to setup FDT
in efiloader compiled with LOADER_FDT_SUPPORT. This matches how it works in
ubldr land, and is how it should have worked when overlay support was added
to efiloader since fdt_setup_fdtp now has the potential to load files
(courtesy of fdt_platform_load_dtb).

PR: 230804
Discussed with: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16858

5 years agoarm64: GENERIC: Compile allwinner dtbs
Emmanuel Vadot [Thu, 23 Aug 2018 13:25:32 +0000 (13:25 +0000)]
arm64: GENERIC: Compile allwinner dtbs

5 years agodtb: Allwinner: Add aarch64 dts files
Emmanuel Vadot [Thu, 23 Aug 2018 13:24:28 +0000 (13:24 +0000)]
dtb: Allwinner: Add aarch64 dts files

5 years agodtb: aarch64 uses vendor subdirectories, handle that
Emmanuel Vadot [Thu, 23 Aug 2018 13:23:54 +0000 (13:23 +0000)]
dtb: aarch64 uses vendor subdirectories, handle that

5 years agomake_dtb: Always add root directory in the include path
Emmanuel Vadot [Thu, 23 Aug 2018 13:23:21 +0000 (13:23 +0000)]
make_dtb: Always add root directory in the include path

Some arch like arm and arm64 share DTS files, add the root dts directory
to the include paths.

5 years agodts: Import DTS for arm64
Emmanuel Vadot [Thu, 23 Aug 2018 13:21:01 +0000 (13:21 +0000)]
dts: Import DTS for arm64

 - Most of the boards are using U-Boot, u-boot embed a DTB that isn't
compiled with -@ (overlay ready) so we cannot use overlays. We want
overlays, overlays are nice.
 - The DTS life is going to linux, then sometimes it's imported in
U-Boot but it depend on the SoC family, U-Boot doesn't batch import
every DTS like we do. So sometimes to U-Boot DTS are very old. Or when
an interesting patch in commited upstream it is in Linux X+2 (roughly 4
months from now), we then have to wait for U-Boot to catch up, that
give us between 4 and 6 months to have an update.
 - Some boards like the Marvell ones have 3 DTS, the one in the
vendor U-Boot made by Marvell themselves, the one in u-boot mainline
and the one in Linux. I found that the DTS in the Marvell U-Boot have
some problem with FreeBSD (especially the macchiatobin that declare
node with the same address but not the same size, that is not something
that the rman code can handle, it could be modified, I don't know the
code well enough). Also some compatible are used when they shouldn't,
for example they declare the gpio being orion-gpio while this binding
requires interrupts supports, which the node doesn't have.
 - The above situation is mostly the same with RockChip SoCs (possibly
others, those are the only SoCs I work on that have this problem).

 Note that importing the DTS doesn't mean that every board will use
them, I don't intend to copy the DTB to the GENERIC memstick image for
the Overdrive 1000/3000 for example, the ones provided by the firmware
works fine.
 RPI3 will still stay an exception as we use the DTB provided by the
rpi-firmware package, so they come from the rpi foundation linux fork.

5 years agousr.sbin/ndp: Cleanup in preparation to add libxo support
Renato Botelho [Thu, 23 Aug 2018 10:38:59 +0000 (10:38 +0000)]
usr.sbin/ndp: Cleanup in preparation to add libxo support

* Constify rtpref_str declaration
* Remove unused h_errno declaration
* Use time_t type for expire
* Use strlcpy to set static "?" value to ifname
* Rename local variable 's' to stop shadowing global definition
* Close socket used in pfx_flush()
* Use local variables for sock() in setdefif() and getdefif()
* Increase WARNS to 3

Reviewed by: allanjude, kevans
Approved by: allanjude
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D11118

5 years agoAdd manpage entry for the new bhyve options -s "help" and -l "help".
Marcelo Araujo [Thu, 23 Aug 2018 07:34:51 +0000 (07:34 +0000)]
Add manpage entry for the new bhyve options -s "help" and -l "help".

Reported by: 0mp
Sponsored by: iXsystems Inc.

5 years agoDon't use the explicit number 32 for the length of the secrets,
Michael Tuexen [Thu, 23 Aug 2018 06:03:59 +0000 (06:03 +0000)]
Don't use the explicit number 32 for the length of the secrets,
use sizeof() or explicit #definesi instead. No functional change.
This was suggested by jmg@.

MFC after: 1 month
XMFC with: r338053
Sponsored by: Netflix, Inc.

5 years agoForgot to bump .Dd in r338233 like I promised in the review. Doh!
Warner Losh [Thu, 23 Aug 2018 05:08:38 +0000 (05:08 +0000)]
Forgot to bump .Dd in r338233 like I promised in the review. Doh!

5 years agoAdd a special note to UPDATING for the devmatch stuff. While tested,
Warner Losh [Thu, 23 Aug 2018 05:06:31 +0000 (05:06 +0000)]
Add a special note to UPDATING for the devmatch stuff. While tested,
there's an elevated risk of trouble, and you must update kernel,
userland and rc scripts for the best experience.

5 years agoImplement blacklisting for devmatch
Warner Losh [Thu, 23 Aug 2018 05:06:27 +0000 (05:06 +0000)]
Implement blacklisting for devmatch

devmatch_blacklist is a space separated list of modules (w/o the .ko
or full path) to exclude from devmatch's processing.

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

5 years agoWhen trying to match the nomatch event passed to us, attempt to look
Warner Losh [Thu, 23 Aug 2018 05:06:22 +0000 (05:06 +0000)]
When trying to match the nomatch event passed to us, attempt to look
up the device described by the nomatch event in the device tree. If we
find it, then if the device is marked as have already attached to a
device once, then ignore the device.

This keeps us from reloading the device driver when it has just been
manually unloaded. All devies that have had a driver attach to them at
least once no longer participate in pnp-based autoloading.

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

5 years agoAdd a new device flag: DF_ATTACHED_ONCE
Warner Losh [Thu, 23 Aug 2018 05:06:16 +0000 (05:06 +0000)]
Add a new device flag: DF_ATTACHED_ONCE

This flag is set once the device has been successfully attached. When
set, it inhibits devmatch from trying to match the device. This in
turn allows kldunload to work as expected. Prior to the change, the
driver would immediately reload because devmatch had no notion that
the driver had once been attached, and therefore shouldn't participate
in further matching.

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

5 years agoRemove sorting of matches and print all the matches as we find them.
Warner Losh [Thu, 23 Aug 2018 05:06:11 +0000 (05:06 +0000)]
Remove sorting of matches and print all the matches as we find them.

This backs out the hack we added in r329458. Now that we can freeze /
thaw probing, this is a much better solution to that problem. Revert
to simply printing the results as we find them, and relying on an
external sort | uniq to clean up the list.

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

5 years agoImprove devmatch driver loading
Warner Losh [Thu, 23 Aug 2018 05:06:07 +0000 (05:06 +0000)]
Improve devmatch driver loading

Use devctl freeze / thaw to allow us to laod multiple modules before
doing the probe/attach so they all get a bite at the apple.

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

5 years agoCreate devctl freeze/thaw.
Warner Losh [Thu, 23 Aug 2018 05:05:47 +0000 (05:05 +0000)]
Create devctl freeze/thaw.

This adds it to devctl, libdevctl, defines the two IOCTLs and
implements the kernel bits. causes any new drivers that are added via
kldload to be deferred until a 'thaw' comes in. These do not stack: it
is an error to freeze while frozen, or thaw while thawed.

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

5 years agodtc(1): Update to 0892ec7; HACKING and implicit header fixes
Kyle Evans [Thu, 23 Aug 2018 02:26:40 +0000 (02:26 +0000)]
dtc(1): Update to 0892ec7; HACKING and implicit header fixes

Fixes courtesy of arichardson and jmg:
- HACKING was pointing to the wrong place
- Added headers were being relied on implicitly, but libstdc++ did not
  comply with the unspoken wishes of dtc.

MFC after: 1 week

5 years agoRemove ZFS leftovers when WITHOUT_ZFS is set
Kyle Evans [Thu, 23 Aug 2018 02:14:39 +0000 (02:14 +0000)]
Remove ZFS leftovers when WITHOUT_ZFS is set

Submitted by: Oliver Pinter
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16810

5 years agobectl(8): Man page and usage cleanup
Kyle Evans [Thu, 23 Aug 2018 02:09:52 +0000 (02:09 +0000)]
bectl(8): Man page and usage cleanup

- Some overly-long lines
- Consistently using .Brq ({})
- Consistently using .Cm
- Not using .Ao/.Ac around .Ar

PR: 230576
Submitted by: Yuri Pankov (with a fair amount of rebasing pre-commit)

5 years agobectl(8): jail: Tear down jail by default after command exits
Kyle Evans [Thu, 23 Aug 2018 01:45:18 +0000 (01:45 +0000)]
bectl(8): jail: Tear down jail by default after command exits

Add a -U flag to get back the old behavior. The new behavior is a little
more friendly to the common use cases, jail the BE and execute a script.
Having the jail torn down automatically when the script is finished, or when
you exit the shell, is a little more friendly than having to remember to
`bectl ujail`.

Batch mode (-b) will continue to leave the jail up, as it's assumed the
caller has other intentions.

Submitted by: Shawn Webb (partially)

5 years agodevstat(9): Constify function parameters that can be const
Conrad Meyer [Thu, 23 Aug 2018 01:42:45 +0000 (01:42 +0000)]
devstat(9): Constify function parameters that can be const

No functional change.

When attempting to document the changed argument types in devstat.9, I
discovered the 20 year old manual page severely mismatched reality even
prior to my simple change.  So I took a first cut pass cleaning that up to
match reality.  I'm sure I've missed some things; the goal was just to leave
it better than when I started.

Sponsored by: Dell EMC Isilon

5 years agofdt_fixups: relocate the /chosen node after applying fixups
Kyle Evans [Thu, 23 Aug 2018 01:22:13 +0000 (01:22 +0000)]
fdt_fixups: relocate the /chosen node after applying fixups

As indicated by the comment, any fixups applied (which might include
overlays) can invalidate the previously located node by adding nodes or
setting/adding properties. The later fdt_setprop of fixup-applied property
would then fail because of the bad/wrong node offset.

This would have generally been harmless, but potentially caused multiple
applications of fixups and caused a little bit of bloat.

MFC after: 1 week

5 years agocxgbev(4): Updates to the VF driver to cope with recent ifmedia and
Navdeep Parhar [Thu, 23 Aug 2018 00:58:10 +0000 (00:58 +0000)]
cxgbev(4): Updates to the VF driver to cope with recent ifmedia and
ctrlq changes in the base driver.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoFix the nfsuserd.8 man page for the changes made to support uid/gid
Rick Macklem [Thu, 23 Aug 2018 00:05:13 +0000 (00:05 +0000)]
Fix the nfsuserd.8 man page for the changes made to support uid/gid
numbers in owner and owner_group strings.

This is a content change.

5 years agotftpd: Fix data corruption bug with netascii
Alan Somers [Wed, 22 Aug 2018 23:31:27 +0000 (23:31 +0000)]
tftpd: Fix data corruption bug with netascii

Transferring files in netascii format requires, among other things,
translating all CR characters to a CR,NUL pair. tftpd does this correctly
except when the CR occurs as the last octet of a packet. In that case, it
erroneously drops the NUL which should be part of the following packet. The
bug was caused by using 0 as a sentinel value in a variable that could
legitimately hold 0. Fix it by switching the sentinel value to -1.

PR: 178055
Reported by: Richard <rsitze@gmail.com>
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16853

5 years ago[ig4] Fix I/O timeout issue with Designware I2C controller on AMD platforms
Oleksandr Tymoshenko [Wed, 22 Aug 2018 22:56:01 +0000 (22:56 +0000)]
[ig4] Fix I/O timeout issue with Designware I2C controller on AMD platforms

Due to hardware limitation AMD I2C controller can't trigger pending
interrupt if interrupt status has been changed after clearing
interrupt status bits.  So, I2C will lose the interrupt and IO will be
timed out. Implements a workaround to disable I2C controller interrupt
and re-enable I2C interrupt before existing interrupt handler.

Submitted by: rajfbsd@gmail.com
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16720

5 years agoKASSERT: Make runtime optionality optional
Conrad Meyer [Wed, 22 Aug 2018 22:19:42 +0000 (22:19 +0000)]
KASSERT: Make runtime optionality optional

Add an option, KASSERT_PANIC_OPTIONAL, that allows runtime KASSERT()
behavior changes.  When this option is not enabled, code that allows
KASSERTs to become optional is not enabled, and all violated assertions
cause termination.

The runtime KASSERT behavior was added in r243980.

One important distinction here is that panic has __dead2
("attribute((noreturn))"), while kassert_panic does not.  Static analyzers
like Coverity understand __dead2.  Without it, KASSERTs go misunderstood,
resulting in many false positives that result from violation of program
invariants.

Reviewed by: jhb, jtl, np, vangyzen
Relnotes: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16835

5 years agoAdd support for send, receive and state-change DTrace providers for
Michael Tuexen [Wed, 22 Aug 2018 21:23:32 +0000 (21:23 +0000)]
Add support for send, receive and state-change DTrace providers for
SCTP. They are based on what is specified in the Solaris DTrace manual
for Solaris 11.4.

Reviewed by: 0mp, dteske, markj
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16839

5 years agoMove services to usr.sbin/services_mkdb/
Brad Davis [Wed, 22 Aug 2018 21:22:40 +0000 (21:22 +0000)]
Move services to usr.sbin/services_mkdb/

This is pkgbase related as it switches to CONFS to properly tag this as a
config file.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16848

5 years agoPrepare the kernel linker to handle PC-relative ifunc relocations.
Mark Johnston [Wed, 22 Aug 2018 20:44:30 +0000 (20:44 +0000)]
Prepare the kernel linker to handle PC-relative ifunc relocations.

The boot-time ifunc resolver assumes that it only needs to apply
IRELATIVE relocations to PLT entries.  With an upcoming optimization,
this assumption no longer holds, so add the support required to handle
PC-relative relocations targeting GNU_IFUNC symbols.
- Provide a custom symbol lookup routine that can be used in early boot.
  The default lookup routine uses kobj, which is not functional at that
  point.
- Apply all existing relocations during boot rather than filtering
  IRELATIVE relocations.
- Ensure that we continue to apply ifunc relocations in a second pass
  when loading a kernel module.

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

5 years agoAdd -s "help" and -l "help" to print a list of supported PCI and LPC devices.
Marcelo Araujo [Wed, 22 Aug 2018 20:23:08 +0000 (20:23 +0000)]
Add -s "help" and -l "help" to print a list of supported PCI and LPC devices.

For tools that uses bhyve such like libvirt, it is important to be able to
probe what features are supported by the given bhyve binary.

To give more context, libvirt probes bhyve's capabilities in a not very
effective way:
- Running 'bhyve -h' and parsing output.
- To detect devices, it runs 'bhyve -s 0,dev' for every each device and
  parses error output to identify if the device is supported or not.

PR: 2101111
Submitted by: novel
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems Inc.

5 years agoExtended pf(4) ioctl interface and pfctl(8) to allow bandwidths of
Patrick Kelsey [Wed, 22 Aug 2018 19:38:48 +0000 (19:38 +0000)]
Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths of
2^32 bps or greater to be used.  Prior to this, bandwidth parameters
would simply wrap at the 2^32 boundary.  The computations in the HFSC
scheduler and token bucket regulator have been modified to operate
correctly up to at least 100 Gbps.  No other algorithms have been
examined or modified for correct operation above 2^32 bps (some may
have existing computation resolution or overflow issues at rates below
that threshold).  pfctl(8) will now limit non-HFSC bandwidth
parameters to 2^32 - 1 before passing them to the kernel.

The extensions to the pf(4) ioctl interface have been made in a
backwards-compatible way by versioning affected data structures,
supporting all versions in the kernel, and implementing macros that
will cause existing code that consumes that interface to use version 0
without source modifications.  If version 0 consumers of the interface
are used against a new kernel that has had bandwidth parameters of
2^32 or greater configured by updated tools, such bandwidth parameters
will be reported as 2^32 - 1 bps by those old consumers.

All in-tree consumers of the pf(4) interface have been updated.  To
update out-of-tree consumers to the latest version of the interface,
define PFIOC_USE_LATEST ahead of any includes and use the code of
pfctl(8) as a guide for the ioctls of interest.

PR: 211730
Reviewed by: jmallett, kp, loos
MFC after: 2 weeks
Relnotes: yes
Sponsored by: RG Nets
Differential Revision: https://reviews.freebsd.org/D16782

5 years agoif_media: Add new 2.5G/5G/25G/40G/50G/100G/200G/400G media types
Eric Joyner [Wed, 22 Aug 2018 18:19:56 +0000 (18:19 +0000)]
if_media: Add new 2.5G/5G/25G/40G/50G/100G/200G/400G media types

Upcoming Ethernet hardware will support new media types that aren't in the kernel
yet, so they are added here. These mostly include new 25G/50G/100G media types;
and this commit introduces new 200G/400G speeds and media.

Reviewed by: hselasky@, jhb@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D16731

5 years agoAdd dmu_tx_assign() error handling in zfs_unlinked_drain().
Alexander Motin [Wed, 22 Aug 2018 16:32:53 +0000 (16:32 +0000)]
Add dmu_tx_assign() error handling in zfs_unlinked_drain().

The error handling got lost during r334810, while according to the report
error there may happen in case of dataset being over quota.  In such case
just leave the node in the unlinked list to be freed sometimes later.

PR: 229887
Sponsored by: iXsystems, Inc.

5 years agoCreate separate taskqueue to call zfs_unlinked_drain().
Alexander Motin [Wed, 22 Aug 2018 16:27:24 +0000 (16:27 +0000)]
Create separate taskqueue to call zfs_unlinked_drain().

r334810 introduced zfs_unlinked_drain() dispatch to taskqueue on every
deletion of a file with extended attributes.  Using system_taskq for that
with its multiple threads in case of multiple files deletion caused all
available CPU threads to uselessly spin on busy locks, completely blocking
the system.

Use of single dedicated taskqueue is the only easy solution I've found,
while in would be great if we could specify that some task should be
executed only once at a time, but never in parallel, while many tasks
could use different threads same time.

Sponsored by: iXsystems, Inc.

5 years agoMove all devfs related files to sbin/devfs/
Brad Davis [Wed, 22 Aug 2018 15:55:23 +0000 (15:55 +0000)]
Move all devfs related files to sbin/devfs/

This is related to pkgbase as it uses CONFS to properly tag these as config
files.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16785

5 years agoTurn off LOADER_GELI and LOADER_LUA for sparc64, until those options
Kurt Lidl [Wed, 22 Aug 2018 15:29:54 +0000 (15:29 +0000)]
Turn off LOADER_GELI and LOADER_LUA for sparc64, until those options
are fully debugged.  With these options off, the unified "loader"
binary for sparc64 works to boot a kernel from ZFS.

Submitted by: kevans
Reviewed by: imp kevans

5 years agoSkip PMAP_PCID_KERN + 1 PCPU pcid_next value on APs as well.
Konstantin Belousov [Wed, 22 Aug 2018 14:58:52 +0000 (14:58 +0000)]
Skip PMAP_PCID_KERN + 1 PCPU pcid_next value on APs as well.
r337838 did it for BSP.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agoIncrease the size of the heap size available on sparc64 during
Kurt Lidl [Wed, 22 Aug 2018 14:33:57 +0000 (14:33 +0000)]
Increase the size of the heap size available on sparc64 during
operation of "loader".  The dramatic increase in size of
SPA_MAXBLOCKSIZE in r304321 causes the heap space to be exhausted,
so malloc() fails, ultimately leading to a memcpy() with a
destination of 0x0.

MFC after: 3 days

5 years agoAdding device ID for Terratec SiXPack 5.1+.
Tai-hwa Liang [Wed, 22 Aug 2018 14:06:31 +0000 (14:06 +0000)]
Adding device ID for Terratec SiXPack 5.1+.

MFC after: 3 days

5 years agoNote that ntpd_sync_on_start is a preferred alternative to ntpdate_enable.
Mateusz Piotrowski [Wed, 22 Aug 2018 13:30:48 +0000 (13:30 +0000)]
Note that ntpd_sync_on_start is a preferred alternative to ntpdate_enable.

A similar note is already present in the description of the
ntpd_sync_on_start variable.

This patch adds a note to the description of the ntpdate_enable variable.
This way it would be easier to spot.  Otherwise a user might skip the part
of the manual describing ntpd_sync_on_start if they stop reading after
learning about ntpdate_enable.

Reviewed by: bcr
Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D16519

5 years agoSuggest to reboot after installworld in the example of development workflow.
Mateusz Piotrowski [Wed, 22 Aug 2018 13:25:41 +0000 (13:25 +0000)]
Suggest to reboot after installworld in the example of development workflow.

Reviewed by: trasz
Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D16746

5 years agoRevert r320758, which was the man page update for r320757 just reverted.
Rick Macklem [Wed, 22 Aug 2018 12:26:17 +0000 (12:26 +0000)]
Revert r320758, which was the man page update for r320757 just reverted.

This is a content change.

PR: 230752

5 years agoRevert r320757 since it can cause "excl->shared" panics.
Rick Macklem [Wed, 22 Aug 2018 12:20:10 +0000 (12:20 +0000)]
Revert r320757 since it can cause "excl->shared" panics.

PR#230752 shows a panic where an nfsd thread tries to do soconnect() on
the AF_LOCAL socket used by the nfsuserd while already holding an
exclusive lock on it. I am not 100% sure how this happens, but since an
AF_LOCAL socket is in the file system namespace it is conceivable that it
could lock it and then attempt an upcall to the nfsuserd.
However, reverting r320757 stops the nfsuserd from using an AF_LOCAL
socket, so it should avoid any such panic().
r320757 did fix a problem with running the nfsuserd when jails were
enabled, but that can be dealt with less elegantly by allowing the
use of an alternate address instead of 127.0.0.1.
The gssd daemon also uses an AF_LOCAL socket, but it will do upcalls
before the nfsd thread processes the RPC, so I think it should not
be suseptible to this problem.

PR: 230752

5 years agoUse unifdef -x1 instead of ignoring the shell exit code
Alex Richardson [Wed, 22 Aug 2018 11:56:51 +0000 (11:56 +0000)]
Use unifdef -x1 instead of ignoring the shell exit code

This way the target fails if unifdef doesn't exist or doesn't modify the
file instead of just generating an empty .c file.
I found this while building without inherited $PATH (D16815)

Approved By: jhb (mentor)

5 years agoStop using unifdef to generate bsdxml.h
Alex Richardson [Wed, 22 Aug 2018 11:56:42 +0000 (11:56 +0000)]
Stop using unifdef to generate bsdxml.h

The current invocation of unifdef causes the build to fail when using a shell
with -o pipefail on by default since unifdef will return a non-zero exit status
if it changes something. The only thing this call to unifdef does is remove 5
lines that will be ignored by the compiler anyway. Furthermore, it is the only
make rule in the source tree that requires unifdef. Removing this call also
makes it slightly easier to build without inhering $PATH (D16815) since we
don't need unifdef anymore.

I also noticed that the sed call to replace the include guard has been broken
for over 10 years since the import of expat 2.0.1 changed it from
`XmlParse_INCLUDED` to `Expat_INCLUDED`. I could also fix this but since it's
been broken for so long and no one noticed, it's probably not necessary.

Reviewed By: emaste
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D14317

5 years agotop(1): Use warnx and errx instead of fprintf
Eitan Adler [Wed, 22 Aug 2018 10:07:15 +0000 (10:07 +0000)]
top(1): Use warnx and errx instead of fprintf

This also makes make "-v" exit without error, since it isn't.

5 years agoloader: bios loader should allow to chain load a file
Toomas Soome [Wed, 22 Aug 2018 10:04:42 +0000 (10:04 +0000)]
loader: bios loader should allow to chain load a file

The current chain command does accept only device, allow also a file to be used,
such as /boot/pmbr or /boot/mbr (or stored third party MBR/VBR block).

Also fix file descriptor leak.

5 years agotop(1): issue warning on invalid delay
Eitan Adler [Wed, 22 Aug 2018 09:49:38 +0000 (09:49 +0000)]
top(1): issue warning on invalid delay

When top -sH is run it continually updates. It should issue an warning
instead.

Reported by: jmg
PR: 230803

5 years agopfctl: Remove unused function
Kristof Provost [Wed, 22 Aug 2018 08:27:49 +0000 (08:27 +0000)]
pfctl: Remove unused function

Fix compile issues.

MFC after: 1 week

5 years agopfctl: Improve set skip handling for groups
Kristof Provost [Wed, 22 Aug 2018 08:14:29 +0000 (08:14 +0000)]
pfctl: Improve set skip handling for groups

Rely on the kernel to appropriately mark group members as skipped.
Once a group is skipped we can clear the update flag on all the members.

PR: 229241
Submitted by: Andreas Longwitz <longwitz AT incore.de>
MFC after: 1 week

5 years agoMake NVMe compatible with the original API
Chuck Tuffli [Wed, 22 Aug 2018 04:29:24 +0000 (04:29 +0000)]
Make NVMe compatible with the original API

The original NVMe API used bit-fields to represent fields in data
structures defined by the specification (e.g. the op-code in the command
data structure). The implementation targeted x86_64 processors and
defined the bit fields for little endian dwords (i.e. 32 bits).

This approach does not work as-is for big endian architectures and was
changed to use a combination of bit shifts and masks to support PowerPC.
Unfortunately, this changed the NVMe API and forces #ifdef's based on
the OS revision level in user space code.

This change reverts to something that looks like the original API, but
it uses bytes instead of bit-fields inside the packed command structure.
As a bonus, this works as-is for both big and little endian CPU
architectures.

Bump __FreeBSD_version to 1200081 due to API change

Reviewed by: imp, kbowling, smh, mav
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D16404

5 years agoin_mcast: fix copy paste error when clearing flag
Matt Macy [Wed, 22 Aug 2018 04:09:55 +0000 (04:09 +0000)]
in_mcast: fix copy paste error when clearing flag

5 years agor338172 followup - removal of stray drm references
Matt Macy [Wed, 22 Aug 2018 03:04:43 +0000 (03:04 +0000)]
r338172 followup - removal of stray drm references

5 years agor338172 follow - remove firmwares
Matt Macy [Wed, 22 Aug 2018 02:53:35 +0000 (02:53 +0000)]
r338172 follow - remove firmwares

5 years agocleanup after git svn detritus left by r338172
Matt Macy [Wed, 22 Aug 2018 02:43:34 +0000 (02:43 +0000)]
cleanup after git svn detritus left by r338172

5 years agodisconnect drm2 from tegra build until made self-contained
Matt Macy [Wed, 22 Aug 2018 02:18:45 +0000 (02:18 +0000)]
disconnect drm2 from tegra build until made self-contained

5 years agolualoader: Fix loader.conf(5) EOL validation for 'exec' lines
Kyle Evans [Wed, 22 Aug 2018 01:52:55 +0000 (01:52 +0000)]
lualoader: Fix loader.conf(5) EOL validation for 'exec' lines

This includes some light rework to simplify the line parsing, as well.  If
we hit a line match, we'll always either use the line and move on to the
next line, or we'll spew out malformed line errors.

We had multiple spots to output the error and set the status based on
whether we had a non-nil first capture group or failed EOL validation, but
it was always the same error.  Light rework entails a small label jump to
skip error handling and elimination of 'found' local.

5 years agoRemove legacy drm and drm2 from tree
Matt Macy [Wed, 22 Aug 2018 01:50:12 +0000 (01:50 +0000)]
Remove legacy drm and drm2 from tree

As discussed on the MLs drm2 conflicts with the ports' version and there
is no upstream for most if not all of drm. Both have been merged in to
a single port.

Users on powerpc, 32-bit hardware, or with GPUs predating Radeon
and i915 will need to install the graphics/drm-legacy-kmod. All
other users should be able to use one of the LinuxKPI-based ports:
graphics/drm-stable-kmod, graphics/drm-next-kmod, graphics/drm-devel-kmod.

MFC: never
Approved by: core@

5 years agolualoader: Refactor config line expressions
Kyle Evans [Tue, 21 Aug 2018 23:42:20 +0000 (23:42 +0000)]
lualoader: Refactor config line expressions

A couple of issues addressed:

1.) Modules with - in the name were not recognized as modules
2.) The module regex was repeated for each place a module name may appear
3.) The 'strip leading space' bits were repeated for each expression
4.) The trailing 'comment validation' stuff was repeated every expression

#4 still has some more work to be done. exec lines, for instance, don't
capture a 'value' -- there's only one capture pattern. This throws off the
'c' value that we match, so the trailing bits aren't *actually* being
validated. This isn't a new issue, though, so a future comit will address
this.

5 years agolualoader: Just compare expression directly
Kyle Evans [Tue, 21 Aug 2018 23:34:30 +0000 (23:34 +0000)]
lualoader: Just compare expression directly

5 years agocxgbe(4): Be explicit about ignoring the return value of cmpset in some
Navdeep Parhar [Tue, 21 Aug 2018 23:33:38 +0000 (23:33 +0000)]
cxgbe(4): Be explicit about ignoring the return value of cmpset in some
cases.

Reported by: Coverity (CIDs 10093981009400100940113573251394783).  All false positives.
Sponsored by: Chelsio Communications

5 years agonewsyslog(8): Reject configurations that specify setuid or executable logs
Conrad Meyer [Tue, 21 Aug 2018 23:12:46 +0000 (23:12 +0000)]
newsyslog(8): Reject configurations that specify setuid or executable logs

Prevent some classes of foot-shooting that may result in permissions
problems.

Reviewed by: dab, delphij, vangyzen (earlier version)
Relnotes: yes (behavior change)
Sponsored by: Dell EMC Isilon
Differential Revision: D16831

5 years agoFix resource leak when using strdup(3).
Marcelo Araujo [Tue, 21 Aug 2018 23:11:26 +0000 (23:11 +0000)]
Fix resource leak when using strdup(3).

Reported by: Coverity
CID: 1394929
Sponsored by: iXsystems Inc.

5 years agoFix null deref in mld_v1_transmit_report
Matt Macy [Tue, 21 Aug 2018 23:03:02 +0000 (23:03 +0000)]
Fix null deref in mld_v1_transmit_report

After r337866 it is possible for an in_multi6 to be referenced while
mid teardown. Handle case of cleared ifnet pointer.

Reported by: ae