]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r340325
Vincenzo Maffione [Mon, 19 Nov 2018 08:55:26 +0000 (08:55 +0000)]
MFC r340325

netmap: pkt-gen: several updates from upstream

Various improvements to the netmap pkt-gen program:

 - indentation fixes
 - support for IPV6
 - fixes to checksum computation
 - support for NS_MOREFRAG
 - rate limiting in ping mode

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

5 years agoMFC r340279
Vincenzo Maffione [Mon, 19 Nov 2018 08:53:52 +0000 (08:53 +0000)]
MFC r340279

netmap: add load balancer program

Add the lb program, which is able to load-balance input traffic
received from a netmap port over M groups, with N netmap pipes in
each group. Each received packet is forwarded to one of the pipes
chosen from each group (using an L3/L4 connection-consistent hash function).
This also adds a man page for lb and some cross-references in related
man pages.

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

5 years agoMFC r339472: rc.initdiskless: fix commentary grammar after r339465
Eugene Grosbein [Mon, 19 Nov 2018 06:49:30 +0000 (06:49 +0000)]
MFC r339472: rc.initdiskless: fix commentary grammar after r339465

5 years agoMFC r339465: rc.initdiskless: add support for auxiliary NVRAM.
Eugene Grosbein [Mon, 19 Nov 2018 06:33:38 +0000 (06:33 +0000)]
MFC r339465: rc.initdiskless: add support for auxiliary NVRAM.

  Currently, rc.inidiskless assumes that local system configuration
  changes are kept in some mountable file system. For example,
  nanobsd uses dedicated partition mounted as /cfg for this.

  However, small embedded devices like MIPS routers may have no enough flash
  space to keep full-blown file system but have only one or couple
  small flash blocks to keep persistent local configuration overrides.

  This change extends rc.initdiskless and introduces ability to run auxiliary
  command /conf/T/M/extract that is supposed to extract configuration overrides
  from such local storage.

  For example, the command /conf/default/etc/extract may contain something like:

  cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg

  bsdcpio command extracts compressed archive from the storage to /etc
  assuming the storage is exposed by the kernel as /dev/map/cfg to userland.

PR: 204215

5 years agoMFC r339898:
Konstantin Belousov [Mon, 19 Nov 2018 05:56:46 +0000 (05:56 +0000)]
MFC r339898:
Convert amd64_get/set_fs/gsbase to ifunc.

5 years agoMFC r340383:
Konstantin Belousov [Mon, 19 Nov 2018 05:47:31 +0000 (05:47 +0000)]
MFC r340383:
Create namespace for the symbols added during 13-CURRENT cycle.

5 years agoMFC r339895:
Konstantin Belousov [Mon, 19 Nov 2018 05:45:47 +0000 (05:45 +0000)]
MFC r339895:
amd64: Use ifuncs to select suitable implementation of set_pcb_flags().

5 years agoMFC r340487:
Konstantin Belousov [Mon, 19 Nov 2018 05:43:41 +0000 (05:43 +0000)]
MFC r340487:
Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068.

5 years agoMFC r340384:
Konstantin Belousov [Mon, 19 Nov 2018 05:42:00 +0000 (05:42 +0000)]
MFC r340384:
Apply fix to un-cripple max cpu id on BSP earlier.

5 years agoMFC r340364:
Konstantin Belousov [Mon, 19 Nov 2018 05:40:37 +0000 (05:40 +0000)]
MFC r340364:
Allow set ether/vlan PCP operation from the VNET jails.

5 years agoMFC: r339999
Rick Macklem [Mon, 19 Nov 2018 00:49:08 +0000 (00:49 +0000)]
MFC: r339999
Fix NFS client vnode locking to avoid a crash during forced dismount.

A crash was reported where the crash occurred in nfs_advlock() when the
NFS_ISV4(vp) macro was being executed. This was caused by the vnode
being VI_DOOMED due to a forced dismount in progress.
This patch fixes the problem by locking the vnode before executing the
NFS_ISV4() macro.

PR: 232673

5 years agoMFC r340171: capability.h: add comment about planned removal timeline
Ed Maste [Sun, 18 Nov 2018 14:58:01 +0000 (14:58 +0000)]
MFC r340171: capability.h: add comment about planned removal timeline

PR: 228878

5 years agoMFC r340299: Octeon SDK: avoid use of uninitialized variable
Ed Maste [Sun, 18 Nov 2018 14:56:08 +0000 (14:56 +0000)]
MFC r340299: Octeon SDK: avoid use of uninitialized variable

Reported by: Clang

5 years agoMFC r340288: nvi: remove superfluous space before ^\
Ed Maste [Sun, 18 Nov 2018 14:54:45 +0000 (14:54 +0000)]
MFC r340288: nvi: remove superfluous space before ^\

This fixes alignment in vi's 'viusage' command and has been fixed
upstream and in OpenBSD.

Submitted by: Raf Czlonka (github:rjc)

5 years agoMFC r340329: build(7): clarify buildenv target can be used for non-cross builds
Ed Maste [Sun, 18 Nov 2018 14:52:16 +0000 (14:52 +0000)]
MFC r340329: build(7): clarify buildenv target can be used for non-cross builds

make buildenv can be used for building for the same architecture as
the host (perhaps this is a degenerate case of cross-building).
TARGET and TARGET_ARCH do not need to be set in this case.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r340072:
Kristof Provost [Sun, 18 Nov 2018 13:03:49 +0000 (13:03 +0000)]
MFC r340072:

pfsync: Add missing unlock

If we fail to set up the multicast entry for pfsync and return an error
we must release the pfsync lock first.

Sponsored by: Orange Business Services

5 years agoMFC r340070:
Kristof Provost [Sun, 18 Nov 2018 12:59:09 +0000 (12:59 +0000)]
MFC r340070:

pfsync: Allow module to be unloaded

Sponsored by: Orange Business Services

5 years agoMFC r340069:
Kristof Provost [Sun, 18 Nov 2018 12:31:40 +0000 (12:31 +0000)]
MFC r340069:

pf tests: Basic pfsync test

Set up two jails, configure pfsync between them and create state in one
of them, verify that this state is copied to the other jail.

Sponsored by: Orange Business Services

5 years agoMFC r340068:
Kristof Provost [Sun, 18 Nov 2018 12:30:16 +0000 (12:30 +0000)]
MFC r340068:

pfsync: Handle syncdev going away

If the syncdev is removed we no longer need to clean up the multicast
entry we've got set up for that device.

Pass the ifnet detach event through pf to pfsync, and remove our
multicast handle, and mark us as no longer having a syncdev.

Note that this callback is always installed, even if the pfsync
interface is disabled (and thus it's not a per-vnet callback pointer).

Sponsored by: Orange Business Services

5 years agoMFC r340067:
Kristof Provost [Sun, 18 Nov 2018 12:09:26 +0000 (12:09 +0000)]
MFC r340067:

pfsync: Ensure uninit is done before pf

pfsync touches pf memory (for pf_state and the pfsync callback
pointers), not the other way around. We need to ensure that pfsync is
torn down before pf.

Sponsored by: Orange Business Services

5 years agoMFC r340066:
Kristof Provost [Sun, 18 Nov 2018 12:04:24 +0000 (12:04 +0000)]
MFC r340066:

Notify that the ifnet will go away, even on vnet shutdown

pf subscribes to ifnet_departure_event events, so it can clean up the
ifg_pf_kif and if_pf_kif pointers in the ifnet.
During vnet shutdown interfaces could go away without sending the event,
so pf ends up cleaning these up as part of its shutdown sequence, which
happens after the ifnet has already been freed.

Send the ifnet_departure_event during vnet shutdown, allowing pf to
clean up correctly.

Sponsored by: Orange Business Services

5 years agoMFC r340065:
Kristof Provost [Sun, 18 Nov 2018 11:55:56 +0000 (11:55 +0000)]
MFC r340065:

pfsync: Make pfsync callbacks per-vnet

The callbacks are installed and removed depending on the state of the
pfsync device, which is per-vnet. The callbacks must also be per-vnet.

Sponsored by: Orange Business Services

5 years agoMFC r339676:
Kristof Provost [Sun, 18 Nov 2018 10:57:31 +0000 (10:57 +0000)]
MFC r339676:

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

5 years agoMFC r339578:
Kristof Provost [Sun, 18 Nov 2018 10:54:47 +0000 (10:54 +0000)]
MFC r339578:

pfctl: Fix line numbers when \ is used inside ""

PR: 201520
Obtained from: OpenBSD

5 years agoMFC r339470:
Kristof Provost [Sun, 18 Nov 2018 10:47:36 +0000 (10:47 +0000)]
MFC r339470:

pf synproxy will do the 3WHS on behalf of the target machine, and once
the 3WHS is completed, establish the backend connection. The trigger
for "3WHS completed" is the reception of the first ACK. However, we
should not proceed if that ACK also has RST or FIN set.

PR: 197484
Obtained from: OpenBSD

5 years agoMFC r340136:
Konstantin Belousov [Sun, 18 Nov 2018 09:57:12 +0000 (09:57 +0000)]
MFC r340136:
Move the fixed base for PIE loading on arm.

5 years agoMFC r339893:
Konstantin Belousov [Sun, 18 Nov 2018 09:55:57 +0000 (09:55 +0000)]
MFC r339893:
Style.

5 years agoMFC r339897:
Konstantin Belousov [Sun, 18 Nov 2018 09:54:03 +0000 (09:54 +0000)]
MFC r339897:
Remove rtld use of libc amd64_set_fsbase().

5 years agoMFC r339507:
Konstantin Belousov [Sun, 18 Nov 2018 09:49:24 +0000 (09:49 +0000)]
MFC r339507:
amd64: flush L1 data cache on syscall return with an error.

5 years agoMFC r339466:
Kristof Provost [Sun, 18 Nov 2018 09:48:51 +0000 (09:48 +0000)]
MFC r339466:

pfctl tests: Basic test case for PR 231323

PR: 231323

5 years agoMFC r339464:
Kristof Provost [Sun, 18 Nov 2018 09:47:30 +0000 (09:47 +0000)]
MFC r339464:

pfctl: Dup strings

When we set the ifname we have to copy the string, rather than just keep
the pointer.

PR: 231323

5 years agoMFC r340344:
Konstantin Belousov [Sun, 18 Nov 2018 09:45:52 +0000 (09:45 +0000)]
MFC r340344:
Remove single-use variable, cleanup warnings.

5 years agoMFC r339554:
Andrey V. Elsukov [Sun, 18 Nov 2018 00:22:01 +0000 (00:22 +0000)]
MFC r339554:
  Rework if_ipsec(4) to use epoch(9) instead of rmlock.

  * use CK_LIST and FNV hash to keep chains of softc;
  * read access to softc is protected by epoch();
  * write access is protected by ipsec_ioctl_sx. Changing of softc fields
    is allowed only when softc is unlinked from CK_LIST chains.
  * linking/unlinking of softc is allowed only when ipsec_ioctl_sx is
    exclusive locked.
  * the plain LIST of all softc is replaced by hash table that uses ingress
    address of tunnels as a key.
  * added support for appearing/disappearing of ingress address handling.
    Now it is allowed configure non-local ingress IP address, and thus the
    problem with if_ipsec(4) configuration that happens on boot, when
    ingress address is not yet configured, is solved.

  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D17190

MFC r339555:
  Follow the fix in r339532 (by glebius):
    Fix exiting an epoch(9) we never entered. May happen only with MAC.

MFC r339642:
  Remove softc from idhash when interface is destroyed.

MFC r339646:
  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

5 years agoMFC r339551:
Andrey V. Elsukov [Sun, 18 Nov 2018 00:17:06 +0000 (00:17 +0000)]
MFC r339551:
  Add handling for appearing/disappearing of ingress addresses to if_gif(4).

  * register handler for ingress address appearing/disappearing;
  * add new srcaddr hash table for fast softc lookup by srcaddr;
  * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
    and set it otherwise;
  * remove the note about ingress address from BUGS section.

  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D17134

MFC r339552:
  Add handling for appearing/disappearing of ingress addresses to if_gre(4).

  * register handler for ingress address appearing/disappearing;
  * add new srcaddr hash table for fast softc lookup by srcaddr;
  * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
    and set it otherwise;

  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D17214

MFC r339553:
  Add handling for appearing/disappearing of ingress addresses to if_me(4).

  * register handler for ingress address appearing/disappearing;
  * add new srcaddr hash table for fast softc lookup by srcaddr;
  * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
    and set it otherwise;

  Sponsored by: Yandex LLC

MFC r339649:
  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.

5 years agoMFC r339550,339556:
Andrey V. Elsukov [Sun, 18 Nov 2018 00:09:33 +0000 (00:09 +0000)]
MFC r339550,339556:
  Add KPI that can be used by tunneling interfaces to handle IP addresses
  appearing and disappearing on the host system.

  Such handling is need, because tunneling interfaces must use addresses,
  that are configured on the host as ingress addresses for tunnels.
  Otherwise the system can send spoofed packets with source address, that
  belongs to foreign host.

  The KPI uses ifaddr_event_ext event to implement addresses tracking.
  Tunneling interfaces register event handlers and then they are
  notified by the kernel, when an address disappears or appears.

  ifaddr_event_compat() handler from if.c replaced by srcaddr_change_event()
  in the ip_encap.c

  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D17134

5 years agoMFC r339537:
Andrey V. Elsukov [Sun, 18 Nov 2018 00:04:03 +0000 (00:04 +0000)]
MFC r339537:
  Add ifaddr_event_ext event. It is similar to ifaddr_event, but the
  handler receives the type of event IFADDR_EVENT_ADD/IFADDR_EVENT_DEL,
  and the pointer to ifaddr. Also ifaddr_event now is implemented using
  ifaddr_event_ext handler.

  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D17100

5 years agoMFC r339544:
Andrey V. Elsukov [Sun, 18 Nov 2018 00:00:39 +0000 (00:00 +0000)]
MFC r339544:
  Call inet_ntop() only when its result is needed.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

5 years agoMFC r339545:
Andrey V. Elsukov [Sat, 17 Nov 2018 23:58:55 +0000 (23:58 +0000)]
MFC r339545:
  Do not decrement RST life time if keep_alive is not turned on.

  This allows use differen values configured by user for sysctl variable
  net.inet.ip.fw.dyn_rst_lifetime.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

5 years agoMFC r339539:
Andrey V. Elsukov [Sat, 17 Nov 2018 23:57:46 +0000 (23:57 +0000)]
MFC r339539:
  Add IPFW_RULE_JUSTOPTS flag, that is used by ipfw(8) to mark rule,
  that was added using "new rule format". And then, when the kernel
  returns rule with this flag, ipfw(8) can correctly show it.

  Reported by: lev
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D17373

5 years agoMFC r339535:
Andrey V. Elsukov [Sat, 17 Nov 2018 23:56:25 +0000 (23:56 +0000)]
MFC r339535:
  Do not allow use `create` keyword as hostname when ifconfig(8) is invoked
  for already existing interface.

  It appeared, that ifconfig(8) assumes `create` keyword as hostname and
  tries to resolve it, when `ifconfig ifname create` invoked for already
  existing interface. This can produce some unexpected results, when hostname
  resolving has successfully happened. This patch adds check for such case.
  When an interface is already exists, and create is only one argument,
  return error message. But when there are some other arguments, just remove
  create keyword from the arguments list.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D17171

MFC r339536:
  Fix grammar.

5 years agoMFC r339533:
Andrey V. Elsukov [Sat, 17 Nov 2018 23:54:19 +0000 (23:54 +0000)]
MFC r339533:
  Add sadb_x_sa2 extension to SADB_ACQUIRE requests.

  SADB_ACQUIRE requests are send by kernel, when security policy doesn't
  have corresponding security association for outbound packet. IKE daemon
  usually registers its handler for such messages and when the kernel asks
  for SA it can handle this request. Now such requests will contain
  additional fields that can help IKE daemon to create SA. And IKE now
  can create SAs using only information from SADB_ACQUIRE request, this
  is useful when many if_ipsec(4) interfaces are in use and IKE doesn track
  security policies that was installed by kernel.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

5 years agoMFC r339542:
Andrey V. Elsukov [Sat, 17 Nov 2018 23:52:56 +0000 (23:52 +0000)]
MFC r339542:
  Retire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add ability
  to switch the output method in run-time. Also document some sysctl
  variables that can by changed for NAT64 module.

  NAT64 had compile time option IPFIREWALL_NAT64_DIRECT_OUTPUT to use
  if_output directly from nat64 module. By default is used netisr based
  output method. Now both methods can be used, but they require different
  handling by rules.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D16647

5 years agoMFC r339780:
Mark Johnston [Sat, 17 Nov 2018 20:59:50 +0000 (20:59 +0000)]
MFC r339780:
Avoid leaking memory in error paths.

5 years agoMFC r339781:
Mark Johnston [Sat, 17 Nov 2018 20:58:35 +0000 (20:58 +0000)]
MFC r339781:
Don't print pathconf() errors if the target file doesn't exist.

MFC r339782:
Update and re-enable ACL tests.

PR: 229930

5 years agoMFC r339490:
Mark Johnston [Sat, 17 Nov 2018 20:55:11 +0000 (20:55 +0000)]
MFC r339490:
Add an assertion to pmap_enter().

5 years agoMFC r339453, r339455, r339456, r339460, r339687, r339745, r339747:
Mark Johnston [Sat, 17 Nov 2018 20:54:24 +0000 (20:54 +0000)]
MFC r339453, r339455, r339456, r339460, r339687, r339745, r339747:
Miscellaneous cleanups of rtsol(d).

5 years agoMFC r340372: dtb.mk: Fix passing of ECHO to make_dtb{,o}.sh
Kyle Evans [Sat, 17 Nov 2018 20:27:06 +0000 (20:27 +0000)]
MFC r340372: dtb.mk: Fix passing of ECHO to make_dtb{,o}.sh

5 years agoMFC r339823:
Vladimir Kondratyev [Sat, 17 Nov 2018 20:18:15 +0000 (20:18 +0000)]
MFC r339823:

evdev: Use console lock as evdev lock for all supported keyboard drivers.

Now evdev part of keyboard drivers does not take any locks if corresponding
input/eventN device node is not opened by userland consumers.

Do not assert console lock inside evdev to handle the cases when keyboard
driver is called from some special single-threaded context like shutdown
thread.

MFC r339824:

evdev: disable evdev if it is invoked from KDB or panic context

This allow to prevent deadlock on entering KDB if one of evdev locks is
already taken by userspace process.

Also this change discards all but LED console events produced by KDB as
unrelated to userspace.

5 years agoMFC r339675:
Mark Johnston [Sat, 17 Nov 2018 20:14:02 +0000 (20:14 +0000)]
MFC r339675:
Fix comments.

5 years agoMFC r339692:
Mark Johnston [Sat, 17 Nov 2018 20:11:39 +0000 (20:11 +0000)]
MFC r339692:
Clarify slightly the interaction between wait*() and pdfork().

5 years agoMFC r339737:
Mark Johnston [Sat, 17 Nov 2018 20:07:37 +0000 (20:07 +0000)]
MFC r339737:
Remove a dead store.

5 years agoMFC r339599:
Mark Johnston [Sat, 17 Nov 2018 20:04:38 +0000 (20:04 +0000)]
MFC r339599:
Don't import 0 into vmem quantum caches.

5 years agoMFC r339598:
Mark Johnston [Sat, 17 Nov 2018 20:02:57 +0000 (20:02 +0000)]
MFC r339598:
Fix style bugs in in6_pcblookup_lbgroup().

5 years agoMFC r339731:
Mark Johnston [Sat, 17 Nov 2018 20:01:35 +0000 (20:01 +0000)]
MFC r339731:
Add FALLTHROUGH comments to appease Coverity.

5 years agoMFC r339728:
Mark Johnston [Sat, 17 Nov 2018 20:00:10 +0000 (20:00 +0000)]
MFC r339728:
Remove a redundant check.

5 years agoMFC r339883:
Mark Johnston [Sat, 17 Nov 2018 19:58:34 +0000 (19:58 +0000)]
MFC r339883:
Expose some netdump configuration parameters through sysctl.

5 years agoMFC r340174:
Mark Johnston [Sat, 17 Nov 2018 19:02:50 +0000 (19:02 +0000)]
MFC r340174:
Initialize last_target in the laundry thread control loop.

5 years agoMFC r340005:
Mark Johnston [Sat, 17 Nov 2018 19:01:40 +0000 (19:01 +0000)]
MFC r340005:
Remove redundant checks for a NULL lbgroup table.

5 years agoMFC r340004:
Mark Johnston [Sat, 17 Nov 2018 19:00:44 +0000 (19:00 +0000)]
MFC r340004:
Improve style in in_pcbinslbgrouphash() and related subroutines.

5 years agoRemove debugging options from arm, armv6, armv7 files included by
Glen Barber [Sat, 17 Nov 2018 18:58:06 +0000 (18:58 +0000)]
Remove debugging options from arm, armv6, armv7 files included by
GENERIC.  This should have been turned off when stable/12 branched.

This is a direct commit to stable/12.

Submitted by: thompsa
Sponsored by: The FreeBSD Foundation

5 years agoMFC r340160;
Mark Johnston [Sat, 17 Nov 2018 18:55:53 +0000 (18:55 +0000)]
MFC r340160;
Document the fact that cap_limit_set() always frees the input nvlist.

5 years agoMFC r339820:
Mark Johnston [Sat, 17 Nov 2018 18:54:34 +0000 (18:54 +0000)]
MFC r339820:
Use M_WAITOK in init_hwpmc().

5 years agoMFC r340014:
Mark Johnston [Sat, 17 Nov 2018 18:53:28 +0000 (18:53 +0000)]
MFC r340014:
Avoid copying a struct stat for acl_from_stat() calls.

5 years agoMFC r340437:
Mark Johnston [Sat, 17 Nov 2018 18:51:22 +0000 (18:51 +0000)]
MFC r340437:
Fix the path to malloc_domain.9.

5 years agoMFC r340438:
Mark Johnston [Sat, 17 Nov 2018 18:49:52 +0000 (18:49 +0000)]
MFC r340438:
Hook mac_ntpd.4 up to the build.

PR: 232757

5 years agoMFC r340249: ipfw.8: fix small syntax error in an example
Eugene Grosbein [Sat, 17 Nov 2018 18:39:09 +0000 (18:39 +0000)]
MFC r340249: ipfw.8: fix small syntax error in an example

5 years ago- Update stable/12 from BETA4 to PRERELEASE as releng/12.0 had
Glen Barber [Fri, 16 Nov 2018 00:03:31 +0000 (00:03 +0000)]
- Update stable/12 from BETA4 to PRERELEASE as releng/12.0 had
  been branched.
- Bump __FreeBSD_version.

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

5 years agoMFC r340314:
Alan Somers [Thu, 15 Nov 2018 19:06:07 +0000 (19:06 +0000)]
MFC r340314:

libjail: fix handling of allow.mount.fusefs in jailparam_init

fusefs is inconsistently named. The kernel module is named "fuse", but the
mount helper is named "mount_fusefs" and the jail(8) parameter is named
"allow.mount.fusefs". Special case it in libjail.

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

5 years agoMFC :r340436
Vincenzo Maffione [Thu, 15 Nov 2018 18:51:37 +0000 (18:51 +0000)]
MFC :r340436

vtnet: fix netmap support

netmap(4) support for vtnet(4) was incomplete and had multiple bugs.
This commit fixes those bugs to bring netmap on vtnet in a functional state.

Changelist:
  - handle errors returned by virtqueue_enqueue() properly (they were
    previously ignored)
  - make sure netmap XOR rest of the kernel access each virtqueue.
  - compute the number of netmap slots for TX and RX separately, according to
    whether indirect descriptors are used or not for a given virtqueue.
  - make sure sglist are freed according to their type (mbufs or netmap
    buffers)
  - add support for mulitiqueue and netmap host (aka sw) rings.
  - intercept VQ interrupts directly instead of intercepting them in txq_eof
    and rxq_eof. This simplifies the code and makes it easier to make sure
    taskqueues are not running for a VQ while it is in netmap mode.
  - implement vntet_netmap_config() to cope with changes in the number of queues.

Sponsored by: Sunny Valley Networks
Differential Revision: https://reviews.freebsd.org/D17916
Approved by: re (gjb)

5 years agoMFC r340361:
Michael Tuexen [Thu, 15 Nov 2018 17:25:32 +0000 (17:25 +0000)]
MFC r340361:

Fix printing of 64-bit counters on 32-bit ppc platforms.

Several statistic counters are uint64_t values and are printed by systat
using %lu. This results in displaying wrong numbers. Use PRIu64 instead.
While there, print variables of size_t using %zd.

Approved by: re (gjb@)
Differential Revision: https://reviews.freebsd.org/D17838

5 years agoMFC r340406:
Glen Barber [Thu, 15 Nov 2018 16:42:59 +0000 (16:42 +0000)]
MFC r340406:

 The roff ascii.gz documentation installed to /usr/share/doc
 was removed in r318881 when roff was removed from the base
 system.

 This results in the doc.txz distribution set containing a
 single directory (./) which is empty.

 Remove the "Additional documentation" option from the menu
 selection of bsdinstall(8), as the plain-text documentation
 installed in /usr/share/doc is installed as part of the
 packageworld target.

 The doc entry has not been removed from EXTRA_DISTRIBUTIONS
 in Makefile.inc1, in case its removal triggers an issue with
 freebsd-update(8), which is currently aware of the world/doc
 component, so the empty doc.txz continues to be created as
 a precaution.

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

5 years agoMFC r340334: libbe(3): Set canmount properly when activating a new BE
Kyle Evans [Thu, 15 Nov 2018 16:03:52 +0000 (16:03 +0000)]
MFC r340334: libbe(3): Set canmount properly when activating a new BE

The previously activated BE should have canmount=noauto set on it upon
activation of the new BE, but we previously did not touch canmount on either
old or new BE.

PR: 233113
Approved by: re (gjb)

5 years agoMFC r340426 (by cem)
Eric van Gyzen [Wed, 14 Nov 2018 22:05:20 +0000 (22:05 +0000)]
MFC r340426 (by cem)

amdtemp(4): Fix temperature reporting on AMD 2990WX

Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255
OSRR, section 4.2.1.

For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the
range -49..206; i.e., subtract 49°C.

Submitted by: gallatin@
Reported by: bcran@
Reviewed by: cem (long ago)
Approved by: re (kib)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16855

5 years agoMFC r340425 (by cem)
Eric van Gyzen [Wed, 14 Nov 2018 21:31:26 +0000 (21:31 +0000)]
MFC r340425 (by cem)

amdsmn(4)/amdtemp(4): Attach to Ryzen 2 hostbridges

As reported, tested, and patch supplied by Johannes.

There may be future work to do to support multiple sensors, but for now, any
sensor at all is a strict improvement for Ryzen 2 systems.

PR: 228480
Submitted by: Johannes Lundberg <johalun0 AT gmail.com> (earlier version)
Reported by: deischen@, Johannes, and numerous others
Early MFC approved by:  cem
Approved by:    re (kib)
Relnotes:       yes

5 years agoMFC S340428: Prepare move of ctm from base to a port (misc/ctm) by:
Stefan Eßer [Wed, 14 Nov 2018 20:35:04 +0000 (20:35 +0000)]
MFC S340428: Prepare move of ctm from base to a port (misc/ctm) by:
- Adding a note to UPDATING
- Adding a note to the history section of the manpage ctm.1
- Adding a message printed to STDERR to the ctm program

This version is meant for release in FreeBSD-12.0 and should remain in
FreeBSD-12 over its life-time.

A follow-up commit will remove ctm from -CURRENT after the MFC to 12
has happened.

Approved by:    re
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D17969

5 years agoMFC r339927:
Mark Johnston [Tue, 13 Nov 2018 18:21:47 +0000 (18:21 +0000)]
MFC r339927:
Add malloc_domainset(9) and _domainset variants to other allocator KPIs.

Approved by: re (gjb)

5 years agoMFC r340331:
Mark Johnston [Tue, 13 Nov 2018 17:43:16 +0000 (17:43 +0000)]
MFC r340331:
Re-apply r336984, reverting r339934.

Approved by: re (gjb)

5 years agoMFC r340313:
Mark Johnston [Tue, 13 Nov 2018 17:25:34 +0000 (17:25 +0000)]
MFC r340313:
Ensure that IP fragments do not extend beyond IP_MAXPACKET.

Approved by: re (gjb)

5 years agoMFC r339925:
Mark Johnston [Tue, 13 Nov 2018 16:51:30 +0000 (16:51 +0000)]
MFC r339925:
Fix some problems that manifest when NUMA domain 0 is empty.

Approved by: re (gjb)

5 years agoRegen after r340388: MFC r340302: Fix freebsd32 mknod(at).
Brooks Davis [Mon, 12 Nov 2018 21:53:47 +0000 (21:53 +0000)]
Regen after r340388: MFC r340302: Fix freebsd32 mknod(at).

Approved by: re (gjb, implicit)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17928

5 years agoMFC r340302:
Brooks Davis [Mon, 12 Nov 2018 21:51:36 +0000 (21:51 +0000)]
MFC r340302:

Fix freebsd32 mknod(at).

As dev_t is now a 64-bit integer, it requires special handling as a
system call argument.  64-bit arguments are split between two 64-bit
integers due to the way arguments are promoted to allow reuse of most
system call implementations.  They must be reassembled before use.
Further, 64-bit arguments at an odd offset (counting from zero) are
padded and slid to the next slot on powerpc and mips.  Fix the
non-COMPAT11 system call by adding a freebsd32_mknodat() and
appropriately padded declerations.

The COMPAT11 system calls are fully compatible with the 64-bit
implementations so remove the freebsd32_ versions.

Use uint32_t consistently as the type of the old dev_t.  This matches
the old definition.

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

5 years agoRegen after r340377: MFC r340272, r340274, r340294
Brooks Davis [Mon, 12 Nov 2018 18:23:51 +0000 (18:23 +0000)]
Regen after r340377: MFC r340272, r340274, r340294

r340272: Make __sysctl follow the freebsd32_foo convention.
r340274: Make freebsd32_umtx_op follow the freebsd32_foo convention.
r340294: Fix a number of bugs in freebsd32's capabilities.conf.

Approved by: re (gjb, implicit)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17925

5 years agoMFC r340272, r340274, r340294
Brooks Davis [Mon, 12 Nov 2018 18:21:17 +0000 (18:21 +0000)]
MFC r340272, r340274, r340294

r340272:
Make __sysctl follow the freebsd32_foo convention.

Sponsored by: DARPA, AFRL

r340274:
Make freebsd32_umtx_op follow the freebsd32_foo convention.

Sponsored by: DARPA, AFRL

r340294:
Fix a number of bugs in freebsd32's capabilities.conf.

Bugs range from failure to update after changing syscall implementaion
names to using the wrong name.  Somewhat confusingly, the name in
capabilities.conf is exactly the string that appears in syscalls.master,
not the name with a COMPAT* prefix which is the actual function name.

Found while making a change to use the default capabilities.conf.

Fixes: r335177, r336980, r340272, r340274, others
Reviewed by: kib, emaste
Approved by: re (gjb)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17925

5 years agoMFC r340251:
Bjoern A. Zeeb [Mon, 12 Nov 2018 16:37:23 +0000 (16:37 +0000)]
MFC r340251:

  Update rum(4) and run(4) man pages to reflect that newer versions
  of TP-LINK TL-WN321G are run(4) and not rum(4) anymore.

  Reported by: J (tech-lists zyxst.net)
Approved by: re (kib)

5 years agoMFC r340310:
Stephen Hurd [Mon, 12 Nov 2018 16:28:07 +0000 (16:28 +0000)]
MFC r340310:

Fix first-packet completion

The first packet after the ring is initialized was never
completed as isc_txd_credits_update() would not include it in the
count of completed packets. This caused netmap to never complete
a batch. See PR 233022 for more details.

PR: 233022
Reported by: lev
Reviewed by: lev
Approved by: re (kib)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D17931

5 years agoMFC r340236:
Stephen Hurd [Mon, 12 Nov 2018 16:08:14 +0000 (16:08 +0000)]
MFC r340236:

Fix rxcsum issue introduced in r338838

r338838 attempted to fix issues with rxcsum and rxcsum6.
However, the rxcsum bits were set as though if_setcapenablebit() was
being called, not if_togglecapenable() which is in use. As a result,
it was not possible to disable rxcsum when rxcsum6 was supported.

PR: 233004
Reported by: lev
Reviewed by: lev
Approved by: re (kib)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D17881

5 years agoMFC r340297: Use ${ECHO} in dtb/dtbo build, pass in from dtb.mk for -s
Kyle Evans [Mon, 12 Nov 2018 15:18:09 +0000 (15:18 +0000)]
MFC r340297: Use ${ECHO} in dtb/dtbo build, pass in from dtb.mk for -s

Approved by: re (kib)

5 years agoMFC r340248:
Hans Petter Selasky [Sun, 11 Nov 2018 12:31:27 +0000 (12:31 +0000)]
MFC r340248:
Don't read the USB audio sync endpoint when we don't use it to save
isochronous bandwidth.

Approved by: re (kib)
Sponsored by: Mellanox Technologies

5 years agoMFC r339971: Add new rc keywords: enable, disable, delete
Devin Teske [Sun, 11 Nov 2018 06:05:28 +0000 (06:05 +0000)]
MFC r339971: Add new rc keywords: enable, disable, delete

This adds new keywords to rc/service to enable/disable a service's
rc.conf(5) variable and "delete" to remove the variable.

When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
(default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
deleted if empty after modification using "service $foo delete".

Submitted by: lme (modified)
Reviewed by: 0mp (previous version), lme, bcr
Approved by: re (rgrimes)
Relnotes: yes
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D17113

5 years agoMFC r340241:
Mark Johnston [Sat, 10 Nov 2018 20:36:48 +0000 (20:36 +0000)]
MFC r340241:
Fix a use-after-free in swp_pager_meta_free().

Approved by: re (gjb)

5 years agoMFC r339793:
Mark Johnston [Sat, 10 Nov 2018 20:34:59 +0000 (20:34 +0000)]
MFC r339793:
Don't set NFSv4 ACL inheritance flags on non-directories.

PR: 155163
Approved by: re (gjb)

5 years agoMFC r340212:
Hans Petter Selasky [Sat, 10 Nov 2018 10:30:01 +0000 (10:30 +0000)]
MFC r340212:
Sometimes the complete split packet may be queued too early and the
transaction translator will return a NAK. Ignore this message and
retry the complete split instead.

Approved by: re (kib)
Sponsored by: Mellanox Technologies

5 years agoMFC r340089:
Hans Petter Selasky [Fri, 9 Nov 2018 09:26:10 +0000 (09:26 +0000)]
MFC r340089:
Use correct type for IOCTL request argument.
This fixes signed IOCTL value warnings in uhsoctl().

Approved by: re (kib)
Submitted by: Marcin Cieslak <saper@saper.info>
Sponsored by: Mellanox Technologies

5 years agoMFC r340100:
Andrey V. Elsukov [Fri, 9 Nov 2018 08:14:47 +0000 (08:14 +0000)]
MFC r340100:
  Do not use bzero() for the O_ICMP6TYPE opcode.

  The buffer is already zeroed in compile_rule() function, and also it
  may contain configured F_NOT flag in o.len field. This fixes the
  filling for "not icmp6types" opcode.

MFC r340175:
  Do not print "ip6" keyword in print_icmp6types() for O_ICMP6TYPE opcode.

  It produces incompatibility when rules listing is used again to
  restore saved ruleset, because "ip6" keyword produces separate opcode.
  The kernel already has the check and only IPv6 packets will be checked
  for matching.

PR: 232939
Approved by: re (kib)

5 years agoUpdate stable/12 from BETA3 to BETA4 as part of the 12.0-RELEASE
Glen Barber [Fri, 9 Nov 2018 00:01:53 +0000 (00:01 +0000)]
Update stable/12 from BETA3 to BETA4 as part of the 12.0-RELEASE
cycle.

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

5 years agoMFC 340164,340168,340170: Add custom cpu_lock_delay() for x86.
John Baldwin [Thu, 8 Nov 2018 22:39:38 +0000 (22:39 +0000)]
MFC 340164,340168,340170: Add custom cpu_lock_delay() for x86.

340164:
Add a KPI for the delay while spinning on a spin lock.

Replace a call to DELAY(1) with a new cpu_lock_delay() KPI.  Currently
cpu_lock_delay() is defined to DELAY(1) on all platforms.  However,
platforms with a DELAY() implementation that uses spin locks should
implement a custom cpu_lock_delay() doesn't use locks.

340168:
Add a delay_tsc() static function for when DELAY() uses the TSC.

This uses slightly simpler logic than the existing code by using the
full 64-bit counter and thus not having to worry about counter
overflow.

340170:
Add a custom implementation of cpu_lock_delay() for x86.

Avoid using DELAY() since it can try to use spin locks on CPUs without
a P-state invariant TSC.  For cpu_lock_delay(), always use the TSC if
it exists (even if it is not P-state invariant) to delay for a
microsecond.  If the TSC does not exist, read from I/O port 0x84 to
delay instead.

PR: 228768
Approved by: re (gjb)

5 years agoMFC r340260 (emaste):
Glen Barber [Thu, 8 Nov 2018 21:58:23 +0000 (21:58 +0000)]
MFC r340260 (emaste):
 Avoid buffer underwrite in icmp_error

 icmp_error allocates either an mbuf (with pkthdr) or a cluster depending
 on the size of data to be quoted in the ICMP reply, but the calculation
 failed to account for the additional padding that m_align may apply.

 Include the ip header in the size passed to m_align.  On 64-bit archs
 this will have the net effect of moving everything 4 bytes later in the
 mbuf or cluster.  This will result in slightly pessimal alignment for
 the ICMP data copy.

 Also add an assertion that we do not move m_data before the beginning of
 the mbuf or cluster.

Approved by: re (kib)
Security: CVE-2018-17156
Sponsored by: The FreeBSD Foundation

5 years agoMFC r340256: ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled
Eric Joyner [Thu, 8 Nov 2018 21:36:45 +0000 (21:36 +0000)]
MFC r340256: ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled

Approved by: re (gjb@)

5 years agoMFC r340181, r340185:
Tijl Coosemans [Thu, 8 Nov 2018 19:56:29 +0000 (19:56 +0000)]
MFC r340181, r340185:

On amd64 both Linux compat modules, linux.ko and linux64.ko, provide
linux_ioctl_(un)register_handler that allows other driver modules to
register ioctl handlers.  The ioctl syscall implementation in each Linux
compat module iterates over the list of handlers and forwards the call to
the appropriate driver.  Because the registration functions have the same
name in each module it is not possible for a driver to support both 32 and
64 bit linux compatibility.

Move the list of ioctl handlers to linux_common.ko so it is shared by
both Linux modules and all drivers receive both 32 and 64 bit ioctl calls
with one registration.  These ioctl handlers normally forward the call
to the FreeBSD ioctl handler which can handle both 32 and 64 bit.

Keep the special COMPAT_LINUX32 ioctl handlers in linux.ko in a separate
list for now and let the ioctl syscall iterate over that list first.
Later, COMPAT_LINUX32 support can be added to the 64 bit ioctl handlers
via a runtime check for ILP32 like is done for COMPAT_FREEBSD32 and then
this separate list would disappear again.  That is a much bigger effort
however and this commit is meant to be MFCable.

This enables linux64 support in x11/nvidia-driver*.

PR: 206711
Reviewed by: kib
Approved by: re (gjb)

5 years agoMFC r340155: Assert locks held for async events.
Warner Losh [Thu, 8 Nov 2018 14:21:25 +0000 (14:21 +0000)]
MFC r340155: Assert locks held for async events.

Approved by: re@ (gjb)