XIO

xWire

Posts from every feed QUEST has found across the web — blogs, news, podcasts, channels and more.

src, branch main

FreeBSD source tree

esp: Allocate the crypto request and its callback state together

esp_input() and esp_output() allocated a cryptop from the crypto layer, then malloc'ed the xform_data the callback needs, and with ESN a third buffer for the separate AAD. The callback freed all three. That is two or three allocation pairs for every packet. Put the three in one structure, allocated once per packet from a dedicated UMA zone. The crypto layer provides crypto_initreq() and crypto_destroyreq() for an embedded cryptop, as wg(4) and ktls use. The AAD buffer is sized for the ESP…

nvme: honor CRTO for the controller ready timeout

CAP.TO is a 8b field and saturate at 127.5 seconds; a controller that needs longer reports the real worst case in CRTO.CRWMT. Waiting only CAP.TO can reset a controller that is still within its declared recovery time after e.g. an abrupt shutdown. Taking the larger of CRTO.CRWMT and CAP.TO when CAP.CRWMS show CRTO support. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D59631

atf-check: Add shortcut for not-exit:0

Allow the command to be preceded by an exclamation point, which changes the default expected result to a clean exit with a non-zero exit code. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D58099

tftpd: Keep proper track of option length

When parsing options, keep track of the length of the unparsed portion and pass that to get_field() instead of the length of the entire header. While here, switch both make_options() and parse_options() to using size_t for sizes and lengths. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61048

tftpd: Fix off-by-one in get_field()

Due to a logic error, get_field() would behave as if the passed-in size was one greater than it actually is. Fix it so it always fails if no terminating NUL is found within the buffer, instead of succeeding if the first byte past the end is a NUL. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61032

carp: Check if_carp under carp_sx in carp_nl_get()

carp_nl_get() tested ifp->if_carp for NULL before taking carp_sx and walked the softc list afterwards. When the last vhid on the interface is removed in between, carp_free_if() clears if_carp and the walk dereferences a NULL pointer. A reader that passes the check while the removal holds carp_sx always hits this. The check was done with the lock held until the ioctl(2) API was retired. Do it under the lock again. Reported by: Marcos Mendoza Fixes: 72472e52e310 ("carp: retire ioctl(2) API")…

TCP RACK: fix RSM computation for TCP fast open

When spitting an RSM containing the SYN and data, honor the sequence number used by the SYN flag when computing the offset in the socket buffer. PR: 297006 Reviewed by: rrs, Peter Lei MFC after: 3 days MFC to: stable/15 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D61149

mac syscalls: add kern_ implementations

Where the kern_ interfaces map trivially to the syscall interface, follow the syscall name even if awkward (e.g., sys___mac* -> kern___mac*). Otherwise use shorter names. Effort: CHERI upstreaming Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/2284

xhci: only set the slot context parent hub fields on xHCI 1.2

The Enhanced SuperSpeed meaning of the slot context parent hub slot ID and port number fields was introduced in xHCI 1.2. Controllers built to an earlier revision define them only for a Low- or Full-speed device behind a High-speed hub. A SuperSpeed device behind a USB 3.2 hub on an Intel Alpine Ridge controller, an xHCI 1.1 part, stops responding to Address Device and loops in uhub_reattach_port until the port is disabled. Fixes: 20b19982545e ("usb: support SSP and SSPx2 xHCI") Reviewed by:…

mqueuefs: set *a_eofflag in VOP_READDIR

mqfs_readdir() never reported end of directory. Since 77b273d8f5f4 VOP_READDIR_APV() asserts that a readdir which returns no entries also sets *a_eofflag, so with INVARIANTS the final zero-length getdirentries(2) that ls(1) issues on a mounted mqueuefs panics: panic: VOP_READDIR: eofflag not set Report end of directory when the child list was walked to its end; leave the flag clear when the walk stopped because the buffer was full. MFC after: 1 week

i2ctinyusb: do not list i2ctinyusb.c twice in SRCS

The module Makefile named its only source file in both the SRCS= line and the SRCS+= line that follows. bsd.kmod.mk tolerates the duplicate in a normal build, but when the kernel is built with -flto=thin the linker sees the same bitcode object twice and refuses to link the module ("Expected at most one ThinLTO module per bitcode file"). Fixes: 54e231b373ef MFC after: 1 week

udp6: make udp6_ctlinput() same as IPv4 version

Processing an incoming ICMPv6 we need to find just the matching inpcb and call udp_notify() on it. The call to in6_pcbnotify() at the first glance seems like a notifying sweep across the entire database, but it is not. It finds just the matching inpcb, but does that in the most inefficient way! The added test case proves that ICMPv6 processing stays the same before and after the change. This weird use of in6_pcbnotify() can be tracked down all the way to the initial KAME code. Reviewed by:…

bhyve/riscv: correctly handle empty masks and broadcast in SBI IPI/RFNC

Bhyve treats an empty cpu set as an error which triggers MPASS panic in the guest. As per the SBI spec, empty masks should return SBI_SUCCESS, and a base of -1UL specifies a broadcast to all harts. Fix both in vmm_sbi.c, clear a1 on return, and skip the SBI ecall in sbi_ipi_pic_ipi_send() if the mask is empty. Also add a NULL check in riscv_send_ipi(). Signed-off-by: Doongar Singh Reviewed by: br Differential Revision: https://reviews.freebsd.org/D61126

iavf: Honor negotiated VLAN offload capabilities

The driver advertised VLAN offload unconditionally, even when the PF did not grant it, as observed with an E835 VF under Hyper-V. This tells the stack to rely on hardware tag insertion and sends the PF unsupported VLAN filter requests. Advertise hardware VLAN tagging and filtering only when GET_VF_RESOURCES grants the legacy VLAN capability. Do not allocate filter shadow entries or send ADD_VLAN/DEL_VLAN requests without that capability. Retain VLAN MTU and checksum/TSO support for…

iavf: Reconcile VLAN filters with acknowledged requests

Track desired and acknowledged VLAN membership separately. Retain pending deletions and uncertain state after failed requests instead of losing the work when a message is submitted. Make repeated registration idempotent. Adapt DPDK's synchronous, single-VID virtchnl request shape and the bounded desired-state reconciliation used by igbv and ixv. Serialize VLAN requests under the existing virtchnl mutex, with filter-list changes under the iflib context lock. Preserve an unresolved transaction so…

tests/sys/file: add tests for the lowest fd after fork

fdcopy() skips plain kqueues and close-on-fork descriptors when it copies the table into the child. Check that dup(2) in the child still returns the lowest unused descriptor, both when the skipped descriptor is the lowest free slot and when it sits above an existing hole. Test cases: kqueue_no_hole a plain kqueue is the lowest descriptor; the child's dup() reuses its slot kqueue_two two adjacent plain kqueues; the child's dup() returns the lower one kqueue_above_hole a plain kqueue sits above a…