]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoarm: clean up empty lines in .c and .h files
mjg [Tue, 1 Sep 2020 21:17:24 +0000 (21:17 +0000)]
arm: clean up empty lines in .c and .h files

3 years agoamd64: clean up empty lines in .c and .h files
mjg [Tue, 1 Sep 2020 21:16:54 +0000 (21:16 +0000)]
amd64: clean up empty lines in .c and .h files

3 years agoadd Xr to device_get_sysctl(9) to make this easier to find
jmg [Tue, 1 Sep 2020 20:42:48 +0000 (20:42 +0000)]
add Xr to device_get_sysctl(9) to make this easier to find

3 years agoiflib: leave only 1 receive descriptor unused
vmaffione [Tue, 1 Sep 2020 20:41:47 +0000 (20:41 +0000)]
iflib: leave only 1 receive descriptor unused

The pidx argument of isc_rxd_flush() indicates which is the last valid
receive descriptor to be used by the NIC. However, current code has
multiple issues:
  - Intel drivers write pidx to their RDT register, which means that
    NICs will only use the descriptors up to pidx-1 (modulo ring size N),
    and won't actually use the one pointed by pidx. This does not break
    reception, but it is anyway confusing and suboptimal (the NIC will
    actually see only N-2 descriptors as available, rather than N-1).
    Other drivers (if_vmx, if_bnxt, if_mgb) adhere to this semantic).
  - The semantic used by Intel (RDT is one descriptor past the last
     valid one) is used by most (if not all) NICs, and it is also used
     on the TX side (also in iflib). Since iflib is not currently
     using this semantic for RX, it must decrement fl->ifl_pidx
     (modulo N) before calling isc_rxd_flush(), and then the
     per-driver callback implementation must increment the index
     again (to match the real semantic). This is confusing and suboptimal.
  -  The iflib refill function is also called at initialization.
     However, in case the ring size is smaller than 128 (e.g. if_mgb),
     the refill function will actually prepare all the receive
     descriptors (N), without leaving one unused, as most of NICs assume
     (e.g. to avoid RDT to overrun RDH). I can speculate that the code
     looks like this right now because this issue showed up during
     testing (e.g. with if_mgb), and it was easy to workaround by
     decrementing pidx before isc_rxd_flush().

The goal of this change is to simplify the code (removing a bunch
of instructions from the RX fast path), and to make the semantic of
isc_rxd_flush() consistent across drivers. To achieve this, we:
  - change the semantics of the pidx argument to the usual one (that
    is the index one past the last valid one), so that both iflib and
    drivers avoid the decrement/increment dance.
  - fix the initialization code to prepare at most N-1 descriptors.

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26191

3 years agoqlxgb: Initialize if_mtu before setting max_frame_size.
markj [Tue, 1 Sep 2020 20:13:50 +0000 (20:13 +0000)]
qlxgb: Initialize if_mtu before setting max_frame_size.

Previously we were relying on ether_ifattach() to set if_mtu, but
max_frame_size is initialized earlier.  This fixes a regression
introduced by r250375.

PR: 249050
Submitted by: Christian Vallières <novacrash_@hotmail.com>
MFC after: 3 days

3 years agoDocument the fact that you must set an i2c slave address as well as the
ian [Tue, 1 Sep 2020 19:06:08 +0000 (19:06 +0000)]
Document the fact that you must set an i2c slave address as well as the
upstream iicbus to configure this device using hints.

3 years agoEnsure zstreamdump subdir can be visited
freqlabs [Tue, 1 Sep 2020 19:02:07 +0000 (19:02 +0000)]
Ensure zstreamdump subdir can be visited

Reported by: Thomas Laus
Sponsored by: iXsystems, Inc.

3 years agoMove all of the error prints in readsb() from stderr to stdout.
chs [Tue, 1 Sep 2020 18:50:26 +0000 (18:50 +0000)]
Move all of the error prints in readsb() from stderr to stdout.
The only output from fsck that should go to stderr is the usage message.
if setup() fails then exit with EEXIT rather than 0.

Reviewed by: mckusick
Sponsored by: Netflix

3 years agoFix a buffer overrun.
jhb [Tue, 1 Sep 2020 16:20:42 +0000 (16:20 +0000)]
Fix a buffer overrun.

getln() returns 'len' valid characters.  line[len] is out of bounds.

Reported by: CHERI
Reviewed by: brooks
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26197

3 years agoIntroduce the SDHCI driver for NXP QorIQ Layerscape SoCs
mw [Tue, 1 Sep 2020 16:17:21 +0000 (16:17 +0000)]
Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs

Implement support for an eSDHC controller found in NXP QorIQ Layerscape SoCs.

This driver has been tested with NXP LS1046A and LX2160A (Honeycomb board),
which is incompatible with the existing sdhci_fsl driver (aiming at older
chips from this family). As such, it is not intended as replacement for
the old driver, but rather serves as an improved alternative for SoCs that
support it.
It comes with support for both PIO and Single DMA modes and samples the
clock from the extres clk API.

Submitted by: Artur Rojek <ar@semihalf.com>
Reviewed by: manu, mmel, kibab
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D26153

3 years agoBump date for r365052
imp [Tue, 1 Sep 2020 16:13:09 +0000 (16:13 +0000)]
Bump date for r365052

3 years agoHave script accept and ignore -e for Linux compat
imp [Tue, 1 Sep 2020 16:11:23 +0000 (16:11 +0000)]
Have script accept and ignore -e for Linux compat

In the util-linux version of script, it will always exit with succes.
Except when run with -e, in which case it will have the exit value of
the child. BSD Script already uses the child's exit value for its exit
value. Some config and other helper scripts depend on being able to
specify -e. Accept it for compatibility since we'll already to the
right thing, but otherwise we ignore it.

3 years agopmc: Fix freed internal location read
vangyzen [Tue, 1 Sep 2020 15:52:18 +0000 (15:52 +0000)]
pmc: Fix freed internal location read

Coverity detected this error.  The fix duplicates the assignment on line 171.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26227

3 years agoAdd Cannon Point PCH Thermal Controller Device ID.
takawata [Tue, 1 Sep 2020 15:33:57 +0000 (15:33 +0000)]
Add Cannon Point PCH Thermal Controller Device ID.

PR: 249047
Reported by: Dries Michiels <driesm.michiels at gmail.com>
--This line, and those below, will be ignored--
> Description of fields to fill in above:                     76 columns --|
> PR:                       If and which Problem Report is related.
> Submitted by:             If someone else sent in the change.
> Reported by:              If someone else reported the issue.
> Reviewed by:              If someone else reviewed your modification.
> Approved by:              If you needed approval for this commit.
> Obtained from:            If the change is from a third party.
> MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
> MFH:                      Ports tree branch name.  Request approval for merge.
> Relnotes:                 Set to 'yes' for mention in release notes.
> Security:                 Vulnerability reference (one per line) or description.
> Sponsored by:             If the change was sponsored by an organization (each collaborator).
> Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
> Empty fields above will be automatically removed.

M    pchtherm.c

3 years agorelease.7: update for current context
emaste [Tue, 1 Sep 2020 15:30:40 +0000 (15:30 +0000)]
release.7: update for current context

It's no longer unusual to be able to build a release with a single
command, so drop "actually" that hints at a surprise.  Also just use
"network install directory" instead of referencing FTP; it's more
likely to be HTTP now.

Reviewed by: gjb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26260

3 years agoTighten frame pointer checking in DTrace's amd64 stack unwinder.
markj [Tue, 1 Sep 2020 15:15:44 +0000 (15:15 +0000)]
Tighten frame pointer checking in DTrace's amd64 stack unwinder.

Avoid assuming that the kernel was compiled with
-fno-omit-frame-pointer.

MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

3 years agoCorrect the D definition for EINTEGRITY.
markj [Tue, 1 Sep 2020 15:15:22 +0000 (15:15 +0000)]
Correct the D definition for EINTEGRITY.

MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

3 years agopw: Handle errors from ftell() when removing records from /etc/opiekeys.
markj [Tue, 1 Sep 2020 15:15:09 +0000 (15:15 +0000)]
pw: Handle errors from ftell() when removing records from /etc/opiekeys.

Reported by: Coverity
MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

3 years agopw: Fix a resource leak.
markj [Tue, 1 Sep 2020 15:14:51 +0000 (15:14 +0000)]
pw: Fix a resource leak.

Reported by: Coverity
MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

3 years agopw: Remove unnecessary errp checks.
markj [Tue, 1 Sep 2020 15:14:26 +0000 (15:14 +0000)]
pw: Remove unnecessary errp checks.

The caller-supplied pointer is unconditionally dereferenced at the
beginning of the function, so there is no point in comparing it with
NULL thereafter.

Reported by: Coverity
MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

3 years agopw: Fix terminal handling when setting a group password.
markj [Tue, 1 Sep 2020 15:14:13 +0000 (15:14 +0000)]
pw: Fix terminal handling when setting a group password.

Reported by: Coverity
MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

3 years agoMake sure not to pass NULL to strtoul(3). The values come
trasz [Tue, 1 Sep 2020 14:58:57 +0000 (14:58 +0000)]
Make sure not to pass NULL to strtoul(3).  The values come
from the kernel, but let's try to be on the safe side.

Reviewed by: mav
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26246

3 years agodiff: always properly kill pr(1)
bapt [Tue, 1 Sep 2020 14:52:39 +0000 (14:52 +0000)]
diff: always properly kill pr(1)

When diff is invoked with -l it will spawn the pr(1) program.
In some circumpstances the pr(1) was not properly killed when diff program
exits.

Submitted by: Bret Ketchum
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D26232

3 years agoFix string overflow that could occur during redirection due to passing
trasz [Tue, 1 Sep 2020 14:52:35 +0000 (14:52 +0000)]
Fix string overflow that could occur during redirection due to passing
the wrong length to strlcpy(3). It looks like it could overflow into
the next field, isc_user, which is properly long to accomodate for it;
I don't think it could cause any harm other than breaking the connection.

Reviewed by: mav
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26247

3 years agoEnsure the tlbi has completed before setting SCTLR
andrew [Tue, 1 Sep 2020 14:50:43 +0000 (14:50 +0000)]
Ensure the tlbi has completed before setting SCTLR

When enabling the MMU on arm64 we need to ensure the tlb invalidation has
completed before setting the enable bit in the SCTLR register.

Reported by: alc
Sponsored by: Innovate UK

3 years agosh: Write absolute path in command -vV and type
jilles [Tue, 1 Sep 2020 13:19:15 +0000 (13:19 +0000)]
sh: Write absolute path in command -vV and type

POSIX is pretty clear that command -v, command -V and type shall write
absolute pathnames. Therefore, we need to prepend the current directory's
name to relative pathnames.

This can happen either when PATH contains a relative pathname or when the
operand contains a slash but is not an absolute pathname.

3 years agoMake hardware TLS send tag allocation synchronous in mlx5en(4).
hselasky [Tue, 1 Sep 2020 12:21:17 +0000 (12:21 +0000)]
Make hardware TLS send tag allocation synchronous in mlx5en(4).

Previously the send tag was setup in the background, and all packets for
the given send tag were dropped until ready. Change this to be blocking
behaviour so that once the setsocketopt() for enabling TLS completes,
the socket is ready to send packets. Do this by simply flushing the
work request which does the needed firmware programming during send
tag allocation.

MFC after: 1 week
Sponsored by: Mellanox Technologies // Nvidia

3 years ago[PowerPC] Fix PMCLOG address width
luporl [Tue, 1 Sep 2020 11:34:05 +0000 (11:34 +0000)]
[PowerPC] Fix PMCLOG address width

PMCLOG macros were always using 32-bit addresses, even on PPC64.
This resulted in truncated addresses in logs, when running on 64-bit PPC
machines.

Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D26112

3 years ago[PowerPC] Move pmc_hook out of critical section
luporl [Tue, 1 Sep 2020 11:30:39 +0000 (11:30 +0000)]
[PowerPC] Move pmc_hook out of critical section

Calling pmc_hook inside a critical section may result in a panic.

This happens when the user callchain is fetched, because it uses
pmap_map_user_ptr, that tries to get the (sleepable) pmap lock when the
needed vsid is not found.

Judging by the implementation in other platforms, intr_irq_handler in
kern/subr_intr.c and what pmc_hook do, it seems safe to move pmc_hook
outside the critical section.

Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D26111

3 years agoSupport stage 2 arm64 pmap in more places
andrew [Tue, 1 Sep 2020 11:02:43 +0000 (11:02 +0000)]
Support stage 2 arm64 pmap in more places

Add support for stage 2 pmap to pmap_pte_dirty, pmap_release, and more
of pmap_enter. This adds support in all placess I have hit while testing
bhyve ehile faulting pages in as needed.

Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D26065

3 years agoChange printf format string to include the extra blank
se [Tue, 1 Sep 2020 09:02:43 +0000 (09:02 +0000)]
Change printf format string to include the extra blank

This is a follow up change to r364321 after a discussion about the style.
All near by places use extra blanks in format strings, and while use of the
format string to provide the extra blank may need more cycles than adding 1
to twidth, it generates shorter code and is clearer in the opinion of some
reviewers of the previous change.

Not objected to by: emaste
MFC after: 3 days

3 years agoFully revert r364379.
hselasky [Tue, 1 Sep 2020 08:14:46 +0000 (08:14 +0000)]
Fully revert r364379.

The "Intel Sunrise Point-LP USB 3.0 controller" doesn't update the wMaxPacket
field in the control endpoint context automatically causing a BABBLE error code
on the initial first USB device descriptor read, when the bMaxPacketSize is not
8 bytes.

Reported by: wulf@
PR: 248784
MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoAdd a pointer to csprng@ for the CSPRNG driver. This is enforced anyway by
markm [Tue, 1 Sep 2020 08:02:12 +0000 (08:02 +0000)]
Add a pointer to csprng@ for the CSPRNG driver. This is enforced anyway by
subversion.

3 years agoUpdate to today's date
imp [Tue, 1 Sep 2020 07:56:28 +0000 (07:56 +0000)]
Update to today's date

Also, fix a whitespace botch

3 years agoAdd defines for OpenZFS variables
imp [Tue, 1 Sep 2020 07:54:14 +0000 (07:54 +0000)]
Add defines for OpenZFS variables

OZFS is the top of the OpenZFS tree (aka src/sys/contrib/openzfs).
ZFSOSSRC is the path to the OepnZFS sources
ZFSOSINC is the path to the OepnZFS includes

MFC After: 3 days

3 years agoVery preliminary loader.efi(8) man page
imp [Tue, 1 Sep 2020 07:54:09 +0000 (07:54 +0000)]
Very preliminary loader.efi(8) man page

3 years agoDocument boot1.efi
imp [Tue, 1 Sep 2020 07:46:27 +0000 (07:46 +0000)]
Document boot1.efi

Crude man page for boo1.efi.

3 years agolib: libnetmap: add missing copyright headers
vmaffione [Tue, 1 Sep 2020 06:06:32 +0000 (06:06 +0000)]
lib: libnetmap: add missing copyright headers

MFC after: 2 weeks

3 years agoSmaller crc for the boot loader.
imp [Tue, 1 Sep 2020 04:37:55 +0000 (04:37 +0000)]
Smaller crc for the boot loader.

Save 7k of text space by using simpler crc32 for standalone case. we
don't need all that fancy optimization in the boot loader, so use a
simplified version of the CRC function. We could save more by doing it
one bit at a time rather than 32, but this is the biggest savings at
the smallest performance hit.

With LUA and verfied exec, gptboot, gptzfsboot and friends are pushing
the ~530k limit and every little bit helps.

Reviewed By: allanjude
Differential Revision: https://reviews.freebsd.org/D24225

3 years ago[PowerPC] Remove unused openpic_set_priority().
bdragon [Tue, 1 Sep 2020 01:57:56 +0000 (01:57 +0000)]
[PowerPC] Remove unused openpic_set_priority().

When SMP support for powerpc was added in r178628, the last callers of this
function were removed. All code that needs to manipulate the task priority
just does it directly instead.

Noticed while reading through the lint logs.

Sponsored by: Tag1 Consulting, Inc.

3 years agoAdd a check to test for the case of the "tls" option being used with "udp".
rmacklem [Tue, 1 Sep 2020 01:10:16 +0000 (01:10 +0000)]
Add a check to test for the case of the "tls" option being used with "udp".

The KERN_TLS only supports TCP, so use of the "tls" option with "udp" will
not work.  This patch adds a test for this case, so that the mount is not
attempted when both "tls" and "udp" are specified.

3 years agoMakefile.inc1: comment .endif to ease finding matching .if
emaste [Tue, 1 Sep 2020 00:14:40 +0000 (00:14 +0000)]
Makefile.inc1: comment .endif to ease finding matching .if

3 years agoSort IFNET alphabetically
imp [Mon, 31 Aug 2020 23:48:27 +0000 (23:48 +0000)]
Sort IFNET alphabetically

3 years agoAdd documentation for ETHERNET events.
imp [Mon, 31 Aug 2020 23:48:23 +0000 (23:48 +0000)]
Add documentation for ETHERNET events.

3 years agoWarn for the non pccard attachments
imp [Mon, 31 Aug 2020 23:31:16 +0000 (23:31 +0000)]
Warn for the non pccard attachments

These devices have non-pccard attachments. Warn for those as well. Both an and
wi don't do the modern cyrpto needed to use these cards on secure wifi networks.
an needs firmware from Cisco, which I don't think was ever produced. wi could
in theory do it with raw frames and on-host encryption, but nobody has written
that in the 15 years since WEP was cracked.

MFC After: 3 days
Noticed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D26138

3 years agocxgbe(4): Check for descriptors before writing a TLS or raw work request.
np [Mon, 31 Aug 2020 22:44:59 +0000 (22:44 +0000)]
cxgbe(4): Check for descriptors before writing a TLS or raw work request.

This fixes a regression in r362905.

Submitted by: jhb@
Sponsored by: Chelsio Communications

3 years agoSuppress -Wempty-body warnings in GCC 6.x and later.
jhb [Mon, 31 Aug 2020 21:57:01 +0000 (21:57 +0000)]
Suppress -Wempty-body warnings in GCC 6.x and later.

libc++ in LLVM 11 uses an empty else clause in
include/c++/v1/__thread_support which triggers this warning.

Reviewed by: dim, emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26257

3 years agoFix the build of scandir_b with GCC.
jhb [Mon, 31 Aug 2020 21:55:25 +0000 (21:55 +0000)]
Fix the build of scandir_b with GCC.

Use explicit typedefs for block thunk structures as in r264143.

Reviewed by: kib, adrian
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26256

3 years agoAdd deprecation notice for apm BIOS
imp [Mon, 31 Aug 2020 21:04:00 +0000 (21:04 +0000)]
Add deprecation notice for apm BIOS

Add deprecation notice for apm bios, aka the apm(4) device. The apm(8)
command will remain, at least for a while, since ACPI emulates the apm
ioctl interface.

Discussed on: arch@
Relnotes: yes
MFC After: 3 days

3 years agovtnet(4): improve the wording
gbe [Mon, 31 Aug 2020 20:02:32 +0000 (20:02 +0000)]
vtnet(4): improve the wording

PR: 247936
Submitted by: PauAmma <pauamma at gundo dot com>
Reported by: PauAmma <pauamma at gundo dot com>
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D26244

3 years agogc pmtimer and apm
imp [Mon, 31 Aug 2020 19:47:30 +0000 (19:47 +0000)]
gc pmtimer and apm

pmtimer was removed from base some time ago. apm hasn't been relevant
for these devices in a long time (and was commented out). Remove them
both from these config files.

3 years agoUse symbolic names for asych events
imp [Mon, 31 Aug 2020 19:38:03 +0000 (19:38 +0000)]
Use symbolic names for asych events

Rather than |= 0x300, define and use asyn event names for the name
space changes and the firmware activations that we're asking for.

3 years agols(1): Update all POSIX references and correct the STANDARDS section
gbe [Mon, 31 Aug 2020 18:47:56 +0000 (18:47 +0000)]
ls(1): Update all POSIX references and correct the STANDARDS section

- Update the POSIX references for non-standard ls(1) options
- Simplify the STANDARDS section by mention both supported POSIX versions

Reported by: hrs
Reviewed by: hrs, bcr
Approved by: hrs, bcr
MFC after: 3 days
X-MFC-With: r364449
Differential Revision: https://reviews.freebsd.org/D26210

3 years agomlx5 sriov: Add controls for VFs to set port/node GUIDs.
kib [Mon, 31 Aug 2020 16:32:17 +0000 (16:32 +0000)]
mlx5 sriov: Add controls for VFs to set port/node GUIDs.

Setting GUIDs make RoCE offloads functional on VFs.

Reported and tested by: chuck
Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agomlx5 sriov: add error message for failed MAC programming on VF.
kib [Mon, 31 Aug 2020 16:30:52 +0000 (16:30 +0000)]
mlx5 sriov: add error message for failed MAC programming on VF.

Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agomlx5en: Implement SIOCGIFDOWNREASON.
kib [Mon, 31 Aug 2020 16:27:03 +0000 (16:27 +0000)]
mlx5en: Implement SIOCGIFDOWNREASON.

Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agomlx5_core: add mlx5_query_pddr().
kib [Mon, 31 Aug 2020 16:25:55 +0000 (16:25 +0000)]
mlx5_core: add mlx5_query_pddr().

And use it in mlx5_query_pddr_range_info() instead of direct register
access.

Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agomlx5_core: Import PDDR register definitions
kib [Mon, 31 Aug 2020 16:23:51 +0000 (16:23 +0000)]
mlx5_core: Import PDDR register definitions

PDDR (Port Diagnostics Database Register) is used to read the physical
layer debug database, which contains helpful troubleshooting information
regarding the state of the link.

PDDR register can only be queried when PCAM register reports it as
supported in its register mask. A new helper macro was added to
the MLX5_CAP_* infrastructure in order to access this mask.

Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agoinfiniband-diags: Fix memory leak in dump_multicast_tables
vangyzen [Mon, 31 Aug 2020 16:18:48 +0000 (16:18 +0000)]
infiniband-diags: Fix memory leak in dump_multicast_tables

Coverity detected leak.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: hselasky, kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26228

3 years agoinfiniband: Appease Coverty
vangyzen [Mon, 31 Aug 2020 16:17:28 +0000 (16:17 +0000)]
infiniband: Appease Coverty

Coverity claims the call to rdma_gid2ip in cma_igmp_send overwrites addr.
Use a consistent definition of sockaddr to prevent detections and code
changes in the future.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: hselasky, kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26229

3 years agolibpmc: Fix memory leak in process_mapfile
vangyzen [Mon, 31 Aug 2020 16:07:40 +0000 (16:07 +0000)]
libpmc: Fix memory leak in process_mapfile

Coverity detected memory leak fix.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: cem
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26230

3 years agoggated(8): Avoid doubly opening the requested disk device.
markj [Mon, 31 Aug 2020 15:59:17 +0000 (15:59 +0000)]
ggated(8): Avoid doubly opening the requested disk device.

- Initialize the disk device fd field in connection_new().
- Close the disk device after handing the connection over
  to a child worker.
- Avoid re-opening a disk device for each connection from
  the same client, avoiding an fd leak.

PR: 132845
Submitted by: Yoshihiro Ota <ota@j.email.ne.jp>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26168

3 years agodhclient: improve error handling parsing option 119
emaste [Mon, 31 Aug 2020 15:55:29 +0000 (15:55 +0000)]
dhclient: improve error handling parsing option 119

Reported by: Shlomi Oberman, JSOF
Submitted by: delphij
Reviewed by: markj
Tested by: markj

3 years agortwn(4): Add support for the Belkin N300.
markj [Mon, 31 Aug 2020 15:32:45 +0000 (15:32 +0000)]
rtwn(4): Add support for the Belkin N300.

PR: 249034
Submitted by: Salvador Martínez Mármol <salvica@kapj.net>
MFC after: 1 week

3 years agoFix nfsrvd_locku memory leak
vangyzen [Mon, 31 Aug 2020 15:31:17 +0000 (15:31 +0000)]
Fix nfsrvd_locku memory leak

Coverity detected memory leak fix.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: rmacklem
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26231

3 years agoopensm: Fix a possible dereference of a NULL pointer
vangyzen [Mon, 31 Aug 2020 15:26:01 +0000 (15:26 +0000)]
opensm: Fix a possible dereference of a NULL pointer

Reported by: Coverity
Reviewed by: hselasky, kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26233

3 years agoposixshm: fix setting of shm_flags
kevans [Mon, 31 Aug 2020 15:07:15 +0000 (15:07 +0000)]
posixshm: fix setting of shm_flags

Noted in D24652, we currently set shmfd->shm_flags on every
shm_open()/shm_open2(). This wasn't properly thought out; one shouldn't be
able to specify incompatible flags on subsequent opens of non-anon shm.

Move setting of shm_flags explicitly to the two places shmfd are created, as
we do with seals, and validate when we're opening a pre-existing mapping
that we've either passed no flags or we've passed the exact same flags as
the first time.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D26242

3 years agojedec_dimm: fix array overrun
vangyzen [Mon, 31 Aug 2020 15:03:23 +0000 (15:03 +0000)]
jedec_dimm: fix array overrun

Coverity detected the overrunning of sc->part_str.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26145

3 years agomake m_getm2() resilient to zone_jumbop exhaustion
gallatin [Mon, 31 Aug 2020 13:53:14 +0000 (13:53 +0000)]
make m_getm2() resilient to zone_jumbop exhaustion

When the zone_jumbop is exhausted, most things using
using sosend* (like sshd)  will eventually
fail or hang if allocations are limited to the
depleted jumbop zone.  This makes it imossible to
communicate with a box which is under an attach which
exhausts the jumbop zone.

Rather than depending on the page size zone, also try cluster
allocations to satisfy larger requests.  This allows me
to ssh to, and serve 100Gb/s of traffic from a server which
under attack and has had its page-sized zone exhausted.

Reviewed by: glebius, markj, rmacklem
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D26150

3 years agoHyper-V: storvsc: Enhance srb_status code handling.
whu [Mon, 31 Aug 2020 09:05:45 +0000 (09:05 +0000)]
Hyper-V: storvsc: Enhance srb_status code handling.

In hv_storvsc_io_request() when coring, prevent changing of the send channel
from the base channel to another one. storvsc_poll always probes on the base
channel.

Based upon conversations with Microsoft, changed the handling of srb_status
codes. Most we should never get, others yes. All are treated as retry-able
except for two. We should not get these statuses, but if we ever do, the I/O
state is not known.

Submitted by: Alexander Sideropoulos <Alexander.Sideropoulos@netapp.com>
Reviewed by: trasz, allanjude, whu
MFC after: 1 week
Sponsored by: Netapp Inc
Differential Revision: https://reviews.freebsd.org/D25756

3 years agoipv6: quit dropping packets looping back on p2p interfaces
kevans [Mon, 31 Aug 2020 01:45:48 +0000 (01:45 +0000)]
ipv6: quit dropping packets looping back on p2p interfaces

To paraphrase the below-referenced PR:

This logic originated in the KAME project, and was even controversial when
it was enabled there by default in 2001. No such equivalent logic exists in
the IPv4 stack, and it turns out that this leads to us dropping valid
traffic when the "point to point" interface is actually a 1:many tun
interface, e.g. with the wireguard userland stack.

Even in the case of true point-to-point links, this logic only avoids
transient looping of packets sent by misconfigured applications or
attackers, which can be subverted by proper route configuration rather than
hardcoded logic in the kernel to drop packets.

In the review, melifaro goes on to note that the kernel can't fix it, so it
perhaps shouldn't try to be 'smart' about it. Additionally, that TTL will
still kick in even with incorrect route configuration.

PR: 247718
Reviewed by: melifaro, rgrimes
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25567

3 years agoAdd an entry to RELNOTES for the NFS over TLS kernel support.
rmacklem [Sun, 30 Aug 2020 21:46:29 +0000 (21:46 +0000)]
Add an entry to RELNOTES for the NFS over TLS kernel support.

3 years agoAdd support for the NFS over TLS exports to mountd.
rmacklem [Sun, 30 Aug 2020 21:21:58 +0000 (21:21 +0000)]
Add support for the NFS over TLS exports to mountd.

Three new export flags are added to mountd that will restrict exported
file system mounts to use TLS.  Without these flags, TLS is allowed, but not
required.

The exports(5) man page will be updated in a future commit.

3 years agowho(1): Add EXAMPLES section
fernape [Sun, 30 Aug 2020 17:40:59 +0000 (17:40 +0000)]
who(1): Add EXAMPLES section

Add EXAMPLES section covering all the flags except -m and -bTu covered by
other flags.

Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26219

3 years agotsort(1): Add EXAMPLES section
fernape [Sun, 30 Aug 2020 17:37:56 +0000 (17:37 +0000)]
tsort(1): Add EXAMPLES section

Add a couple of simple examples to the man page

Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D25883

3 years agoFollowup on r364922. Old comment said that the only reason to put
glebius [Sun, 30 Aug 2020 17:13:04 +0000 (17:13 +0000)]
Followup on r364922. Old comment said that the only reason to put
the hook at queue mode was that mn_rx_intr() doesn't run at splnet
level. In today's netgraph the only legitimate reason for queue mode
is recursion avoidance. So I see no reason for queue mode here.

Not tested!

3 years agoDriver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME
zec [Sun, 30 Aug 2020 07:34:32 +0000 (07:34 +0000)]
Driver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME
development board.

Submitted by: Denis Salopek <denis.salopek AT fer.hr>
Reported by: zec, bz (src); rgrimes, bcr (manpages)
MFC after: 7 days
Sponsored by: Google Summer of Code 2020
Differential Revision: https://reviews.freebsd.org/D26074

3 years agoAdd __BEGIN_DECLS to jail.h to keep C++ happy.
jamie [Sat, 29 Aug 2020 22:24:41 +0000 (22:24 +0000)]
Add __BEGIN_DECLS to jail.h to keep C++ happy.

PR: 238928
Reported by: yuri@

3 years agoFix ordering of the 'pull' subcommand and the '-q' flag.
gjb [Sat, 29 Aug 2020 21:47:49 +0000 (21:47 +0000)]
Fix ordering of the 'pull' subcommand and the '-q' flag.

Pointyhat to: gjb (myself)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoRestore the '-q' flag to the 'git pull' command.
gjb [Sat, 29 Aug 2020 21:46:34 +0000 (21:46 +0000)]
Restore the '-q' flag to the 'git pull' command.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoRemove the VCSUPDATE command, because git is too stupid to have
gjb [Sat, 29 Aug 2020 21:42:59 +0000 (21:42 +0000)]
Remove the VCSUPDATE command, because git is too stupid to have
the '-C <directory>' after the subcommand.

Meanwhile, hard-code 'git -C <...> pull' for now.

Reported by: Michael Butler
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agozalloc_malloc:Free hexdump preceeding buffer when we detect overflow
sjg [Sat, 29 Aug 2020 21:05:43 +0000 (21:05 +0000)]
zalloc_malloc:Free hexdump preceeding buffer when we detect overflow

Move hexdump from stand/common/misc.c to stand/libsa/hexdump.c
(svn cp)
Disable use of pager - causes linking issue for boot1
can be re-enabled by defining HEXDUMP_PAGER.

Reviewed by: stevek, imp
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D26235

3 years agoLinuxKPI: Implement ksize() function.
wulf [Sat, 29 Aug 2020 19:26:31 +0000 (19:26 +0000)]
LinuxKPI: Implement ksize() function.

In Linux, ksize() gets the actual amount of memory allocated for a given
object. This commit adds malloc_usable_size() to FreeBSD KPI which does
the same. It also maps LinuxKPI ksize() to newly created function.

ksize() function is used by drm-kmod.

Reviewed by: hselasky, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26215

3 years agoRefine the VCSUPDATE logic further:
gjb [Sat, 29 Aug 2020 16:04:02 +0000 (16:04 +0000)]
Refine the VCSUPDATE logic further:
- Look for the .git directory instead of top-level directory.
- Use 'git -C' instead of cd(1).

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAdd a VCSUPDATE command to run 'git pull' instead of 'git clone'
gjb [Sat, 29 Aug 2020 15:50:27 +0000 (15:50 +0000)]
Add a VCSUPDATE command to run 'git pull' instead of 'git clone'
if the tree already exists.

Reported by: Michael Butler
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoIndentation fixes. No functional changes.
gjb [Sat, 29 Aug 2020 15:31:23 +0000 (15:31 +0000)]
Indentation fixes.  No functional changes.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAvoid the build from falling over if devel/git is not installed
gjb [Sat, 29 Aug 2020 15:30:21 +0000 (15:30 +0000)]
Avoid the build from falling over if devel/git is not installed
on the system.  Set a null branch/hash in this case, to avoid
undefined GITREV/GITBRANCH variables from falling over in other
areas.

Reported by: many
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoInstall devel/git from packages if NOPORTS is set in the release.sh
gjb [Sat, 29 Aug 2020 15:13:07 +0000 (15:13 +0000)]
Install devel/git from packages if NOPORTS is set in the release.sh
configuration file.

Reported by: Michael Butler
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoRevert uma zone alignemnt cache unadvertenly committed in r364950.
melifaro [Sat, 29 Aug 2020 12:04:13 +0000 (12:04 +0000)]
Revert uma zone alignemnt cache unadvertenly committed in r364950.

3 years agoWe don't need to INCLUDENUL, so turn it off to avoid assertion...
imp [Sat, 29 Aug 2020 11:46:50 +0000 (11:46 +0000)]
We don't need to INCLUDENUL, so turn it off to avoid assertion...

sbuf_new_for_sysctl turns on INCLUDENUL, but we don't need it. And we assert for
it in the new bus_pnpinfo_sb and bus_location_sb strings.

3 years agoFix arm64 build after r364927
manu [Sat, 29 Aug 2020 11:39:53 +0000 (11:39 +0000)]
Fix arm64 build after r364927

Reported by: jenkins, dch
Pointy hat to: manu

3 years agoUse sbuf_cat instead of sbuf_cpy
imp [Sat, 29 Aug 2020 11:18:10 +0000 (11:18 +0000)]
Use sbuf_cat instead of sbuf_cpy

sbuf_cpy doesn't work with sysctl sbufs because of the drain function.

3 years agoFix build with RADIX_MPATH.
melifaro [Sat, 29 Aug 2020 11:04:24 +0000 (11:04 +0000)]
Fix build with RADIX_MPATH.

Reported by: Hartmann, O <ohartmann@walstatt.org>

3 years agoAvoid NULL pointer dereferences
imp [Sat, 29 Aug 2020 09:59:52 +0000 (09:59 +0000)]
Avoid NULL pointer dereferences

Add back NULL pointer checks accidentally dropped in r364946. We need
to append a NUL character when that happens.

3 years agoMove to using sbuf for some sysctl in newbus
imp [Sat, 29 Aug 2020 04:30:12 +0000 (04:30 +0000)]
Move to using sbuf for some sysctl in newbus

Convert two different sysctl to using sbuf. First, for all the default
sysctls we implement for each device driver that's attached. This is a
pure sbuf conversion.

Second, convert sysctl_devices to fill its buffer with sbuf rather
than a hand-rolled crappy thing I wrote years ago.

Reviewed by: cem, markj
Differential Revision: https://reviews.freebsd.org/D26206

3 years agoRetire devctl_notify_f()
imp [Sat, 29 Aug 2020 04:30:06 +0000 (04:30 +0000)]
Retire devctl_notify_f()

devctl_notify_f isn't needed, so retire it. The flags argument is now
unused, so rather than keep it around, retire it. Convert all old
users of it to devctl_notify(). This path no longer sleeps, so is safe
to call from any context. Since it doesn't sleep, it doesn't need to
know if it is OK to sleep or not.

Reviewed by: markj@
Differential Revision: https://reviews.freebsd.org/D26140

3 years agodevctl: move to using a uma zone
imp [Sat, 29 Aug 2020 04:29:53 +0000 (04:29 +0000)]
devctl: move to using a uma zone

Convert the memory management of devctl.  Rewrite if to make better
use of memory. This eliminates several mallocs (5? worse case) needed
to send a message. It's now possible to always send a message, though
if things are really backed up the oldest message will be dropped to
free up space for the newest.

Add a static bus_child_{location,pnpinfo}_sb to start migrating to
sbuf instead of buffer + length. Use it in the new code.  Other code
will be converted later (bus_child_*_str is only used inside of
subr_bus.c, though implemented in ~100 places in the tree).

Reviewed by: markj@
Differential Revision: https://reviews.freebsd.org/D26140

3 years agocarrot: update bundle
kevans [Sat, 29 Aug 2020 02:46:25 +0000 (02:46 +0000)]
carrot: update bundle

Stats:
- Seven (7) removed
- Four (4) added

MFC after: 3 days

3 years agoMove fib_rte_to_nh_flags() from net/route_var.h to net/route/nhop_ctl.c.
melifaro [Fri, 28 Aug 2020 23:01:56 +0000 (23:01 +0000)]
Move fib_rte_to_nh_flags() from net/route_var.h to net/route/nhop_ctl.c.

No functional changes.
Initially this function was created to perform runtime flag conversions
 for the previous incarnation of fib lookup functions. As these functions
 got deprecated, move the function to the file with the only remaining
 caller. Lastly, rename it to convert_rt_to_nh_flags() to follow the
 naming notation.

3 years agoMove net/route/shared.h definitions to net/route/route_var.h.
melifaro [Fri, 28 Aug 2020 22:50:20 +0000 (22:50 +0000)]
Move net/route/shared.h definitions to net/route/route_var.h.

No functional changes.

net/route/shared.h was created in the inital phases of nexthop conversion.
It was intended to serve the same purpose as route_var.h - share definitions
 of functions and structures between the routing subsystem components. At
 that time route_var.h was included by many files external to the routing
 subsystem, which largerly defeats its purpose.

As currently this is not the case anymore and amount of route_var.h includes
 is roughly the same as shared.h, retire the latter in favour of the former.