freebsd.git
20 months agoamd64: Fix a common typo in source code comments
Gordon Bergling [Thu, 19 Jan 2023 13:27:18 +0000 (14:27 +0100)]
amd64: Fix a common typo in source code comments

- s/comparision/comparison/

MFC after: 3 days

20 months agonfs: Fix a common typo in source code comments
Gordon Bergling [Thu, 19 Jan 2023 13:26:06 +0000 (14:26 +0100)]
nfs: Fix a common typo in source code comments

- s/ingore/ignore/

MFC after: 3 days

20 months agomountd(8): Fix a typo in a source code comment
Gordon Bergling [Thu, 19 Jan 2023 13:23:51 +0000 (14:23 +0100)]
mountd(8): Fix a typo in a source code comment

- s/ingore/ignore/

MFC after: 3 days

20 months agocxgbetool(8): Fix common typos in sysctl descriptions
Gordon Bergling [Thu, 19 Jan 2023 13:22:00 +0000 (14:22 +0100)]
cxgbetool(8): Fix common typos in sysctl descriptions

- s/addres/address/

MFC after: 5 days

20 months agobsnmpget.1: Fix a typo in the man page
Gordon Bergling [Thu, 19 Jan 2023 13:18:52 +0000 (14:18 +0100)]
bsnmpget.1: Fix a typo in the man page

- s/ingore/ignore/

MFC after: 3 days

20 months agorc.initdiskless: Fix a typo in a comment
Gordon Bergling [Thu, 19 Jan 2023 13:17:37 +0000 (14:17 +0100)]
rc.initdiskless: Fix a typo in a comment

- s/attemping/attempting/

MFC after:5 days

20 months agoath(4): Fix a sysctl description and a typo in a comment
Gordon Bergling [Thu, 19 Jan 2023 13:16:05 +0000 (14:16 +0100)]
ath(4): Fix a sysctl description and a typo in a comment

- s/delimeter/delimiter/

MFC after: 7 days

20 months agoip_gre: Fix a common typo in source code comments
Gordon Bergling [Thu, 19 Jan 2023 13:13:02 +0000 (14:13 +0100)]
ip_gre: Fix a common typo in source code comments

- s/addres/address/

MFC after: 3 days

20 months agoextra_tcp_stacks: Fix a common typo in source code comments
Gordon Bergling [Thu, 19 Jan 2023 13:11:00 +0000 (14:11 +0100)]
extra_tcp_stacks: Fix a common typo in source code comments

- s/orginal/original/

MFC after: 3 days

20 months agoImprove debuggability of VOP_* locking assertions
Jason A. Harmening [Mon, 16 Jan 2023 20:07:19 +0000 (14:07 -0600)]
Improve debuggability of VOP_* locking assertions

Include the phase and argument field to make it easier to determine
at a glance where the failure originated.

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

20 months agoktls_disable_ifnet_help: Set curvnet around sorele().
John Baldwin [Wed, 18 Jan 2023 23:39:04 +0000 (15:39 -0800)]
ktls_disable_ifnet_help: Set curvnet around sorele().

This is required in kernels with VIMAGE such as GENERIC.

MFC after: 1 week
Sponsored by: Chelsio Communications

20 months agolinuxkpi: Define `hrtimer_try_to_cancel()`
Jean-Sébastien Pédron [Wed, 11 Jan 2023 01:00:57 +0000 (02:00 +0100)]
linuxkpi: Define `hrtimer_try_to_cancel()`

It is the same as callout_stop(9) but the return values are different.

Reviewed by: hselasky
Approved by: hselasky
Differential Revision: https://reviews.freebsd.org/D38081

20 months agoipsec.c: typos in the comment
Konstantin Belousov [Sat, 4 Sep 2021 13:42:33 +0000 (16:42 +0300)]
ipsec.c: typos in the comment

Sponsored by: NVIDIA Networking
MFC after: 3 days

20 months agoif_ipsec(4): handle situations where there are no policy or SADB entry for if
Konstantin Belousov [Tue, 17 Jan 2023 01:59:56 +0000 (03:59 +0200)]
if_ipsec(4): handle situations where there are no policy or SADB entry for if

Reviewed by: ae, hselasky
Sponsored by: NVIDIA Networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38093

20 months agoif_ipsec(4): protect against user supplying unknown address family
Konstantin Belousov [Tue, 17 Jan 2023 01:37:45 +0000 (03:37 +0200)]
if_ipsec(4): protect against user supplying unknown address family

Reviewed by: ae, hselasky
Sponsored by: NVIDIA Networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38093

20 months agoAdd CPU Ident for Qualcomm Kryo 400 (used in MS Dev Kit)
Allan Jude [Tue, 20 Dec 2022 21:31:38 +0000 (21:31 +0000)]
Add CPU Ident for Qualcomm Kryo 400 (used in MS Dev Kit)

Reviewed by: imp
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37767

20 months agoRefresh CPU types and classes from sys/sys/pmc.h.
Pau Amma [Sat, 28 May 2022 18:49:17 +0000 (18:49 +0000)]
Refresh CPU types and classes from sys/sys/pmc.h.

While here, fix a few nits.

Inspired by reviewing D35342.

Sources for trademark info
- https://www.arm.com/company/policies/trademarks (no Arm8, curiously)
- https://www.ibm.com/legal/copytrade?mhsrc=ibmsearch_a&mhq=trademark

Reviewed by: carlavilla, luporl, mhorne
Approved by: carlavilla (mentor), mhorne (src)
Differential Revision: https://reviews.freebsd.org/D35344

20 months agoumodem: ignore CDC_CM descriptor for baltech smartcard reader
Steffen Dirkwinkel [Fri, 4 Nov 2022 14:46:07 +0000 (15:46 +0100)]
umodem: ignore CDC_CM descriptor for baltech smartcard reader

The CDC_CM descriptor points to the wrong interface for serial port use.
Ignore it to use the CDC_UNION descriptor.

usbconfig dump (spec at: https://usb.org/sites/default/files/CDC1.2_WMC1.1_012011.zip):
ugen0.2: <Baltech AG Smartcard Reader> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (300mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x13ad
  idProduct = 0xf019
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <Baltech AG>
  iProduct = 0x0002  <Smartcard Reader>
  iSerialNumber = 0x0003  <45031910>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0064
    bNumInterfaces = 0x0003
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0080
    bMaxPower = 0x0096

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0003  <HID device>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x11
       RAW dump:
       0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0xd0,
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0040
        bInterval = 0x0001
        bRefresh = 0x0000
        bSynchAddress = 0x0000

      Additional Descriptor

      bLength = 0x08
      bDescriptorType = 0x0b
      bDescriptorSubType = 0x01
       RAW dump:
       0x00 | 0x08, 0x0b, 0x01, 0x02, 0x02, 0x02, 0x00, 0x00

    Interface 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0002  <Communication device>
      bInterfaceSubClass = 0x0002
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump:
       0x00 | 0x05, 0x24, 0x00, 0x10, 0x01

      Additional Descriptor

      bLength = 0x04
      bDescriptorType = 0x24
      bDescriptorSubType = 0x02
       RAW dump:
       0x00 | 0x04, 0x24, 0x02, 0x00

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump:
       0x00 | 0x05, 0x24, 0x06, 0x01, 0x02

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x01
       RAW dump:
       0x00 | 0x05, 0x24, 0x01, 0x00, 0x01

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0085  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008
        bInterval = 0x0010
        bRefresh = 0x0000
        bSynchAddress = 0x0000

    Interface 2
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0002
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0086  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0040
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0006  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0040
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

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

20 months agoumodem: add quirk to ignore CDC_CM descriptor
Steffen Dirkwinkel [Tue, 17 Jan 2023 07:58:46 +0000 (08:58 +0100)]
umodem: add quirk to ignore CDC_CM descriptor

Some devices have CDC_CM descriptors that would point us to
the wrong interfaces. Add a quirk to ignore those (prefering the
CDC_UNION descriptor effectively)

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

20 months agoAdd the fixed memory type to the pci ecam driver
Andrew Turner [Wed, 18 Jan 2023 09:30:46 +0000 (09:30 +0000)]
Add the fixed memory type to the pci ecam driver

Add ACPI_RESOURCE_TYPE_FIXED_MEMORY32 to the PCI ECAM driver. This is
used on the Microsoft Dev Kit 2023 and reportedly the Lenovo x13s.

Reviewed by: Robert Clausecker <fuz@fuz.su> (Earlier version)
Tested by: Robert Clausecker <fuz@fuz.su> (Earlier version)
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D38031

20 months agoReduce an arm64 VFP critical section
Andrew Turner [Wed, 18 Jan 2023 09:30:36 +0000 (09:30 +0000)]
Reduce an arm64 VFP critical section

In set_fpcontext we only need a critical section around vfp_discard.
The remainder of the code can run without it.

While here add an assert to check the passed in thread is the
current thread as the code already this.

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

20 months agoAlways store the arm64 VFP context
Andrew Turner [Wed, 18 Jan 2023 09:30:32 +0000 (09:30 +0000)]
Always store the arm64 VFP context

If a thread enters a kernel FP context the PCB_FP_STARTED may be
unset when calling get_fpcontext even if the VFP unit has been used
by the current thread.

Reduce the use of this flag to just decide when to store the VFP state.

While here add an assert to check the assumption that the passed in
thread is the current thread and remove the unneeded critical section.
The latter is unneeded as the only place we would need it is in
vfp_save_state and this already has a critical section when needed.

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

20 months agoAlways read the VFP regs in the arm64 fill_fpregs
Andrew Turner [Wed, 18 Jan 2023 09:30:20 +0000 (09:30 +0000)]
Always read the VFP regs in the arm64 fill_fpregs

The PCB_FP_STARTED is used to indicate that the current VFP context
has been used since either 1. the start of the thread, or 2. exiting
a kernel FP context.

When case 2 was added to the kernel this could cause incorrect results
to be returned when a thread exits the kernel FP context and fill_fpregs
is called before it has restored the VFP state, e.g. by trappin on a
userspace VFP instruction.

In both of the cases the base save area is still valid so reduce the
use of the PCB_FP_STARTED flag check to help decide if we need to
store the current threads VFP state.

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

20 months agounbound: Fix config file path
Juraj Lutter [Tue, 17 Jan 2023 17:25:47 +0000 (18:25 +0100)]
unbound: Fix config file path

Commit 1838dec31895fd4752fa8631322ab93be0705a66 changed the
config file path to /usr/local/etc/unbound/unbound.conf which
is wrong for unbound in base.

Reported by: Ihor Antonov <ihor_AT_antonovs_family>
Reviewed by: zlei
Approved by: zlei
Differential Revision: https://reviews.freebsd.org/D38106

Fixes:          1838dec31895fd4752fa8631322ab93be0705a66
MFC after:      1 month
X-MFC with:     1838dec31895fd4752fa8631322ab93be0705a66

20 months agoifnet: Rename DrvAPI to "IfAPI"
Justin Hibbits [Tue, 17 Jan 2023 20:08:43 +0000 (15:08 -0500)]
ifnet: Rename DrvAPI to "IfAPI"

"DrvAPI" is too generic a name.  Make the name more specific as "IfAPI"
(InterFace API).

Sponsored by: Juniper Networks, Inc.

20 months agoriscv: Fix thread0.td_kstack_pages init
Brooks Davis [Tue, 17 Jan 2023 16:36:15 +0000 (16:36 +0000)]
riscv: Fix thread0.td_kstack_pages init

Commit 0ef3ca7ae37c70e9dc83475dc2e68e98e1c2a418 initialized
thread0.td_kstack_pages to KSTACK_PAGES.  Due to the lack of an
include of opt_kstack_pages.h it used the fallback value of 4 from
machine/param.h.  This meant that increasing KSTACK_PAGES in the kernel
config resulted in a panic in _epoch_enter_preempt as the following
assertion was false during network stack setup:

MPASS((vm_offset_t)et >= td->td_kstack &&
    (vm_offset_t)et + sizeof(struct epoch_tracker) <=
    td->td_kstack + td->td_kstack_pages * PAGE_SIZE);

Switch to initializing with kstack_pages following other architectures.

Reviewed by: imp, markj
Sponsored by:   DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D38049

20 months agoarm64: Fix thread0.td_kstack_pages init
Brooks Davis [Tue, 17 Jan 2023 16:35:08 +0000 (16:35 +0000)]
arm64: Fix thread0.td_kstack_pages init

Commit 86a994d6537d7b5e1efb1019e466d86a688fd570 initialized
thread0.td_kstack_pages to KSTACK_PAGES.  Due to the lack of an
include of opt_kstack_pages.h it used the fallback value of 4 from
machine/param.h.  This meant that increasing KSTACK_PAGES in the kernel
config resulted in a panic in _epoch_enter_preempt as the following
assertion was false during network stack setup:

        MPASS((vm_offset_t)et >= td->td_kstack &&
    (vm_offset_t)et + sizeof(struct epoch_tracker) <=
    td->td_kstack + td->td_kstack_pages * PAGE_SIZE);

Switch to initializing with kstack_pages following other architectures.

Reviewed by: imp, markj
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D38048

20 months agodf: Return non-zero status on write failure.
Dag-Erling Smørgrav [Tue, 17 Jan 2023 13:40:05 +0000 (14:40 +0100)]
df: Return non-zero status on write failure.

While here, complete the libxo conversion and switch return value to standard constants.

MFC after: 1 week
Sponsored by: Klara, Inc.
Differential revision: https://reviews.freebsd.org/D38097

20 months agonetlink: Fix indentation in netlink_message_writer.c
Mark Johnston [Tue, 17 Jan 2023 14:37:33 +0000 (09:37 -0500)]
netlink: Fix indentation in netlink_message_writer.c

This file is indented with a mixture of tabs and spaces.  No functional
change intended.

Reviewed by: melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38100

20 months agonetlink: Make the writers function table static and const
Mark Johnston [Tue, 17 Jan 2023 14:37:21 +0000 (09:37 -0500)]
netlink: Make the writers function table static and const

No functional change intended.

Reviewed by: melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38099

20 months agonetlink: Zero-initialize mbuf messages
Mark Johnston [Tue, 17 Jan 2023 14:36:54 +0000 (09:36 -0500)]
netlink: Zero-initialize mbuf messages

Some users of nlmsg_reserve_object() and nlmsg_reserve_data() are not
careful to fully initialize pad and reserved fields, allowing
uninitialized bytes to leak to userspace.  For example, dump_nhgrp()
doesn't set nhm->resvd = 0.

Meanwhile, nlmsg_get_ns_buf() and nlmsg_get_ns_lbuf() zero-initialize
the buffer, so nlmsg_get_ns_mbuf() is inconsistent.  Let's just make
them all behave the same here.

Reported by: KMSAN
Reviewed by: melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38098

20 months agomixer(3): remove redundant argument in _mixer_readvol()
Christos Margiolis [Tue, 17 Jan 2023 13:08:59 +0000 (08:08 -0500)]
mixer(3): remove redundant argument in _mixer_readvol()

There's no reason to pass the mixer as an argument since we can fetch it
from mix_dev.  No functional change intended.

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

20 months agoxhci(4): Add new USB IDs.
Dmitry Luhtionov [Tue, 17 Jan 2023 10:43:40 +0000 (11:43 +0100)]
xhci(4): Add new USB IDs.

MFC after: 1 week
Sponsored by: NVIDIA Networking

20 months agoehci(4): Add new USB IDs.
Dmitry Luhtionov [Tue, 17 Jan 2023 10:43:33 +0000 (11:43 +0100)]
ehci(4): Add new USB IDs.

MFC after: 1 week
Sponsored by: NVIDIA Networking

20 months agouhci(4): Add new USB IDs.
Dmitry Luhtionov [Tue, 17 Jan 2023 10:43:24 +0000 (11:43 +0100)]
uhci(4): Add new USB IDs.

MFC after: 1 week
Sponsored by: NVIDIA Networking

20 months agoif_tun: Add basic connectivity test with nc tun support
Tom Jones [Tue, 17 Jan 2023 10:05:00 +0000 (10:05 +0000)]
if_tun: Add basic connectivity test with nc tun support

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

20 months agonetcat: Allow nc to be an if_tun tunnel broker
Tom Jones [Tue, 17 Jan 2023 10:02:06 +0000 (10:02 +0000)]
netcat: Allow nc to be an if_tun tunnel broker

Reviewed by: kevans
Relnotes: yes
Sponsored by:   Zenarmor
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37435

20 months agoMinor changes to force commit these files so new freebsd*.cf files are
Gregory Neil Shapiro [Tue, 17 Jan 2023 06:49:49 +0000 (06:49 +0000)]
Minor changes to force commit these files so new freebsd*.cf files are
built to use the new sendmail-8.17.1/cf tree.

20 months agoSync with vendor sendmail 8.17.1 cf/cf/submit.mc
Gregory Neil Shapiro [Tue, 17 Jan 2023 06:49:07 +0000 (06:49 +0000)]
Sync with vendor sendmail 8.17.1 cf/cf/submit.mc

20 months agonetlink: add snl(3) manpage to the build
Alexander V. Chernikov [Mon, 16 Jan 2023 20:24:49 +0000 (20:24 +0000)]
netlink: add snl(3) manpage to the build

20 months agobsdconfig: correct name of the wpa_supplicant config file
Ceri Davies [Mon, 16 Jan 2023 18:56:45 +0000 (18:56 +0000)]
bsdconfig: correct name of the wpa_supplicant config file

Approved by: maintainer timeout (dteske)
Differential Revision: https://reviews.freebsd.org/D37750

20 months agolagg.4: update wireless example, document laggtype
Ceri Davies [Mon, 16 Jan 2023 18:53:30 +0000 (18:53 +0000)]
lagg.4: update wireless example, document laggtype

The wireless example in lagg(4)'s manpage no longer works, so update.

laggtype is not documented in the manpage other than in the example,
so add a paragraph about it.

While here, move section on rc.conf somewhere it sits more logically.

Reviewed by: pauamma
Differential Revision: https://reviews.freebsd.org/D31315

20 months agolinuxkpi: Define EBADSLT to 57
Jean-Sébastien Pédron [Mon, 2 Jan 2023 22:48:16 +0000 (23:48 +0100)]
linuxkpi: Define EBADSLT to 57

This is the same error code as Linux.

As emaste@ noted in the review, FreeBSD defines the following errno
values in `sys/errno.h`:
* 56 is `EISCONN`
* 57 is `ENOTCONN`

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D37935

20 months agolinuxkpi: Add `memalloc_noreclaim_save()` and `memalloc_noreclaim_restore()`
Jean-Sébastien Pédron [Mon, 2 Jan 2023 20:59:17 +0000 (21:59 +0100)]
linuxkpi: Add `memalloc_noreclaim_save()` and `memalloc_noreclaim_restore()`

They are no-ops.

Reviewed by: emaste, manu
Approved by: emaste, manu
Differential Revision: https://reviews.freebsd.org/D37933

20 months agolinuxkpi: Define `ioremap_cache()`
Jean-Sébastien Pédron [Fri, 30 Dec 2022 10:36:24 +0000 (11:36 +0100)]
linuxkpi: Define `ioremap_cache()`

It uses the `VM_MEMATTR_WRITE_BACK` flag on FreeBSD.

It replaces `ioremap_wb()` which doesn't exist in Linux. Perhaps it
existed in the past and was removed.

Reviewed by: emaste, manu
Approved by: emaste, manu
Differential Revision: https://reviews.freebsd.org/D37916

20 months agolinuxkpi: Add `gfp_mask` field to `struct shrink_control`
Jean-Sébastien Pédron [Fri, 30 Dec 2022 09:56:46 +0000 (10:56 +0100)]
linuxkpi: Add `gfp_mask` field to `struct shrink_control`

bz@ asked if the KBI breakage is a concern here. My answer was that this
is the first time in the DRM drivers in Linux 5.13 (the version I'm
working on) that this structure is initialized (as a variable local to
the function in this case), so it shouldn't be a problem for the DRM
drivers.

However, I can't speak for other drivers maintained outside of the src
tree.

Reviewed by: emaste, manu
Approved by: emaste, manu
Differential Revision: https://reviews.freebsd.org/D37913

20 months agolinuxkpi: Define `GFP_NOFS` in `linux/gfp.h`
Jean-Sébastien Pédron [Fri, 30 Dec 2022 09:49:08 +0000 (10:49 +0100)]
linuxkpi: Define `GFP_NOFS` in `linux/gfp.h`

Reviewed by: emaste, manu
Approved by: emaste, manu
Differential Revision: https://reviews.freebsd.org/D37910

20 months agobsdconfig, bsdinstall: Refresh mirrors list
Danilo G. Baio [Tue, 10 Jan 2023 01:06:57 +0000 (22:06 -0300)]
bsdconfig, bsdinstall: Refresh mirrors list

The mirrors list is in sync with the Handbook / Mirrors section [1],
which was refreshed a few months ago. Mirrors removed were not
responding or had duplicated addresses (aliases) with another mirror.

1 - https://docs.freebsd.org/en/books/handbook/mirrors/

Reviewed by: philip (clusteradm)
Approved by: philip
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38014

20 months agovm_object: Fix a kernel memory disclosure via the vm_object list sysctl
Mark Johnston [Mon, 16 Jan 2023 15:53:59 +0000 (10:53 -0500)]
vm_object: Fix a kernel memory disclosure via the vm_object list sysctl

Reported by: Chris J-D <chris@accessvector.net>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

20 months agoipsec: Clear pad bytes in PF_KEY messages
Mark Johnston [Mon, 16 Jan 2023 15:46:20 +0000 (10:46 -0500)]
ipsec: Clear pad bytes in PF_KEY messages

Various handlers for SADB messages will allocate a new mbuf and populate
some structures in it.  Some of these structures, such as struct
sadb_supported, contain small reserved fields that are not initialized
and are thus leaked to userspace.

Fix the problem by adding a helper to allocate zeroed mbufs.  This
reduces code duplication and the overhead of zeroing these messages
isn't harmful.

Reviewed by: zlei, melifaro
Reported by: KMSAN
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D38068

20 months agoopenssh: remove mention of now-unused svn:keywords
Ed Maste [Mon, 16 Jan 2023 14:52:00 +0000 (09:52 -0500)]
openssh: remove mention of now-unused svn:keywords

Reported by: gshapiro

20 months agoatomic.9: Remove the stated dependency on types.h
Mark Johnston [Mon, 16 Jan 2023 13:04:01 +0000 (08:04 -0500)]
atomic.9: Remove the stated dependency on types.h

All machine/atomic.h necessarily include sys/atomic_common.h, which
brings in types.h.

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

20 months agoatomic: Remove cdefs.h includes from atomic_*.h
Mark Johnston [Mon, 16 Jan 2023 13:03:20 +0000 (08:03 -0500)]
atomic: Remove cdefs.h includes from atomic_*.h

Avoid including cdefs.h in system headers.  Both headers now include
types.h, and we can assume that that pulls in cdefs.h (required for
__typeof usage in some of the atomic macro expansions).

No functional change intended.

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

20 months agomixer: Fix default_unit switching with mixers that have no devices
Mark Johnston [Mon, 16 Jan 2023 13:02:54 +0000 (08:02 -0500)]
mixer: Fix default_unit switching with mixers that have no devices

Apparently it's possible for a mixer to have no devices:

$ mixer -f /dev/mixer2
pcm2:mixer: <USB audio> at ? kld snd_uaudio (rec)
$

If this is the default sound device, an attempt to change the default
unit using mixer -d fails with a segfault because mod_dunit is called
with a NULL device pointer, which is dereferenced to get the parent
mixer.

ctl_dunit seems to be a dummy, i.e., we don't actually need it and can
simply pass the mixer to mod_dunit() directly.  This patch removes that
structure and associated indirection to fix the crash.

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

20 months agonetlink: fix compatibility with older netlink applications.
Alexander V. Chernikov [Mon, 16 Jan 2023 12:14:35 +0000 (12:14 +0000)]
netlink: fix compatibility with older netlink applications.

Some apps try to provide only the non-zero part of the required message
 header instead of the full one. It happens when fetching routes or
 interface addresses, where the first header byte is the family.
This behavior is "illegal" under the "strict" Netlink socket option,
 however there are many applications out there doing things in the
 "old" way.

Support this usecase by copying the provided bytes into the temporary
 zero-filled header and running the parser on this header instead.

Reported by: Goran Mekić <meka@tilda.center>

20 months agonetlink: fix typo in netlink(4)
Alexander V. Chernikov [Mon, 16 Jan 2023 10:56:10 +0000 (10:56 +0000)]
netlink: fix typo in netlink(4)

Reported by: Ihor Antonov <ihor@antonovs.family>

20 months agortsock: fix socket closure.
Alexander V. Chernikov [Sun, 15 Jan 2023 13:40:28 +0000 (13:40 +0000)]
rtsock: fix socket closure.

Currently `close(2)` erroneously return `EOPNOTSUPP` for `PF_ROUTE` sockets.
It happened after making rtsock socket implementation self-contained (
36b10ac2cd18 ). Rtsock code marks socket as connected in `rts_attach()`.
`soclose()` tries to disconnect such socket using `.pr_disconnect` callback.
Rtsock does not implement this callback, resulting in the default method being
substituted. This default method returns `ENOTSUPP`, failing `soclose()` logic.

This diff restores the previous behaviour by adding custom `pr_disconnect()`
returning `ENOTCONN`.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D38059

20 months agopf tests: properly destroy renamed interfaces
Kajetan Staszkiewicz [Mon, 16 Jan 2023 06:19:41 +0000 (07:19 +0100)]
pf tests: properly destroy renamed interfaces

The pfsync:pbr tests leaves  lot of interfaces when they finish, making
other tests slower due to long time of loading scapy from pft_ping.py
when more interfaces are present. When both sides of epair are assigned
to jails, they are both removed from created_interfaces.lst and thus
won't be removed during cleanup from this file. An interface assigned to
jail is stored in created_jails.lst but if it is renamed, it won't be
cleaned up either. Furthermore this test uses identical names for
multiple interfaces across multiple jails which after destroying those
jails adds to overall confusion.

To address this issue a new function is provided for renaming interfaces
in jails and storing their new names in created_jails.lst for deletion
during cleanup.

MFC after: 1 week
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D38024

20 months agoRequire INVARIANTS and WITNESS if DEBUG_VFS_LOCKS is set
Konstantin Belousov [Sun, 15 Jan 2023 21:33:10 +0000 (23:33 +0200)]
Require INVARIANTS and WITNESS if DEBUG_VFS_LOCKS is set

Reported by: pho
Reviewed by: markj, mjg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38070

20 months agonfsserver: Fix handling of SP4_NONE
Rick Macklem [Sun, 15 Jan 2023 22:07:40 +0000 (14:07 -0800)]
nfsserver: Fix handling of SP4_NONE

For NFSv4.1/4.2, when the client specifies SP4_NONE for
state protection in the ExchangeID operation arguments,
the server MUST allow the state management operations for
any user credentials.  (I misread the RFC and thought that
SP4_NONE meant "at the server's discression" and not MUST
be allowed.)

This means that the "sec=XXX" field of the "V4:" exports(5)
line only applies to NFSv4.0.

This patch fixes the server to always allow state management
operations for SP4_NONE, which is the only state management
option currently supported. (I have patches that add support
for SP4_MACH_CRED to the server. These will be in a future commit.)

In practice, this bug does not seem to have caused
interoperability problems.

MFC after: 2 weeks

20 months agosendmail 8.17.1 included this fix, though in a different location so
Gregory Neil Shapiro [Sun, 15 Jan 2023 21:25:39 +0000 (21:25 +0000)]
sendmail 8.17.1 included this fix, though in a different location so
removing the FreeBSD local code in favor of the vendor branch version

20 months agoAdd -DSTARTTLS CFLAG in order to enable DANE in sendmail builds
Gregory Neil Shapiro [Sun, 15 Jan 2023 21:24:38 +0000 (21:24 +0000)]
Add -DSTARTTLS CFLAG in order to enable DANE in sendmail builds

20 months agoUpdate for new library files in sendmail 8.17.1
Gregory Neil Shapiro [Sun, 15 Jan 2023 21:23:27 +0000 (21:23 +0000)]
Update for new library files in sendmail 8.17.1

20 months agoMerge commit '28fbd2825d216dafca4d991ad96d05b312f4f9a3'
Gregory Neil Shapiro [Sun, 15 Jan 2023 21:20:22 +0000 (21:20 +0000)]
Merge commit '28fbd2825d216dafca4d991ad96d05b312f4f9a3'

Merge vendor sendmail 8.17.1 into HEAD

20 months agoImport sendmail 8.17.1
Gregory Neil Shapiro [Sun, 15 Jan 2023 19:15:36 +0000 (19:15 +0000)]
Import sendmail 8.17.1

20 months agoDocument the mntopts(3) functions.
Kirk McKusick [Sun, 15 Jan 2023 18:20:48 +0000 (10:20 -0800)]
Document the mntopts(3) functions.

The mntopts(3) functions support operations associated with a mount
point. The main purpose of this commit is to document the mntopts(3)
functions that now appear in 18 utilities in the base system. See
mntopts(3) for the documentation details.

The getmntopts() function appeared in 4.4BSD. The build_iovec(),
build_iovec_argf(), free_iovec(), checkpath(), and rmslashes()
functions were added with nmount(8) in FreeBSD 5.0. The getmntpoint()
and chkdoreload() functions are being added in this commit.

These functions should be in a library but for historic reasons are
in a file in the sources for the mount(8) program. Thus, to access
them the following lines need to be added to the Makefile of the
program wanting to use them:

SRCS+= getmntopts.c
MOUNT= ${SRCTOP}/sbin/mount
CFLAGS+= -I${MOUNT}
.PATH: ${MOUNT}

Once these changes have been MFC'ed to 13 they may be made into
a library.

Reviewed by:  kib, gbe
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37907

20 months agond6: fix panic in lltable_drop_entry_queue()
Alexander V. Chernikov [Sun, 15 Jan 2023 15:10:48 +0000 (15:10 +0000)]
nd6: fix panic in lltable_drop_entry_queue()

nd6_resolve_slow() can be called without mbuf. If the LLE entry
 is not reachable, nd6_resolve_slow() will add this NULL mbuf to
 the holdchain via lltable_append_entry_queue, which will "append"
 NULL to the end of the queue (effectively no-op) and bump la_numhold
 value. When this entry gets freed, the kernel will panic due to the
 inconsistency between the amount of mbufs in the queue and the value
 of la_numhold.

Fix the panic by checking of mbuf is not NULL prior to inserting it
 into the holdchain.

Reported by: kib
MFC after: 3 days

20 months agoman: add Netlink reference to socket(2)
Alexander V. Chernikov [Sat, 14 Jan 2023 17:35:43 +0000 (17:35 +0000)]
man: add Netlink reference to socket(2)

Reviewed by: lwhsu, pauamma, gbe
Differential Revision: https://reviews.freebsd.org/D38054

20 months agounbound: Fix config.h
Cy Schubert [Sun, 15 Jan 2023 06:55:05 +0000 (22:55 -0800)]
unbound: Fix config.h

FreeBSD src does not support HAVE_DECL_EVSIGNAL_ASSIGN. While reviewing
the new config.h after regenerating it, this definition was not removed.

Updating config.h is a manual process of configuring the port and
copying/merging the generated config.h into src. This definition was
missed and not removed (#undef'd).

Fixes: 1838dec31895fd4752fa8631322ab93be0705a66
MFC after: 1 month
X-MFC with: 1838dec31895fd4752fa8631322ab93be0705a66

20 months agounbound: Vendor import 1.17.1
Cy Schubert [Sun, 15 Jan 2023 05:39:31 +0000 (21:39 -0800)]
unbound: Vendor import 1.17.1

Release notes at
    https://www.nlnetlabs.nl/news/2023/Jan/12/unbound-1.17.1-released/.

MFC after:      1 month

Merge commit '7699e1386a16236002b26107ffd2dcbde375e197' into main

20 months agomixer(3): Add HEADNAME to TAILQ_HEAD declarations
Christos Margiolis [Sun, 15 Jan 2023 02:33:58 +0000 (21:33 -0500)]
mixer(3): Add HEADNAME to TAILQ_HEAD declarations

This allows us to use the TAILQ_PREV and TAILQ_FOREACH_REVERSE_* macros,
useful for an out-of-tree consumer.

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

20 months agostress2: Added a regression test
Peter Holm [Sat, 14 Jan 2023 19:19:05 +0000 (20:19 +0100)]
stress2: Added a regression test

20 months agoAllow a comma-separated list in login class capabilities,
Sean Eric Fagan [Sat, 14 Jan 2023 18:37:31 +0000 (10:37 -0800)]
Allow a comma-separated list in login class capabilities,
by adding a version of strcspn that allows quoting.

20 months agoffs_syncvnode(): avoid a LoR for SU
Konstantin Belousov [Sat, 7 Jan 2023 12:22:18 +0000 (14:22 +0200)]
ffs_syncvnode(): avoid a LoR for SU

There is another case where SU code does ffs_syncvnode(dvp) for the
parent directory dvp while the child vnode vp is locked.  Avoid the
issue by relocking and returning ERELOOKUP to indicate the need of
resync.

Reported by: jkim
Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37997

20 months agoStop cleaning MNT_LOCAL on unmount
Konstantin Belousov [Fri, 6 Jan 2023 16:38:44 +0000 (18:38 +0200)]
Stop cleaning MNT_LOCAL on unmount

There is no point in clearing just this flag.  Flags are reset on the
struct mount re-allocation for reuse anyway.

Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37966

20 months agodepend-cleanup.sh: handle zic moving one level up.
Dag-Erling Smørgrav [Fri, 13 Jan 2023 18:09:51 +0000 (19:09 +0100)]
depend-cleanup.sh: handle zic moving one level up.

MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38044

20 months agotzcode: Silence warnings.
Dag-Erling Smørgrav [Fri, 13 Jan 2023 15:05:36 +0000 (16:05 +0100)]
tzcode: Silence warnings.

* Ignore failure to remove our temp file.
* Avoid a minor memory leak in the -D case.

Reported by: Coverity (CID 1502534, 1502535, 1502538)
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38038

20 months agotzcode: Fully initialize structs before use.
Dag-Erling Smørgrav [Fri, 13 Jan 2023 14:59:05 +0000 (15:59 +0100)]
tzcode: Fully initialize structs before use.

Reported by: Coverity (CID 1502542, 1502548)
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38037

20 months agotzcode: Avoid memory leak if pthread_setspecific() fails.
Dag-Erling Smørgrav [Fri, 13 Jan 2023 14:57:19 +0000 (15:57 +0100)]
tzcode: Avoid memory leak if pthread_setspecific() fails.

Reported by: Coverity (CID 1018472, 1018474)
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38036

20 months agotzcode: Remove access() again, cf. 02ba1d993fa9.
Dag-Erling Smørgrav [Fri, 13 Jan 2023 14:54:21 +0000 (15:54 +0100)]
tzcode: Remove access() again, cf. 02ba1d993fa9.

Reported by: Coverity (CID 1250126)
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38035

20 months agoTypo, spotted by Matteo.
Poul-Henning Kamp [Sat, 14 Jan 2023 14:53:12 +0000 (14:53 +0000)]
Typo, spotted by Matteo.

20 months agoAdd a SVG version of vector-Beastie.
Poul-Henning Kamp [Sat, 14 Jan 2023 14:30:53 +0000 (14:30 +0000)]
Add a SVG version of vector-Beastie.

(If somebody with a proper vector-based drawingprogram replaced the
polylines with splines, the file would probably shrink by 80%.)

20 months agounbound: Vendor import 1.17.1
Cy Schubert [Fri, 13 Jan 2023 23:52:47 +0000 (15:52 -0800)]
unbound: Vendor import 1.17.1

Release notes at
    https://www.nlnetlabs.nl/news/2023/Jan/12/unbound-1.17.1-released/.

20 months agostand: dev can't be NULL in default_prasedev
Warner Losh [Fri, 13 Jan 2023 22:44:23 +0000 (15:44 -0700)]
stand: dev can't be NULL in default_prasedev

We pass in the address of a variable to store this value always in the
only place that calls this function, so there is no need to test for NULL.

Sponsored by: Netflix
Notied by: tsoome in D38041

20 months agocal: don't print terminal control characters unless stdout is a TTY
Alan Somers [Fri, 13 Jan 2023 20:19:03 +0000 (13:19 -0700)]
cal: don't print terminal control characters unless stdout is a TTY

A similar change was made in svn r223931, but it was incomplete, working
only when the utility was invoked as "ncal".  Fix the same issue when
invoking as "cal".

PR: 268936
Reported by: Ray Bellis <ray@bellis.me.uk>
MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D38045

20 months agokboot: Use standard set_currdev
Warner Losh [Fri, 13 Jan 2023 21:21:16 +0000 (14:21 -0700)]
kboot: Use standard set_currdev

Use the standard set_currdev instead of the (now very old) copy of
setting currdev and loaddev directly. We do this only when we don't go
find the ZFS pool to boot from.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38012

20 months agokboot: Add hostdisk override
Warner Losh [Fri, 13 Jan 2023 21:21:07 +0000 (14:21 -0700)]
kboot: Add hostdisk override

When hostdisk_override is set, all the /dev devices are hidden, and only
the files in that directory are used. This will allow filesystem testing
on FreeBSD without root, for example. Adjust the parse routine to not
require devices start with /dev (plus fix a leak for an error
condition). Add a match routine to allow the device name to be something
like "/home/user/testing/zfsfoo:" instead of strictly in /dev. Note:
since we need to look at all the devices in the system to probe for ZFS
zpools, you can't generally use a full path to get a 'virtual disk' at
this time.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38011

20 months agokboot: Fetch hostfs_root and bootdev from the environment
Warner Losh [Fri, 13 Jan 2023 21:20:56 +0000 (14:20 -0700)]
kboot: Fetch hostfs_root and bootdev from the environment

Fetch bootdev from the environment variable (so it should be set on the
command line). Default to 'zfs:' which will in the future look for the
first zpool that we can boot from. Prior versions of kboot would set
this from the second argument on the command line.

Fetch hostfs_root from the environment (defaulting to '/'). Prior
versions of kboot would set this from the first arg on the command line.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38010

20 months agokboot: Add ZFS support build glue
Warner Losh [Fri, 13 Jan 2023 21:20:48 +0000 (14:20 -0700)]
kboot: Add ZFS support build glue

Now that all the pieces are in place, allow kboot to be built with ZFS
support.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38009

20 months agokboot: Add support for ZFS volumes
Warner Losh [Fri, 13 Jan 2023 21:20:40 +0000 (14:20 -0700)]
kboot: Add support for ZFS volumes

Add the zfs device and filesystem to config and write the hook we need
to probe zfs since there's not a generic mechanism in place to do that
when ZFS is configured.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38008

20 months agokboot: Add ZFS support to hostdisk
Warner Losh [Fri, 13 Jan 2023 21:20:30 +0000 (14:20 -0700)]
kboot: Add ZFS support to hostdisk

Add helper function to walk through the disk drives we've found to look
for zpools. main.c will still need to call this because the loader
hasn't implemented a good way to 'taste' drives for zpools and/or GELI
partitions (mostly because there's no generic list of candidate
devices).

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38007

20 months agokboot: Rework hostdisk.c to allow easier ZFS support.
Warner Losh [Fri, 13 Jan 2023 21:20:09 +0000 (14:20 -0700)]
kboot: Rework hostdisk.c to allow easier ZFS support.

Keep a list of disks and partitions that we have. Keep track of the
sizes of the media and sector and use that to implement DIOCGMEDIASIZE
and DIOCGSECTORSIZE. Proivde a way to lookup disks by name.

Sponsored by: Netflix
Reviewed by: kevans (prior version)
Differential Revision: https://reviews.freebsd.org/D38013

20 months agostand/zfs: Fix memory leaking on error cases
Warner Losh [Fri, 13 Jan 2023 21:20:00 +0000 (14:20 -0700)]
stand/zfs: Fix memory leaking on error cases

Now that we return an allocated zfs_devdesc, we have to free it. These
frees were missing from the error cases. In addition, simplify the code
a bit for the out of memory case.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38006

20 months agostand/uboot: Explain why we test for NULL here
Warner Losh [Fri, 13 Jan 2023 21:19:47 +0000 (14:19 -0700)]
stand/uboot: Explain why we test for NULL here

Most parsedev routines assume that idev is non-null and can always be
set. Since we break from this pattern in uboot, explain why in a
comment. devparse was invented to put a lot of common code in one place
and to simplify the archsw.arch_getdev code and any dv_parsedev code
called. However, uboot couldn't use devparse at the time because its
device naming scheme slightly different parsing. So, we still use
uboot_parsedev directly from uboot_getdev where dev could be NULL. Add a
comment to this effect.

The match functionality added for ofw likely could be used to clean up
the multiple kludges that are here for uboot's device naming differences
with the normal boot loader. This work will wait for the future.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38042

20 months agostand/ofw: dev can't be NULL here
Warner Losh [Fri, 13 Jan 2023 21:19:39 +0000 (14:19 -0700)]
stand/ofw: dev can't be NULL here

dev can't be NULL here. ofw_common_parsedev is always called via
devparse (indirectly through dv_parsedev() calls there which call it
with the args unchanged). In the past, ofw_getdev could call us with
NULL pointer for the parse-only case, but that's now all handled inside
of devparse for simplicity.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38041

20 months agostand: Separate base and cli parts of nvstore
Warner Losh [Fri, 13 Jan 2023 21:19:30 +0000 (14:19 -0700)]
stand: Separate base and cli parts of nvstore

zfs lives in libsa. However, it depends on nvstore (and other things)
that are in common. Fix part of this layering violation by splitting
nvstore into a libsa piece (which is the base implementation) and
keeping a much smaller common piece (to implement the nvstore
command). This just leaves zfs' knowledge of device names that's
specific to common and its calling platform specific init code to
resolve. Add a nvstore.h file for these two parts to communicate private
things and move the public nvstore api from bootstrap.h to stand.h.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D38043

20 months agopf: fix panic on deferred packets
Kristof Provost [Fri, 13 Jan 2023 03:34:20 +0000 (04:34 +0100)]
pf: fix panic on deferred packets

The pfsync_defer_tmo() callout needs to set the correct vnet before it
can transmit packets. It used the rcvif in the mbuf to get this vnet,
but that doesn't work for locally originated traffic. In that case the
rcvif pointer is NULL, and the dereference leads to a panic.

Instead use the sc_sync_if, which is always set (if pfsync is enabled,
at least).

PR: 268246
MFC after: 2 weeks

20 months agoipfw: Add missing 'va' code point name
Jose Luis Duran [Fri, 13 Jan 2023 20:19:34 +0000 (20:19 +0000)]
ipfw: Add missing 'va' code point name

Per RFC 5865, add the 'va' (VOICE-ADMIT, 101100) symbolic name.

Reviewed By: melifaro, pauamma
Differential Revision: https://reviews.freebsd.org/D37508
MFC after: 2 weeks

20 months agoMechanically convert ena(4) to DrvAPI
Justin Hibbits [Fri, 13 Jan 2023 16:04:09 +0000 (17:04 +0100)]
Mechanically convert ena(4) to DrvAPI

Reviewed by: mw
Differential Revision: https://reviews.freebsd.org/D37837

20 months agoena: Update driver version to v2.6.2
Arthur Kiyanovski [Tue, 13 Dec 2022 16:58:25 +0000 (16:58 +0000)]
ena: Update driver version to v2.6.2

Bug Fixes:
* Remove timer service re-arm on ena_restore_device failure.
* Re-Enable per-packet missing tx completion print

Minor Changes:
* Switch driver owners from Semihalf to Amazon in man file.

MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/637