nfs_nfsdstate.c: Partial revert of 64857418bb23
Dropping the cached reply that is too large causes
a correctness problem that is too difficult to fix,
so revert this and leave it the way it was.
Although there is an argument that not doing could
cause resource exhaustion, it has not been reported
in the field as a problem.
(cherry picked from commit bc7366a340edb366c37352c636b8360de92aa3a2)
nfsd: Fix handling of RPC messages too large to cache
The NFSv4.1/4.2 session negotiates a limit to the size
of an RPC reply message that can be cached for the session
slot.
This patch fixes the code so that it checks that limit and
does not cache replies larger than the limit, even if the
client requested that it be cached.
This patch is slightly different than what the author
submitted, but retains the check for reply cache size limit.
(cherry picked from commit 64857418bb2379a7d89b6af04cddf92fa48dd28c)
net-im/continuwuity: Update to 26.11.0
Experimental features are now opt-in and have to be enabled in the new
experiments section, and support for unauthenticated media is gone along
with the allow_legacy_media and freeze_legacy_media options. The
release also carries security fixes.
Changelog: https://forgejo.ellis.link/continuwuation/continuwuity/releases/tag/v26.11.0
Sponsored by: Netzkommune GmbH
xprt_verbs.c: Use the default fib# for route lookups
Without this patch, fib4_lookup()/fib6_lookup() are
called with the fib# for the current thread.
During a reconnect, this could be any thread, so use
the default fib# instead.
Reported by: llm-postcr
MFC after: 1 month
Fixes: 80bee4d83637 ("nfsclrdma: Add code to support client side NFS over RDMA")
netinet6: Keep the AH flags on the inner packet of a tunnel mode SA
ip6_input() clears M_AUTHIPHDR and M_AUTHIPDGM on every packet. The
inner packet of a tunnel mode AH SA reaches it through netisr after
ipsec[46]_common_input_cb() has stripped the outer header, so it loses
the flags that ah_input_cb() set after verifying the ICV. The inbound
policy check in ipsec_in_reject() then finds no AH flag on a packet
whose policy requires AH and drops it as a policy violation ("inbound
packets violated process security policy" in netstat -sp ipsec6). With
the usual "require" level, every IPv6 packet carried by a policy-based
AH tunnel is dropped, whatever the outer address family. ESP is not
affected, since M_DECRYPTED is not cleared, and neither are IPv4 inner
packets, since ip_input() has never cleared the flags. if_ipsec(4) is
not involved, since it only uses ESP.
net.inet.ipsec.check_policy_history does not help: ipsec_in_reject()
checks the flags in addition to the history tags.
The clearing comes from KAME, whose ah6_input() deliberately did not
[24 lines not shown]
powerpc: keep the vector registers in a core after setcontext
After setcontext() or sigreturn the AltiVec and VSX registers stay in
the PCB until the thread touches them again, and only PCB_VECREGS and
PCB_FPREGS say they're valid. The NT_PPC_VMX and NT_PPC_VSX core notes
are only written when PCB_VEC and PCB_VSX are set, so a core dumped in
that window has no vector registers for the thread. Check the validity
flags instead, like get_mcontext() does.
PCB_FPREGS is also set on CPUs without VSX, so only write the VSX note
when the CPU has it.
Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D62315
netipsec: Find the next header field of an IPv6 IPsec header
The transforms write the protocol of the payload over the next header
field that led to the AH, ESP or IPComp header they remove.
ipsec6_input() always gave them the field of the IPv6 header. When
extension headers precede the IPsec header, the field to update is in
the last of them. The packet was still delivered, because the callback
reads the protocol back from the same place, but the chain left in the
mbuf was wrong: the IPv6 header named the payload while the extension
headers were still in front of it. Whatever walks the chain again
misread the packet; a socket with IPV6_RECVHOPOPTS set, for one, no
longer got the hop-by-hop options of a packet that ESP protected.
Look the field up with ip6_get_prevhdr(), as ipsec6_common_input() did
before the projects/ipsec merge.
Reported by: llm-postcr
Reviewed by: kib
Fixes: fcf596178b5f ("Merge projects/ipsec into head/.")
[3 lines not shown]
netinet6: limit size of packet options set via setsockopt(2) to MCLBYTES
While soopt_getm() can indeed allocate a chain of mbufs, the control is
then passed to ip6_pcbopts(), that passes to ip6_setpktopts(). And the
latter refuses to work on a chain and returns EINVAL. This all was true
since KAME import. Thus, the limit set by aec9c8d5a5ee indeed protects
from a local DoS vector, but it doesn't make a practical sense. Anything
between MCLBYTES and IPV6_PKTOPTIONS_MBUF_LIMIT would be refused with
EINVAL and freed.
Reviewed by: pouria
Fixes: aec9c8d5a5ee52dd6d19892138ef78fc78ef2210
PR: 100219
Differential Revision: https://reviews.freebsd.org/D62252
Uses/zig: simplify build/install targets
The workaround of building the port while staging is now unnecessary.
Reviewed by: arrowd, kenrap
Tested by: kenrap
Differential Revision: https://reviews.freebsd.org/D60710
nd6: Skip periodic DAD while SLAAC can regenerate a stable address
A failed periodic DAD retry probes the same address. Counting it as
another RFC 7217 failure lets a persistent duplicate exhaust the
interface's regeneration budget and prevent SLAAC on other prefixes.
Count only the initial DAD failure for each address. When SLAAC can
generate another stable address, disable periodic DAD for the failed
candidate. The final candidate remains eligible for periodic recovery
if the conflict clears.
Reported by: llm-postcr
Fixes: 4d5833adfd19 ("nd6: Periodically retry DAD for duplicated IPv6 addresses")
powerpc: fix single stepping across signal delivery and fork
PT_STEP sets MSR[SE] and trap() clears it again when the trace trap
comes in, but the rest of the kernel treated it as a bit a thread can't
change, which broke stepping in three places.
sendsig() kept it set for the signal handler, so the debugger got a
SIGTRAP on the handler's first instruction. This is what
ptrace__PT_STEP_with_signal in ptrace_test trips over. Clear it for the
handler, like amd64 does with PSL_T.
The context saved for the handler still has it, but set_mcontext()
refused a context whose MSR[SE] no longer matched the frame, so
sigreturn(2) failed and the process exited as soon as the handler
returned. Let a context carry MSR[SE].
cpu_fork() copied it into the child, which nobody traces, so a fork(2)
done while stepping killed the child with SIGTRAP. Clear it there.
[3 lines not shown]