]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 months agoehci(4): Correct PCI device ID for Zhaoxin USB 2.0 controller
Zhenlei Huang [Fri, 17 Mar 2023 17:24:46 +0000 (01:24 +0800)]
ehci(4): Correct PCI device ID for Zhaoxin USB 2.0 controller

And minor style fixes.

Tested by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Fixes: f9237e1937a4 ehci(4): Add new USB IDs
Differential Revision: https://reviews.freebsd.org/D38923

15 months agoxhci(4): Correct PCI device IDs for Zhaoxin USB 3.0 controllers
Zhenlei Huang [Fri, 17 Mar 2023 17:12:30 +0000 (01:12 +0800)]
xhci(4): Correct PCI device IDs for Zhaoxin USB 3.0 controllers

And minor style fixes.

Reviewed by: hselasky
Tested by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Fixes: 0d7064d58f89 xhci(4): Add new USB IDs
Differential Revision: https://reviews.freebsd.org/D38921

15 months agovfs: retire KERN_VNODE
Mateusz Guzik [Thu, 16 Mar 2023 17:21:59 +0000 (17:21 +0000)]
vfs: retire KERN_VNODE

It got disabled in 2003:

commit acb18acfec97aa7fe26ff48f80a5c3f89c9b542d
Author: Poul-Henning Kamp <phk@FreeBSD.org>
Date:   Sun Feb 23 18:09:05 2003 +0000

    Bracket the kern.vnode sysctl in #ifdef notyet because it results
    in massive locking issues on diskless systems.

    It is also not clear that this sysctl is non-dangerous in its
    requirements for locked down memory on large RAM systems.

There does not seem to be practical use for it and the disabled routine
does not work anyway.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D39127

15 months agoping: Avoid magic numbers
Jose Luis Duran [Fri, 17 Mar 2023 13:24:44 +0000 (09:24 -0400)]
ping: Avoid magic numbers

The sizeof(struct ip) is 20.
The sizeof(struct in_addr) is 4.

No functional change intended.

Reviewed by: asomers, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39125

15 months agoamd64 acpi_wakeup.c: fix typo
Konstantin Belousov [Fri, 17 Mar 2023 12:42:26 +0000 (14:42 +0200)]
amd64 acpi_wakeup.c: fix typo

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

15 months agovmm: fix missing ipi statistic
Vitaliy Gusev [Fri, 17 Mar 2023 09:17:22 +0000 (10:17 +0100)]
vmm: fix missing ipi statistic

ipi counters are missing in bhyvectl's output because vm_maxcpu is 0
when initializing them. That's because vmm_stat_register is executed
before vmm_init.

Instead of directly fixing it, there's a better solution in illumos
which is cherry picked:
https://github.com/illumos/illumos-gate/commit/65a3bc83734e5fb0fc2c19df3e5112b87dcdc3f8

It replaces the matrix statistic by two counters per vcpu. One for
counting the ipis to the vcpu and one counting the ipis received by the
vcpu. This has several advantages:

- A matrix statistic becomes huge when using many vcpus.
- A matrix statistic easily reaches the MAX_VMM_STAT_ELEMS limit.
- Two counters are enough in most cases. DTrace can be used for more
  advanced debugging purposes.
- A matrix statistic wastes memory. The matrix size is determined by
  vm_maxcpu regardless of the number of vcpus assigned to the vm.

Reviewed by: corvink, markj
Fixes: ee98f99d7a68b284a669fefb969cbfc31df2d0ab ("vmm: Convert VM_MAXCPU into a loader tunable hw.vmm.maxcpu.")
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D39038

15 months agoarm: Remove SOCFPGA specific kernel configs
Emmanuel Vadot [Wed, 15 Mar 2023 09:29:27 +0000 (10:29 +0100)]
arm: Remove SOCFPGA specific kernel configs

We had GENERIC for a while now so anyone still interested in those boards
should make sure that we can boot on them with it and with upstream DTS files.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D39088

15 months agoUPDATING: Document arm video devices renaming.
Emmanuel Vadot [Thu, 16 Mar 2023 09:38:46 +0000 (10:38 +0100)]
UPDATING: Document arm video devices renaming.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D39121

15 months agoarm: Rename hdmi_if.m to crtc_if.m
Emmanuel Vadot [Thu, 16 Mar 2023 09:48:06 +0000 (10:48 +0100)]
arm: Rename hdmi_if.m to crtc_if.m

There is nothing hdmi related in this interface, it's just a generic interface
for crt controller so rename it.
This also remove the 'hdmi' device used in arm kernel config. 'vt' now controls
if we build this interface (sc(4) isn't supported on arm).

Sponsored by: Beckhoff Automation GmbH & Co. KG
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D39120

15 months agoarm: ti: Rename video related devices
Emmanuel Vadot [Thu, 16 Mar 2023 09:36:23 +0000 (10:36 +0100)]
arm: ti: Rename video related devices

device 'hdmi' is too generic (and will be used later in a new device) so rename
the arm TI devices to some proper name.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D39119

15 months agoarm: imx: Rename video related devices
Emmanuel Vadot [Thu, 16 Mar 2023 09:30:57 +0000 (10:30 +0100)]
arm: imx: Rename video related devices

device 'hdmi' is too generic (and will be used later in a new device) so rename
the arm IMX devices to some proper name.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D39118

15 months agoarm: allwinner: Garbage collect a10_hdmi driver
Emmanuel Vadot [Wed, 15 Mar 2023 12:00:20 +0000 (13:00 +0100)]
arm: allwinner: Garbage collect a10_hdmi driver

It was disconnected 5 years ago in 4573cd3914d7
("arm: allwinner: Disconnect A10/A20 HDMI driver") as it wasn't working.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D39117

15 months agoarm: Remove IMX6 kernel config
Emmanuel Vadot [Wed, 15 Mar 2023 09:53:15 +0000 (10:53 +0100)]
arm: Remove IMX6 kernel config

All devices are in GENERIC and GENERIC is known to boot on those SoCs.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D39090

15 months agoarm: Remove IMX5 specific kernel configs
Emmanuel Vadot [Wed, 15 Mar 2023 09:39:02 +0000 (10:39 +0100)]
arm: Remove IMX5 specific kernel configs

We had GENERIC for a while now so anyone still interested in those boards
should make sure that we can boot on them with it and with upstream DTS files.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D39089

15 months agoarm: Remove VYBRID specific kernel config
Emmanuel Vadot [Wed, 15 Mar 2023 09:26:24 +0000 (10:26 +0100)]
arm: Remove VYBRID specific kernel config

We had GENERIC for a while now so anyone still interested in those boards
should make sure that we can boot on them with it and with upstream DTS files.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D39087

15 months agoarm: Remove kernel config APALIS-IMX6
Emmanuel Vadot [Wed, 15 Mar 2023 09:17:24 +0000 (10:17 +0100)]
arm: Remove kernel config APALIS-IMX6

It reference to a non-existant dts file apalis-imx6.dts so unlikekly to compile.
Aldo IMX6 support is in GENERIC so anyone interested in this board should
make it work with GENERIC kernel (if that's not already the case).

Sponsored by: Beckhoff Automation GmbH & Co. KG
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D39086

15 months agostress2: Fix compiler warning
Peter Holm [Fri, 17 Mar 2023 11:06:52 +0000 (12:06 +0100)]
stress2: Fix compiler warning

15 months agobhyve: add cmdline option to enable qemu's fwcfg
Corvin Köhne [Wed, 18 Aug 2021 07:31:59 +0000 (09:31 +0200)]
bhyve: add cmdline option to enable qemu's fwcfg

Let the user decide if he wants to use bhyve's fwctl or qemu's fwcfg. He
can set the interface by adding a fwcfg option to bootrom:

-l bootrom,<path/to/rom>,fwcfg=bhyve
-l bootrom,<path/to/rom>,fwcfg=qemu

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38337

15 months agobhyve: add helper for adding fwcfg files
Corvin Köhne [Wed, 11 Aug 2021 08:04:36 +0000 (10:04 +0200)]
bhyve: add helper for adding fwcfg files

Fwcfg items without a fixed index are reported by the file_dir. They
have an index of 0x20 and above. This helper simplifies the addition of
such fwcfg items. It selects a new free index, assigns it to the fwcfg
items and creates an proper entry in the file_dir.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38336

15 months agox86: gate smbios hypervisor identification behind vm_guest
Kyle Evans [Thu, 16 Mar 2023 19:26:28 +0000 (14:26 -0500)]
x86: gate smbios hypervisor identification behind vm_guest

cpuid detection may have picked up a more specific guest type already,
and a follow-up check of smbios vendor/product may erroneously blow
away the previously detected type.

This reportedly fixes the boot under Hyper-V, which advertises an
smbios.system.product of "Virtual Machine."

PR: 270239
Reviewed by: imp, kib (both earlier version, same concept)
Fixes: 2fee87562948 ("abstract out the vm detection via smbios..")
Differential Revision: https://reviews.freebsd.org/D39140

15 months agonfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts
Rick Macklem [Thu, 16 Mar 2023 22:55:36 +0000 (15:55 -0700)]
nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts

Without this patch, a Kerberized NFSv4.1/4.2 mount must provide
a Kerberos credential for the client at mount time.  This credential
is typically referred to as a "machine credential".  It can be
created one of two ways:
- The user (usually root) has a valid TGT at the time the mount
  is done and this becomes the machine credential.
  There are two problems with this.
  1 - The user doing the mount must have a valid TGT for a user
      principal at mount time.  As such, the mount cannot be put
      in fstab(5) or similar.
  2 - When the TGT expires, the mount breaks.
- The client machine has a service principal in its default keytab
  file and this service principal (typically called a host-based
  initiator credential) is used as the machine credential.
  There are problems with this approach as well:
  1 - There is a certain amount of administrative overhead creating
      the service principal for the NFS client, creating a keytab
      entry for this principal and then copying the keytab entry
      into the client's default keytab file via some secure means.
  2 - The NFS client must have a fixed, well known, DNS name, since
      that FQDN is in the service principal name as the instance.

This patch uses a feature of NFSv4.1/4.2 called SP4_NONE, which
allows the state maintenance operations to be performed by any
authentication mechanism, to do these operations via AUTH_SYS
instead of RPCSEC_GSS (Kerberos).  As such, neither of the above
mechanisms is needed.

It is hoped that this option will encourage adoption of Kerberized
NFS mounts using TLS, to provide a more secure NFS mount.

This new NFSv4.1/4.2 mount option, called "syskrb5" must be used
with "sec=krb5[ip]" to avoid the need for either of the above
Kerberos setups to be done by the client.

Note that all file access/modification operations still require
users on the NFS client to have a valid TGT recognized by the
NFSv4.1/4.2 server.  As such, this option allows, at most, a
malicious client to do some sort of DOS attack.

Although not required, use of "tls" with this new option is
encouraged, since it provides on-the-wire encryption plus,
optionally, client identity verification via a X.509
certificate provided to the server during TLS handshake.
Alternately, "sec=krb5p" does provide on-the-wire
encryption of file data.

A mount_nfs(8) man page update will be done in a separate commit.

Discussed on: freebsd-current@
MFC after: 3 months

15 months agolibipsec: ansify
Mateusz Guzik [Thu, 16 Mar 2023 19:19:35 +0000 (19:19 +0000)]
libipsec: ansify

Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agolibmd: ansify
Mateusz Guzik [Thu, 16 Mar 2023 19:02:56 +0000 (19:02 +0000)]
libmd: ansify

Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agolibc/yp: sort out warnings
Mateusz Guzik [Thu, 16 Mar 2023 18:56:47 +0000 (18:56 +0000)]
libc/yp: sort out warnings

.. in least-effort manner

Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agoless: silence K&R warns
Mateusz Guzik [Thu, 16 Mar 2023 18:24:12 +0000 (18:24 +0000)]
less: silence K&R warns

Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agolibz: silence K&R warns
Mateusz Guzik [Thu, 16 Mar 2023 18:22:24 +0000 (18:22 +0000)]
libz: silence K&R warns

Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agosendmail: silence K&R warns
Mateusz Guzik [Thu, 16 Mar 2023 18:18:48 +0000 (18:18 +0000)]
sendmail: silence K&R warns

Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agotun tests: Fix cleanup definitions
Mark Johnston [Thu, 16 Mar 2023 16:52:54 +0000 (12:52 -0400)]
tun tests: Fix cleanup definitions

Without this, vnet jails for the tests don't get torn down.

Fixes: fe701c39e8aa ("if_tun: Add basic connectivity test with nc tun support")

15 months agoMark arm64 mair_el1 fields as unsigned long
Andrew Turner [Thu, 16 Mar 2023 16:19:21 +0000 (16:19 +0000)]
Mark arm64 mair_el1 fields as unsigned long

The register is 64-bit so the upper bits could be shifted past the
signed 32-bit size of an int the values were before.

Sponsored by: Arm Ltd

15 months agoSwitch the arm64 VM_MEMATTR_DEVICE to nGnRE
Andrew Turner [Thu, 16 Mar 2023 15:36:06 +0000 (15:36 +0000)]
Switch the arm64 VM_MEMATTR_DEVICE to nGnRE

Move device memory to a weaker type. The new device memory type allows
the system to acknowledge a write to a device before the write has
completed. This is inline with VM_MEMATTR_DEVICE on armv6/armv7.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D38945

15 months agoAllow forcing non-posted memory on arm64
Andrew Turner [Thu, 16 Mar 2023 15:35:59 +0000 (15:35 +0000)]
Allow forcing non-posted memory on arm64

To allow for debugging after changing the arm64 VM_MEMATTR_DEVICE
memory type add a new set of tunables to tell the kernel to use
non-posted memory.

This adds the following tunables:
 - kern.force_nonposted: When set to non-zero the kernel will use
   non-posted memory for all device allocations.
 - hint.<dev>.<unit>.force_nonposted: As above, however only forces
   non-posted memory on the named device.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D38944

15 months agoRemove an unneeded CTASSERT in the smmu driver
Andrew Turner [Thu, 16 Mar 2023 15:35:04 +0000 (15:35 +0000)]
Remove an unneeded CTASSERT in the smmu driver

We don't map the DMAP here

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D38951

15 months agoRemove unneeded arm64 smmu macros
Andrew Turner [Thu, 16 Mar 2023 15:34:59 +0000 (15:34 +0000)]
Remove unneeded arm64 smmu macros

These aren't used by the driver so can be removed.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D38950

15 months agoOnly support a 4 level smmu page table
Andrew Turner [Thu, 16 Mar 2023 15:34:54 +0000 (15:34 +0000)]
Only support a 4 level smmu page table

We only ever build a 4 level page table for the Arm SMMU. Remove the
support for a 3 level table.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D38949

15 months agoRename smmu pmap functions
Andrew Turner [Thu, 16 Mar 2023 15:34:48 +0000 (15:34 +0000)]
Rename smmu pmap functions

These are SMMU (and MALI GPU) specific. Give them a SMMU specific name.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D38948

15 months agosctp: enforce Kahn's rule during the handshake
Michael Tuexen [Thu, 16 Mar 2023 16:40:40 +0000 (17:40 +0100)]
sctp: enforce Kahn's rule during the handshake

Don't take RTT measurements on packets containing INIT or COOKIE-ECHO
chunks, when they were retransmitted.

MFC after: 1 week

15 months agoMove access to tcp's t_logstate into inline functions and provide new tracepoint...
Randall Stewart [Thu, 16 Mar 2023 15:43:16 +0000 (11:43 -0400)]
Move access to tcp's t_logstate into inline functions and provide new tracepoint and bbpoint capabilities.

The TCP stacks have long accessed t_logstate directly, but in order to do tracepoints and the new bbpoints
we need to move to using the new inline functions. This adds them and moves rack to now use
the tcp_tracepoints.

Reviewed by: tuexen, gallatin
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D38831

15 months agotail: Verify correct behavior when input does not end in a newline.
Dag-Erling Smørgrav [Thu, 16 Mar 2023 15:36:49 +0000 (15:36 +0000)]
tail: Verify correct behavior when input does not end in a newline.

Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D39116

15 months agossh: Update to OpenSSH 9.3p1
Ed Maste [Thu, 16 Mar 2023 14:29:55 +0000 (10:29 -0400)]
ssh: Update to OpenSSH 9.3p1

This release fixes a number of security bugs and has minor new
features and bug fixes.  Security fixes, from the release notes
(https://www.openssh.com/txt/release-9.3):

This release contains fixes for a security problem and a memory
safety problem. The memory safety problem is not believed to be
exploitable, but we report most network-reachable memory faults as
security bugs.

 * ssh-add(1): when adding smartcard keys to ssh-agent(1) with the
   per-hop destination constraints (ssh-add -h ...) added in OpenSSH
   8.9, a logic error prevented the constraints from being
   communicated to the agent. This resulted in the keys being added
   without constraints. The common cases of non-smartcard keys and
   keys without destination constraints are unaffected. This problem
   was reported by Luci Stanescu.

 * ssh(1): Portable OpenSSH provides an implementation of the
   getrrsetbyname(3) function if the standard library does not
   provide it, for use by the VerifyHostKeyDNS feature. A
   specifically crafted DNS response could cause this function to
   perform an out-of-bounds read of adjacent stack data, but this
   condition does not appear to be exploitable beyond denial-of-
   service to the ssh(1) client.

   The getrrsetbyname(3) replacement is only included if the system's
   standard library lacks this function and portable OpenSSH was not
   compiled with the ldns library (--with-ldns). getrrsetbyname(3) is
   only invoked if using VerifyHostKeyDNS to fetch SSHFP records. This
   problem was found by the Coverity static analyzer.

Sponsored by: The FreeBSD Foundation

15 months agoAdd PSCI affinity info return values
Andrew Turner [Thu, 16 Mar 2023 12:16:59 +0000 (12:16 +0000)]
Add PSCI affinity info return values

These can be returned from the PSCI AFFINITY_INFO call. This is not
marked as optional so bhyve will need to implement it & can use these
macros.

Sponsored by: Arm Ltd

15 months agoAdd a psci macro to build a version value
Andrew Turner [Thu, 16 Mar 2023 12:14:01 +0000 (12:14 +0000)]
Add a psci macro to build a version value

Add PSCI_VER that takes a major and minor version and builds the value
returned by the firmware. This will be used by bhyve.

Sponsored by: Arm Ltd

15 months agoAllow psci.h to be used by userspace
Andrew Turner [Thu, 16 Mar 2023 12:08:32 +0000 (12:08 +0000)]
Allow psci.h to be used by userspace

Wrap parts of psci.h that aren't usable by userspace in _KERNEL checks.
This allows it to be used to implement PSCI and SMCCC by bhyve in
userspace.

Sponsored by: Arm Ltd
Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation

15 months agostress2: New problem found was added
Peter Holm [Thu, 16 Mar 2023 12:59:16 +0000 (13:59 +0100)]
stress2: New problem found was added

15 months agoVendor import of OpenSSH 9.3p1
Ed Maste [Thu, 16 Mar 2023 12:41:22 +0000 (08:41 -0400)]
Vendor import of OpenSSH 9.3p1

15 months agotarfs: Fix backtracking during node creation.
Dag-Erling Smørgrav [Thu, 16 Mar 2023 11:31:14 +0000 (11:31 +0000)]
tarfs: Fix backtracking during node creation.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D39082

15 months agotarfs: Support tar files which include file modes with permissions.
Dag-Erling Smørgrav [Thu, 16 Mar 2023 11:31:10 +0000 (11:31 +0000)]
tarfs: Support tar files which include file modes with permissions.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D39020

15 months agotarfs: Correctly track link count.
Dag-Erling Smørgrav [Thu, 16 Mar 2023 11:31:06 +0000 (11:31 +0000)]
tarfs: Correctly track link count.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D39019

15 months agotarfs: Repeat tests using GNU tar if available.
Dag-Erling Smørgrav [Thu, 16 Mar 2023 11:31:01 +0000 (11:31 +0000)]
tarfs: Repeat tests using GNU tar if available.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: ngie, asomers
Differential Revision: https://reviews.freebsd.org/D39018

15 months agocarp: carp_master_down_locked() requires net epoch
Zhenlei Huang [Thu, 16 Mar 2023 10:00:13 +0000 (18:00 +0800)]
carp: carp_master_down_locked() requires net epoch

Reviewed by: kp
Fixes: 1d126e9b9474 carp: Widen epoch coverage
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D39113

15 months agopf tests: test IPv6 fragmentation with link-local addresses
Kristof Provost [Sun, 12 Mar 2023 15:08:31 +0000 (16:08 +0100)]
pf tests: test IPv6 fragmentation with link-local addresses

We've observed a panic after pf_refragment6() with link-local addresses,
because pf_refragment6() calls ip6_forward() even for a simple output
case.
That results in us entering ip6_forward() with an mbuf with a NULL
m->m_pkthdr.rcvif, which can cause a NULL deref (but seemingly not for
GUAs.

Test sending fragmented link-local packets to pf.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D39063

15 months agopf: set scope in pf_refragment6()
Kristof Provost [Mon, 13 Mar 2023 09:27:59 +0000 (10:27 +0100)]
pf: set scope in pf_refragment6()

Link-local traffic needs to have a scope embedded before it's passed on
to ip6_output(). Do so in pf_refragment6(), because when we end up here
in the output path we may have passed through ip6_output() already
(before being reassembled), where the scope would have been removed.

Re-embed the scope so that link-local traffic is sent correctly.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D39062

15 months agopf: distinguish forwarding and output cases for pf_refragment6()
Kristof Provost [Sun, 12 Mar 2023 17:34:42 +0000 (18:34 +0100)]
pf: distinguish forwarding and output cases for pf_refragment6()

Re-introduce PFIL_FWD, because pf's pf_refragment6() needs to know if
we're ip6_forward()-ing or ip6_output()-ing.

ip6_forward() relies on m->m_pkthdr.rcvif, at least for link-local
traffic (for in6_get_unicast_scopeid()). rcvif is not set for locally
generated traffic (e.g. from icmp6_reflect()), so we need to call the
correct output function.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revisi: https://reviews.freebsd.org/D39061

15 months agosctp: don't do RTT measurements with cookies
Michael Tuexen [Thu, 16 Mar 2023 09:45:13 +0000 (10:45 +0100)]
sctp: don't do RTT measurements with cookies

When receiving a cookie, the receiver does not know whether the
peer retransmitted the COOKIE-ECHO chunk or not. Therefore, don't
do an RTT measurement. It might be much too long.
To overcome this limitation, one could do at least two things:
1. Bundle the INIT-ACK chunk with a HEARTBEAT chunk for doing the
   RTT measurement. But this is not allowed.
2. Add a flag to the COOKIE-ECHO chunk, which indicates that it
   is the initial transmission, and not a retransmission. But
   this requires an RFC.

MFC after: 1 week

15 months agosctp: allow disabling of SCTP_ACCEPT_ZERO_CHECKSUM socket option
Michael Tuexen [Wed, 15 Mar 2023 21:55:23 +0000 (22:55 +0100)]
sctp: allow disabling of SCTP_ACCEPT_ZERO_CHECKSUM socket option

15 months agosctp: improve negotiation of zero checksum feature
Michael Tuexen [Wed, 15 Mar 2023 21:29:52 +0000 (22:29 +0100)]
sctp: improve negotiation of zero checksum feature

Enforce consistency between announcing 0-cksum support and actually
using it in the association. The value from the inp when the
INIT ACK is sent must be used, not the one from the inp when the
cookie is received.

15 months agonetlink: improve snl(3)
Alexander V. Chernikov [Wed, 15 Mar 2023 13:56:26 +0000 (13:56 +0000)]
netlink: improve snl(3)

Summary:
* add snl_send_message() as a convenient send wrapper
* add signed integer parsers
* add snl_read_reply_code() to simplify operation result checks
* add snl_read_reply_multi() to simplify reading multipart messages
* add snl_create_genl_msg_request()
* add snl_get_genl_family() to simplify family name->id resolution
* add tests for some of the functionality

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D39092
MFC after: 2 weeks

15 months agoarm64: Support stage 2 mappings in pmap_remove_all
Andrew Turner [Wed, 15 Mar 2023 16:27:51 +0000 (16:27 +0000)]
arm64: Support stage 2 mappings in pmap_remove_all

This has been hit when testing bhyve.

Sponsored by: Arm Ltd

15 months agossh: update FREEBSD-upgrade instructions
Ed Maste [Wed, 23 Feb 2022 18:33:24 +0000 (13:33 -0500)]
ssh: update FREEBSD-upgrade instructions

Make it clear that the 'freebsd-configure.sh' and 'freebsd-namespace.sh'
scripts are run from the crypto/openssh directory.

Sponsored by: The FreeBSD Foundation

15 months agoStop using the rid as an index in the arm timer
Andrew Turner [Wed, 15 Mar 2023 13:35:04 +0000 (13:35 +0000)]
Stop using the rid as an index in the arm timer

The order of the interrupt array doesn't matter. Store the described
interrupts at the start of the array to simplify iterating over them.

Reviewed by: imp, kevans
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D39094

15 months agoUse the arm physical timer when able
Andrew Turner [Wed, 15 Mar 2023 13:33:02 +0000 (13:33 +0000)]
Use the arm physical timer when able

To allow bhyve manage the virtual timer while in a guest have FreeBSD
use the virtual timer only when bhyve will be unavailable due to not
starting at EL2 where the hypervisor switcher will run.

Reviewed by: imp, kevans
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D39093

15 months agoSupport the arm64 pmap_remove_write for stage 2
Andrew Turner [Tue, 15 Nov 2022 17:49:42 +0000 (17:49 +0000)]
Support the arm64 pmap_remove_write for stage 2

The fields we need to adjust are different in stage 1 and stage 2
tables. Handle this by adding variables to hold the bits to check,
set, and clear.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37399

15 months agoarm64: limit EFI excluded regions to physical memory types
Mitchell Horne [Wed, 15 Mar 2023 15:26:57 +0000 (12:26 -0300)]
arm64: limit EFI excluded regions to physical memory types

Consolidate add_efi_map_entry() and exclude_efi_map_entry() into a
single function, handle_efi_map_entry(), so that the exact set of entry
types handled is the same in the addition or exclusion cases. Before,
exclude_efi_map_entry() had a 'default' case that would exclude all
entry types that were not listed explicitly in the switch statement.

Logically, we do not need to exclude a range that could not possibly be
added to physmem, and we do not need to exclude bus ranges that are not
physical memory, for example EFI_MD_TYPE_IOMEM.

Since physmem's ram0 device will reserve bus memory resources for its
owned ranges, this was preventing attachment of the watchdog device on
the RPI4B. For some reason its region of memory-mapped I/O appeared in
the EFI memory map (with the aforementioned EFI_MD_TYPE_IOMEM type).
This change fixes the attachment issue, as we prevent the physmem API
from messing with this range of bus space.

PR: 270044
Reported by: karels, Mark Millard
Reviewed by: andrew, karels, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39003

15 months agonet: refactor if_clone.c #1
Alexander V. Chernikov [Mon, 13 Mar 2023 10:41:58 +0000 (10:41 +0000)]
net: refactor if_clone.c #1

* Add ifc_find_cloner()
* Rename current ifc_find_cloner() to ifc_find_cloner_in_vnet()
* Add ifc_find_cloner_match()

This change simplifies the code a bit and reduces the diff to
 the netlink interface cloners merge (D39032).

Reviewed by: glebius, kp
Differential Revision: https://reviews.freebsd.org/D39046
MFC after: 2 weeks

15 months agoSupport arm64 stage2 TLB invalidation
Andrew Turner [Thu, 3 Nov 2022 16:01:37 +0000 (16:01 +0000)]
Support arm64 stage2 TLB invalidation

To invalidate stage 2 mappings on arm64 we may need to call into the
hypervisor so add a function pointer that bhyve can use to implement
this.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37254

15 months agoKeep per-timer interrupt data together
Andrew Turner [Tue, 14 Mar 2023 09:27:23 +0000 (09:27 +0000)]
Keep per-timer interrupt data together

Eliminate a redundant resource array allow possible use by bhyve later.

Reviewed by: kevans
Sponsored by: Arm Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37424

15 months agoveriexec: Improve comments
Warner Losh [Wed, 15 Mar 2023 04:59:20 +0000 (22:59 -0600)]
veriexec: Improve comments

Make it clear we're checking to see if the target is a verified file and
prevent its replacement if so.

Sponsored by: Netflix
Reviewed by: rpokala
Differential Revision: https://reviews.freebsd.org/D39079

15 months agolibbe: Avoid double printing cloning errors.
John Grafton [Wed, 15 Mar 2023 03:14:14 +0000 (21:14 -0600)]
libbe: Avoid double printing cloning errors.

be_clone calls be_clone_cb and both call set_error on the return
error path.  set_error prints the error resulting in a double print.
be_clone_cb should just return the error code and allow be_clone
to print it.

PR: 265248
Reported by: Graham Perrin
Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/685

15 months agojail: convert several functions from int to bool
Mina Galić [Wed, 15 Mar 2023 03:04:40 +0000 (21:04 -0600)]
jail: convert several functions from int to bool

these functions exclusively return (0) and (1), so convert them to bool

We also convert some networking related jail functions from int to bool
some of which were returning an error that was never used.

Differential Revision: https://reviews.freebsd.org/D29659
Reviewed by: imp, jamie (earlier version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/663

15 months agorc: ignore .pkgsave files
Mina Galić [Wed, 15 Mar 2023 02:52:15 +0000 (20:52 -0600)]
rc: ignore .pkgsave files

The local parts of rc already skip .sample files; we add .pkgsave to the
list, and add logic for base.

Thanks to @RhodiumToad for getting this started.

Differential Revision: https://reviews.freebsd.org/D27962
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/662

15 months agoppp: Remove trailing semicolon
Elyes Haouas [Wed, 15 Mar 2023 02:09:16 +0000 (20:09 -0600)]
ppp: Remove trailing semicolon

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/654

15 months agopmccontrol: Remove trailing semicolon
Elyes Haouas [Wed, 15 Mar 2023 02:09:16 +0000 (20:09 -0600)]
pmccontrol: Remove trailing semicolon

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/654

15 months agolpr: Remove trailing semicolon
Elyes Haouas [Wed, 15 Mar 2023 02:09:16 +0000 (20:09 -0600)]
lpr: Remove trailing semicolon

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/654

15 months agobhyve: Remove trailing semicolon
Elyes Haouas [Wed, 15 Mar 2023 02:09:16 +0000 (20:09 -0600)]
bhyve: Remove trailing semicolon

Macros shouldn't use trailing semicolon.

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/654

15 months agoCI: Run pkgbase METALOG lint script
Ed Maste [Wed, 16 Nov 2022 21:24:19 +0000 (16:24 -0500)]
CI: Run pkgbase METALOG lint script

tools/pkgbase/metalog_reader.lua checks for errors in METALOG (for
pkgbase staging), such as hard links with differing modes, duplicate
entries, etc.  Run it as part of the Cirrus-CI job to prevent
regressions.

Reviewed by: manu, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37521

15 months ago.github: Test DISK_IMAGE_TOOLS_BOOTSTRAP in CI
Jessica Clarke [Wed, 15 Mar 2023 00:06:53 +0000 (00:06 +0000)]
.github: Test DISK_IMAGE_TOOLS_BOOTSTRAP in CI

Building the tools is quick so we should provide coverage of this to
ensure it keeps working, especially on non-FreeBSD.

Reviewed by: emaste, arichardson
Differential Revision: https://reviews.freebsd.org/D39073

15 months agoAdd new DISK_IMAGE_TOOLS_BOOTSTRAP option
Jessica Clarke [Wed, 15 Mar 2023 00:06:53 +0000 (00:06 +0000)]
Add new DISK_IMAGE_TOOLS_BOOTSTRAP option

This will build etdump, makefs and mkimg as bootstrap tools to allow
easily creating disk images. Note that etdump is bootstrapped due to its
use in the release scripts for building ISO images.

Reviewed by: emaste, arichardson
Differential Revision: https://reviews.freebsd.org/D39072

15 months agosrc.conf.5: Regen after ZFS-related options changes
Jessica Clarke [Wed, 15 Mar 2023 00:06:52 +0000 (00:06 +0000)]
src.conf.5: Regen after ZFS-related options changes

Since 9503d2704ca6 LOADER_ZFS gets turned off when ZFS is, and since
63715498ac6b ZFS is no longer disabled on powerpc and powerpcspe.

Reviewed by: emaste
Fixes: 9503d2704ca6 ("opts: Minor cleanup of ZFS options")
Fixes: 63715498ac6b ("powerpc: enable ZFS on 32 bit powerpc/powerpcspe")
Differential Revision: https://reviews.freebsd.org/D39071

15 months agosecure_getenv: Put under __BSD_VISIBLE
Warner Losh [Tue, 14 Mar 2023 23:42:18 +0000 (17:42 -0600)]
secure_getenv: Put under __BSD_VISIBLE

Sponsored by: Netflix
Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D39076

15 months agojail.8: Update the allow.nfsd section
Rick Macklem [Tue, 14 Mar 2023 22:28:02 +0000 (15:28 -0700)]
jail.8: Update the allow.nfsd section

This patch updates the information for "allow.nfsd"
and adds configuration information.

This is a content change.

Reviewed by: karels, markj, pauamma (manpages)
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D39033

15 months agonet80211: make ieee80211_scan_dump_channels private
Bjoern A. Zeeb [Tue, 14 Mar 2023 21:01:19 +0000 (21:01 +0000)]
net80211: make ieee80211_scan_dump_channels private

ieee80211_scan_dump_channels() is only used locally and only when
IEEE80211_DEBUG is compiled.  Stop exporting it, make it file local
and hide under the #ifdef to reduce the footprint for production
kernels a tiny bit.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38833

15 months agonet80211: define mask for ss_flags rather than using hardcoded 0xfff
Bjoern A. Zeeb [Tue, 14 Mar 2023 21:00:48 +0000 (21:00 +0000)]
net80211: define mask for ss_flags rather than using hardcoded 0xfff

scan state ss_flags in two places cut off the "internal" GOTPICK
options.  Replace the hardcoded 0xfff with a defined mask.
Note that "internal" flags is confusing as we also supplement the
the 16bit by another 16bit of "internal flags" passed around but
comaparing to GOTPICK never stored to my understanding.

No functional change.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D38832

15 months agonetmap: get rid of save_if_input for emulated adapters
Vincenzo Maffione [Tue, 14 Mar 2023 21:59:23 +0000 (21:59 +0000)]
netmap: get rid of save_if_input for emulated adapters

The save_if_input function pointer was meant to save the previous
value of ifp->if_input before replacing it with the emulated
adapter hook.
However, the same pointer value is already stored in the if_input
field of the netmap_adapter struct, to be used for host TX ring processing.

Reuse the netmap_adapter if_input field to simplify the code
and save some space.

MFC after: 14 days

15 months agoinfiniband: Convert BPF handling for IfAPI
Justin Hibbits [Thu, 9 Feb 2023 02:32:47 +0000 (21:32 -0500)]
infiniband: Convert BPF handling for IfAPI

Summary:
All callers of infiniband_bpf_mtap() call it through the wrapper macro,
which checks the if_bpf member explicitly.  Since this is getting
hidden, move this check into the internal function and remove the
wrapper macro.

Reviewed by: hselasky
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39024

15 months agossh: fix leak and apply style(9) to hostname canonicalization
Ed Maste [Wed, 8 Feb 2023 13:16:53 +0000 (08:16 -0500)]
ssh: fix leak and apply style(9) to hostname canonicalization

Fixes: bf2e2524a2ce ("ssh: canonicize the host name before...")
Fixes: 3e74849a1ee2 ("ssh: canonicize the host name before...")
Reviewed by: rew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38441

15 months agocompiler-rt: remove eprintf
Ed Maste [Tue, 14 Mar 2023 17:01:20 +0000 (13:01 -0400)]
compiler-rt: remove eprintf

It was used by ancient GCC assert.h.  Prior to 2001 GCC used to provide
its own assert.h  The GCC assert.h required __eprintf to emit the error
message.  FreeBSD's own assert.h never used this.

Reviewed by: ed (previously), imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2597

15 months agoReserve u2f group for FIDO/U2F key support (SSH, etc.)
Ed Maste [Fri, 18 Feb 2022 18:13:20 +0000 (13:13 -0500)]
Reserve u2f group for FIDO/U2F key support (SSH, etc.)

We have FIDO/U2F support in the base system now, so reserve a group ID
for it (maching the security/u2f-devd port).

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34341

15 months agoping: Remove ifndef icmp_data guards
Jose Luis Duran [Tue, 14 Mar 2023 15:22:33 +0000 (11:22 -0400)]
ping: Remove ifndef icmp_data guards

Early versions of <netinet/ip_icmp.h> [1] did not have icmp_data
defined, but FreeBSD has always had.  Remove these guards.

NetBSD [2] and OpenBSD [3] have already removed them.

[1]: https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/netinet/ip_icmp.h
[2]: https://github.com/NetBSD/src/commit/203dfd34867991fd002f747d74a96f26ae80d41c
[3]: https://github.com/openbsd/src/commit/d83449c83c03b86e72d642dc92bcea434310435a

Reviewed by: markj
MFC after: 1 week

15 months agoping: Fix the display of Flags/Fragment Offset
Jose Luis Duran [Tue, 14 Mar 2023 15:09:27 +0000 (11:09 -0400)]
ping: Fix the display of Flags/Fragment Offset

In the IP header, Flags + Fragment Offset is a 16-bit field.

Use ntohs() instead of ntohl(), otherwise the Flags/Fragment Offset
values may not display correctly.

Before (DF set)

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
     4  5  00 0054 0001   0 0000  40  01 b6a4 192.0.2.1  192.0.2.2

After (DF set)

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
     4  5  00 0054 0001   2 0000  40  01 b6a4 192.0.2.1  192.0.2.2

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38479

15 months agoping6: Use errx to avoid appending a specious error message
Jose Luis Duran [Tue, 14 Mar 2023 15:08:54 +0000 (11:08 -0400)]
ping6: Use errx to avoid appending a specious error message

Reviewed by: asomers, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38418

15 months agoudp: Fix a memory leak in udp6_send()
Mark Johnston [Tue, 14 Mar 2023 14:26:29 +0000 (10:26 -0400)]
udp: Fix a memory leak in udp6_send()

Reviewed by: glebius
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38993

15 months agoIncrease protection provided by veriexec with new unlink/rename hooks.
dl [Tue, 14 Mar 2023 04:26:41 +0000 (22:26 -0600)]
Increase protection provided by veriexec with new unlink/rename hooks.

Functions implemented :

- mac_veriexec_vnode_check_unlink: Unlink on a file has been
  requested and requires validation. This function prohibits the
  deleting a protected file (or deleting one of these hard links, if
  any).
- mac_veriexec_vnode_check_rename_from: Rename the file has been
  requested and must be validated. This function controls the renaming
  of protected file
- mac_veriexec_vnode_check_rename_to: File overwrite rename has been
  requested and must be validated. This function prevent overwriting of
  a file protected (overwriting by mv command).

The 3 fonctions together aim to control the 'removal' (via unlink) and
the 'mv' on files protected by veriexec. The intention is to reach the
functional level of NetBSD veriexec.

Add sysctl node security.mac.veriexec.unlink to toggle control on
syscall unlink.

Add tunable kernel variable security.mac.veriexec.block_unlink to toggle
unlink protection. Add the corresponding read-only sysctl.

[ tidied up commit message, trailing whitespace, long lines, { placement ]

Reviewed by: sjg, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/613

15 months agoloader: Add support for booting from a ZFS snapshot
Allan Jude [Sat, 26 Nov 2022 18:11:13 +0000 (18:11 +0000)]
loader: Add support for booting from a ZFS snapshot

When booting from a snapshot we need to follow a different code path
to turn the objset ID into the name, and for forward lookups we need
to walk the parent's snapnames_zap.

With this, it is possible to set the pools BOOTFS property to a
snapshot and boot with a read-only filesystem of that snapshot.

Reviewed by: tsoome, rew, imp
Sponsored By: Beckhoff Automation GmbH & Co. KG
Sponsored By: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38600

15 months agoroute.8: Don't reference an external command in EXAMPLES
Gordon Bergling [Tue, 14 Mar 2023 13:55:28 +0000 (14:55 +0100)]
route.8: Don't reference an external command in EXAMPLES

It is better to mention the externel command for showing
the routing table as using an explicit command.

PR: 231579
Suggested by: karels
Reviewed by: karles, gbe
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39075

15 months agoCI: update QEMU command line to avoid deprecated option format
Ed Maste [Tue, 7 Mar 2023 16:38:01 +0000 (11:38 -0500)]
CI: update QEMU command line to avoid deprecated option format

> warning: short-form boolean option 'readonly' deprecated
> Please use readonly=on instead

Sponsored by: The FreeBSD Foundation

15 months agoAlways enable the virtual timer for userspace
Andrew Turner [Fri, 10 Mar 2023 12:43:59 +0000 (12:43 +0000)]
Always enable the virtual timer for userspace

We always have it, some languages assume it's present, e.g. go
before 1.20. Enable it by default on arm and arm64.

PR: 269070
Reviewed by: kevans
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D39059

15 months agoFix the ofw parent check in arm64 nexus
Andrew Turner [Mon, 6 Mar 2023 09:54:57 +0000 (09:54 +0000)]
Fix the ofw parent check in arm64 nexus

OF_parent returns 0 for no parent. Fix the check in teh arm64
nexus_fdt_activate_resource.

Sponsored by: Arm Ltd

15 months agoxen: take struct size into account for video information
Roger Pau Monné [Mon, 13 Mar 2023 14:17:21 +0000 (15:17 +0100)]
xen: take struct size into account for video information

The xenpf_dom0_console_t structure can grow as more data is added, and
hence we need to check that the fields we accesses have been filled by
Xen.  The only extra field FreeBSD currently uses is the top 32 bits
for the frame buffer physical address.

Note that this field is present in all the versions that make the
information available from the platform hypercall interface, so the
check here is mostly cosmetic, and to remember us that newly added
fields require checking the size of the returned data.

Fixes: 6f80738b228c ('xen: fetch dom0 video console information from Xen')
Sponsored by: Citrix Systems R&D

15 months agoAdd GNU glibc compatible secure_getenv
lucy [Mon, 13 Mar 2023 22:01:12 +0000 (16:01 -0600)]
Add GNU glibc compatible secure_getenv

Add mostly glibc and msl compatible secure_getenv. Return NULL if
issetugid() indicates the process is tainted, otherwise getenv(x).  The
rational behind this is the fact that many Linux applications use this
function instead of getenv() as it's widely consider a, "best
practice".

Reviewed by: imp, mjg (feedback)
Pull Request: https://github.com/freebsd/freebsd-src/pull/686
Signed-off-by: Lucy Marsh <seafork@disroot.org>
15 months agoarm64: Delete redundant badly formatted and capitalised comment
Jessica Clarke [Tue, 14 Mar 2023 04:15:03 +0000 (04:15 +0000)]
arm64: Delete redundant badly formatted and capitalised comment

Fixes: 9729f076e4d9 ("arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)")

15 months agoarm64: Move Azure-specific config from std.hyperv to std.azure
Jessica Clarke [Tue, 14 Mar 2023 04:12:31 +0000 (04:12 +0000)]
arm64: Move Azure-specific config from std.hyperv to std.azure

Hyper-V does not provide Mellanox hardware, some of Azure's instances
do, thus the configuration to enable them does not belong in the generic
std.hyperv config.

Fixes: 15e7fa83ef3c ("arm64: Hyper-V: Add vPCI and Mellanox driver modules into build")