]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoUpdate sendmail to work with the OpenSSL 1.1 API.
John Baldwin [Tue, 9 Oct 2018 17:44:25 +0000 (17:44 +0000)]
Update sendmail to work with the OpenSSL 1.1 API.

Submitted by: jkim
Approved by: re (gjb), gshapiro
Obtained from: ports/mail/sendmail/files/patch-tls.c

5 years agoUpdate Apache Serf to 1.3.9 to support OpenSSL 1.1.1.
John Baldwin [Tue, 9 Oct 2018 15:28:06 +0000 (15:28 +0000)]
Update Apache Serf to 1.3.9 to support OpenSSL 1.1.1.

Approved by: re (rgrimes)

5 years agolibevent: eliminate in-tree usage of arc4random_addrandom
Ed Maste [Tue, 9 Oct 2018 14:27:40 +0000 (14:27 +0000)]
libevent: eliminate in-tree usage of arc4random_addrandom

Apply r338059 to newly-added libevent 2.1.18.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

5 years agoCopy libevent sources to contrib
Ed Maste [Tue, 9 Oct 2018 14:05:11 +0000 (14:05 +0000)]
Copy libevent sources to contrib

To replace the libevent embedded in ntp, for OpenSSL 1.1.1 compat.

Approved by: re (gjb)

5 years agoThere are three places where we return from a function which entered an
Jonathan T. Looney [Tue, 9 Oct 2018 13:26:06 +0000 (13:26 +0000)]
There are three places where we return from a function which entered an
epoch section without exiting that epoch section. This is bad for two
reasons: the epoch section won't exit, and we will leave the epoch tracker
from the stack on the epoch list.

Fix the epoch leak by making sure we exit epoch sections before returning.

Reviewed by: ae, gallatin, mmacy
Approved by: re (gjb, kib)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D17450

5 years agofollowing "Setup, Conventions, and Traditions" (Committer's Guide);
Vinícius Zavam [Tue, 9 Oct 2018 07:22:14 +0000 (07:22 +0000)]
following "Setup, Conventions, and Traditions" (Committer's Guide);

5. share/misc/committers-ports.dot
  * reflecting my privileges only for ports/, with mentors' entries;
  * did test it with dot (graphics/graphviz) to check accent support.
9. usr.bin/calendar/calendars/calendar.freebsd
  * added birth date + place.

'calendar.freebsd' offers UTF-8, so I added my entry using proper accents.

Reviewed by: rene (mentor)
Approved by: re (gjb), araujo (mentor), beat (mentor)
Differential Revision: https://reviews.freebsd.org/D17469

5 years agoopenssh: regenerate ssh-namespace.h after r339213 and r339216
Ed Maste [Tue, 9 Oct 2018 03:11:59 +0000 (03:11 +0000)]
openssh: regenerate ssh-namespace.h after r339213 and r339216

Reported by: des
Approved by: re (rgrimes)

5 years agoFix the pNFS server's reporting of disk space usage for the "#<path>" case.
Rick Macklem [Tue, 9 Oct 2018 01:10:50 +0000 (01:10 +0000)]
Fix the pNFS server's reporting of disk space usage for the "#<path>" case.

The pNFS server would report the total disk space used and free for all
of the DSs, even when certain DSs are assigned to the file system via
the "#<path>" suffix used in the "nfsd -p" option argument.
This patch fixes this case. It only reports usage for the file system
that the argument vnode resides on. This is consistent with the non-pNFS
NFSv4 server. In NFSv4 it is possible to have subtrees on other file
systems, but these are not included in the usage information for NFSv4.

Approved by: re (gjb)

5 years agocrypto: Don't limit to TLSv1 only
John Baldwin [Mon, 8 Oct 2018 23:23:09 +0000 (23:23 +0000)]
crypto: Don't limit to TLSv1 only

Approved by: re (rgrimes, gjb)
Obtained from: upstream commit e94f50bbbe7318eec5b6b165ff73d94bbc9d20b0

5 years agoFix the distribution path for -ALPHA builds, which are under
Glen Barber [Mon, 8 Oct 2018 19:48:58 +0000 (19:48 +0000)]
Fix the distribution path for -ALPHA builds, which are under
the snapshots directory, not releases.

Reported by: David Marec david.marec _at_ davenulle _dot_ org
Approved by: re (rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agoAdd support for relocations in RISC-V kernel modules to kldxref.
John Baldwin [Mon, 8 Oct 2018 19:15:58 +0000 (19:15 +0000)]
Add support for relocations in RISC-V kernel modules to kldxref.

Reviewed by: br, markj
Approved by: re (gjb)
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17415

5 years agoDisallow zero day of month from strptime("%d").
Konstantin Belousov [Mon, 8 Oct 2018 18:45:40 +0000 (18:45 +0000)]
Disallow zero day of month from strptime("%d").

It is required by POSIX, specified in our man page, and followed by
Linux.

PR: 232072
Reported by: miguel_tete17@hotmail.com
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

5 years agoFix r336951 mismerge -- use of uninitialized variable.
Alexander Motin [Mon, 8 Oct 2018 15:19:03 +0000 (15:19 +0000)]
Fix r336951 mismerge -- use of uninitialized variable.

Reported by: tsoome
Approved by: re (gjb)
MFC after: 3 days

5 years agoAdd missing steering rules for virtual function, VF, in mlx4en(4) driver.
Hans Petter Selasky [Mon, 8 Oct 2018 14:52:21 +0000 (14:52 +0000)]
Add missing steering rules for virtual function, VF, in mlx4en(4) driver.

When acting as a VF it is required to add steering rules for all unicast
addresses. Even if promiscious mode is selected. Else incoming data packets
will be dropped.

MFC after: 3 days
Approved by: re (gjb)
Sponsored by: Mellanox Technologies

5 years agoVendor import serf-1.3.9 (now Apache serf)
Peter Wemm [Mon, 8 Oct 2018 08:12:28 +0000 (08:12 +0000)]
Vendor import serf-1.3.9 (now Apache serf)

5 years agoem/igb: Do not print link state messages
Eric van Gyzen [Mon, 8 Oct 2018 01:28:46 +0000 (01:28 +0000)]
em/igb:  Do not print link state messages

These messages are totally redundant with the iflib messages.
They're also not very useful, since they don't include the
interface name.

Discussed with: shurd
Approved by: re (rgrimes)
Sponsored by: Dell EMC Isilon

5 years agoTeach truss how to display shm_open(2), shm_unlink(2)
Allan Jude [Sun, 7 Oct 2018 19:50:44 +0000 (19:50 +0000)]
Teach truss how to display shm_open(2), shm_unlink(2)

Submitted by: Thomas Munro <munro@ip9.org>
Reviewed by: tuexen, kib
Approved by: re (rgrimes)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D17457

5 years agoAddress the warning regarding duplicate option 'GEOM_PART_GPT' when
Michael Tuexen [Sun, 7 Oct 2018 15:54:13 +0000 (15:54 +0000)]
Address the warning regarding duplicate option 'GEOM_PART_GPT' when
configuring kernels for i386, amd64, and arm64.
The 'GEOM_PART_GPT' option was added to the DEFAULTS configuration
in r337967.

Approved by: re (kib@)
Reviewed by: ler@
Differential Revision: https://reviews.freebsd.org/D17458
Sponsored by: Netflix, Inc.

5 years agolualoader: Honor boot_* variables at lua init
Kyle Evans [Sun, 7 Oct 2018 15:28:50 +0000 (15:28 +0000)]
lualoader: Honor boot_* variables at lua init

For non-UEFI systems, boot.config(5) may have -s or -v specified for
single-user and verbose boot respectively. These were not being properly
taken into account and reflected in the "Boot Options" submenu. When we
initialize core.lua, we'll record boot_single and boot_verbose as we do ACPI
and consider these the system defaults.

Reported by: David Wolfskill <david@catwhisker.org>
Approved by: re (kib)

5 years agoAvoid truncating unrecognised parameters when reporting them.
Michael Tuexen [Sun, 7 Oct 2018 15:13:47 +0000 (15:13 +0000)]
Avoid truncating unrecognised parameters when reporting them.
This resulted in sending malformed packets.

Approved by: re (kib@)
MFC after: 1 week

5 years agoEnable TCP Fast Open support for PPC platforms.
Michael Tuexen [Sun, 7 Oct 2018 12:56:05 +0000 (12:56 +0000)]
Enable TCP Fast Open support for PPC platforms.

Reviewed by: kbowling@, andreast@
Approved by: re (kib@)
Differential Revision: https://reviews.freebsd.org/D17407

5 years agoEnsure that the ips_localout counter is incremented for
Michael Tuexen [Sun, 7 Oct 2018 11:26:15 +0000 (11:26 +0000)]
Ensure that the ips_localout counter is incremented for
locally generated SCTP packets sent over IPv4. This make
the behaviour consistent with IPv6.

Reviewed by: ae@, bz@, jtl@
Approved by: re (kib@)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17406

5 years agolualoader: Create a module blacklist, add DRM modules to it
Kyle Evans [Sun, 7 Oct 2018 01:53:43 +0000 (01:53 +0000)]
lualoader: Create a module blacklist, add DRM modules to it

This is a step in the process of easing migration into the new world order
of DRM drivers. Strongly encourage users towards loading DRM modules via
rc.conf(5) instead of loader.conf(5) by failing the load from loader(8).
Users so inclined may wipe out the blacklist via module_blacklist="" in
loader.conf(5), and it is expected that these modules will eventually be
removed from the blacklist. They may still be loaded as dependencies of
other modules or explicitly via the loader prompt, but this should not be a
major problem.

Approved by: re (rgrimes)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16914

5 years agosshd: address capsicum issues
Ed Maste [Sat, 6 Oct 2018 21:32:55 +0000 (21:32 +0000)]
sshd: address capsicum issues

* Add a wrapper to proxy login_getpwclass(3) as it is not allowed in
  capability mode.
* Cache timezone data via caph_cache_tzdata() as we cannot access the
  timezone file.
* Reverse resolve hostname before entering capability mode.

PR: 231172
Submitted by: naito.yuichiro@gmail.com
Reviewed by: cem, des
Approved by: re (rgrimes)
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D17128

5 years agopowerpc/pseries: EOI interrupts in XICS by setting lowest priority
Justin Hibbits [Sat, 6 Oct 2018 18:51:49 +0000 (18:51 +0000)]
powerpc/pseries: EOI interrupts in XICS by setting lowest priority

Discussing with Benjamin Herrenschmidt, OPAL_INT_GET_XIRR masks the
returned priority, so must be resumed before more interrupts can be
handled at this priority.  Since there are only two priorities used in
FreeBSD, we know that the previous priority in an EOI will always be
0xff (lowest priority).

Reviewed by: nwhitehorn
Approved by: re(rgrimes)
Differential Revision: https://reviews.freebsd.org/D17361

5 years agoRemove BUGS section from nscd.conf(5) man page. This was missed in r339194.
Edward Tomasz Napierala [Sat, 6 Oct 2018 17:40:14 +0000 (17:40 +0000)]
Remove BUGS section from nscd.conf(5) man page.  This was missed in r339194.

Approved by: re (rgrimes)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoopenssh: cherry-pick OpenSSL 1.1.1 compatibility
Ed Maste [Sat, 6 Oct 2018 14:38:34 +0000 (14:38 +0000)]
openssh: cherry-pick OpenSSL 1.1.1 compatibility

Compatibility with existing OpenSSL versions is maintained.

Upstream commits:
482d23bcac upstream: hold our collective noses and use the openssl-1.1.x
48f54b9d12 adapt -portable to OpenSSL 1.1x API
86e0a9f3d2 upstream: use only openssl-1.1.x API here too
a3fd8074e2 upstream: missed a bit of openssl-1.0.x API in this unittest
cce8cbe0ed Fix openssl-1.1 fallout for --without-openssl.

Trivial conflicts in sshkey.c and test_sshkey.c were resolved.

Connect libressl-api-compat.c to the build, and regenerate config.h

Reviewed by: des
Approved by: re (rgrimes)
MFC after: 2 seeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17444

5 years agopowerpc64/powernv: Don't mask MSIs in OPAL
Justin Hibbits [Sat, 6 Oct 2018 03:20:26 +0000 (03:20 +0000)]
powerpc64/powernv: Don't mask MSIs in OPAL

Summary:
Discussing with Benjamin Herrenschmidt, MSIs, and edge-triggered
interrupts in general, must not be masked in XICS and XIVE, else
subsequent interrupts may be ignored.

Testing locally on my Talos II (single CPU, 18-core POWER9), NVMe now
works with MSI, improving read throughput by ~70% (900MB/s -> 1.67GB/s,
with 64MB block size) over INTx interrupts, and snd_hda(4) now will
actually play music with MSI.  Previously, snd_hda(4) would not receive
interrupts, timing out, and declaring the channels dead.

This has also been tested by Kevin Bowling, and others, with great
success.  Kevin reported NVMe unusable on his Talos II prior to this
patch.

Reviewed by: nwhitehorn, kbowling
Approved by: re(rgrimes)
Differential Revision: https://reviews.freebsd.org/D17356

5 years agoFix the test prohibiting jails from sharing IP addresses.
Jamie Gritton [Sat, 6 Oct 2018 02:10:32 +0000 (02:10 +0000)]
Fix the test prohibiting jails from sharing IP addresses.

It's not supposed to be legal for two jails to contain the same IP address,
unless both jails contain only that one address.  This is the behavior
documented in jail(8), and is there to prevent confusion when multiple
jails are listening on IADDR_ANY.

VIMAGE jails (now the default for GENERIC kernels) test this correctly,
but non-VIMAGE jails have been performing an incomplete test when nested
jails are used.

Approved by: re@ (kib@)
MFC after: 5 days

5 years agoFix information about $firewall_myservices
Danilo G. Baio [Fri, 5 Oct 2018 20:35:43 +0000 (20:35 +0000)]
Fix information about $firewall_myservices

After r273201 it is supported "/{udp,tcp,proto}" suffix into
$firewall_myservices, and in the rc.conf the information is outdated.

Reviewed by: bcr, rgrimes
Approved by: re (gjb), doc (bcr), src (rgrimes)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17338

5 years agoFix igb corrupting checksums with BPF and VLAN
Stephen Hurd [Fri, 5 Oct 2018 20:16:20 +0000 (20:16 +0000)]
Fix igb corrupting checksums with BPF and VLAN

When using a vlan with igb and the vlanhwcsum option, any mbufs which
already had the TCP, UDP, or SCTP checksum calculated and therefore don't
have the CSUM_[IP|IP6]_[TCP|UDP|SCTP] bits set in the csum_flags field would
have the L4 checksum corrupted by the hardware.

This was caused by the driver setting E1000_TXD_POPTS_TXSM any time a
checksum bit was set OR a vlan tag was present.

The patched driver only sets E1000_TXD_POPTS_TXSM when an offload is
requested.

PR: 231416
Reported by: pi
Approved by: re (gjb)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D17404

5 years agoamd64: import updated kernel memset to libc
Mateusz Guzik [Fri, 5 Oct 2018 19:27:42 +0000 (19:27 +0000)]
amd64: import updated kernel memset to libc

See r339205 for details.

An unused ERMS support is retained in the macro. It will be activated
after ifunc support lands.

Reviewed by:    kib
Approved by:    re (gjb)
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17405

5 years agoamd64: make memset less slow with mov
Mateusz Guzik [Fri, 5 Oct 2018 19:25:09 +0000 (19:25 +0000)]
amd64: make memset less slow with mov

rep stos has a high startup time even on modern microarchitectures like
Skylake. Intel optimization manuals discuss how for small sizes it is
beneficial to go for streaming stores. Since those cannot be used without
extra penalty in the kernel I investigated performance impact of just
regular movs.

The patch below implements a very simple scheme: a 32-byte loop followed
by filling in the remainder of at most 31 bytes. It has a 256 breaking
point on which it falls back to rep stos. It provides a significant win
over the current primitive on several machines I tested (both Intel and
AMD). A 64-byte loop did not provide any benefit even for multiple of 64
sizes.

See the review for benchmark data.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17398

5 years agolualoader: Don't draw loader menu with autoboot_delay=-1
Kyle Evans [Fri, 5 Oct 2018 17:07:10 +0000 (17:07 +0000)]
lualoader: Don't draw loader menu with autoboot_delay=-1

This was mostly a cosmetic issue. autoboot_delay=-1 is documented to bypass
the loader menu and immediately execute the boot command, but lualoader
would draw the menu and immediately execute the boot command. No interaction
was possible with the menu.

The fix lifts autoboot_delay processing out of menu.autoboot, which now
takes a delay and does nothing if no delay is specified. This lines up with
my expectations of menu.autoboot's usage from a third party, which may
want more control over the process than the default behavior.

PR: 231610
Approved by: re (gjb)

5 years agoDocument signal handling in blacklistd(8).
Kurt Lidl [Fri, 5 Oct 2018 16:52:21 +0000 (16:52 +0000)]
Document signal handling in blacklistd(8).

Reviewed by: bcr@, 0mp@
Approved by: re (gjb@)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17423

5 years agoAdd sysctls for dbuf metadata cache variables added in r336959.
Alexander Motin [Fri, 5 Oct 2018 16:05:59 +0000 (16:05 +0000)]
Add sysctls for dbuf metadata cache variables added in r336959.

Approved by: re (gjb)
MFC after: 1 week

5 years agoConvert UDP length to host byte order
Tom Jones [Fri, 5 Oct 2018 12:51:30 +0000 (12:51 +0000)]
Convert UDP length to host byte order

When getting the number of bytes to checksum make sure to convert the UDP
length to host byte order when the entire header is not in the first mbuf.

Reviewed by: jtl, tuexen, ae
Approved by: re (gjb), jtl (mentor)
Differential Revision:  https://reviews.freebsd.org/D17357

5 years agoRemove the BUGS section of nscd(8) man page. According to bushman@'s
Edward Tomasz Napierala [Fri, 5 Oct 2018 12:08:32 +0000 (12:08 +0000)]
Remove the BUGS section of nscd(8) man page.  According to bushman@'s
reponse quoted in PR, he no longer maintains it.

PR: 210590
Approved by: re (kib)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agobsdinstall(8): Fix a typo.
Mateusz Piotrowski [Fri, 5 Oct 2018 08:17:29 +0000 (08:17 +0000)]
bsdinstall(8): Fix a typo.

Reported by: Jose Luis Duran
Reviewed by: bcr
Approved by: re (gjb), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17409

5 years agoMODULE_PNP_INFO(9): Fix a grammar mistake.
Mateusz Piotrowski [Fri, 5 Oct 2018 08:00:45 +0000 (08:00 +0000)]
MODULE_PNP_INFO(9): Fix a grammar mistake.

Reported by: ak
Reviewed by: imp, Yuri Pankov <yuripv@yuripv.net>
Approved by: re (gjb), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17403

5 years agohwpmc: Refactor sample ring buffer handling to fix races
Matt Macy [Fri, 5 Oct 2018 05:55:56 +0000 (05:55 +0000)]
hwpmc: Refactor sample ring buffer handling to fix races

Refactor sample ring buffer ring handling to make it more robust to
long running callchain collection handling

r338112 introduced a (now fixed) regression that exposed a number of race
conditions within the management of the sample buffers. This
simplifies the handling and moves the decision to overwrite a
callchain sample that has taken too long out of the NMI in to the
hardlock handler. With this change the problem no longer shows up as a
ring corruption but as the code spending all of its time in callchain
collection.

- Makes the producer / consumer index incrementing monotonic, making it
  easier (for me at least) to reason about.
- Moves the decision to overwrite a sample from NMI context to interrupt
  context where we can enforce serialization.
- Puts a time limit on waiting to collect a user callchain - putting a
  bound on head-of-line blocking causing samples to be dropped
- Removes the flush routine which was previously needed to purge
  dangling references to the pmc from the sample buffers but now is only
  a source of a race condition on unload.

Previously one could lock up or crash HEAD by running:
pmcstat -S inst_retired.any_p -T and then hitting ^C

After this change it is no longer possible.

PR: 231793
Reviewed by: markj@
Approved by: re (gjb@)
Differential Revision: https://reviews.freebsd.org/D17011

5 years agoeliminate locking surrounding ui_vmsize and swap reserve by using atomics
Matt Macy [Fri, 5 Oct 2018 05:50:56 +0000 (05:50 +0000)]
eliminate locking surrounding ui_vmsize and swap reserve by using atomics

Change swap_reserve and swap_total to be in units of pages so that
swap reservations can be done using only atomics instead of using a single
global mutex for swap_reserve and a single mutex for all processes running
under the same uid for uid accounting.

Results in mmap speed up and a 70% increase in brk calls / second.

Reviewed by: alc@, markj@, kib@
Approved by: re (delphij@)
Differential Revision: https://reviews.freebsd.org/D16273

5 years agoRevert r339174: Move 32-bit compat support for FIODGNAME to the right place.
Brooks Davis [Thu, 4 Oct 2018 23:55:03 +0000 (23:55 +0000)]
Revert r339174: Move 32-bit compat support for FIODGNAME to the right place.

A case was missed in this commit which breaks sshing into a 32-bit sshd
on a 64-bit system.

Approved by: re (gjb)

5 years agoHold a write lock across udp_notify()
Ryan Stone [Thu, 4 Oct 2018 22:03:58 +0000 (22:03 +0000)]
Hold a write lock across udp_notify()

With the new route cache feature udp_notify() will modify the inp when it
needs to invalidate the route cache.  Ensure that we hold a write lock on
the inp before calling the function to ensure that multiple threads don't
race while trying to invalidate the cache (which previously lead to a page
fault).

Differential Revision: https://reviews.freebsd.org/D17246
Reviewed by: sbruno, bz, karels
Sponsored by: Dell EMC Isilon
Approved by: re (gjb)

5 years agoReduce NL_ARGMAX to 4096 to match Linux.
Brooks Davis [Thu, 4 Oct 2018 21:55:58 +0000 (21:55 +0000)]
Reduce NL_ARGMAX to 4096 to match Linux.

NL_ARGMAX is the maximum number of positional arguments supported by
printf(3). Prior to r308145 it was declared as 99 and not enforced.
r308145 added enforcement and increased the value to 64k.

Unfortunately, development versions of PostgreSQL used the system
definition to allocate and zero an NL_ARGMAX * 4 sized array on the
stack of its snprintf implementation with measurable performance
impacts. This has been fixed in new PostgreSQL versions, but it is
possible that other programs suffer from this problem.

A value of 4096 puts us on par with Linux and is certainly large enough
for any reasonable program.

Reviewed by: mjg
Reported by: mjg
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D17387
Differential revision: https://reviews.freebsd.org/D8286

5 years agoamd64: hide non-erms jump label under non-erms copyin/copyout
Mateusz Guzik [Thu, 4 Oct 2018 20:01:48 +0000 (20:01 +0000)]
amd64: hide non-erms jump label under non-erms copyin/copyout

This change is a no-op in terms of semantics, but has a side effect
of removing a perfectly useless nop sled for CPUs with ERMS.

Approved by: re (gjb)
Sponsored by:   The FreeBSD Foundation

5 years ago[ig4] style(9) clean-up
Oleksandr Tymoshenko [Thu, 4 Oct 2018 19:54:47 +0000 (19:54 +0000)]
[ig4] style(9) clean-up

Submitted by: Rajesh Kumar <rajfbsd@gmail.com>
Approved by: re (gjb, kib)

5 years agocrt: switch to standard note type definitions from elf_common.h
Ed Maste [Thu, 4 Oct 2018 17:35:32 +0000 (17:35 +0000)]
crt: switch to standard note type definitions from elf_common.h

This makes it easier to grep the source tree for these notes, and
ensures that they will remain in sync.

Reviewed by: kib
Approved by: re (gjb)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17408

5 years agobsdinstall(8): Document ZFS installation scripting.
Mateusz Piotrowski [Thu, 4 Oct 2018 09:28:40 +0000 (09:28 +0000)]
bsdinstall(8): Document ZFS installation scripting.

- Extend the bsdinstall(8) man page with ZFS installation scripting
  details. [1]
- Extend the bsdinstall(8) man page with the description of all the ZFS
  variables involved in a scripted installation of ZFS-based systems. [1]
- Extend the SCRIPTING section with an example for a ZFS-based scripted
  installation. [1]
- Create a new section explaining how ZFS datasets must be written into
  a variable to get them set on the final system. [1]

While here:
- Add Roberto to the copyrights for recognition as changes to the manual
  page are huge.
- Use "Dq" for default values.
- Use sysrc(8) instead of echo in examples.

Submitted by: Roberto Fernandez Cueto <roberfern@gmail.com> [1]
Reviewed by: dteske
Approved by: re (gjb), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D14169

5 years agoRemove invalid comments and correct some typos.
Pawel Jakub Dawidek [Thu, 4 Oct 2018 05:57:27 +0000 (05:57 +0000)]
Remove invalid comments and correct some typos.

Approved by: re (kib)

5 years agoWhen the adist_free list is empty and we lose connection to the receiver we
Pawel Jakub Dawidek [Thu, 4 Oct 2018 05:54:57 +0000 (05:54 +0000)]
When the adist_free list is empty and we lose connection to the receiver we
move all elements from the adist_send and adist_recv lists back onto the
adist_free list, but we don't wake consumers waitings for the adist_free list
to become non-empty. This can lead to the sender process stopping audit trail
files distribution and waiting forever.

Fix the problem by adding the missing wakeup.

While here slow down spinning on CPU in case of a short race in
sender_disconnect() and add an explaination when it can occur.

PR: 201953
Reported by: peter
Approved by: re (kib)

5 years agoWhen we look for a new trail file there might be a race between find trail
Pawel Jakub Dawidek [Thu, 4 Oct 2018 05:48:09 +0000 (05:48 +0000)]
When we look for a new trail file there might be a race between find trail
file name and opening it. This race was not properly handled, because we were
copying new name before checking for openat(2) error and when we were trying
again we were starting with the next trail file. This could result in skipping
distribution of such a trail file.

Fix this problem by checking for ENOENT first (only for .not_terminated files)
and then updating (or not) tr_filename before restarting the search.

PR: 200139
Reported by: peter
Approved by: re (kib)

5 years agoFix the hardware.{txt,html} build in the release/Makefile 'reldoc'
Glen Barber [Thu, 4 Oct 2018 01:46:56 +0000 (01:46 +0000)]
Fix the hardware.{txt,html} build in the release/Makefile 'reldoc'
target.

The doc/share/mk/doc.commands.mk sets SVN to /usr/local/bin/svn
by default, which is not necessarily installed by the documentation
project textproc/docproj port.

Ensure SVN can be evaluated properly to include the hardware pages
by iterating through /usr/local/bin and /usr/bin and looking for
both svn and svnlite binaries, and pass the SVN variable explicitly
through env(1) in the reldoc target to avoid failures if it does not
exist.

Approved by: re (rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agoMove 32-bit compat support for FIODGNAME to the right place.
Brooks Davis [Wed, 3 Oct 2018 20:39:48 +0000 (20:39 +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.

Reviewed by: kib
Approved by: re (rgrimes, gjb)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Review: https://reviews.freebsd.org/D17388

5 years agoSet the default loader for powerpc64 back to to forth too.
Andreas Tobler [Wed, 3 Oct 2018 19:09:09 +0000 (19:09 +0000)]
Set the default loader for powerpc64 back to to forth too.
The commit from r338893 covered only the powerpc build.

Approved by: re (kib)

5 years agoIn PR 227259, a user is reporting that they have code which is using
Gleb Smirnoff [Wed, 3 Oct 2018 17:40:04 +0000 (17:40 +0000)]
In PR 227259, a user is reporting that they have code which is using
shutdown() to wakeup another thread blocked on a stream listen socket.
This code is failing, while it used to work on FreeBSD 10 and still
works on Linux.

It seems reasonable to add another exception to support something users are
actually doing, which used to work on FreeBSD 10, and still works on Linux.
And, it seems like it should be acceptable to POSIX, as we still return
ENOTCONN.

This patch is different to what had been committed to stable/11, since
code around listening sockets is different. Patch in D15019 is written
by jtl@, slightly modified by me.

PR: 227259
Obtained from: jtl
Approved by: re (kib)
Differential Revision:  D15019

5 years agoopenssh: cherry-pick OpenSSL 1.1.1 compatibility
Ed Maste [Wed, 3 Oct 2018 16:11:13 +0000 (16:11 +0000)]
openssh: cherry-pick OpenSSL 1.1.1 compatibility

Upstream commits:
482d23bcac upstream: hold our collective noses and use the openssl-1.1.x
48f54b9d12 adapt -portable to OpenSSL 1.1x API
86e0a9f3d2 upstream: use only openssl-1.1.x API here too
a3fd8074e2 upstream: missed a bit of openssl-1.0.x API in this unittest
cce8cbe0ed Fix openssl-1.1 fallout for --without-openssl.

Trivial conflicts in sshkey.c and test_sshkey.c were resolved.

Discussed with: des

5 years agoFix an inverted test in ucode_load_ap().
Mark Johnston [Wed, 3 Oct 2018 14:20:43 +0000 (14:20 +0000)]
Fix an inverted test in ucode_load_ap().

This caused microcode to be updated only on the BSP if hyperthreading
was disabled, typically resulting in a hang or reset.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoUse strlcpy() instead of strncpy().
Michael Tuexen [Wed, 3 Oct 2018 07:35:16 +0000 (07:35 +0000)]
Use strlcpy() instead of strncpy().

Approved by:            re (kib@)
CID: 13959801395981
X-MFC with: r339012
MFC after:              1 week

5 years agoMove 32-bit compat support for CDIOREADTOCENTRYS to the right place.
Brooks Davis [Tue, 2 Oct 2018 23:23:56 +0000 (23:23 +0000)]
Move 32-bit compat support for CDIOREADTOCENTRYS 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 members which require no translation.

Reviewed by: kib (prior version), jhb
Approved by: re (rgrimes)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Review: https://reviews.freebsd.org/D17378

5 years agoUse nda(4) on powerpc64
Kevin Bowling [Tue, 2 Oct 2018 21:36:00 +0000 (21:36 +0000)]
Use nda(4) on powerpc64

Approved by: re@ (kib), krion (mentor), imp
Differential Revision: https://reviews.freebsd.org/D17368

5 years agoAfter r338257 is was possible to trigger a KASSERT() in ud6_output()
Bjoern A. Zeeb [Tue, 2 Oct 2018 17:29:56 +0000 (17:29 +0000)]
After r338257 is was possible to trigger a KASSERT() in ud6_output()
using an application trying to use a v4mapped destination address on a
kernel without INET support or on a v6only socket.
Catch this case and prevent the packet from going anywhere;
else, without the KASSERT() armed, a v4mapped destination
address might go out on the wire or other undefined behaviour
might happen, while with the KASSERT() we panic.

PR: 231728
Reported by: Jeremy Faulkner (gldisater gmail.com)
Approved by: re (kib)

5 years agoMODULE_PNP_INFO(9): Add example of T usage.
Mateusz Piotrowski [Tue, 2 Oct 2018 17:01:42 +0000 (17:01 +0000)]
MODULE_PNP_INFO(9): Add example of T usage.

Provide an example of specifying a common vendor value as the documentation
is not clear enough at the moment.

While here, add 'D:#' to the previous example to eat the remaining
description string.

Also, pet mandoc a bit.

Submitted by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: cem, imp
Approved by: re (kib), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17321

5 years agoRework the logic around quick checks for auditing that take place at
Robert Watson [Tue, 2 Oct 2018 15:58:17 +0000 (15:58 +0000)]
Rework the logic around quick checks for auditing that take place at
system-call entry and whenever audit arguments or return values are
captured:

1. Expose a single global, audit_syscalls_enabled, which controls
   whether the audit framework is entered, rather than exposing
   components of the policy -- e.g., if the trail is enabled,
   suspended, etc.

2. Introduce a new function audit_syscalls_enabled_update(), which is
   called to update audit_syscalls_enabled whenever an aspect of the
   policy changes, so that the value can be updated.

3. Remove a check of trail enablement/suspension from audit_new() --
   at the point where this function has been entered, we believe that
   system-call auditing is already in force, or we wouldn't get here,
   so simply proceed to more expensive policy checks.

4. Use an audit-provided global, audit_dtrace_enabled, rather than a
   dtaudit-provided global, to provide policy indicating whether
   dtaudit would like system calls to be audited.

5. Do some minor cosmetic renaming to clarify what various variables
   are for.

These changes collectively arrange it so that traditional audit
(trail, pipes) or the DTrace audit provider can enable system-call
probes without the other configured.  Otherwise, dtaudit cannot
capture system-call data without auditd(8) started.

Reviewed by: gnn
Sponsored by: DARPA, AFRL
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17348

5 years agolibelf: correct mips64el test to use ELF header
Ed Maste [Tue, 2 Oct 2018 15:08:41 +0000 (15:08 +0000)]
libelf: correct mips64el test to use ELF header

libelf maintains two views of endianness: e_byteorder, and
e_ident[EI_DATA] in the ELF header itself.  e_byteorder is not always
kept in sync, so use the ELF header endianness to test for mips64el.

PR: 231790
Bisected by: sbruno
Reviewed by: jhb
Approved by: re (kib)
MFC with: r338478
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17380

5 years agoAdd missing newline in pwarn message.
Kirk McKusick [Tue, 2 Oct 2018 13:45:25 +0000 (13:45 +0000)]
Add missing newline in pwarn message.

Reported by: Mark Millard <marklmi@yahoo.com>
Approved by: re (kib)

5 years agotop(1): Rework DESCRIPTION OF MEMORY section.
Mateusz Piotrowski [Tue, 2 Oct 2018 08:13:54 +0000 (08:13 +0000)]
top(1): Rework DESCRIPTION OF MEMORY section.

Due to markup issues, the DESCRIPTION OF MEMORY section is rather
unreadable; rework it a bit, using subsections for different lines of the
top output, and move it closer to description.

While here, pet manlint ordering other sections as expected.

Submitted by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: eadler
Approved by: re (gjb), krion (mentor)
Differential Revision: https://reviews.freebsd.org/D17369

5 years agoMake sendmail work with OpenSSL 1.1 API. Taken from the ports tree.
Jung-uk Kim [Mon, 1 Oct 2018 20:55:01 +0000 (20:55 +0000)]
Make sendmail work with OpenSSL 1.1 API.  Taken from the ports tree.

https://svnweb.freebsd.org/ports/head/mail/sendmail/files/patch-tls.c?revision=466240

Requested by: gshapiro

5 years agoRevert r338773. A patch from the ports tree will be committed.
Jung-uk Kim [Mon, 1 Oct 2018 20:51:26 +0000 (20:51 +0000)]
Revert r338773.  A patch from the ports tree will be committed.

Requested by: gshapiro

5 years agoamd64: reimplement libc memset and bzero with kernel memset
Mateusz Guzik [Mon, 1 Oct 2018 20:39:17 +0000 (20:39 +0000)]
amd64: reimplement libc memset and bzero with kernel memset

This is a depessimization, see r334537 for an explanation. Routines
remain significantly slower than they have to be.

bzero was removed from the kernel but remains in libc. Macroify to
accommodate differences to memset (no return value, always setting to 0).

The bzero.S file is left in place due to libc build magic which pulls in
a C variant if a matching .S file is missing.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17355

5 years agoFix a da(4) driver memory leak for SCSI SMR devices.
Kenneth D. Merry [Mon, 1 Oct 2018 19:00:46 +0000 (19:00 +0000)]
Fix a da(4) driver memory leak for SCSI SMR devices.

In the probe case for SCSI SMR Host Aware or Most Managed drives, be sure
to free allocated memory.

sys/cam/scsi/scsi_da.c:
In dadone_probezone(), free the data pointer before returning.

MFC after: 3 days
Sponsored by: Spectra Logic
Approved by: re (kib)

5 years agoUse an unsigned iterator for domain sets.
Mark Johnston [Mon, 1 Oct 2018 18:51:39 +0000 (18:51 +0000)]
Use an unsigned iterator for domain sets.

Otherwise (iter % ds->ds_cnt) is not guaranteed to lie in the range
[0, MAXMEMDOM).

Reported by: pho
Reviewed by: kib
Approved by: re (rgrimes)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17374

5 years agoAdd kernel ifunc support on arm64.
Andrew Turner [Mon, 1 Oct 2018 18:51:08 +0000 (18:51 +0000)]
Add kernel ifunc support on arm64.

Tested with ifunc resolvers in the kernel and module with calls from
kernel to kernel, module to kernel, and module to module.

Reviewed by: kib (previous version)
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17370

5 years agoApply r339046 to i386.
Mark Johnston [Mon, 1 Oct 2018 18:48:33 +0000 (18:48 +0000)]
Apply r339046 to i386.

Belatedly add a comment to the amd64 pmap explaining why we initialize
the kernel pmap's resident page count.

Reviewed by: alc, kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17377

5 years agoThis commit reverts 338930. The approach was wrong.
Andreas Tobler [Mon, 1 Oct 2018 18:46:35 +0000 (18:46 +0000)]
This commit reverts 338930. The approach was wrong.

Fix the issue with subtracting the TLS_TCB_SIZE too when we are trying to get
the 'where' in the R_PPC_TPREL32 case. At allocation time we added an offset
and the TLS_TCB_SIZE. This has to be subtracted as well.

Now all the issues reported are fixed. Tests were done on G4 and G5 PowerMac's.
Additionally I ran the tls tests from the gcc test suite and made sure the
results are as good as pre 338486.

Thanks to tuexen for reporting the malfunction and for patient testing.
Also testing thanks goes to jhibbits.

Reported by: tuexen
Discussed with: jhibbits, nwhitehorn
Approved by: re (gjb)
Pointyhat to: andreast

5 years agoRemove references to the "new" NFS clients and servers. The "old"
Edward Tomasz Napierala [Mon, 1 Oct 2018 18:26:41 +0000 (18:26 +0000)]
Remove references to the "new" NFS clients and servers.  The "old"
NFS stack is long gone.

Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoDrop pre-AVX toolchain for amd64 and i386 to simplify the makefile.
Jung-uk Kim [Mon, 1 Oct 2018 18:16:36 +0000 (18:16 +0000)]
Drop pre-AVX toolchain for amd64 and i386 to simplify the makefile.

Especially, head does not support old toolchains because of ifunc support.

5 years agoFix build with GCC 8.1.
Ruslan Bukin [Mon, 1 Oct 2018 16:16:05 +0000 (16:16 +0000)]
Fix build with GCC 8.1.

GCC 8.1 failed to build LLVM's libc++ when -Wshadow is set,
so lower down WARNS flag to 3.

This is similar to dtc(1) which uses libc++ and sets WARNS to 3.

Approved by: re (gjb)
Sponsored by: DARPA, AFRL

5 years agolibbe(3): Fix BE activation promoting activated BE
Kyle Evans [Mon, 1 Oct 2018 14:57:33 +0000 (14:57 +0000)]
libbe(3): Fix BE activation promoting activated BE

This allows older BEs to be destroyed as they become replaced by a BE
created from them: e.g.

bectl create -e brokenworld fixedworld
bectl activate fixedworld
bectl destroy brokenworld

Submitted by: Shawn Webb
Approved by: re (gjb)
Obtained from: HardenedBSD (5948c0581e)

5 years agoCount bootstrap data as resident in the kernel pmap.
Mark Johnston [Mon, 1 Oct 2018 14:47:49 +0000 (14:47 +0000)]
Count bootstrap data as resident in the kernel pmap.

Such data may later be unmapped.  This occurs, for example, when a
loader-provided microcode update file is discarded.

Reviewed by: alc, kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17340

5 years agoarm64: Raise again L3 table for early devmap
Emmanuel Vadot [Mon, 1 Oct 2018 14:27:53 +0000 (14:27 +0000)]
arm64: Raise again L3 table for early devmap

The initial raise in r336519 wasn't enough for using big resolution
(1920 x 1200 for example). Raise it again.

Reported by: bob prohaska <fbsd@www.zefox.net>
Tested by: bob prohaska <fbsd@www.zefox.net>
Approved by: re (gjb@)

5 years agoAllow empty NUMA memory domains to support Threadripper2
Andrew Gallatin [Mon, 1 Oct 2018 14:14:21 +0000 (14:14 +0000)]
Allow empty NUMA memory domains to support Threadripper2

The AMD Threadripper 2990WX is basically a slightly crippled Epyc.
Rather than having 4 memory controllers, one per NUMA domain, it has
only 2  memory controllers enabled. This means that only 2 of the
4 NUMA domains can be populated with physical memory, and the
others are empty.

Add support to FreeBSD for empty NUMA domains by:

- creating empty memory domains when parsing the SRAT table,
    rather than failing to parse the table
- not running the pageout deamon threads in empty domains
- adding defensive code to UMA to avoid allocating from empty domains
- adding defensive code to cpuset to avoid binding to an empty domain
    Thanks to Jeff for suggesting this strategy.

Reviewed by: alc, markj
Approved by: re (gjb@)
Differential Revision: https://reviews.freebsd.org/D1683

5 years agoMitigate providing a timing signal if the COOKIE or AUTH
Michael Tuexen [Mon, 1 Oct 2018 14:05:31 +0000 (14:05 +0000)]
Mitigate providing a timing signal if the COOKIE or AUTH
validation fails.
Thanks to jmg@ for reporting the issue, which was discussed in
https://admbugs.freebsd.org/show_bug.cgi?id=878

Approved by:            re (TBD@)
MFC after:              1 week

5 years agoAdd STT_GNU_IFUNC and R_AARCH64_IRELATIVE support on arm64.
Andrew Turner [Mon, 1 Oct 2018 14:02:29 +0000 (14:02 +0000)]
Add STT_GNU_IFUNC and R_AARCH64_IRELATIVE support on arm64.

This is based on the amd64 implementation. Support for both PLT and
non-PLT (e.g. a global variable initilised with a pointer to an ifunc)
cases are supported.

We don't pass anything to the resolver as it is expected they will read
the ID registers directly, with the number of registers with CPU info
likely to increase in the future.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17341

5 years agoAfter allocating chunks set the fields in a consistent way.
Michael Tuexen [Mon, 1 Oct 2018 13:09:18 +0000 (13:09 +0000)]
After allocating chunks set the fields in a consistent way.
This removes two assignments for the flags field being done
twice and adds one, which was missing.
Thanks to Felix Weinrank for reporting the issue he found
by using fuzz testing of the userland stack.

Approved by:            re (kib@)
MFC after:              1 week

5 years agoAdd INP_INFO_WUNLOCK_ASSERT() macro and use it instead of
Andrey V. Elsukov [Mon, 1 Oct 2018 10:46:00 +0000 (10:46 +0000)]
Add INP_INFO_WUNLOCK_ASSERT() macro and use it instead of
INP_INFO_UNLOCK_ASSERT() in TCP-related code. For encapsulated traffic
it is possible, that the code is running in net_epoch_preempt section,
and INP_INFO_UNLOCK_ASSERT() is very strict assertion for such case.

PR: 231428
Reviewed by: mmacy, tuexen
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17335

5 years agoFix the MODULE_PNP_INFO() for iwm(4) where I got the bus and module
Bjoern A. Zeeb [Mon, 1 Oct 2018 10:44:33 +0000 (10:44 +0000)]
Fix the MODULE_PNP_INFO() for iwm(4) where I got the bus and module
arguments wrong in r339020.

PR: 231625
Reported by: Yuri Pankov (yuripv yuripv.net)
Reviewed by: cem, Yuri Pankov (yuripv yuripv.net)
Approved by: re (kib)
Pointyhat to: bz (a rather big one for this one)

5 years agoPlug mbuf leak in the SCTP input path in an error case.
Michael Tuexen [Sun, 30 Sep 2018 21:54:02 +0000 (21:54 +0000)]
Plug mbuf leak in the SCTP input path in an error case.

Approved by:            re (kib@)
MFC after:              1 week
CID: 749312

5 years agoPlug mbuf leaks in the SCTP output path in error cases.
Michael Tuexen [Sun, 30 Sep 2018 21:31:33 +0000 (21:31 +0000)]
Plug mbuf leaks in the SCTP output path in error cases.

Approved by:            re (kib@)
MFC after:              1 week
CID: 1395307

5 years agoUse PNP metadata to allow devmatch to autoload ure(4)
Allan Jude [Sun, 30 Sep 2018 21:23:31 +0000 (21:23 +0000)]
Use PNP metadata to allow devmatch to autoload ure(4)

Reviewed by: manu imp
Approved by: re (kib)
X-MFC-with: devmatch
Sponsored by: Klara Systems

5 years agoUpdate x86/ifunc.h.
Konstantin Belousov [Sun, 30 Sep 2018 16:57:30 +0000 (16:57 +0000)]
Update x86/ifunc.h.

Remove ifunc emulation.
Add helper for usermode ifunc resolver definition.
Update copyright years.

Sponsored by: The FreeBSD Foundation
Approved by: re (rgrimes)
MFC after: 1 week

5 years agoFix the handling of ancillary data for SCTP socket. Implement
Michael Tuexen [Sun, 30 Sep 2018 16:21:31 +0000 (16:21 +0000)]
Fix the handling of ancillary data for SCTP socket. Implement
sctp_process_cmsgs_for_init() and sctp_findassociation_cmsgs()
similar to sctp_find_cmsg() to improve consistency and avoid
the signed/unsigned issues in sctp_process_cmsgs_for_init()
and sctp_findassociation_cmsgs().

Thanks to andrew@ for reporting the problem he found using
syzcaller.

Approved by:            re (kib@)
MFC after:              1 week

5 years agoIncrement the corresponding UDP stats counter (udps_opackets) when
Michael Tuexen [Sun, 30 Sep 2018 12:16:06 +0000 (12:16 +0000)]
Increment the corresponding UDP stats counter (udps_opackets) when
sending UDP encapsulated SCTP packets.
This is consistent with the behaviour that when such packets are received,
the corresponding UDP stats counter (udps_ipackets) is incremented.
Thanks to Peter Lei for making me aware of this inconsistency.

Approved by:            re (kib@)
MFC after:              1 week

5 years agoProvide MODULE_PNP_INFO() for iwm(4) so that devmatch(8) can
Bjoern A. Zeeb [Sat, 29 Sep 2018 21:14:54 +0000 (21:14 +0000)]
Provide MODULE_PNP_INFO() for iwm(4) so that devmatch(8) can
do its job.

PR: 231625
Submitted by: Yuri Pankov (yuripv yuripv.net)
Approved by: re (kib)

5 years agoclang: allow ifunc resolvers to accept arguments
Ed Maste [Sat, 29 Sep 2018 20:01:23 +0000 (20:01 +0000)]
clang: allow ifunc resolvers to accept arguments

Previously Clang required ifunc resolution functions to take no
arguments, presumably because GCC documented ifunc resolvers as taking
no arguments.  However, GCC accepts resolvers accepting arguments, and
our rtld passes CPU ID information (cpuid, hwcap, etc.) to ifunc
resolvers.  Just remove the check from the in-tree compiler for our in-
tree compiler; a different (per-OS) approach may be required upstream.

Reported by: mjg
Approved by: re (rgrimes)
MFC after: 1 week
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

5 years agoFix UP build.
Konstantin Belousov [Sat, 29 Sep 2018 16:17:35 +0000 (16:17 +0000)]
Fix UP build.

Reported by: tijl
Sponsored by: The FreeBSD Foundation
Approved by: re (rgrimes)

5 years agoPull in r329557 from upstream lld trunk (by George Rimar):
Dimitry Andric [Sat, 29 Sep 2018 14:12:03 +0000 (14:12 +0000)]
Pull in r329557 from upstream lld trunk (by George Rimar):

  [ELF] - Allow LLD to produce file symbols.

  This is for PR36716 and
  this enables emitting STT_FILE symbols.

  Output size affect is minor:
  lld binary size changes from 52,883,408 to 52,949,400
  clang binary size changes from 83,136,456 to 83,219,600

  Differential revision: https://reviews.llvm.org/D45261

This fixes a regression in lld that made it stop emitting STT_FILE
symbols, which ctfmerge relies upon to uniquify function table entries
that reference STB_LOCAL symbols.  Consequently, ctfmerge stopped
emitting entries for static functions into the function table, and
dtrace no longer gets type info for them.

Approved by: re (kib)
Reported by: markj
PR: 230444
MFC after: 3 days

5 years agoFor changing the MTU on tun/tap devices, it should not matter whether it
Michael Tuexen [Sat, 29 Sep 2018 13:01:23 +0000 (13:01 +0000)]
For changing the MTU on tun/tap devices, it should not matter whether it
is done via using ifconfig, which uses a SIOCSIFMTU ioctl() command, or
doing it using a TUNSIFINFO/TAPSIFINFO ioctl() command.
Without this patch, for IPv6 the new MTU is not used when creating routes.
Especially, when initiating TCP connections after increasing the MTU,
the old MTU is still used to compute the MSS.
Thanks to ae@ and bz@ for helping to improve the patch.

Reviewed by: ae@, bz@
Approved by: re (kib@)
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D17180

5 years agoamd64: remove unnecessary cld from libc memcpy/bcopy
Mateusz Guzik [Sat, 29 Sep 2018 07:40:52 +0000 (07:40 +0000)]
amd64: remove unnecessary cld from libc memcpy/bcopy

The ABI specifies the direction forward on function call, making
the cld instruction redundant.

Approved by: re (kib)

5 years agoAvoid panic when adjusting priority of a read in the face of an IO error
Allan Jude [Sat, 29 Sep 2018 01:26:07 +0000 (01:26 +0000)]
Avoid panic when adjusting priority of a read in the face of an IO error

PR: 231516
Reported by: sbruno
Approved by: re (rgrimes)
Obtained from: ZFS-on-Linux
X-MFC-with: 334844
Sponsored by: Klara Systems

MFV/ZoL: Fix zio->io_priority failed (7 < 6) assert

commit c26cf0966d131b722c32f8ccecfe5791a789d975
Author: Tony Hutter <hutter2@llnl.gov>
Date:   Tue May 29 18:13:48 2018 -0700

  Fix zio->io_priority failed (7 < 6) assert

  This fixes an assert in vdev_queue_change_io_priority():

    VERIFY3(zio->io_priority < ZIO_PRIORITY_NUM_QUEUEABLE) failed (7 < 6)
    PANIC at vdev_queue.c:832:vdev_queue_change_io_priority()

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>