RFC8275 defines a new attribute as an extension to NFSv4.2
called MODE_UMASK. This patch adds the attribute number
to nfsproto.h.
Future patches will add optional support for the attribute.
This patch does not cause any semantics change.
(cherry picked from commit 10d5b43424da7fadfbdcc41bbffe40d130af1e1d)
The format for CTLTYPE_UINT is "IU" instead of "UI" as specified
in sysctl.9.
Reviewed by: cc, zlei
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46408
(cherry picked from commit 498286d4e807d6b9e4caad22b96ebca7f16e9b18)
Originally, a SYN-cache entry was always allocated and later freed,
when not needed anymore. Then the allocation was avoided, when no
SYN-cache entry was needed, and a copy on the stack was used.
But the logic regarding freeing was not updated.
This patch doesn't re-check conditions (which may have changed) when
deciding to insert or free the entry, but uses the result of
the earlier check.
This simplifies the code and improves also consistency.
Reviewed by: glebius
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46410
(cherry picked from commit e41364711ca3f7e214f9607ebedf62e03e51633d)
There will at most lro_entries entries in the LRO hash table. So no
need to take lro_mbufs into account, which only results in the
LRO hash table being too large and therefore wasting memory.
Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46378
(cherry picked from commit aa6c490bf80fcef15cfc0d3f562fae19ef2375aa)
Use LIST_FOREACH_SAFE(), since the list element is removed from
the list in the loop body, zero out and inserted in the free list.
Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46383
(cherry picked from commit 64443828bbe7c571db8d8731758ec8c4b8364c86)
Some SCTP implementations will abort connections and then later re-use the same
port numbers (i.e. both src and dst) for a new connection, before pf has fully
purged the old connection.
Apply the same hack we already have for similarly misbehaving TCP
implementations and forcibly remove the old state so we can create a new one.
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 82e021443a76b1f210cfb929a495185179606868)
We can't post a AER for this page, so there's no need to be able to swap
it to host byte order. It's not one of the standard defined pages that
can post via AER, and the vendor's public docs for this temperature page
don't suggest it's possible to get over or under event changes. Since
nvmecontrol no longer needsd the swap routine, remove it since it's
now unused.
Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44659
(cherry picked from commit 97b77de2d951b4946fb3219a99c98f2dd4c0120f)
This is used in NVMe over Fabrics to enumerate a list of available
controllers.
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44446
(cherry picked from commit 88ecf154c7c5a2e413a81ae1b0511b0295265b99)
nvme(4) doesn't check this flag, but Fabrics implementations may need
to set this flag in the log page attributes cdata field.
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44444
(cherry picked from commit cbda1886ab1cd3ec2847b7da5136d3bb68d56101)
This is not used in nvme(4) but is used in NVMe over Fabrics
transports which use SGLs to describe buffers instead of PRPs.
While here, adjust the shift value for the FUSE field to be relative
to the 'fuse' member of 'struct nvme_command'.
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44443
(cherry picked from commit b8cb8dd3625d7396ea98152d89e1e64b16e77bc6)
Fabrics capsules use an SGL structure instead of prp1/2 addresses to
describe the data buffer used for a command. The SGL structure is
added to a union with the existing prp1/2 fields.
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44442
(cherry picked from commit f21a54d19080510bce279183f4bf07d5315bd179)
These are useful for NVMe over Fabrics.
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44441
(cherry picked from commit 1931b75e004f25cf1d2db809bfd9baba40c04521)
This macro accepts a field name and a value for the field and
constructs the shifted field value.
Reviewed by: chuck
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43604
(cherry picked from commit 3a477a9b70a34dc0686630599c27f022b1e07bd8)
A few of these omitted a shift of 0, but this is more consistent.
Reviewed by: chuck
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43602
(cherry picked from commit 8488fc417fc24af37fa6f1e880f09a5023670950)
The current macro always builds a full mask for a named field, so use
the M suffix for mask.
Reviewed by: chuck, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43601
(cherry picked from commit 1dade1f255ee535ad357211395b46188bece52dc)
When we release a multicast address (e.g. on interface shutdown) we may
still have packets queued in inm_scq. We have to free those, or we'll
leak memory.
Reviewed by: glebius
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D43033
(cherry picked from commit c2e340452c147b551180f2a1600ae76491342b0e)
This reverts commit fa03d37432caf17d56a931a9e6f5d9b06f102c5b.
This commit caused us to not send IGMP leave messages if the inpcb went
away. In other words: we freed pending packets whenever the socket
closed rather than when the interface (or address) goes away.
Reviewed by: glebius
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D43032
(cherry picked from commit c196e43243b83840cc9f3d1dadc7dacb3b0f556f)
- Use snd_afmt2str() to display format conversions in feeder_format,
instead of the plain hex value.
- Simplify feeder_rate contents.
- Print "ch" (e.g 2.1ch) after matrix values in feeder_matrix.
- Use snd_afmt2str() instead of a plain hex for the the rest of the
feeder classes.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D46309
(cherry picked from commit 0864dfe6299b75e424b845c0d0e1a593da905ae3)
Previously 3 bytes of data from the heap could be leaked to ctl
consumers.
Reported by: Synacktiv
Reviewed by: asomers, mav
Sponsored by: The Alpha-Omega Project
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46091
(cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d)
Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19,
model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This
enables temperature readings of these CPUs via sysctl.
The sensors function identically to those for the "Raphael" processors
(model 0x60-0x6f); only the PCI device ID differs.
PR: kern/280942
Relnotes: yes
MFC after: 3 days
(cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c)
sys/netinet/libalias/alias_db.c has internal static function UseLink()
that passes a link to CleanupLink() to verify if the link has expired.
If so, UseLink() may return NULL.
_FindLinkIn()'s usage of UseLink() is not quite correct.
Assume there is "redirect_port udp" configured to forward incoming
traffic for specific port to some internal address.
Such a rule creates partially specified permanent link.
After first such incoming packet libalias creates new fully specifiled
temporary LINK_UDP with default timeout of 60 seconds.
Also, in case of low traffic libalias may assign "timestamp"
for this new temporary link way in the past because
LibAliasTime is updated seldom and can keep old value
for tens of seconds, and it will be used for the temporary link.
It may happen that next incoming packet for redirected port
passed to _FindLinkIn() results in a call to UseLink()
that returns NULL due to detected expiration.
Immediate return of NULL results in broken translation:
either a packet is dropped (deny_incoming mode) or delivered to
original destination address instead of internal one.
Fix it with additional check for NULL to proceed with a search
for original partially specified link. In case of UDP,
it also recreates temporary fully specified link
with a call to ReLink().
Practical examples are "redirect_port udp" rules for unidirectional
SYSLOG protocol (port 514) or some low volume VPN encapsulated in UDP.
Thanks to Peter Much for initial analysis and first version of a patch.
Reported by: Peter Much <pmc@citylink.dinoex.sub.org>
PR: 269770
(cherry picked from commit 8132e959099f0c533f698d8fbc17386f9144432f)
(cherry picked from commit e5b85380836378c9e321a4e6d300591e6faf622a)
(e.g. traceroute with icmp)
ok henning, jsing
Also extend the test case to cover this scenario.
PR: 280701
Obtained from: OpenBSD
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 89f6723288b0d27d3f14f93e6e83f672fa2b8aca)
In 534ee17e6 pf state checking for ICMP(v6) was made stricter. This change
failed to correctly set the pf_pdesc for ICMP-in-ICMP lookups, resulting in ICMP
error packets potentially being dropped incorrectly.
Specially, it copied the ICMP header into a separate variable, not into the
pf_pdesc.
Populate the required pf_pdesc fields for the embedded ICMP packet's state lookup.
PR: 280701
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 2da98eef1f352c496ffd458b4c68ddee972bb903)
Previously, to destroy an ithread we would set IT_DEAD in its flags, and
then wake it up if it wasn't already running. After doing this,
intr_event_destroy() would free the intr_event structure. However, it
did not wait for the ithread to exit, so it was possible for the ithread
to access the intr_event after it was freed.
This use-after-free happens readily when running the pf tests in
parallel, since they frequently create and destroy VNET jails, and pf
registers several VNET-local swi handlers.
Fix the race by modifying ithread_destroy() to wait until the ithread
has signaled that it is about to exit by setting ie->ie_thread = NULL.
Existing callers of intr_event_destroy() are allowed to sleep.
Reported by: KASAN
Reviewed by: kib, jhb
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D45492
(cherry picked from commit 8381e9f49ec733437754a822ef2e8344115289ac)
netmap's generic mode tries to improve performance by minimizing mbuf
allocations. In service of this goal, it maintains an extra reference
to the mbuf and polls the counter to see if the driver has released its
reference by calling m_freem(). As a result, the extref destructor is
not called when expected by the netfront driver, and mbufs tags are not
freed.
Modify the tx path to release its mbuf tags promptly when reclaiming tx
descriptors. They are drawn from a fixed-size pool, so otherwise are
quickly exhausted when a netfront interface is in netmap generic mode.
Co-authored by: royger
MFC after: 2 weeks
Fixes: dabb3db7a8 ("xen/netfront: deal with mbuf data crossing a page boundary")
Sponsored by: Cloud Software Group
Sponsored by: Klara, Inc.
Sponsored by: Zenarmor
(cherry picked from commit 2e4781cb12af2d13262ed5decf6fd95c8d58d9f5)
A lock needs to be held to ensure that the socket does not become a
listening socket while sotoxsocket() is loading fields from the socket
buffers, as the memory backing the socket buffers is repurposed when
transitioning to a listening socket.
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
(cherry picked from commit fc4365853f1c4b572d9fd643ea336508d9a6a0f7)
The maximum cluster number was calculated based on the number of data
cluters that fit in the givem partition size and the size of the FAT
area. This limit did not take into account that the highest 10 cluster
numbers are reserved and must not be used for files.
PR: 280347
Reported by: pho@FreeBSD.org
(cherry picked from commit 45d4e82bf61f91792142a2b9e2af657dab8500fd)
This fixes the build on 32-bit platforms.
Fixes: dc91e7452482 ("zdb: dump ZAP_FLAG_UINT64_KEY ZAPs properly (#16334)")
(cherry picked from commit f029f6277996760be4be42148295231af425cc2d)
We currently destroy the ithread in intr_event_destroy(). In
preparation for fixing a bug there, remove this dead code and reorganize
a bit to avoid some code duplication. No functional change intended.
Reviewed by: kib, jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D45490
(cherry picked from commit 177624f2f425901bb241789d639a16bded2247ae)
The qlnxe driver always sets the NIC's rx mac address to the card's
default MAC, ignoring any MAC address set via ifconfig.
PR: 278085
(cherry picked from commit 792226e53023cb09566cb78b2135b052e9b62e0e)
Update the ddb printing of t_flags and t_flags2 to the current state of
definitions in tcp_var.h.
Reviewed by: cc
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46222
(cherry picked from commit 093d9b46f4720392e53c171eaabfd7a6a8101170)
Update the ddb printing of t_flags and t_flags2 to the current state of
definitions in tcp_var.h.
Reviewed by: cc
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46222
(cherry picked from commit 093d9b46f4720392e53c171eaabfd7a6a8101170)
This fixes a number of clang 19 warnings:
sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:709:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
709 | freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
148 | (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
| ~~~ ^ ~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:745:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
745 | freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
148 | (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
| ~~~ ^ ~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:781:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
781 | freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
148 | (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
| ~~~ ^ ~~~~~~~~~~~~~~~~~~
The `FBIN2FREQ()` and `FREQ2FBIN()` macros in `ar9300eep.h` are invoked
in most places around the `ath_hal` code with a (effectively) boolean
second argument, corresponding to "is this 2GHz?". But in the code that
is warned about, the value `HAL_FREQ_BAND_2GHZ` is of a different
non-boolean type, `HAL_FREQ_BAND`.
Update the `FBIN2FREQ()` and `FREQ2FBIN()` macros to interpret the
second argument as boolean value, and rename the macro parameter names
to better describe their meaning.
Reviewed by: adrian, bz
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D46201
(cherry picked from commit 82246ac5d890e031c9978052e5a431e0960182d5)
OpenZFS release 2.2.5
Notable upstream pull request merges:
#15609566841171 Only provide execvpe(3) when needed
#159409edf6af4a Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN
#160380f1e8ba2f L2ARC: Cleanup buffer re-compression
#16104b474dfad0 Refactor dbuf_read() for safer decryption
#16118938d1588e Make more taskq parameters writable
#16131672474659 Slightly improve dnode hash
#161384c0fbd8d6 FreeBSD: Add zfs_link_create() error handling
#16159fa4b1a404 ZAP: Fix leaf references on zap_expand_leaf() errors
#1616241f2a9c81 Fix scn_queue races on very old pools
#161654c484d66b Fix ZIL clone records for legacy holes
#1620627cc6df76 Use memset to zero stack allocations containing unions
#162072eab4f7b3 Fix assertion in Persistent L2ARC
#1621413ccbbb47 Some improvements to metaslabs eviction
#16216ba3c7692c Destroy ARC buffer in case of fill error
#162584d2f7f983 vdev_open: clear async fault flag after reopen
#16264ef08cb26d Fix long_free_dirty accounting for small files
#1627354ef0fdf6 head_errlog: fix use-after-free
#1628414cce09a6 FreeBSD: Use a statement expression to implement
SET_ERROR()
#164066f27c4cad Make 'rmmod zfs' work after zfs-2.2.4
Obtained from: OpenZFS
OpenZFS commit: 33174af151
OpenZFS tag: zfs-2.2.5