From noreply at github.com  Thu Nov 23 15:23:21 2023
From: noreply at github.com (Zhenlei Huang)
Date: Thu, 23 Nov 2023 12:23:21 -0800
Subject: [Midnightbsd-cvs] [MidnightBSD/src] 62002c: Fix geom build with
 clang 17 and KTR enabled
Message-ID: <MidnightBSD/src/push/refs/heads/master/496a9c-308858@github.com>

  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: 62002cd67b82978bb17124eab7aed9f8916a72e2
      https://github.com/MidnightBSD/src/commit/62002cd67b82978bb17124eab7aed9f8916a72e2
  Author: Dimitry Andric <dim at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M sys/geom/geom_io.c

  Log Message:
  -----------
  Fix geom build with clang 17 and KTR enabled

When building a kernel with clang 17 and KTR enabled, such as with the
LINT configurations, a -Werror warning is emitted:

    sys/geom/geom_io.c:145:31: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
      145 |         if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) {
          |             ~~~~~~~~~~~~~~~~~~~~~~~~ ^
    sys/geom/geom_io.c:145:31: note: use '&' for a bitwise operation
      145 |         if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) {
          |                                      ^~
          |                                      &
    sys/geom/geom_io.c:145:31: note: remove constant to silence this warning

Replace the multiple uses of the expression with one macro, and in this
macro use "!= 0" to get a logical operand instead of a bitwise one.

Reviewed by:	jhb
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D41823

(cherry picked from commit 479d224efcbf0115f8cd84314fcc46cbac146a1d)


  Commit: 4b54a0b3f6603688c975c07afb9217235d51e5ae
      https://github.com/MidnightBSD/src/commit/4b54a0b3f6603688c975c07afb9217235d51e5ae
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M sys/net/if_ethersubr.c

  Log Message:
  -----------
  net: Check per-flow priority code point for untagged traffic

Commit 868aabb4708d introduced per-flow priority. There's a defect in the
logic for untagged traffic, it does not check M_VLANTAG set in the mbuf
packet header or MTAG_8021Q/MTAG_8021Q_PCP_OUT tag set by firewall, then
can result missing desired priority in the outbound packets.

For mbuf packet with M_VLANTAG in header, some interfaces happen to work
due to bug in the drivers mentioned in D39499. As modern interfaces have
VLAN hardware offloading, the defect is barely noticeable unless the
feature per-flow priority is widely tested.

As a side effect of this defect, the soft padding to work around buggy
bridges is bypassed. That may result in regression if soft padding is
requested.

PR:		273431
Discussed with:	kib
Fixes:	868aabb4708d Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39536

(cherry picked from commit 49d6743da15fe378782e43776df8b4fd4f84c8d0)
(cherry picked from commit c750055382f73db964c20f8eba855a9ac9e19591)
(cherry picked from commit 8303afca1765148d0069ce5144072b3ae9cab61e)


  Commit: cdf84a8c84f6c404a94aa3127007655d65c12e03
      https://github.com/MidnightBSD/src/commit/cdf84a8c84f6c404a94aa3127007655d65c12e03
  Author: Alan Somers <asomers at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc
    M cddl/usr.sbin/zfsd/vdev_iterator.cc

  Log Message:
  -----------
  Fix zfsd with the device_removal pool feature.

Previously zfsd would crash in the presence of a pool with a
top-level-vdev that had previously been removed.  The crash happened
because the configuration nvlist of such a TLV contains an empty
ZPOOL_CONFIG_CHILDREN array, which led to a pop_front from an empty
list, which has undefined behavior.

The crash only happened in stable/14 and later, probably do to
differences in libcxx, but the change should be MFCed anyway.

PR:		273663
Reported by:	Marek Zarychta <zarychtam at plan-b.pwste.edu.pl>
Sponsored by:	Axcient
Reviewed by:	mav
Differential Revision: https://reviews.freebsd.org/D41818

(cherry picked from commit 0b294a386d34f6584848ed52407687df7ae59861)


  Commit: 97c692c5662fb588c648894109722a1c83516242
      https://github.com/MidnightBSD/src/commit/97c692c5662fb588c648894109722a1c83516242
  Author: Wolfram Schneider <wosch at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M usr.bin/man/man.sh

  Log Message:
  -----------
  switch groff parameter -man to -mandoc

groff 1.23.0 changed the semantics of the -man parameter, and many
manual pages are not rendered. The -mandoc parameter brings back
the old behavior, as in groff 1.22.4 and earlier.

PR: 273565, 273245

Reviewed by:	emaste, bapt
MFC after: 1 week for all supported branches (stable/12, 13, 14)
Differential Revision:	https://reviews.freebsd.org/D41737

(cherry picked from commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e)


  Commit: 0a35130c1b5c5b9987190f26ac3c2bd14835e39f
      https://github.com/MidnightBSD/src/commit/0a35130c1b5c5b9987190f26ac3c2bd14835e39f
  Author: Wolfram Schneider <wosch at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M usr.bin/man/man.conf.5

  Log Message:
  -----------
  switch groff parameter -man to -mandoc for new groff release 1.23.0

PR: 273565

(cherry picked from commit cd89fe3923e92ab090cbdff7eb215c2d85b51718)


  Commit: 500aa74a9aefa3dc2e7ebfd02591f2aebc5756da
      https://github.com/MidnightBSD/src/commit/500aa74a9aefa3dc2e7ebfd02591f2aebc5756da
  Author: John Hein <jcfyecrayz at liamekaens.com>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M lib/libprocstat/core.c

  Log Message:
  -----------
  libprocstat: use elf_getphdrnum rather than deprecated elf_getphnum

PR:             273966
Reviewed by:	emaste

(cherry picked from commit 633094c27f0ac1b1001d5bd24a883240b4bce1dc)
(cherry picked from commit fd8bf2ecc05af841aa7e8369a43861cdc122d404)


  Commit: f05ec2ed5eeae6dab2e3c4d05ac68d48ce020f93
      https://github.com/MidnightBSD/src/commit/f05ec2ed5eeae6dab2e3c4d05ac68d48ce020f93
  Author: Cy Schubert <cy at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M sys/netpfil/ipfilter/netinet/fil.c

  Log Message:
  -----------
  ipfilter: Avoid allocating a new ipf token when not needed

Only allocate a new ipftoken_t if one cannot be found. This eliminates
allocating unnecessary token structures that will never be used when
performing simple lookups for existing token structures.

(cherry picked from commit 7f5e3b9fa3d159b7f061b4d01a767cbe5d0527f3)


  Commit: 658a8ab6864ede624109aeb2e6b2a40809184bab
      https://github.com/MidnightBSD/src/commit/658a8ab6864ede624109aeb2e6b2a40809184bab
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M sys/net/rtsock.c

  Log Message:
  -----------
  rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable

The sysctl variable `net.route.netisr_maxqlen` is actually a loader
tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will
report it correctly.

No functional change intended.

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

(cherry picked from commit 21a722d9593eb477f4ccdad011a2b4df0727fc62)
(cherry picked from commit bffb01eda9bffc3307ea8bf70f91087ed316e01c)
(cherry picked from commit c6afda2e5a0389ce293d3a3ced2889979aa2e442)


  Commit: 30885858af8f4b270e08a59a7546bc2c2d6a80ee
      https://github.com/MidnightBSD/src/commit/30885858af8f4b270e08a59a7546bc2c2d6a80ee
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M sys/netinet6/in6_proto.c

  Log Message:
  -----------
  netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables

The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. net.inet6.ip6.auto_linklocal
 2. net.inet6.ip6.accept_rtadv
 3. net.inet6.ip6.no_radr

No functional change intended.

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

(cherry picked from commit 03dac3e37993801dab4418087bfedacce0526e66)
(cherry picked from commit da2b630c12ec074673dfc646b2055a31b0d8d6d9)
(cherry picked from commit 28a80239fd6ab2ff79af5a2b19e349fa6f1d62e9)


Compare: https://github.com/MidnightBSD/src/compare/496a9ca51e1f...30885858af8f

From noreply at github.com  Thu Nov 23 15:25:45 2023
From: noreply at github.com (Zhenlei Huang)
Date: Thu, 23 Nov 2023 12:25:45 -0800
Subject: [Midnightbsd-cvs] [MidnightBSD/src] 3df01f: ipfw: Add sysctl flag
 CTLFLAG_TUN to loader tunables
Message-ID: <MidnightBSD/src/push/refs/heads/master/308858-2345f0@github.com>

  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: 3df01f4b49d495e92e94b4486181e81a4277b3ef
      https://github.com/MidnightBSD/src/commit/3df01f4b49d495e92e94b4486181e81a4277b3ef
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M sys/netpfil/ipfw/ip_fw_pfil.c

  Log Message:
  -----------
  ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables

The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. net.inet.ip.fw.enable
 2. net.inet6.ip6.fw.enable
 3. net.link.ether.ipfw

No functional change intended.

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

(cherry picked from commit 49197c391b3d49a33bcd08471bf64d533cd10f9d)
(cherry picked from commit f5f6da90597cb65ce55c4f17718a200097f6f78f)
(cherry picked from commit 09f08dbe248e6ffd031c1eff26aeacef0c6880e9)


  Commit: 0daa41d3addd46e55193348087cb29e7a0de717f
      https://github.com/MidnightBSD/src/commit/0daa41d3addd46e55193348087cb29e7a0de717f
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M sbin/ipfw/ipfw.8

  Log Message:
  -----------
  ipfw.8: Adjust section for loader tunables

Move the descriptions of loader tunables from section 'SYSCTL VARIABLES'
to section 'LOADER TUNABLES'.

See also 49197c391b3d (ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables).

MFC after:	2 days
Differential Revision:	https://reviews.freebsd.org/D41981

(cherry picked from commit 12349f38898f231ca803dcf526bac88cb1b5cd2b)
(cherry picked from commit bb6f9a95402a6c3ab8167481b81465f8ad5016fc)
(cherry picked from commit e31a331ddda6ffcb711bb950794be5d53e537e2a)


  Commit: b74ffdc110ce2ce942025c59b22f974ae02eb2e4
      https://github.com/MidnightBSD/src/commit/b74ffdc110ce2ce942025c59b22f974ae02eb2e4
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M sys/netinet/ip_mroute.c

  Log Message:
  -----------
  ip_mroute: Fix sysctl knobs

The loader tunable `net.inet.ip.mfchashsize` does not have corresponding
sysctl MIB entry. Just add it.

While here, the sysctl variable `net.inet.pim.squelch_wholepkt` is actually
a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T`
will report it correctly.

Reviewed by:	kp
Fixes:		443fc3176dee Introduce a number of changes to the MROUTING code
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41997

(cherry picked from commit f549e22901b3a391c76659bee55802b1214112fd)
(cherry picked from commit b0f026435a150933ecb6f2d1359fd1b4898657f1)
(cherry picked from commit ef3edef9ec8b7d19e5f66c385340604ab29ccc78)


  Commit: 2345f0ee54813260d3cd6d1c17eb0e65a8864e48
      https://github.com/MidnightBSD/src/commit/2345f0ee54813260d3cd6d1c17eb0e65a8864e48
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M sys/netpfil/ipfilter/netinet/mlfk_ipl.c

  Log Message:
  -----------
  ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable

The sysctl variable `net.inet.ipf.large_nat` is actually a loader
tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will
report it correctly.

No functional change intended.

Reviewed by:	cy (for #network)
Fixes:		a805ffbcbce8 ipfilter: Make LARGE_NAT a tunable
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42005

(cherry picked from commit ba883e7a5ac43b27a373f2b1b0044fd2eb769d4e)
(cherry picked from commit a9359dcde241f17421a71bc8c96dee08625db9dd)
(cherry picked from commit 25c371dc559a9ea23905baa5cbfed3f6d9d6eb5c)


Compare: https://github.com/MidnightBSD/src/compare/30885858af8f...2345f0ee5481

From noreply at github.com  Fri Nov 24 01:17:06 2023
From: noreply at github.com (Michael Osipov)
Date: Thu, 23 Nov 2023 22:17:06 -0800
Subject: [Midnightbsd-cvs] [MidnightBSD/src] f48494: libfetch: don't rely on
 ca_root_nss for certificat...
Message-ID: <MidnightBSD/src/push/refs/heads/master/2345f0-f48494@github.com>

  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: f4849477709addf5f9db2f4ffdc49f3d13dfbd48
      https://github.com/MidnightBSD/src/commit/f4849477709addf5f9db2f4ffdc49f3d13dfbd48
  Author: Michael Osipov <michael.osipov at siemens.com>
  Date:   2023-11-24 (Fri, 24 Nov 2023)

  Changed paths:
    M lib/libfetch/common.c

  Log Message:
  -----------
  libfetch: don't rely on ca_root_nss for certificate validation

Before certctl(8), there was no system trust store, and libfetch
relied on the CA certificate bundle from the ca_root_nss port to
verify peers.

We now have a system trust store and a reliable mechanism for
manipulating it (to explicitly add, remove, or revoke certificates),
but if ca_root_nss is installed, libfetch will still prefer that to
the system trust store.

With this change, unless explicitly overridden, libfetch will rely on
OpenSSL to pick up the default system trust store.

PR:		256902
MFC after:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D42059

(cherry picked from commit 09f5c1e118bb4eca77b83a0d08f559b20f60aa59)



From noreply at github.com  Fri Nov 24 01:17:44 2023
From: noreply at github.com (Lucas Holt)
Date: Thu, 23 Nov 2023 22:17:44 -0800
Subject: [Midnightbsd-cvs] [MidnightBSD/src] 938920: Advertise the MPI
 Message Version that's contained...
Message-ID: <MidnightBSD/src/push/refs/heads/master/f48494-938920@github.com>

  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: 938920aed8c4431daddeea3d0fb3adf908d84b58
      https://github.com/MidnightBSD/src/commit/938920aed8c4431daddeea3d0fb3adf908d84b58
  Author: Scott Long <scottl at FreeBSD.org>
  Date:   2023-11-24 (Fri, 24 Nov 2023)

  Changed paths:
    M sys/dev/mpr/mpr.c
    M sys/dev/mpr/mpr_user.c
    M sys/dev/mpr/mprvar.h
    M sys/dev/mps/mps.c
    M sys/dev/mps/mps_user.c
    M sys/dev/mps/mpsvar.h
    M usr.sbin/mpsutil/mps_cmd.c

  Log Message:
  -----------
  Advertise the MPI Message Version that's contained in the IOCFacts message
in the sysctl block for the driver.  mpsutil/mprutil needs this so it can
know how big of a buffer to allocate when requesting the IOCFacts from the
controller.  This eliminates the kernel console messages about wrong
allocation sizes.

Reported by:	imp

(cherry picked from commit 69e85eb8ae4919e0806bc2957cbc4a33f9138b54)

mprutil: "fix user reply buffer (64)..." warnings

Depending on the card's firmware version, it may return different length
responses for MPI2_FUNCTION_IOC_FACTS.  But the first part of the
response contains the length of the rest, so query it first to get the
length and then use that to size the buffer for the full response.

Also, correctly zero-initialize MPI2_IOC_FACTS_REQUEST.  It only worked
by luck before.

PR:		264848
Reported by:	Julien Cigar <julien at perdition.city>
Sponsored by:	Axcient
Reviewed by:	scottl, imp
Differential Revision: https://reviews.freebsd.org/D38739

(cherry picked from commit 7d154c4dc64e61af7ca536c4e9927fa07c675a83)