FreeBSD/src 8b10555sbin/ipfw ipfw2.c, sys/netpfil/ipfw ip_fw2.c

ipfw: fix IPv6 flow label matching

* do not require just only ip6 proto for flow-id opcode in ipfw(8).
  ipv6-icmp, tcp, udp should be fine too.
* fix off-by-one bug leading to out-of-bounds read.
* apply IPV6_FLOWLABEL_MASK before comparison in flow6id_match(),
  so flow-id opcode will match a specified flow label. No need to
  take protocol version and traffic class into account.
* add the test to verify that opcode is working correctly.

Reviewed by:    pouria
Obtained from:  Yandex LLC
Differential Revision:  https://reviews.freebsd.org/D56869

(cherry picked from commit 3d39eadcdeb301e95abdc94b1ad5d1255fa0f446)
DeltaFile
+78-0tests/sys/netpfil/ipfw/ipv6-flow-id.sh
+12-1tests/sys/netpfil/common/pft_ping.py
+1-4sbin/ipfw/ipfw2.c
+3-1sys/netpfil/ipfw/ip_fw2.c
+1-0tests/sys/netpfil/ipfw/Makefile
+95-65 files

FreeBSD/src 1cfc208sys/fs/tmpfs tmpfs_vfsops.c

tmpfs: Overhaul option handling on remount

On remount, we must accept all the same options as on initial mount.
For parameters which we're unable to modify on the fly, fail only if
the new value is different from the existing one.

PR:             295096
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57044
DeltaFile
+62-38sys/fs/tmpfs/tmpfs_vfsops.c
+62-381 files

FreeBSD/src 4617a6clib/libc/gen nlist.c nlist.3

nlist: Handle multiple symbol tables

* Instead of looking for and stopping at the first SHT_SYMTAB section,
  iterate over all SHT_DYNSYM and SHT_SYMTAB sections until we've either
  found all our symbols or run out.

* Perform bounds checks on section and string table offsets and sizes
  before attempting to mmap() the string table.

* Perform bounds checks on individual symbol table entries before
  attempting to access the corresponding strings.

* Stop treating _Foo and Foo as the same symbol.

This unbreaks OpenSSH which uses nlist(3) to verify PKCS#11 providers.

PR:             295336
MFC after:      1 week
Fixes:          77909f597881 ("Initial elf nlist support [...]")

    [3 lines not shown]
DeltaFile
+83-69lib/libc/gen/nlist.c
+5-3lib/libc/gen/nlist.3
+88-722 files

FreeBSD/src 8d36ec1sys/net80211 ieee80211_crypto_tkip.c

net80211: migrate wk_rxmic / wk_rxmic in TKIP code to accessors

These are the last two uses of the wk_rxmic / wk_txmic macros.
Everything should be using the accessor methods at ths point.

Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D54790
DeltaFile
+2-2sys/net80211/ieee80211_crypto_tkip.c
+2-21 files

FreeBSD/src e56f7besys/dev/iwx if_iwx.c if_iwxreg.h

iwx: clean up / document noise floor and RSSI fetching

* Document what iwx_rxmq_get_signal_strength() is doing in a comment,
  noting what the firmware returns and what math is being done on it
  to turn it into a dBm value.

* Document what iwx_get_noise() is supposed to do, that we can't just
  go do math with log numbers like we're doing, but also that we're
  seeing zeros in this firmware (AX210), which may mean we're decoding
  using the wrong structs.

* Swizzle around the RSSI calculation as a function, add min/max RSSI
  values, and calculate RSSI against the noise floor.

* And handle the lowest noise floor value - it can't be -127dBm as
  that will throw things off.  Cap it at -100dBm which is a little
  lower than the thermal noise floor at 20MHz (-98dBm), but it matches
  IWX_MIN_DBM.

Differential Revision:  https://reviews.freebsd.org/D53780
DeltaFile
+72-11sys/dev/iwx/if_iwx.c
+17-0sys/dev/iwx/if_iwxreg.h
+89-112 files

FreeBSD/src f6f5eb3sys/compat/linux linux_common.h

linux/linux_common.h: make header self-contained

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+6-0sys/compat/linux/linux_common.h
+6-01 files

FreeBSD/src 67f7f27sys/compat/linuxkpi/common/include/asm set_memory.h, sys/compat/linuxkpi/common/src linux_page.c

linuxkpi: work with numpages > 1 in the set_pages_*() KPIs

These calls are used for buddy pages at least in drm's ttm_pool, which
leads to a panic when we invoke lowmem handlers and drm tries to shrink
the pool.

Cope with numpages > 1 by traversing the contiguous pages and executing
the adjustment there, as well, as suggested by markj@.  Previous
versions have tried to use the corresponding `set_memory_*()` functions,
but it is believed that not updating `md.pat_mode` breaks subsequent
userspace mappings in ways that may result in things like screen tearing
or other artifacts when running i915kms.

This stabilized my amdgpu laptop running two VMs, chromium and a
concurrent buildworld.

Reviewed by:    bz, markj
Differential Revision:  https://reviews.freebsd.org/D57004
DeltaFile
+21-0sys/compat/linuxkpi/common/src/linux_page.c
+5-12sys/compat/linuxkpi/common/include/asm/set_memory.h
+26-122 files

FreeBSD/src 7e74f27sys/dev/wtap if_wtap.c

wtap: use typed rssi and noise floor values

Adjust the rssi and nf arguments to typed int8_t and adjust the maths
for rssi to be consistant with what net80211 expects.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    lwhsu, adrian
Differential Revision: https://reviews.freebsd.org/D57020

(cherry picked from commit d201e4e8491901d1de6bcaeb581a0bf958bf86f2)
DeltaFile
+12-2sys/dev/wtap/if_wtap.c
+12-21 files

FreeBSD/src da8f27dsys/net80211 ieee80211_node.c _ieee80211.h

net80211: define a type for rssi values

Due to net80211 keeping values in 0.5dBm relative to the noise floor
an int8_t is not good enough to prevent a double wrap around, which
means the reported rssi values can be wrong (see D50928 or likely
a commit in the future for more information).

In order to address the problem and not break the userspace API,
start by defining a type within the kernel and use that.  In a
next step we will then update the int8_t to int16_t to avoid the
problem up to the ioctl code.  This will then allow us to work
on the the user space API indepedently (see PR 293016 for possible
impact outside the base system).

No functional changes intended.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D57021

    [2 lines not shown]
DeltaFile
+9-9sys/net80211/ieee80211_node.c
+10-5sys/net80211/_ieee80211.h
+4-3sys/net80211/ieee80211_wds.c
+3-3sys/net80211/ieee80211_var.h
+3-1sys/net80211/ieee80211_ioctl.c
+2-2sys/net80211/ieee80211_mesh.c
+31-239 files not shown
+47-3915 files

FreeBSD/src 3f702b2usr.sbin/fwget/pci pci_network_intel pci_network_realtek

fwget: update realtek and intel pci entries

For Realtek we only add new entries.

For Intel the old way of extracting IDs from the driver no longer
works.  The new list is shortened as we drop more specific entries
which were already covered by wildcard entries.  The new lists are
also sorted within the groups.
There are 4 entries the new driver no longer carries but are still
present in older versions, so we keep them manually.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit ca67cfa5237f7ac537ca8611054b5af2098e2d86)
DeltaFile
+74-178usr.sbin/fwget/pci/pci_network_intel
+4-1usr.sbin/fwget/pci/pci_network_realtek
+78-1792 files

FreeBSD/src 6adb27eshare/man/man4 iwlwifi.4 iwlwififw.4

man: iwlwifi/rtw88/rtw89: update man pages for Linux v7.0 based updates

For all:
- harmonize Copyright/license section according to style.9 and used
  SPDX only.
- mention that the current generation of the driver is based on
  Linux version 7.0.
- make linuxkpi.4 and linuxkpi_wlan.4 .Xr as the man pages do exist
  these days.

iwlwifi: update the card/chipset names supported (while we still can)
iwlwififw: leave a comment only that we can no longer update the
  man page and it will be removed in the future.
rtw88: update supported chipsets and add note to BUGS sections
rtw89: update supported chipsets and add note to BUGS sections

Sponsored by:   The FreeBSD Foundation
Reviewed by:    ziaee
Differential Revision: https://reviews.freebsd.org/D57019

    [2 lines not shown]
DeltaFile
+91-99share/man/man4/iwlwifi.4
+6-22share/man/man4/iwlwififw.4
+18-9share/man/man4/rtw88.4
+19-7share/man/man4/rtw89.4
+134-1374 files

FreeBSD/src db50534sys/contrib/dev/rtw89 zzz_fw_ports_fwget.sh

rtw89: firmware: extend script to extract fwget entries

The so far so consistent (file)names got an outlier so add the
one character longer pattern as well to catch that.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 56460a6a420a066ea6eeadc3725bfdaf49f8142b)
DeltaFile
+2-2sys/contrib/dev/rtw89/zzz_fw_ports_fwget.sh
+2-21 files

FreeBSD/src 31c97d2sys/contrib/dev/iwlwifi zzz_fw_ports_fwget.sh

iwlwifi: firmware: reduce script to extract fwget information

Due to driver changes it is no longer feasible to extract the full
PCI ID / firmware / card type information in one go as we used to
be able to.
We have already changed the way we extract firmware information for
ports and marked the iwlwififw.4 man page as obsolete.

Reduce the script to simply extarct the fwget(8) information and,
compared to the old times, sort each section so diffs will be easier
to see in the future.  This was particular helpful this time to make
sure we do not lose entries with the change of technique.

We also keep the script in the best perl spirit to do the job but
not to win a price, especially given it seems we have to change
matters every (other) year.

Given we can no longer extract firmware information for the PCI IDs,
we need to "manually" check against the ports that names match.

    [7 lines not shown]
DeltaFile
+82-356sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh
+82-3561 files

FreeBSD/src 85afe03cddl/lib/libzpool Makefile, cddl/usr.bin/ztest Makefile

Remove -fms-extensions throughout the tree

During a discussion about using -fms-extensions jhb pointed out that
we have them enabled in the kernel for gcc by default (even multiple
times in one part). I had missed all that and clang still failed on
my use case (needing another option).

The original cause for enabling them for our tree back then was that
we needed to support C11 anonymous struct/unions.
Our in-tree gcc 4.2.1, despite later patches, needed the
-fms-extensions to support these even though this was not the expected
use case for that option ( cc4a90c445aa0 enabled it globally for the
kernel).
clang at that time (or at least when it became default for 10.0)
already was fine (with C11).

Any later gcc (4.6.0 onwards) did not need that option anymore, even
when compiled for -std=iso9899:1990 (which does not support anonymous
structs/unions) unless one would add -pedantic (see gcc git 4bdd0a60b27a).

    [17 lines not shown]
DeltaFile
+1-2sys/conf/kern.pre.mk
+1-1sys/powerpc/conf/dpaa/config.dpaa
+0-1cddl/usr.bin/ztest/Makefile
+0-1cddl/lib/libzpool/Makefile
+0-1cddl/usr.sbin/zdb/Makefile
+0-1sys/conf/kmod.mk
+2-72 files not shown
+2-98 files

FreeBSD/src a9e71a2release/tools ec2-small.conf

EC2: Don't enable firstboot_pkgs in small flavour

The EC2 "base" flavour installs the devel/py-awscli package at boot
time by default; we don't do this in the "small" flavour, so the
default behaviour was to update the FreeBSD-ports repository and
then do nothing with it.

Turn off firstboot_pkgs by default; if someone is using the "small"
flavour of AMIs and wants to install packages at instance launch
time, they simply need to add 'firstboot_pkgs_enable="YES"' to
/etc/rc.conf (which they must already be editing via user-data, in
order to provide the list of packages they want installed).

Sponsored by:   Amazon
MFC after:      3 days
MFC to:         stable/15
Relnotes:       EC2 "small" images now have firstboot_pkgs_enable="NO".

(cherry picked from commit 61df4be487cfbfd27b0959e1eb66ef0d8f84562f)
DeltaFile
+1-1release/tools/ec2-small.conf
+1-11 files

FreeBSD/src 762e451lib/libc/gen nlist.3

nlist.3: Add stab(5) Xref

Commit 876a17321c89 removed the a.out Xref as nlist(3) no longer
supports a.out, but this left nlist(3) without a reference to a page
documenting struct nlist.

struct nlist is documented in both a.out(5) and stab(5), so add an Xref
to the latter.

Reported by:    brooks
Fixes: 876a17321c89 ("nlist.3: Replace a.out(5) Xref with elf(5)")
DeltaFile
+2-1lib/libc/gen/nlist.3
+2-11 files

FreeBSD/src 29a286dsys/fs/nfsserver nfs_nfsdserv.c

nfs_nfsdserv.c: Clip number of callback slots

The client tells the server how many callback slots
it can handle in the callback session.  However, the
NFSv4.1/4.2 server can only handle a maximum of
NFSV4_SLOTS slots.  This patch clips the client's
value to that, to avoid using too high a slot#
for a callback.

Fortunately, I do not know of an extant client that
specifies a value greater than NFSV4_SLOTS, so this
patch is not really needed, as yet.  Also, the client
rarely uses a slot# above 0 when doing callbacks.

(cherry picked from commit 03e9e83f358678bab5e4c1ddf9c9d8faa7183cbb)
DeltaFile
+8-0sys/fs/nfsserver/nfs_nfsdserv.c
+8-01 files

FreeBSD/src 94b7a33lib/libc/gen nlist.3

nlist.3: Add discouraged use notice

It is a relic from a.out days and is poorly specified. Although ELF
support was added to nlist, there are better ways to access ELF data.

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57078
DeltaFile
+4-0lib/libc/gen/nlist.3
+4-01 files

FreeBSD/src 3414663sys/fs/nfsserver nfs_nfsdserv.c

nfs_nfsdserv.c: Clip number of callback slots

The client tells the server how many callback slots
it can handle in the callback session.  However, the
NFSv4.1/4.2 server can only handle a maximum of
NFSV4_SLOTS slots.  This patch clips the client's
value to that, to avoid using too high a slot#
for a callback.

Fortunately, I do not know of an extant client that
specifies a value greater than NFSV4_SLOTS, so this
patch is not really needed, as yet.  Also, the client
rarely uses a slot# above 0 when doing callbacks.

(cherry picked from commit 03e9e83f358678bab5e4c1ddf9c9d8faa7183cbb)
DeltaFile
+8-0sys/fs/nfsserver/nfs_nfsdserv.c
+8-01 files

FreeBSD/src cd6bf93lib/libc/gen nlist.3

nlist.3: Clarify which symbol table is used

nlist() requires section headers, and currently fetches symbol names
only from SHT_SYMTAB,

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57065
DeltaFile
+5-3lib/libc/gen/nlist.3
+5-31 files

FreeBSD/src 10edaa6sbin/sysctl sysctl.8, share/man/man4 dtrace_mib.4 ifmib.4

dtrace_mib.4: Document the DTrace MIB provider

Reviewed by:    kp
MFC after:      1 week
Obtained from:  60d8dbbef075 netinet: add a probe point for IP, IP6, ICMP, ICMP6, UDP and TCP stats counters
Differential Revision:  https://reviews.freebsd.org/D53709

(cherry picked from commit ef19cae25337e7449f338914650bbfab0fbea99f)
DeltaFile
+123-0share/man/man4/dtrace_mib.4
+4-1share/man/man7/stats.7
+2-1share/man/man4/ifmib.4
+2-1sbin/sysctl/sysctl.8
+2-1share/man/man4/dtrace_ip.4
+2-1share/man/man4/dtrace_tcp.4
+135-58 files not shown
+149-1114 files

FreeBSD/src 457fbd5share/man/man7 d.7

d.7: Document macro variables

MFC after:      1 week

(cherry picked from commit 2b9301a22bc677239d3c0dc783d970f17e7ca294)
DeltaFile
+44-2share/man/man7/d.7
+44-21 files

FreeBSD/src 3ae6829share/man/man9 uio.9 Makefile

uio.9: Document uiomove_fromphys()

Reviewed by:    kib
Discussed with: markj, royger
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54070

(cherry picked from commit 076e44839160f74f96fda83fa81c3acb41b9ebc8)
DeltaFile
+34-11share/man/man9/uio.9
+1-0share/man/man9/Makefile
+35-112 files

FreeBSD/src 544c3eecddl/contrib/opensolaris/cmd/dtrace dtrace.1, lib/libsys intro.2

dtrace: Document the syscall provider

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56831

(cherry picked from commit 242050278a377f5ca6906545ddc924b60ad8aa58)
DeltaFile
+87-0share/man/man4/dtrace_syscall.4
+3-2lib/libsys/intro.2
+2-1share/man/man4/linux.4
+2-1cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+1-0share/man/man4/Makefile
+95-45 files

FreeBSD/src 9306d04usr.sbin/ctld ctld.cc

ctld: Simplify pidfile rename handling in conf::apply

Explicitly copy the pidfile path from the initial configuration file
to the kernel-derived configuration to avoid having to check if the
old path is empty as a special case in conf::apply().

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56533
DeltaFile
+10-15usr.sbin/ctld/ctld.cc
+10-151 files

FreeBSD/src f1c5de5usr.sbin/ctld ctld.cc ctld.hh

ctld: Add a dedicated conf method for shutting down

Currently the main loop creates an empty config and applies it to
force a shutdown of all of the existing configuration.  While this is
functional and does avoid duplicating some code, it is also a bit
clunky and requires a special hack in the pidfile path handling
in the conf::apply method.

Instead, use a dedicated conf::shutdown method which tears down the
CTL ports and LUNs and closes the sockets.

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56532
DeltaFile
+40-16usr.sbin/ctld/ctld.cc
+1-0usr.sbin/ctld/ctld.hh
+41-162 files

FreeBSD/src 63d7b7fusr.sbin/ctld ctld.hh

ctld: Mark a few more isns_* methods in the conf class private

These are only invoked from other methods in the conf class.

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56531
DeltaFile
+3-3usr.sbin/ctld/ctld.hh
+3-31 files

FreeBSD/src 4f90de0usr.sbin/ctld ctld.cc

ctld: Remove redundant call to conf::isns_schedule_update

This is already called at the end of conf::apply.

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56530
DeltaFile
+0-2usr.sbin/ctld/ctld.cc
+0-21 files

FreeBSD/src be4f245sys/dev/sound/pcm ac97.c, sys/dev/thunderbolt tb_pcib.c

sys: Use is_pci_device instead of checking device or devclass names

Reviewed by:    bz, imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56998
DeltaFile
+2-5sys/dev/thunderbolt/tb_pcib.c
+1-1sys/dev/sound/pcm/ac97.c
+3-62 files

FreeBSD/src 6dc8133sys/arm64/cavium thunder_pcie_pem.c, sys/dev/bge if_bge.c

sys: Use is_pci_device instead of direct comparisons to devclasses

Reviewed by:    bz
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56997
DeltaFile
+8-24sys/dev/iommu/busdma_iommu.c
+3-10sys/dev/bge/if_bge.c
+3-10sys/x86/iommu/intel_drv.c
+2-8sys/dev/pci/pci.c
+2-7sys/dev/vnic/thunder_bgx_fdt.c
+1-5sys/arm64/cavium/thunder_pcie_pem.c
+19-646 files not shown
+29-8312 files