]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoDon't print pathconf() errors if the target file doesn't exist.
markj [Fri, 26 Oct 2018 19:01:52 +0000 (19:01 +0000)]
Don't print pathconf() errors if the target file doesn't exist.

The subsequent acl_get_file(3) call will simply echo the same error.

PR: 229930
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoAvoid leaking memory in error paths.
markj [Fri, 26 Oct 2018 18:56:58 +0000 (18:56 +0000)]
Avoid leaking memory in error paths.

CID: 1390906
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoMove 32-bit compat support for FIODGNAME to the right place.
brooks [Fri, 26 Oct 2018 17:59:25 +0000 (17:59 +0000)]
Move 32-bit compat support for FIODGNAME to the right place.

ioctl(2) commands only have meaning in the context of a file descriptor
so translating them in the syscall layer is incorrect.

The new handler users an accessor to retrieve/construct a pointer from
the last member of the passed structure and relies on type punning to
access the other member which requires no translation.

Unlike r339174 this change supports both places FIODGNAME is handled.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17475

5 years agoRemove empty directories after r339776.
imp [Fri, 26 Oct 2018 16:34:19 +0000 (16:34 +0000)]
Remove empty directories after r339776.

git svn won't remove empty directories without --rmdir which I
forgot in r339776.

5 years agoAdd statistics for TRIM comands
imp [Fri, 26 Oct 2018 16:23:51 +0000 (16:23 +0000)]
Add statistics for TRIM comands

Add a counter for the LBAs, Ranges and hardware commands so that we
can provide additional color to the statistics we provide to vendors.

Sponsored by: Netflix, Inc

5 years agoRedo r339563: Remove joy(4) driver.
imp [Fri, 26 Oct 2018 16:03:30 +0000 (16:03 +0000)]
Redo r339563: Remove joy(4) driver.

This driver was marked as gone in 12. We're at 13 now. Remove it.
Data from nycbug's dmesg cache shows only one potential user,
suggesting it never was used much. However, even though this device
has been obsolete for 15 years at least, sys/joystick.h is included in
a number of graphics packages still, so that remains. A full exprun
is needed before that can be removed.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D17629

5 years agoPut a workaround in for command timeout malfunctioning
imp [Fri, 26 Oct 2018 14:27:37 +0000 (14:27 +0000)]
Put a workaround in for command timeout malfunctioning

At least one NVMe drive has a bug that makeing the Command Time Out
PCIe feature unreliable. The workaround is to disable this
feature. The driver wouldn't deal correctly with a timeout anyway.
Only do this for drives that are known bad.

Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D17708

5 years agoo Add pmap lock around pmap_fault_fixup() to ensure other thread will not
br [Fri, 26 Oct 2018 12:27:07 +0000 (12:27 +0000)]
o Add pmap lock around pmap_fault_fixup() to ensure other thread will not
  modify l3 pte after we loaded old value and before we stored new value.
o Preset A(accessed), D(dirty) bits for kernel mappings.

Reported by: kib
Reviewed by: markj
Discussed with: jhb
Sponsored by: DARPA, AFRL

5 years agoAdd __dso_handle to the BSD crtbegin. This is used to identify shared
andrew [Fri, 26 Oct 2018 11:53:20 +0000 (11:53 +0000)]
Add __dso_handle to the BSD crtbegin. This is used to identify shared
objects.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoDrop the csu tests WARNS to 5 to fix the powerpc64 build.
andrew [Fri, 26 Oct 2018 08:12:28 +0000 (08:12 +0000)]
Drop the csu tests WARNS to 5 to fix the powerpc64 build.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoAdjust bsdinstall zfsboot code to 80-columns and whitespace fixes
dteske [Fri, 26 Oct 2018 05:25:22 +0000 (05:25 +0000)]
Adjust bsdinstall zfsboot code to 80-columns and whitespace fixes

No functional changes.

Sponsored by: Smule, Inc.

5 years agoRemove #warning since it breaks libsysdecode
imp [Fri, 26 Oct 2018 04:53:29 +0000 (04:53 +0000)]
Remove #warning since it breaks libsysdecode

5 years agoBump to 1300002 for sys/joystick.h removal reversion.
imp [Fri, 26 Oct 2018 04:13:56 +0000 (04:13 +0000)]
Bump to 1300002 for sys/joystick.h removal reversion.

5 years agoAdd warning to sys/joystick.h announcing its planned demise.
imp [Fri, 26 Oct 2018 04:11:58 +0000 (04:11 +0000)]
Add warning to sys/joystick.h announcing its planned demise.

5 years agoRevert r339563.
imp [Fri, 26 Oct 2018 04:10:32 +0000 (04:10 +0000)]
Revert r339563.

I held the mistaken belief this was completely unused. While the
driver is unused and likely not relevant for a long time,
sys/joystick.h lives on in maybe half a dozen ports, even though
hardware to use it hasn't been widely used in maybe 15 years.

5 years agoFix dialog autosizing in bsdinstall auto error messages
dteske [Fri, 26 Oct 2018 02:08:44 +0000 (02:08 +0000)]
Fix dialog autosizing in bsdinstall auto error messages

Sponsored by: Smule, Inc.

5 years agoWhitespace alignment in bsdinstall hostname
dteske [Fri, 26 Oct 2018 01:57:32 +0000 (01:57 +0000)]
Whitespace alignment in bsdinstall hostname

Aligning line-continuation characters to prevent mistakes.
This is also the prevalent style replication throughout.

Sponsored by: Smule, Inc.

5 years agoSort i18n strings in bsdinstall hostname
dteske [Fri, 26 Oct 2018 01:47:52 +0000 (01:47 +0000)]
Sort i18n strings in bsdinstall hostname

Sponsored by: Smule, Inc.

5 years agoUpdate elftoolchain bootstrapping test after r339083
emaste [Fri, 26 Oct 2018 01:13:20 +0000 (01:13 +0000)]
Update elftoolchain bootstrapping test after r339083

Sponsored by: The FreeBSD Foundation

5 years agoAdd improved error checking to bsdinstall hostname
dteske [Fri, 26 Oct 2018 01:06:03 +0000 (01:06 +0000)]
Add improved error checking to bsdinstall hostname

Sponsored by: Smule, Inc.

5 years agoFix dialog autosizing in bsdinstall hostname
dteske [Fri, 26 Oct 2018 00:08:27 +0000 (00:08 +0000)]
Fix dialog autosizing in bsdinstall hostname

Sponsored by: Smule, Inc.

5 years agoDistinguish _CID match and _HID match and make lower priority probe
takawata [Fri, 26 Oct 2018 00:05:46 +0000 (00:05 +0000)]
Distinguish _CID match and _HID match and make lower priority probe
when _CID match.

Reviewed by: jhb, imp
Differential Revision:https://reviews.freebsd.org/D16468

5 years agoRemove vestigial DIALOG_ITEM_HELP value in bsdconfig dialog.subr
dteske [Thu, 25 Oct 2018 23:32:32 +0000 (23:32 +0000)]
Remove vestigial DIALOG_ITEM_HELP value in bsdconfig dialog.subr

Sponsored by: Smule, Inc.

5 years agoMFV r339750:
mm [Thu, 25 Oct 2018 23:13:19 +0000 (23:13 +0000)]
MFV r339750:
Sync libarchive with vendor.

Relevant vendor changes:
  RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64),
               sparc64 and riscv64

MFC after: 1 month

5 years agocxgbe(4): Add a knob to split the rx queues for a netmap enabled
np [Thu, 25 Oct 2018 22:55:18 +0000 (22:55 +0000)]
cxgbe(4): Add a knob to split the rx queues for a netmap enabled
interface into two groups.  Filters can be used to match traffic
and distribute it across a group.

hw.cxgbe.nm_split_rss

Sponsored by: Chelsio Communications

5 years agoImplement O_BENEATH and AT_BENEATH.
kib [Thu, 25 Oct 2018 22:16:34 +0000 (22:16 +0000)]
Implement O_BENEATH and AT_BENEATH.

Flags prevent open(2) and *at(2) vfs syscalls name lookup from
escaping the starting directory.  Supposedly the interface is similar
to the same proposed Linux flags.

Reviewed by: jilles (code, previous version of manpages), 0mp (manpages)
Discussed with: allanjude, emaste, jonathan
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D17547

5 years agoMinor style fixes around script execution.
markj [Thu, 25 Oct 2018 21:45:24 +0000 (21:45 +0000)]
Minor style fixes around script execution.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoMFV r339640,339641,339644:
mm [Thu, 25 Oct 2018 21:44:17 +0000 (21:44 +0000)]
MFV r339640,339641,339644:
Sync libarchive with vendor

Relevant vendor changes:
  PR #1013: Add missing h_base offset when performing absolute seeks in
            xar decompression
  PR #1061: Add support for extraction of RAR v5 archives
  PR #1066: Fix out of bounds read on empty string filename for gnutar, pax
            and v7tar
  PR #1067: Fix temporary file path buffer overflow in tests
  IS #1068: Correctly process and verify integer arguments passed to
            bsdcpio and bsdtar
  PR #1070: Don't default XAR entry atime/mtime to the current time

MFC after: 1 month

5 years agoClarify the description of the -u option.
markj [Thu, 25 Oct 2018 21:41:58 +0000 (21:41 +0000)]
Clarify the description of the -u option.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoAdd a missing include for src.opts.mk. Without it MK_TESTS isn't defined.
andrew [Thu, 25 Oct 2018 21:08:15 +0000 (21:08 +0000)]
Add a missing include for src.opts.mk. Without it MK_TESTS isn't defined.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoUpdate SHLIB_VERSION_NUMBER following the OpenSSL shared library
gjb [Thu, 25 Oct 2018 18:46:45 +0000 (18:46 +0000)]
Update SHLIB_VERSION_NUMBER following the OpenSSL shared library
number bump.

Reported by: jkim
Discussed with: kib
MFC after: immediate
Sponsored by: The FreeBSD Foundation

5 years agoUse correct format specificator to print setdscp action.
ae [Thu, 25 Oct 2018 18:06:23 +0000 (18:06 +0000)]
Use correct format specificator to print setdscp action.

PR: 232642
MFC after: 3 days

5 years agoRegen src.conf.5 to add WITH_BSD_CRTBEGIN
andrew [Thu, 25 Oct 2018 17:42:43 +0000 (17:42 +0000)]
Regen src.conf.5 to add WITH_BSD_CRTBEGIN

Sponsored by: DARPA, AFRL

5 years agoImplement a BSD licensed crtbegin/crtend
andrew [Thu, 25 Oct 2018 17:39:41 +0000 (17:39 +0000)]
Implement a BSD licensed crtbegin/crtend

These are needed for .ctors/.dtors and .jcr handling. The former needs
all the function pointers to be called in the correct order from the
.init/.fini section. The latter just needs to call a gcj specific function
if it exists with a pointer to the start of the .jcr section.

This is currently disabled until __dso_handle support is added.

Reviewed by: emaste
MFC after: 1 month
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17587

5 years agoRemove a dead store.
markj [Thu, 25 Oct 2018 17:36:28 +0000 (17:36 +0000)]
Remove a dead store.

CID: 1304878
MFC after: 1 week

5 years agoUpdate comment for AMI00[12]0 override.
imp [Thu, 25 Oct 2018 17:17:11 +0000 (17:17 +0000)]
Update comment for AMI00[12]0 override.

The AML is even stupider than always returning 0. It will only return
non-zero for an OS that reports itself as "Windows 2015", at least
on the Threadripper board's AML that I've examined.

Those AMLs also suggest we may need this quirk for AMI0030 as well.
There may be other cases where we need to override the _STA in a
generic way, so we should consider writing code to do that.

5 years agoAdd FALLTHROUGH comments to appease Coverity.
markj [Thu, 25 Oct 2018 15:43:21 +0000 (15:43 +0000)]
Add FALLTHROUGH comments to appease Coverity.

CID: 1017862-10178641017866-1017868
MFC after: 2 weeks

5 years agoBump __FreeBSD_version following the OpenSSL shared library version
gjb [Thu, 25 Oct 2018 15:41:26 +0000 (15:41 +0000)]
Bump __FreeBSD_version following the OpenSSL shared library version
number bump.

Submitted by: antoine
MFC with: r339709
Sponsored by: The FreeBSD Foundation

5 years agoefivar(3): Fix some typos and improve style
0mp [Thu, 25 Oct 2018 15:41:19 +0000 (15:41 +0000)]
efivar(3): Fix some typos and improve style

- Fix some typos.
- Remove redundant semicolons from the synopsis section.
- Stylize variable names and types with Vt and Va respectively.
- Use a list to present non-implemented functions.
- Sort the order of the sections.
- Add a history section.
- Use Nm when "libefivar" is mentioned.

PR: 232626
Reported by: Tiwei Bie <btw@mail.ustc.edu.cn>
Reviewed by: bcr, imp
Approved by: krion (mentor, implicit), mat (mentor, implicit)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17686

5 years agoRemove a redundant check.
markj [Thu, 25 Oct 2018 15:40:59 +0000 (15:40 +0000)]
Remove a redundant check.

CID: 1042100
MFC after: 2 weeks

5 years agocxgbe(4): Allow "pass" filters to distribute matching traffic using a
np [Thu, 25 Oct 2018 14:37:26 +0000 (14:37 +0000)]
cxgbe(4): Allow "pass" filters to distribute matching traffic using a
subset of a VI's RSS indirection table.

This makes it possible to make groups out of rx queues and steer
different kinds of traffic to different groups.  For example, an
interface with 8 rx queues could have all non-TCP traffic delivered to
queues 0-3 and all TCP traffic to queues 4-7.

Note that it is already possible for filters to steer traffic to a
particular queue or to distribute it using the full indirection table
(much like normal rx does).

Sponsored by: Chelsio Communications

5 years agoBump base OpenSSL libraries versions to avoid conflict with port's libraries.
kib [Thu, 25 Oct 2018 13:37:57 +0000 (13:37 +0000)]
Bump base OpenSSL libraries versions to avoid conflict with port's libraries.

Reported by: many
Reviewed by: gjb
Sponsored by: The FreeBSD Foundation
MFC after: 3 hours

5 years agoAllow fdisk(8) to deal with sectors larger than 2048
rgrimes [Thu, 25 Oct 2018 12:13:13 +0000 (12:13 +0000)]
Allow fdisk(8) to deal with sectors larger than 2048
especially for 4Kn drives with PMBR's

Approved by:    bde (mentor)
MFC:            3 days

5 years agoNow that the portsnap buildbox is generating the raw bits for INDEX-13,
delphij [Thu, 25 Oct 2018 08:05:53 +0000 (08:05 +0000)]
Now that the portsnap buildbox is generating the raw bits for INDEX-13,
add it to the set of INDEX files built by portsnap.

Switch to INDEX-13 for head/.

5 years agocxgbe(4): Update the VI's default queue when netmap is enabled/disabled.
np [Thu, 25 Oct 2018 06:24:42 +0000 (06:24 +0000)]
cxgbe(4): Update the VI's default queue when netmap is enabled/disabled.

Sponsored by: Chelsio Communications

5 years agoDeprecate a number of less used 10 and 10/100 Ethernet devices.
brooks [Thu, 25 Oct 2018 04:10:41 +0000 (04:10 +0000)]
Deprecate a number of less used 10 and 10/100 Ethernet devices.

The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe,
pcn, sf, sn, tl, tx, txp, vx, wb, xe

The list as refined as part of FCP-0101. Per the FCP, devices may be
removed from the deprecation list if enough users are found or they are
converted to iflib.

FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md

5 years agolualoader: Improve module loading diagnostics
kevans [Thu, 25 Oct 2018 02:14:35 +0000 (02:14 +0000)]
lualoader: Improve module loading diagnostics

Some fixes:

- Maintain historical behavior more accurately w.r.t verbose_loading;
  verbose_loading strictly prints "${module_name...}" and later "failed!"
  or "ok" based on load success
- With or without verbose_loading, dump command_errbuf on load failure.
  This usually happens prior to ok/failed if we're verbose_loading

Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17694

5 years agoUpdate lualoader test script a little bit
kevans [Thu, 25 Oct 2018 02:04:01 +0000 (02:04 +0000)]
Update lualoader test script a little bit

Use userboot.so from the test directory if possible, fall back to .OBJDIR.
This avoids a problem that we've had since userboot coexistence was added,
where userboot.so alone no longer exists in the .OBJDIR but is instead just
a link installed later.

5 years agocxgbe(4): new sysctl to display the start of the RSS region for a VI.
np [Thu, 25 Oct 2018 01:20:32 +0000 (01:20 +0000)]
cxgbe(4): new sysctl to display the start of the RSS region for a VI.

dev.<ifname>.<inst>.rss_base

For example:
dev.cc.0.rss_base: 0
dev.cc.1.rss_base: 128
dev.vcc.0.rss_base: 256
dev.vcc.1.rss_base: 384

Sponsored by: Chelsio Communications

5 years agoRemove code that is dead since r287197. Today wlan(4) interfaces aren't
glebius [Wed, 24 Oct 2018 20:49:51 +0000 (20:49 +0000)]
Remove code that is dead since r287197. Today wlan(4) interfaces aren't
children of some other interface. Creation happens only in wlan_up().

5 years agoCorrect condition to detect mount(2) support by a filesystem.
kib [Wed, 24 Oct 2018 19:40:09 +0000 (19:40 +0000)]
Correct condition to detect mount(2) support by a filesystem.

Reported and tested by: cy
Sponsored by: The FreeBSD Foundation
Approved by: re (rgrimes)

5 years agoadd links to the saga of CTM
imp [Wed, 24 Oct 2018 19:21:04 +0000 (19:21 +0000)]
add links to the saga of CTM

Submitted by: phk

5 years agoClarify slightly the interaction between wait*() and pdfork().
markj [Wed, 24 Oct 2018 18:42:13 +0000 (18:42 +0000)]
Clarify slightly the interaction between wait*() and pdfork().

There are multiple ways to wait for any child process to return a
status (e.g., waitpid(-1, ...), waitid(P_ALL, ...)), so don't be so
specific.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoAdd a !NUMA definition for vm_domainset_iter_policy_ref_init().
markj [Wed, 24 Oct 2018 17:09:20 +0000 (17:09 +0000)]
Add a !NUMA definition for vm_domainset_iter_policy_ref_init().

Pointy hat: markj
X-MFC with: r339661
Sponsored by: The FreeBSD Foundation

5 years agoAdd an #include required after r339686.
markj [Wed, 24 Oct 2018 16:49:16 +0000 (16:49 +0000)]
Add an #include required after r339686.

X-MFC with: r339686
Sponsored by: The FreeBSD Foundation

5 years agoAlways free dynamically allocated memory before returning.
markj [Wed, 24 Oct 2018 16:46:26 +0000 (16:46 +0000)]
Always free dynamically allocated memory before returning.

CID: 1007418
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoUse a vm_domainset iterator in keg_fetch_slab().
markj [Wed, 24 Oct 2018 16:41:47 +0000 (16:41 +0000)]
Use a vm_domainset iterator in keg_fetch_slab().

Previously, it used a hand-rolled round-robin iterator.  This meant that
the minskip logic in r338507 didn't apply to UMA allocations, and also
meant that we would call vm_wait() for individual domains rather than
permitting an allocation from any domain with sufficient free pages.

Discussed with: jeff
Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17420

5 years agonetmap: add man page for the vale-ctl program
vmaffione [Wed, 24 Oct 2018 16:01:56 +0000 (16:01 +0000)]
netmap: add man page for the vale-ctl program

Added man page for vale-ctl program.
Small fixes to vale-ctl, including the support for -m option
(to specify the netmap memory allocator id).

Reviewed by: 0mp
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D17683

5 years agoReduce the GCE image size to 27G to be lower than the free
gjb [Wed, 24 Oct 2018 15:51:55 +0000 (15:51 +0000)]
Reduce the GCE image size to 27G to be lower than the free
quota limit.

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

5 years agoRemove redundant redeclaration of netmap_vp_reg().
bz [Wed, 24 Oct 2018 14:14:49 +0000 (14:14 +0000)]
Remove redundant redeclaration of netmap_vp_reg().
This should unbreak sparc64 and powerpc LINT builds.

5 years agorip6_input() inp validation after epoch(9)
bz [Wed, 24 Oct 2018 10:42:35 +0000 (10:42 +0000)]
rip6_input() inp validation after epoch(9)

After r335924 rip6_input() needs inp validation to avoid
working on FREED inps.

Apply the relevant bits from r335497,r335501 (rip_input() change)
to the IPv6 counterpart.

PR: 232194
Reviewed by: rgrimes, ae (,hps)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17594

5 years agoAllow the bhyve VNC server to listen on IPv6 for incoming connections.
bz [Wed, 24 Oct 2018 08:45:33 +0000 (08:45 +0000)]
Allow the bhyve VNC server to listen on IPv6 for incoming connections.

Alternatively to IPv4 address:port this will allow to listen on IPv6
link-local (incl. scope), a specific address, or ::.  Addresses have
to be given in RFC2732 format so that [::]:port parsing will work.

This patch also starts to introduce WITH_INET/INET6_SUPPORT to bhyve.

PR: 232018
Submitted by: Dave Rush (northwoodlogic.free gmail.com) (original)
Reviewed by: Dave Rush (updated verison)
MFC after: 3 days

5 years agomenu.lua: Abort autoboot sequence on failed command
kevans [Wed, 24 Oct 2018 03:14:10 +0000 (03:14 +0000)]
menu.lua: Abort autoboot sequence on failed command

Currently, a timeout in the menu autoboot sequence would effectively do
nothing. We would return from the autoboot handling, then begin processing
the menu without redrawing it.

This change makes the behavior a little more friendly. Returning the user to
the menu can't have any good effects, so abort the autoboot sequence and
drop to the loader prompt.

MFC after: 3 days

5 years agolualoader: unload upon kernel change if a kernel was previously loaded
kevans [Wed, 24 Oct 2018 02:02:37 +0000 (02:02 +0000)]
lualoader: unload upon kernel change if a kernel was previously loaded

In the majority of cases, a kernel is not loaded before we hit the menu.
However, if a password is set, we'll trigger autoboot and have loadelf'd
beforehand. We also need to take into account one dropping to the loader
prompt and twiddling with things manually; if they try to toggle through
kernels, we'll assume they mean it.

Reported by: trasz
MFC after:  3 days

5 years agopf: Fix copy/paste error in IPv6 address rewriting
kp [Wed, 24 Oct 2018 00:19:44 +0000 (00:19 +0000)]
pf: Fix copy/paste error in IPv6 address rewriting

We checked the destination address, but replaced the source address. This was
fixed in OpenBSD as part of their NAT rework, which we don't want to import
right now.

CID: 1009561
MFC after: 3 weeks

5 years agoFix comments.
markj [Wed, 24 Oct 2018 00:17:19 +0000 (00:17 +0000)]
Fix comments.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agopf: ifp can never be NULL in pfi_ifaddr_event()
kp [Tue, 23 Oct 2018 23:15:44 +0000 (23:15 +0000)]
pf: ifp can never be NULL in pfi_ifaddr_event()

There's no point in the NULL check for ifp, because we'll already have
dereferenced it by then. Moreover, the event will always have a valid ifp.

Replace the late check with an early assertion.

CID: 1357338

5 years agoFix stand/ build after r339671.
kib [Tue, 23 Oct 2018 23:11:38 +0000 (23:11 +0000)]
Fix stand/ build after r339671.

ffs_subr.c requires calculate_crc32c() from libkern.  Unfortunately we
cannot just add libkern/crc32.c to libstand because crc32.o is already
compiled from contrib/zlib/crc32.c. Use the include trick to rename
the source.

Note that libstand also provides crc32.c which seems to be unused.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D17677

5 years agoOnly call sigdeferstop() for NFS.
kib [Tue, 23 Oct 2018 21:43:41 +0000 (21:43 +0000)]
Only call sigdeferstop() for NFS.

Use bypass to catch any NFS VOP dispatch and route it through the
wrapper which does sigdeferstop() and then dispatches original
VOP. NFS does not need a bypass below it, which is not supported.

The vop offset in the vop_vector is added since otherwise it is
impossible to get vop_op_t from the internal table, and I did not
wanted to create the layered fs only to wrap NFS VOPs.

VFS_OP()s wrap is straightforward.

Requested and reviewed by: mjg (previous version)
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D17658

5 years agoContinuing efforts to provide hardening of FFS, this change adds a
mckusick [Tue, 23 Oct 2018 21:10:06 +0000 (21:10 +0000)]
Continuing efforts to provide hardening of FFS, this change adds a
check hash to the superblock. If a check hash fails when an attempt
is made to mount a filesystem, the mount fails with EINVAL (Invalid
argument). This avoids a class of filesystem panics related to
corrupted superblocks. The hash is done using crc32c.

Check hases are added only to UFS2 and not to UFS1 as UFS1 is primarily
used in embedded systems with small memories and low-powered processors
which need as light-weight a filesystem as possible.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoFor the moment, put back the MOUSE_PROTO_{BUS,INPORT} #defines until
imp [Tue, 23 Oct 2018 20:45:46 +0000 (20:45 +0000)]
For the moment, put back the MOUSE_PROTO_{BUS,INPORT} #defines until
some ports can be updated.

5 years agocxgbe/iw_cxgbe: save the ep in the driver-private provider_data field.
np [Tue, 23 Oct 2018 18:32:55 +0000 (18:32 +0000)]
cxgbe/iw_cxgbe: save the ep in the driver-private provider_data field.

Submitted By: Lily Wang @ Netapp

MFC after: 1 week

5 years agoSupport the SHA224 HMAC algorithm in ccr(4).
jhb [Tue, 23 Oct 2018 18:31:39 +0000 (18:31 +0000)]
Support the SHA224 HMAC algorithm in ccr(4).

MFC after: 2 months
Sponsored by: Chelsio Communications

5 years agoAdd sha224 to the authctx union.
jhb [Tue, 23 Oct 2018 18:07:37 +0000 (18:07 +0000)]
Add sha224 to the authctx union.

MFC after: 2 months
Sponsored by: Chelsio Communications

5 years agoInitialize static domainsets regardless of whether an SRAT is present.
markj [Tue, 23 Oct 2018 18:07:16 +0000 (18:07 +0000)]
Initialize static domainsets regardless of whether an SRAT is present.

Reported by: yuripv
X-MFC with: r339452
Sponsored by: The FreeBSD Foundation

5 years agoInitializer error variable in nvdimm_spa_uio().
kib [Tue, 23 Oct 2018 17:53:35 +0000 (17:53 +0000)]
Initializer error variable in nvdimm_spa_uio().

Several code paths might result in returning uninitialized value.

Reported by: coverity through cem
CID: 1396315
Sponsored by: The FreeBSD Foundation

5 years agoRevert r339634.
erj [Tue, 23 Oct 2018 17:06:36 +0000 (17:06 +0000)]
Revert r339634.

That commit is causing kernel panics in em(4), so this will be reverted
until those are fixed.

Reported by: ae@, pho@, et al
Sponsored by: Intel Corporation

5 years agoRefactor domainset iterators for use by malloc(9) and UMA.
markj [Tue, 23 Oct 2018 16:35:58 +0000 (16:35 +0000)]
Refactor domainset iterators for use by malloc(9) and UMA.

Before this change we had two flavours of vm_domainset iterators: "page"
and "malloc".  The latter was only used for kmem_*() and hard-coded its
behaviour based on kernel_object's policy.  Moreover, its use contained
a race similar to that fixed by r338755 since the kernel_object's
iterator was being run without the object lock.

In some cases it is useful to be able to explicitly specify a policy
(domainset) or policy+iterator (domainset_ref) when performing memory
allocations.  To that end, refactor the vm_dominset_* KPI to permit
this, and get rid of the "malloc" domainset_iter KPI in the process.

Reviewed by: jeff (previous version)
Tested by: pho (part of a larger patch)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17417

5 years agonetmap: add man page for the bridge program
vmaffione [Tue, 23 Oct 2018 15:34:43 +0000 (15:34 +0000)]
netmap: add man page for the bridge program

Added bridge(8).
Also, minor fixes to the netmap "bridge" application:
 - indentation fixes and code cleanup
 - better usage description
 - better processing of netmap flags

Reviewed by: 0mp
Approved by: gnn (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17664

5 years agoloader: biosdisk interface should be able to cope with 4k sectors
tsoome [Tue, 23 Oct 2018 14:44:32 +0000 (14:44 +0000)]
loader: biosdisk interface should be able to cope with 4k sectors

The 4kn support in current bios specific biosdisk.c is broken, as the code
is only implementing the support for the 512B sector size.

This work is building the support for custom size sectors, we still do assume
the requested data to be multiple of 512B blocks and we only do address the
biosdisk.c interface here.

For reference, see also:
https://www.illumos.org/issues/8303
https://www.illumos.org/rb/r/547

As the GELI is moved above biosdisk "layer", the GELI should just work

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D11174

5 years agoAdd debug.witness.trace=0 back to the installer sysctl.conf(5),
gjb [Tue, 23 Oct 2018 14:38:08 +0000 (14:38 +0000)]
Add debug.witness.trace=0 back to the installer sysctl.conf(5),
incorrectly removed from head when it should have been removed
from stable/12 post-branch.

Reported by: bdrewery
Sponsored by: The FreeBSD Foundation

5 years agoFollow up on r331936. gets_s(3) will also fail in the same way that
cy [Tue, 23 Oct 2018 14:16:02 +0000 (14:16 +0000)]
Follow up on r331936. gets_s(3) will also fail in the same way that
gets(3) does. This was missed in r331936.

Reported by: emaste@
MFC after: 3 days

5 years agoPick f80c97e477d1b3fe7778c65d9439d673738b4131 from upstream:
trasz [Tue, 23 Oct 2018 14:11:35 +0000 (14:11 +0000)]
Pick f80c97e477d1b3fe7778c65d9439d673738b4131 from upstream:

    Rework the way jemalloc uses mmap(2) on FreeBSD.

    This makes it directly use MAP_EXCL and MAP_ALIGNED() instead
    of weird workarounds involving mapping at random places and then
    unmapping parts of them.

Discussed with: jasone
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoPick 676cdd66792ccb629a978837ea2a066d5db342cc from upstream:
trasz [Tue, 23 Oct 2018 13:54:54 +0000 (13:54 +0000)]
Pick 676cdd66792ccb629a978837ea2a066d5db342cc from upstream:

    Disable runtime detection of lazy purging support on FreeBSD.

    The check doesn't seem to serve any purpose here, and this shaves
    off three syscalls on binary startup.

Discussed by: jasone
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoAdd an IMPLEMENTATION NOTES section to ldd.1.
markj [Tue, 23 Oct 2018 13:49:53 +0000 (13:49 +0000)]
Add an IMPLEMENTATION NOTES section to ldd.1.

PR: 231926
Reviewed by: emaste
MFC after: 1 month

5 years agolibsa: re-send ACK for older data packets in tftp
tsoome [Tue, 23 Oct 2018 13:38:39 +0000 (13:38 +0000)]
libsa: re-send ACK for older data packets in tftp

In current tftp code we drop out-of-order packets; however, we should play
nice and re-send ACK for older data packets we are receiving. This will
hopefully stop server repeating those packets we already have received.
Note we do not answer duplicates from "previous" session (that is, session
with different port number), those will eventually time out.

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

5 years agoAdd the check that current VNET is ready and access to srchash is allowed.
ae [Tue, 23 Oct 2018 13:11:45 +0000 (13:11 +0000)]
Add the check that current VNET is ready and access to srchash is allowed.

This change is similar to r339646. The callback that checks for appearing
and disappearing of tunnel ingress address can be called during VNET
teardown. To prevent access to already freed memory, add check to the
callback and epoch_wait() call to be sure that callback has finished its
work.

MFC after: 20 days

5 years agoar: report errno on warning/error
emaste [Tue, 23 Oct 2018 13:07:03 +0000 (13:07 +0000)]
ar: report errno on warning/error

Previously ar would report an error like "ar: fatal: Write error"
without including additional errno information.  Change warnings and
errors to include archive_errno() so that the user may have some idea
of the reason for the failure.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17650

5 years agoarch.7: update final ia64 release to 10.4
emaste [Tue, 23 Oct 2018 13:03:24 +0000 (13:03 +0000)]
arch.7: update final ia64 release to 10.4

No more 10.x releases are planned.

5 years agoAdd the check that current VNET is ready and access to srchash is
ae [Tue, 23 Oct 2018 13:03:03 +0000 (13:03 +0000)]
Add the check that current VNET is ready and access to srchash is
allowed.

ipsec_srcaddr() callback can be called during VNET teardown, since
ingress address checking subsystem isn't VNET specific. And thus
callback can make access to already freed memory. To prevent this,
use V_ipsec_idhtbl pointer as indicator of VNET readiness. And make
epoch_wait() after resetting it to NULL in vnet_ipsec_uninit() to
be sure that ipsec_srcaddr() is finished its work.

Reported by: kp
MFC after: 20 days

5 years agosort {delete,check}-old* output
emaste [Tue, 23 Oct 2018 13:00:11 +0000 (13:00 +0000)]
sort {delete,check}-old* output

It is more convenient to review old libraries, files, and directories
in order.

Sort check-* after checking for existence of files for efficiency, and
because /usr/lib/debug entries are added while iterating over the list.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17649

5 years agoFix ipw_start(), where logic was reverted in r287197.
glebius [Tue, 23 Oct 2018 12:53:09 +0000 (12:53 +0000)]
Fix ipw_start(), where logic was reverted in r287197.

PR: 232554
Submitted by: gl00my@mail.ru

5 years agoRemove softc from idhash when interface is destroyed.
ae [Tue, 23 Oct 2018 12:50:28 +0000 (12:50 +0000)]
Remove softc from idhash when interface is destroyed.

MFC after: 20 days

5 years agoUpdate vendor/libarchive/dist to git d5f35a90a4cb1eeb918213bff9d78e8b0471dc0a
mm [Tue, 23 Oct 2018 10:58:07 +0000 (10:58 +0000)]
Update vendor/libarchive/dist to git d5f35a90a4cb1eeb918213bff9d78e8b0471dc0a

Relevant vendor changes:
  PR #1013: Add missing h_base offset when performing absolute seeks in
            xar decompression
  PR #1061: Add support for extraction of RAR v5 archives
  PR #1066: Fix out of bounds read on empty string filename for gnutar, pax
            and v7tar
  PR #1067: Fix temporary file path buffer overflow in tests
  IS #1068: Correctly process and verify integer arguments passed to
            bsdcpio and bsdtar
  PR #1070: Don't default XAR entry atime/mtime to the current time

5 years agonetmap: align codebase to the current upstream (sha 8374e1a7e6941)
vmaffione [Tue, 23 Oct 2018 08:55:16 +0000 (08:55 +0000)]
netmap: align codebase to the current upstream (sha 8374e1a7e6941)

Changelist:
    - Move large parts of VALE code to a new file and header netmap_bdg.[ch].
      This is useful to reuse the code within upcoming projects.
    - Improvements and bug fixes to pipes and monitors.
    - Introduce nm_os_onattach(), nm_os_onenter() and nm_os_onexit() to
      handle differences between FreeBSD and Linux.
    - Introduce some new helper functions to handle more host rings and fake
      rings (netmap_all_rings(), netmap_real_rings(), ...)
    - Added new sysctl to enable/disable hw checksum in emulated netmap mode.
    - nm_inject: add support for NS_MOREFRAG

Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D17364

5 years agoFix ncurses fallback.c build with a strict build shell
arichardson [Tue, 23 Oct 2018 06:31:31 +0000 (06:31 +0000)]
Fix ncurses fallback.c build with a strict build shell

The script uses shift three times and when building with a strict /bin/sh
shifting without any arguments will cause the script to fail. In this case
the target will fail and we write an empty output file. When doing a
NO_CLEAN build after this will mean fallback.c is up to date and clang
will happily compile the empty input file which leads to strange build
errors later.

Fixed by passing three empty arguments to MkFallback.sh and only creating
fallback.c if MKfallback.sh succeeds.

Aproved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16867

5 years agoOnly compute the X_COMPILER_*/X_LINKER_* variables when needed
arichardson [Tue, 23 Oct 2018 06:31:25 +0000 (06:31 +0000)]
Only compute the X_COMPILER_*/X_LINKER_* variables when needed

When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line.
This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD
in bsd.linker.mk) which causes it to call ${XCC} --version and
${XLD} --version (plus various awk+sed+echo calls) in every subdirectory.
For incremental builds and stages that only walk the source tree this is
often the majority of the time spent in that directory.

By only computing the value of the X_COMPILER_*/X_LINKER_* variables if
_WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls
to once per build stage instead of once per recursive make.

With this change (and no changes to the sources) the `make includes` stage
now takes 28 seconds at -j1 instead of 86 seconds.

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

5 years agoFix regex for extracting SHM_* values for libsysdecode
arichardson [Tue, 23 Oct 2018 06:31:19 +0000 (06:31 +0000)]
Fix regex for extracting SHM_* values for libsysdecode

There was an additional + after the {6} which is apparently ignored by the
FreeBSD regex implementation but was giving me an error when compiling on
MacOS.

While changing this also make sure that tables.h is not created if mktables
fails. The current rule would create a partial tables.h which causes following
incremental builds to use that broken file and fail with an unrelated
compilation error or even succeed even though they shouldn't.

Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D17069

5 years agoiflib: drain enqueued tasks before detaching from taskqgroup
erj [Tue, 23 Oct 2018 04:37:29 +0000 (04:37 +0000)]
iflib: drain enqueued tasks before detaching from taskqgroup

The taskqgroup_detach function does not check if task is already enqueued when
detaching it. This may lead to kernel panic if enqueued task starts after
context state lock is destroyed. Ensure that the already enqueued admin tasks
are executed before detaching them.

The issue was discovered during validation of D16429. Unloading of if_ixlv
followed by immediate removal of VFs with iovctl -D may lead to panic on
NODEBUG kernel.

As well, check if iflib is in detach before enqueueing new admin or iov
tasks, to prevent new tasks from executing while the taskqgroup tasks
are being drained.

Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: shurd@, erj@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D17404

5 years agodpaa: Mark BMan and QMan as earlier driver modules
jhibbits [Tue, 23 Oct 2018 01:56:52 +0000 (01:56 +0000)]
dpaa: Mark BMan and QMan as earlier driver modules

The BMan softc must exist when dtsec devices are created, else a NULL
pointer is dereferenced.  QMan likely as well.  Until now, we have relied on
order within the fdt parsing to attach correctly, but this obviously is not
foolproof.  Mark these as BUS_PASS_SUPPORTDEV so they're probed and attached
explicitly before dtsec devices.