]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r341540:
Hans Petter Selasky [Wed, 12 Dec 2018 11:37:43 +0000 (11:37 +0000)]
MFC r341540:
libibverbs: Fix memory leak in ibv_read_sysfs_file().

Testing packetdrill using valgrind resulted in finding a memory leak in
ibv_read_sysfs_file(). The attached patch fixes it.

Submitted by: tuexen@
Sponsored by:   Mellanox Technologies

5 years agoMFC r341539:
Hans Petter Selasky [Wed, 12 Dec 2018 11:35:36 +0000 (11:35 +0000)]
MFC r341539:
krping: Fix for memory leak in error case.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341538:
Hans Petter Selasky [Wed, 12 Dec 2018 11:33:50 +0000 (11:33 +0000)]
MFC r341538:
ipoib: Notify on modify QP failure only when relevant

Modify QP can fail and it can be acceptable, like when moving from RST to
ERR state, all the rest are not acceptable and a message to the log
should be printed.

The current code prints on all failures and many messages like:
"Failed to modify QP to ERROR state" appear, even when supported by the
state machine of the QP object.

Linux commit:
5dc78ad1904db597bdb4427f3ead437aae86f54c

Sponsored by:   Mellanox Technologies

5 years agoMFC r341537:
Hans Petter Selasky [Wed, 12 Dec 2018 11:32:31 +0000 (11:32 +0000)]
MFC r341537:
ipoib: increase the non-cm queue length

When a packet needs fragmentation, it might generate more than 3 fragments.
With the queue length 3, all fragments are generated faster than the
queue is drained, which effectively drops fourth and later fragments on
the floor.

Submitted by:   kib@
Sponsored by:   Mellanox Technologies

5 years agoMFC r341536:
Hans Petter Selasky [Wed, 12 Dec 2018 11:30:46 +0000 (11:30 +0000)]
MFC r341536:
ipoib: Don't do a light flush when MTU is unchanged.

When changing the MTU of ibX network interfaces, check that the MTU was really
changed before requesting an update of the multicast rules. Else we might go
into an infinite loop joining and leaving ibX multicast groups towards the
opensm master interface.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341535:
Hans Petter Selasky [Wed, 12 Dec 2018 11:17:15 +0000 (11:17 +0000)]
MFC r341535:
ipoib: correct setting MTU from inside ipoib(4).

It is not enough to set ifnet->if_mtu to change the interface MTU.
System saves the MTU for route in the radix tree, and route cache keeps
the interface MTU as well. Since addition of the multicast group causes
recalculation of MTU, even bringing the interface up changes MTU from
4042 to 1500, which makes the system configuration inconsistent. Worse,
ip_output() prefers route MTU over interface MTU, so large packets are
not fragmented and dropped on floor.

Fix it for ipoib(4) using the same approach (or hack) as was applied
for it_tun/if_tap in r339012.  Thanks to bz@ for giving the hint.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341534:
Hans Petter Selasky [Wed, 12 Dec 2018 11:15:12 +0000 (11:15 +0000)]
MFC r341534:
ibcore: Fix clearing of bound device interface.

Binding to a loopback device is not allowed. Make sure the destination
device address is global by clearing the bound device interface.
Only do this conditionally, else link local addresses won't work.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341533:
Hans Petter Selasky [Wed, 12 Dec 2018 11:02:48 +0000 (11:02 +0000)]
MFC r341533:
ibcore: ip6_dev_find() needs to know the scope ID.

Else the wrong network device can be returned for link-local addresses.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341532:
Hans Petter Selasky [Wed, 12 Dec 2018 11:00:36 +0000 (11:00 +0000)]
MFC r341532:
ibcore: Fix sleeping in atomic when RoCE is used

A couple of places in the CM do

    spin_lock_irq(&cm_id_priv->lock);
    ...
    if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg))

However when the underlying transport is RoCE, this leads to a sleeping function
being called with the lock held - the callchain is

    cm_alloc_response_msg() ->
      ib_create_ah_from_wc() ->
        ib_init_ah_from_wc() ->
          rdma_addr_find_l2_eth_by_grh() ->
            rdma_resolve_ip()

and rdma_resolve_ip() starts out by doing

    req = kzalloc(sizeof *req, GFP_KERNEL);

not to mention rdma_addr_find_l2_eth_by_grh() doing

    wait_for_completion(&ctx.comp);

to wait for the task that rdma_resolve_ip() queues up.

Fix this by moving the AH creation out of the lock.

Linux commit:
c76161181193985087cd716fdf69b5cb6cf9ee85

Sponsored by:   Mellanox Technologies

5 years agoMFC r341531:
Hans Petter Selasky [Wed, 12 Dec 2018 10:57:58 +0000 (10:57 +0000)]
MFC r341531:
ibcore: Add missing unref of netdevice.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341530:
Hans Petter Selasky [Wed, 12 Dec 2018 10:55:55 +0000 (10:55 +0000)]
MFC r341530:
ibcore: Fix loopback with rdma-cm.

Trying to validate loopback fails because rtalloc1() resolves system
local addresses to the loopback network interface, lo0. Fix this by
explicitly checking for loopback during validation of the source
and destination network address. If the source address belongs to
a local network interface and is equal to the destination address,
there is no need to run the destination address through rtalloc1().

Sponsored by:   Mellanox Technologies

5 years agoMFC r341529:
Hans Petter Selasky [Wed, 12 Dec 2018 10:49:41 +0000 (10:49 +0000)]
MFC r341529:
ibcore: Make sure all VNETs are scanned for VLAN interfaces.

The master network interface and the VLANs may reside in different VNETs.
Make sure that all VNETs are searched when scanning for GID entries.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341528:
Hans Petter Selasky [Wed, 12 Dec 2018 10:32:59 +0000 (10:32 +0000)]
MFC r341528:
ibcore: Always check return value from ib_init_ah_from_wc().

This prevents code from accepting RoCEv1 connections when
only ROCEv2 is enabled and vice versa.

Linux commit:
0c4386ec77cfcd0ccbdbe8c2e67dd3a49b2a4c7f

Sponsored by:   Mellanox Technologies

5 years agoMFC r341527:
Hans Petter Selasky [Wed, 12 Dec 2018 10:30:54 +0000 (10:30 +0000)]
MFC r341527:
ibcore: Add missing check for failure.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341526:
Hans Petter Selasky [Wed, 12 Dec 2018 10:28:50 +0000 (10:28 +0000)]
MFC r341526:
ibcore: Fix an array index check

The array ib_mad_mgmt_class_table.method_table has MAX_MGMT_CLASS
(80) elements. Hence compare the array index with that value instead
of with IB_MGMT_MAX_METHODS (128). This patch avoids that Coverity
reports the following:

Overrunning array class->method_table of 80 8-byte elements at element index 127
(byte offset 1016) using index convert_mgmt_class(mad_hdr->mgmt_class)
(which evaluates to 127).

Linux commit:
2fe2f378dd45847d2643638c07a7658822087836

Sponsored by:   Mellanox Technologies

5 years agoMFC r341525:
Hans Petter Selasky [Wed, 12 Dec 2018 10:25:55 +0000 (10:25 +0000)]
MFC r341525:
ibcore: Check ib_find_pkey() return value.

Linux commit:
d3a2418ee36a59bc02e9d454723f3175dcf4bfd9

Sponsored by:   Mellanox Technologies

5 years agoMFC r341524:
Hans Petter Selasky [Wed, 12 Dec 2018 10:23:49 +0000 (10:23 +0000)]
MFC r341524:
ibcore: Add support for IB_SPEED_HDR in sysfs rate printout.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341523:
Hans Petter Selasky [Wed, 12 Dec 2018 10:21:10 +0000 (10:21 +0000)]
MFC r341523:
ibcore: Don't access invalid port.

The port number in the listen_id_priv has been observed to be zero which
means no port has been selected. The current code lacks a check for invalid
port number.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341522:
Hans Petter Selasky [Wed, 12 Dec 2018 10:18:51 +0000 (10:18 +0000)]
MFC r341522:
ibcore: Discard unused error codes.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341521:
Hans Petter Selasky [Wed, 12 Dec 2018 10:16:35 +0000 (10:16 +0000)]
MFC r341521:
ibcore: Make sure GID index variable gets initialized.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341520:
Hans Petter Selasky [Wed, 12 Dec 2018 10:13:49 +0000 (10:13 +0000)]
MFC r341520:
linuxkpi: Really check if PCI is offline

Currently we always return false if for PCI offline query.
Try to read PCI config, if the return value if 0xffff probably the
PCI is offline.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341519:
Hans Petter Selasky [Wed, 12 Dec 2018 10:10:56 +0000 (10:10 +0000)]
MFC r341519:
linuxkpi: properly implement netif_carrier_ok().

Submitted by:   kib@
Sponsored by:   Mellanox Technologies

5 years agoMFC r341518:
Hans Petter Selasky [Wed, 12 Dec 2018 10:08:15 +0000 (10:08 +0000)]
MFC r341518:
linuxkpi: Fix for use-after-free when tearing down character devices.

Make sure we hold a reference on the character device for every opened file
to prevent the character device to be freed prematurely.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341591:
Hans Petter Selasky [Wed, 12 Dec 2018 10:04:34 +0000 (10:04 +0000)]
MFC r341591:
Fix build of the atomic long LinuxKPI header file on some platforms.

Sponsored by: Mellanox Technologies

5 years agoMFC r341517 and r341592:
Hans Petter Selasky [Wed, 12 Dec 2018 10:00:09 +0000 (10:00 +0000)]
MFC r341517 and r341592:
linuxkpi: implement idr_is_empty() and ida_is_empty().

Submitted by:   kib@
Sponsored by:   Mellanox Technologies

5 years agoMFC r340360:
Andrey V. Elsukov [Wed, 12 Dec 2018 09:03:10 +0000 (09:03 +0000)]
MFC r340360:
  Add ability to use dynamic external prefix in ipfw_nptv6 module.

  Now an interface name can be specified for nptv6 instance instead of
  ext_prefix. The module will track if_addr_ext events and when suitable
  IPv6 address will be added to specified interface, it will be configured
  as external prefix. When address disappears instance becomes unusable,
  i.e. it doesn't match any packets.

  Reviewed by: 0mp (manpages)
  Tested by: Dries Michiels <driesm dot michiels gmail com>
  Differential Revision: https://reviews.freebsd.org/D17765

5 years agoMFC r341469:
Andrey V. Elsukov [Wed, 12 Dec 2018 08:55:54 +0000 (08:55 +0000)]
MFC r341469:
  Add assertion to check that named object has correct type.

5 years agoMFC 340694: Enable evdev on ppc32
Niclas Zeising [Tue, 11 Dec 2018 21:01:38 +0000 (21:01 +0000)]
MFC 340694: Enable evdev on ppc32

Enable evdev on ppc32 as well, similar to what was done i386 and amd64 in
r340387 and ppc64 in r340632.

Evdev can be used by X and is used by wayland to handle input devices.

Approved by: jhibbits

5 years agoMFC 340632
Niclas Zeising [Tue, 11 Dec 2018 20:56:05 +0000 (20:56 +0000)]
MFC 340632

Enable evdev on ppc64

Enable evdev on ppc64 as well, similar to what was done for amd64 and i386
in r340387.

Evdev can be used by X and is used by wayland to handle input devices.

Approved by: mmacy

5 years agoCall stable/12 -STABLE now that 12.0-RELEASE is out.
Glen Barber [Tue, 11 Dec 2018 19:12:44 +0000 (19:12 +0000)]
Call stable/12 -STABLE now that 12.0-RELEASE is out.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r341516, r341589
Vincenzo Maffione [Tue, 11 Dec 2018 11:31:13 +0000 (11:31 +0000)]
MFC r341516, r341589

netmap: align codebase to the current upstream (760279cfb2730a585)

Changelist:
  - Replace netmap passthrough host support with a more general
    mechanism to call TXSYNC/RXSYNC from an in-kernel event-loop.
    No kernel threads are used to use this feature: the application
    is required to spawn a thread (or a process) and issue a
    SYNC_KLOOP_START (NIOCCTRL) command in the thread body. The
    kernel loop is executed by the ioctl implementation, which returns
    to userspace only when a different thread calls SYNC_KLOOP_STOP
    or the netmap file descriptor is closed.
  - Update the if_ptnet driver to cope with the new data structures,
    and prune all the obsolete ptnetmap code.
  - Add support for "null" netmap ports, useful to allocate netmap_if,
    netmap_ring and netmap buffers to be used by specialized applications
    (e.g. hypervisors). TXSYNC/RXSYNC on these ports have no effect.
  - Various fixes and code refactoring.

Sponsored by: Sunny Valley Networks
Differential Revision: https://reviews.freebsd.org/D18015

5 years agoAs part of the general cleanup of the ipfilter code, special cases
Cy Schubert [Tue, 11 Dec 2018 01:49:06 +0000 (01:49 +0000)]
As part of the general cleanup of the ipfilter code, special cases
are committed separately to document fixing them separately from
the general cleanup. In this case we don't want to hide the utter
brokenness of what is being fixed.

Clean up a discombobulated block of #if's, with one block unreachable.
ip_fil.c is used in ipftest which is used to dry-run test ipfilter
rules in userspace without loading them in the kernel. The call to
(*ifp->if_output) matches that in the FreeBSD kernel.

Further testing and work will be required to make ipftest fully
functional.

5 years agoMFC r340322-r340324,r340327: periodic/etc/weekly/340.noid
Eugene Grosbein [Mon, 10 Dec 2018 14:19:57 +0000 (14:19 +0000)]
MFC r340322-r340324,r340327: periodic/etc/weekly/340.noid

Prevent periodic/etc/weekly/340.noid from descending into root directories
of jails. Jails have their own user/group databases and this script
can produce multiple false warnings, not to mention significant extra
load in case of large jailed subtrees. Leave this check for jailed
invocations of the same script.

5 years agoMFC r340321: Move definition of $jail_conf variable to /etc/defaults/rc.conf
Eugene Grosbein [Mon, 10 Dec 2018 14:09:15 +0000 (14:09 +0000)]
MFC r340321: Move definition of $jail_conf variable to /etc/defaults/rc.conf
from jail startup script so it can be successfully queried
with the command "sysrc jail_conf".

5 years agoMFC r340319: jail(8): introduce new command option -e to exhibit
Eugene Grosbein [Mon, 10 Dec 2018 13:41:28 +0000 (13:41 +0000)]
MFC r340319: jail(8): introduce new command option -e to exhibit
a list of configured non-wildcard jails with their parameters,
no matter running or not.

The option -e takes separator argument that is used
to separate printed parameters. It will be used with following
additions to system periodic scripts to differentiate parts
of directory tree belonging jails as opposed to host's.

5 years agoMFC r341448:
Konstantin Belousov [Mon, 10 Dec 2018 01:03:16 +0000 (01:03 +0000)]
MFC r341448:
Print type designator 'D' for the KF_TYPE_DEV files.

5 years agoMFC r341447:
Konstantin Belousov [Mon, 10 Dec 2018 01:01:43 +0000 (01:01 +0000)]
MFC r341447:
Improve procstat reporting for the linux cdev file descriptors.

5 years agoMFC r341439:
Konstantin Belousov [Mon, 10 Dec 2018 00:56:07 +0000 (00:56 +0000)]
MFC r341439:
Provide naive but self-contained implementations of memset(3) and
bzero(3) for rtld.

5 years agoMFC r341441:
Konstantin Belousov [Mon, 10 Dec 2018 00:54:18 +0000 (00:54 +0000)]
MFC r341441:
Some fixes for LD_BIND_NOW + ifuncs.

5 years agoMFC r341164: sh: Fix ${param?} default error message
Jilles Tjoelker [Sun, 9 Dec 2018 19:14:21 +0000 (19:14 +0000)]
MFC r341164: sh: Fix ${param?} default error message

If word in ${param?word} is missing, the shell shall write a default error
message. So expanding ${param?} when param is not set should write an error
message like

sh: param: parameter not set

This was broken by r316417.

PR: 233585

5 years agoMFC r340211:
Marcelo Araujo [Sun, 9 Dec 2018 06:48:44 +0000 (06:48 +0000)]
MFC r340211:

Comestic change to try to inline the memset with SSE/AVX instructions.
Also switch from int to size_t to keep portability.

Reviewed by: brooks
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D17795

5 years agoMFC r341393:
Michal Meloun [Sun, 9 Dec 2018 06:46:53 +0000 (06:46 +0000)]
MFC r341393:

  Return computed real memory size, not a value from similarly named global
  variable.

5 years agoMFC r340046, r340050
Marcelo Araujo [Sun, 9 Dec 2018 06:41:57 +0000 (06:41 +0000)]
MFC r340046, r340050

r340046:
Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
keys.

PR: 213835
Submitted by: Vasily Postnicov <ivan.zhmudo@gmail.com>
Relnotes: Yes
Sponsored by: iXsystems Inc.

r340050:
Remove printf for debug purpose forgotten on r340046.

Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

5 years agoMFC r341397:
Konstantin Belousov [Sun, 9 Dec 2018 00:41:46 +0000 (00:41 +0000)]
MFC r341397:
Correct accuracy of the barrier writes accounting.

5 years agoMFC r340835:
Yuri Pankov [Sat, 8 Dec 2018 19:45:05 +0000 (19:45 +0000)]
MFC r340835:
regexec: fix processing multibyte strings.

Matcher function incorrectly assumed that moffset that we get from
findmust is in bytes. Fix this by introducing a stepback function,
taking short path if MB_CUR_MAX is 1, and going back byte-by-byte,
checking if we have a legal character sequence otherwise.

PR: 153502
Reviewed by: pfg, kevans
Differential revision: https://reviews.freebsd.org/D18297

5 years agoMFC r341377, r341388 (fixup):
Cy Schubert [Sat, 8 Dec 2018 17:50:00 +0000 (17:50 +0000)]
MFC r341377, r341388 (fixup):

Restore handling of PMTU discovery, removed through an unifdef(1)
following the MFV of r254219 into r255332. In addition the 'FreeBSD'
macro was never defined in ipfilter 5.1.2 thus it never would have
been enabled in the first place.

This work is prompted by a general cleanup of the IP Filter code
prompted by working to resolve a PR. More to follow.

5 years agoMFC r341384:
Cy Schubert [Sat, 8 Dec 2018 17:28:52 +0000 (17:28 +0000)]
MFC r341384:

Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
is dead). This includes collaterally removing code shared by HP/UX,
SGI, and Linux, where IP Filter will in all likelihood for various
reasons never run again.

5 years agoMFC r340474:
Mike Karels [Sat, 8 Dec 2018 14:54:33 +0000 (14:54 +0000)]
MFC r340474:
Fix flags collision causing inability to enable CBQ in ALTQ

The CBQ BORROW flag conflicts with the RMCF_CODEL flag; the
two sets of definitions actually define the same things. The symptom
is that a kernel with CBQ support and not CODEL fails to load a QoS
policy with the obscure error "pfctl: DIOCADDALTQ: Cannot allocate memory."
If ALTQ_DEBUG is enabled, the error becomes a little clearer:
"rmc_newclass: CODEL not configured for CBQ!" is printed by the kernel.
There really shouldn't be two sets of macros that have to be defined
consistently, but the include structure isn't right for exporting
CBQ flags to altq_rmclass.h. Re-align the definitions, and add
CTASSERTs in the kernel to ensure that the definitions are consistent.

PR:             215716
Reviewed by:    pkelsey
Sponsored by:   Forcepoint LLC
Differential Revision:  https://reviews.freebsd.org/D17758

5 years agoMFC r341375:
Konstantin Belousov [Sat, 8 Dec 2018 00:46:05 +0000 (00:46 +0000)]
MFC r341375:
Allow to create swap zone larger than v_page_count / 2.

5 years agoMFC r341374:
Konstantin Belousov [Sat, 8 Dec 2018 00:44:44 +0000 (00:44 +0000)]
MFC r341374:
Correct the tunable name in the message.

PR: 231577

5 years agoMFC r340245: ping(8): improve diagnostics in case of wrong arguments.
Eugene Grosbein [Sat, 8 Dec 2018 00:28:27 +0000 (00:28 +0000)]
MFC r340245: ping(8): improve diagnostics in case of wrong arguments.

  For example, in case of super-user:
  $ sudo ping -s -64 127.0.0.1
  PING 127.0.0.1 (127.0.0.1): -64 data bytes
  ping: sendto: Invalid argument

  For unprivileged user:
  $ ping -s -64 127.0.0.1
  ping: packet size too large: 18446744073709551552 > 56: Operation not permitted

  Fix this by switching from strtoul() to strtol() for integer arguments
  and adding explicit checks for negative values.

5 years agoMFC r341280:
Cy Schubert [Fri, 7 Dec 2018 21:42:41 +0000 (21:42 +0000)]
MFC r341280:

Clean up a rather useless conditional structure member definition.

5 years agoMFC r341346:
Mark Johnston [Fri, 7 Dec 2018 15:48:42 +0000 (15:48 +0000)]
MFC r341346:
Add missing display messages when toggling modes.

PR: 233667

5 years agoMFC r340864:
Konstantin Belousov [Fri, 7 Dec 2018 14:45:28 +0000 (14:45 +0000)]
MFC r340864:
Parse FreeBSD Feature Control note on the ELF image activation.

5 years agoMFC r340858:
Konstantin Belousov [Fri, 7 Dec 2018 14:25:46 +0000 (14:25 +0000)]
MFC r340858:
rtld: parse FreeBSD Feature Control note on the object load.

5 years agoMFC r340076: Define NT_FREEBSD_FEATURE_CTL ELF note type
Ed Maste [Fri, 7 Dec 2018 13:53:29 +0000 (13:53 +0000)]
MFC r340076: Define NT_FREEBSD_FEATURE_CTL ELF note type

This ELF note will be used to allow binaries to opt out of, or in to,
upcoming vulnerability mitigation and other features.

5 years agoMFC r341008:
Andrey V. Elsukov [Fri, 7 Dec 2018 09:38:25 +0000 (09:38 +0000)]
MFC r341008:
  Fix possible panic during ifnet detach in rtsock.

  The panic can happen, when some application does dump of routing table
  using sysctl interface. To prevent this, set IFF_DYING flag in
  if_detach_internal() function, when ifnet under lock is removed from
  the chain. In sysctl_rtsock() take IFNET_RLOCK_NOSLEEP() to prevent
  ifnet detach during routes enumeration. In case, if some interface was
  detached in the time before we take the lock, add the check, that ifnet
  is not DYING. This prevents access to memory that could be freed after
  ifnet is unlinked.

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

MFC r341334:
  Adapt the fix in r341008 to correctly work with EBR.

  IFNET_RLOCK_NOSLEEP() is epoch_enter_preempt() in FreeBSD 12+. Holding
  it in sysctl_rtsock() doesn't protect us from ifnet unlinking, because
  unlinking occurs with IFNET_WLOCK(), that is rw_wlock+sx_xlock, and it
  doesn check that concurrent code is running in epoch section. But while
  we are in epoch section, we should be able to do access to ifnet's
  fields, even it was unlinked. Thus do not change if_addr and if_hw_addr
  fields in ifnet_detach_internal() to NULL, since rtsock code can do
  access to these fields and this is allowed while it is running in epoch
  section.

  This should fix the race, when ifnet_detach_internal() unlinks ifnet
  after we checked it for IFF_DYING in sysctl_dumpentry.

  Move free(ifp->if_hw_addr) into ifnet_free_internal(). Also remove the
  NULL check for ifp->if_description, since free(9) can correctly handle
  NULL pointer.

5 years agoMFC r341505:
Pedro F. Giffuni [Fri, 7 Dec 2018 03:43:34 +0000 (03:43 +0000)]
MFC r341505:
ext2fs.5: basic updates.

Starting with FreeBSD 12 we fully support writing ext4 filesystems.
Mention some features that we don't support while here.

5 years agoMFC r340860:
Konstantin Belousov [Fri, 7 Dec 2018 00:50:02 +0000 (00:50 +0000)]
MFC r340860:
Provide storage for the process feature control flags in struct proc.

5 years agoMFC r340863:
Konstantin Belousov [Fri, 7 Dec 2018 00:35:56 +0000 (00:35 +0000)]
MFC r340863:
Generalize ELF parse_notes().

5 years agoMFC r340862:
Konstantin Belousov [Fri, 7 Dec 2018 00:33:02 +0000 (00:33 +0000)]
MFC r340862:
Trivial reduction of the code duplication, reuse the return FALSE code.

5 years agoMFC r340986: UPDATING: add note for ld.bfd removal
Ed Maste [Thu, 6 Dec 2018 16:10:39 +0000 (16:10 +0000)]
MFC r340986: UPDATING: add note for ld.bfd removal

r340984 in HEAD, MFC in r341239

5 years agoMFC r340010
Eric Joyner [Thu, 6 Dec 2018 15:28:09 +0000 (15:28 +0000)]
MFC r340010

ixl/iavf(4): Update remaining references of "num_queues" to "num_rx_queues"

5 years agoMFC r340491, r340492:
Yuri Pankov [Thu, 6 Dec 2018 10:53:11 +0000 (10:53 +0000)]
MFC r340491, r340492:
Use UnicodeData.txt to create UTF-8 ctype map.

This should provide more complete coverage of currently defined Unicode
characters as compared to manually assembled one we use currently.

Comparison of original and new UTF-8 ctype maps by character class:

TYPE    ORIG    NEW
alnum   94229   126029
alpha   93557   125419
blank   4       2
cntrl   73      137685
digit   469     622
graph   109615  137203
lower   1478    2145
print   109641  137222
punct   3428    797
rune    110481  274907
space   33      24
upper   983     1781
xdigit  469     622

Large number of added cntrl definitions is due to the fact that private-use
planes are currently defined as such, this can change in the future.

Discussed with: bapt
Differential revision: https://reviews.freebsd.org/D17842

5 years agoMFC r340204:
Yuri Pankov [Thu, 6 Dec 2018 10:48:46 +0000 (10:48 +0000)]
MFC r340204:
Cleanup locale tools:

- Simplify the source dir specification, and update README
  appropriately
- Drop the LC (doonly) processing, it's broken, and even if fixed, not
  really useful
- Don't remove the target directories while installing new data as it
  removes Makefile.depend which we don't manage; only rm the files we
  are going to add/replace/delete instead
- Restrict adding bsd.endian.mk to colldef and ctypedef Makefiles, it's
  not needed in other (text-only) categories
- GC unused scripts; they don't seem to be particularly helpful standalone
  as well

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D17858

5 years agoMFC r340144:
Yuri Pankov [Thu, 6 Dec 2018 10:41:22 +0000 (10:41 +0000)]
MFC r340144:
Add hybrid C.UTF-8 locale being identical to default C locale except
that it uses the same ctype maps and functions as other UTF-8 locales.

Reviewed by: bapt, cem, eadler
Differential Revision: https://reviews.freebsd.org/D17833

5 years agoMFC r340128:
Yuri Pankov [Thu, 6 Dec 2018 09:51:51 +0000 (09:51 +0000)]
MFC r340128:
Teach man(1) about C.UTF-8.

While here, use LANG as the proper source to select man pages language/encoding,
falling back to LC_CTYPE.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D17835

5 years agoMFC r340104:
Yuri Pankov [Thu, 6 Dec 2018 09:47:23 +0000 (09:47 +0000)]
MFC r340104:
Update to CLDR 34 and UNICODE 11.

Discussed with: bapt

5 years agoMFC r340111:
Baptiste Daroussin [Thu, 6 Dec 2018 08:27:30 +0000 (08:27 +0000)]
MFC r340111:

nfsd: Factorize code

Factorize code by using struct sockaddr_storage to handle both ipv6 and ipv4

Discussed with: rmacklem
Reviewed by: manu
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D13223

5 years agoMFC r341265:
Cy Schubert [Thu, 6 Dec 2018 04:28:39 +0000 (04:28 +0000)]
MFC r341265:

Remove an old comment/code and replace with a comment that
directly references a NetBSD commit.

5 years agoMFC r340525:
Alan Somers [Thu, 6 Dec 2018 02:38:42 +0000 (02:38 +0000)]
MFC r340525:

mount_fusefs.8: expand HISTORY section

Note that fuse was available from ports long before joining the base system.
Also, update the upstream URL.

5 years agoMFC r340455:
Alan Somers [Thu, 6 Dec 2018 02:37:34 +0000 (02:37 +0000)]
MFC r340455:

fcntl.2: document an additional error condition

5 years agoMFC r339827:
Yuri Pankov [Wed, 5 Dec 2018 17:10:06 +0000 (17:10 +0000)]
MFC r339827:
localedef: define characters in "space" class also as "print", except
for the known conflicts ("control" characters can't be "print"able).
POSIX doesn't explicitly forbid this, and actually includes <space>
character in "print".

PR: 225692
Reviewed by: bapt, cem (previous version), pfg (previous version)
Differential Revision: https://reviews.freebsd.org/D17467

5 years agoMFC r339989, r339991:
Michael Tuexen [Tue, 4 Dec 2018 22:46:58 +0000 (22:46 +0000)]
MFC r339989, r339991:

Improve a comment to refer to the actual sections in the TCP
specification for the comparisons made.
Thanks to lstewart@ for the suggestion.

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

5 years agoMFC r341335:
Michael Tuexen [Tue, 4 Dec 2018 22:15:56 +0000 (22:15 +0000)]
MFC r341335:

Limit option_len for the TCP_CCALGOOPT.

Limiting the length to 2048 bytes seems to be acceptable, since
the values used right now are using 8 bytes.
This issue was found by using syzkaller.

Reviewed by: glebius, bz, rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18366

5 years agoMFC r340782:
Michael Tuexen [Tue, 4 Dec 2018 22:14:18 +0000 (22:14 +0000)]
MFC r340782:

A TCP stack is required to check SEG.ACK first, when processing a
segment in the SYN-SENT state as stated in Section 3.9 of RFC 793,
page 66. Ensure this is also done by the TCP RACK stack.

Reviewed by: rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18034

5 years agoMFC r340781:
Michael Tuexen [Tue, 4 Dec 2018 22:13:05 +0000 (22:13 +0000)]
MFC r340781:

Ensure that the TCP RACK stack honours the setting of the
net.inet.tcp.drop_synfin sysctl-variable.

Reviewed by: rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18033

5 years agoMFC r340777:
Michael Tuexen [Tue, 4 Dec 2018 22:11:41 +0000 (22:11 +0000)]
MFC r340777:

Ensure that the default RTT stack can make an RTT measurement if
the TCP connection was initiated using the RACK stack, but the
peer does not support the TCP RACK extension.

This ensures that the TCP behaviour on the wire is the same if
the TCP connection is initated using the RACK stack or the default
stack.

Reviewed by: rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18032

5 years agoMFC r340774:
Michael Tuexen [Tue, 4 Dec 2018 22:10:09 +0000 (22:10 +0000)]
MFC r340774:

Ensure that TCP RST-segments announce consistently a receiver window of
zero. This was already done when sending them via tcp_respond().

Reviewed by: rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D17949

5 years agoMFC r340738:
Michael Tuexen [Tue, 4 Dec 2018 22:05:36 +0000 (22:05 +0000)]
MFC r340738:

Improve two KASSERTs in the TCP RACK stack.

There are two locations where an always true comparison was made in
a KASSERT. Replace this by an appropriate check and use a consistent
panic message. Also use this code when checking a similar condition.

PR: 229664
Reviewed by: rrs@
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18021

5 years agoMFC r341464:
Renato Botelho [Tue, 4 Dec 2018 20:40:28 +0000 (20:40 +0000)]
MFC r341464:

Restore /var/crash permissions to 0750, as declared in mtree file. After
r337337 it changed to 0755.

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

5 years agoMFC r341442, r341443:
Mark Johnston [Tue, 4 Dec 2018 19:06:11 +0000 (19:06 +0000)]
MFC r341442, r341443:
Plug memory disclosures via ptrace(2).

5 years agoMFC r341484
Gordon Tetlow [Tue, 4 Dec 2018 18:31:21 +0000 (18:31 +0000)]
MFC r341484

Always treat firmware request and response sizes as unsigned.

This fixes an incomplete bounds check on the guest-supplied request
size where a very large request size could be interpreted as a negative
value and not be caught by the bounds check.

Submitted by: jhb
Reported by:  Reno Robert
Approved by:  so
Security:     FreeBSD-SA-18:14.bhyve
Security:     CVE-2018-17160

5 years agoMFC r341430
Vincenzo Maffione [Tue, 4 Dec 2018 17:57:01 +0000 (17:57 +0000)]
MFC r341430

netmap(4): improve man page

Reviewed by:    bcr
Differential Revision:  https://reviews.freebsd.org/D18057

5 years agoMFC r341096:
Konstantin Belousov [Tue, 4 Dec 2018 15:06:24 +0000 (15:06 +0000)]
MFC r341096:
Fix assert condition in pmap_large_unmap().

5 years agoMFC r341094:
Konstantin Belousov [Tue, 4 Dec 2018 15:02:19 +0000 (15:02 +0000)]
MFC r341094:
Improve sigonstack().

5 years agoMFC r341073:
Andrey V. Elsukov [Tue, 4 Dec 2018 09:16:20 +0000 (09:16 +0000)]
MFC r341073:
  Do not limit the mbuf queue length for keepalive packets.

  It was unlimited before overhaul, and one user reported that this limit
  can be reached easily.

  PR: 233562

5 years agoMFC r340135: Make ng_pptpgre(8) netgraph node be able to restore order
Eugene Grosbein [Tue, 4 Dec 2018 07:39:54 +0000 (07:39 +0000)]
MFC r340135: Make ng_pptpgre(8) netgraph node be able to restore order
for packets reordered in transit instead of dropping them altogether.
It uses sequence numbers of PPtPGRE packets.

A set of new sysctl(8) added to control this ability or disable it:

net.graph.pptpgre.reorder_max (1) defines maximum length of node's
private reorder queue used to keep data waiting for late packets.
Zero value disables reordering. Default value 1 allows the node to restore
the order for two packets swapped in transit. Greater values allow the node
to deliver packets being late after more packets in sequence
at cost of increased kernel memory usage.

net.graph.pptpgre.reorder_timeout (1) defines time value in miliseconds
used to wait for late packets. It may be useful to increase this
if reordering spot is distant.

5 years agoMFC r341357:
Guangyuan Yang [Tue, 4 Dec 2018 02:30:11 +0000 (02:30 +0000)]
MFC r341357:

Clarify that patterns are extended regular expressions in pkill(1) manual page.

PR: 231060
Submitted by: naddy

5 years agoMFC r340110: ipfw(8): clarify layer2 processing abilities
Eugene Grosbein [Tue, 4 Dec 2018 00:41:12 +0000 (00:41 +0000)]
MFC r340110: ipfw(8): clarify layer2 processing abilities

Make it clear that ipfw action set for layer2 frames is a bit limited.

PR: 59835
Reviewed by: yuripv
Differential Revision: https://reviews.freebsd.org/D17719

5 years agoMFC r339627:
Kristof Provost [Mon, 3 Dec 2018 22:02:08 +0000 (22:02 +0000)]
MFC r339627:

pf tests: Fix incorrect test for PR 231323

Fix r339466.  The test result file did not list the rdr rule.
Additionally, the route-to rule needs a redirection address.

PR: 233739

5 years agoMFC r341156:
Stephen Hurd [Mon, 3 Dec 2018 15:18:35 +0000 (15:18 +0000)]
MFC r341156:

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.

This is the same fix as the r340310 for e1000

PR: 233607
Reported by: lev
Reviewed by: lev
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D18368

5 years agoMFC r341001:
Mark Johnston [Mon, 3 Dec 2018 15:14:40 +0000 (15:14 +0000)]
MFC r341001:
Check for an allocation failure before dereferencing the pointer.

5 years agoMFC r341071, r341160
Ian Lepore [Mon, 3 Dec 2018 04:07:18 +0000 (04:07 +0000)]
MFC r341071, r341160

r341071:
Restore the ability to override the disk unit/partition at the boot: prompt
in gptboot.

When arch-independent geli support was added, a new static 'gdsk' struct
was added, but there was still a static 'dsk' struct, and when you typed
in an alternate disk/partition, the string was parsed into that struct,
which was then never used for anything.  Now the string gets parsed into
gdsk.dsk, the struct that's actually used.

r341160:
Add comments describing the bootargs handoff between loader(8) and gptboot
or zfsboot, when loader(8) is the BTX loader.  No functional changes.

5 years agoMFC r340095: Remove apparently unused 0-byte files that cause grief on Windows
Ed Maste [Mon, 3 Dec 2018 02:32:39 +0000 (02:32 +0000)]
MFC r340095: Remove apparently unused 0-byte files that cause grief on Windows

r235274 added a sort regression test (it operates by comparing output
against GNU sort).  The commit included a number of 0-byte files, one
of which ends in a trailing . which reportedly breaks svn/git checkouts
on Windows.

It appears these were added accidentally, so just remove them.

PR: 232479

5 years agoMFC r340917, r341007
Guangyuan Yang [Sun, 2 Dec 2018 19:08:51 +0000 (19:08 +0000)]
MFC r340917, r341007

r340917:
Update pxeboot(8) manual page to reflect the next-server change in the ISC DHCP v3 server.

r341007:
Bump the date of pxeboot(8) manual page for r340917.

PR: 123484
Submitted by: edwin@mavetju.org
Reviewed by: AllanJude

5 years agoMFC r340922:
Konstantin Belousov [Sun, 2 Dec 2018 12:35:48 +0000 (12:35 +0000)]
MFC r340922:
Avoid unneeded check in vmspace_alloc().

5 years agoMFC r340867:
Cy Schubert [Sat, 1 Dec 2018 18:23:41 +0000 (18:23 +0000)]
MFC r340867:

FreeBSD 7 has been history for many moons. Remove some dead code.

5 years agoMFC r340868:
Cy Schubert [Sat, 1 Dec 2018 18:17:51 +0000 (18:17 +0000)]
MFC r340868:

An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source
file.

5 years agoMFC r340909:
Cy Schubert [Sat, 1 Dec 2018 18:09:17 +0000 (18:09 +0000)]
MFC r340909:

Combine two lines into one following unifdef for r255332.