XIO

xWire

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

src, branch main

FreeBSD source tree

if_geneve: Fix nexthop reference imbalance on output

geneve_encap4() and geneve_encap6() look up the nexthop of the outer packet without a reference and pass it to ip_output() or ip6_output() in a route on the stack. When the output routine drops the nexthop of that route, because a pfil hook asked for a new lookup or the nexthop is no longer valid, it releases a reference that was never taken. It then stores a referenced nexthop in the route, which the caller never releases. Set RT_NH_NOREF on these routes, so that ip_output() and ip6_output()…

if_vxlan: Fix nexthop reference imbalance on output

When the inner frame asks for checksum offload or TSO, vxlan_encap4() and vxlan_encap6() look up the nexthop of the outer packet without a reference, to check the capabilities of the outgoing interface, and pass it to ip_output() or ip6_output() in a route on the stack. When the output routine drops the nexthop of that route, because a pfil hook asked for a new lookup or the nexthop is no longer valid, it releases a reference that was never taken. It then stores a referenced nexthop in the…

ip_forward: Do not reference the nexthop

ip_forward() looked the route up with NHR_REF and released the nexthop on every exit. The function runs in the network epoch, and nexthops are destroyed through NET_EPOCH_CALL(), so the nexthop stays valid until ip_forward() returns without a reference, as ip_tryforward() already relies on. The reference costs two atomic operations per packet on a counter that every CPU forwarding to that nexthop shares. Look the nexthop up without NHR_REF, and set RT_NH_NOREF on the on-stack route, so that…

routing: Add RT_NH_NOREF for routes that do not reference the nexthop

A route that is used within one network epoch section does not need a reference on its nexthop: nexthops are destroyed through NET_EPOCH_CALL(), so a nexthop looked up in the section stays valid until the section ends. ip_output() and ip6_output() have no way to know that a route is used like this. When they drop the nexthop of the route they are given, because it is no longer valid or a pfil hook asked for a new lookup, they release it, and they store a referenced nexthop in its place. Add a…

bsdconfig: finish wlanconfig SSID join and wpa_supplicant(5) editing

Complete the wireless network menu, which since its 2013 introduction stopped just short of usefulness: it could scan the airwaves and list networks configured in wpa_supplicant.conf(5), but selecting a scanned network did nothing, the configuration editor displayed values it could not change, and nothing was ever written back to disk. All three XXXDT-unfinished paths are now implemented. Selecting an unmarked ([ ]) entry joins that network. The security type is derived from the wpa_cli(8)…

sysrc: Accept values that contain a newline

awk -v rejects a newline in the value, and the old writer treated that failure as an empty edit. The temporary file then held only the new assignment, so the rest of the configuration was lost. Pass the value in the environment and replace the last assignment by joining that line through end of file. A quoted newline stays with the value, and the text after it stays after the closer. If awk exits above 1, leave the file alone. sh -n still refuses a value that would break the quotes. PR: 283729…

nd6: Do not make SLAAC addresses usable with ifdisabled

Setting TENTATIVE was what made these addresses unusable, because TENTATIVE is part of IN6_IFF_NOTREADY. keep setting TENTATIVE in nd6_timer() and nd6_ioctl() to not making them usable. Reported by: llm-postcr Fixes: c7cd7e7fad57 ("nd6: Add support for Optimistic DAD (RFC 4429)") Differential Revision: https://reviews.freebsd.org/D55229

ext2fs: Multi-block allocator with extent tree support and allocation lifecycle state machine

The idea is to have an allocator that makes better use of the locality information and is better suited for extents. It is similar to what Linux calls a multiblock allocator in a paper from 2005. The Linux code was not inspected or used in this implementation. Implement ext2_alloc_run() — a multi-block physical allocator that reserves a contiguous physical block run and returns it via a context-based state machine: ALLOCATED -> MAPPED -> PUBLISHED -> ROLLED_BACK ext2_alloc_run() enforces the…

zfsbootcfg: don't crash on bad or incomplete options

getopt() errors fell through the switch without a default case, so zfsbootcfg carried on with whatever options it had. Setting a key without a value, whether with -k alone or after such an error, then crashed in add_pair() on a NULL value. Print a usage message and fail for unknown options, missing option arguments, and a key with no value to set it to. While we're here, clean up some pre-existing style issues and ensure we properly route warnings/errors to stderr. Reviewed by: avg, des…

zfsbootcfg.8: list each form in the synopsis and document -d

The synopsis listed every option as optional in a single form, which doesn't show that -k needs -v, and it didn't mention -d at all. List the distinct forms instead: setting boot.config(5) options (or printing them, with none), setting or deleting a key, and printing the bootenv area. Document -d alongside the other options. Reviewed by: avg, bcr Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D61834

uefisign: rename to efisign

uefisign seems to have come first, but the efi* naming has won out in our UEFI tooling and consistency is good. This fixes it so that "efi" gives a reasonable view of what efitools we have in base. uefi* links are added for compatibility, at least for now. Maybe it's a reasonable idea to add such links for all of the efi tools, but I'm punting on that for a moment. Reviewed by: emaste, imp (both previous version), ziaee Relnotes: maybe Differential Revision: https://reviews.freebsd.org/D58187

netipsec: Send the packet when the rest of a bundle is skipped

A policy can bundle several requests, for example an ESP tunnel and an AH transport request. A request at level "use" that has no SA is skipped (as is "default", which the net.inet.ipsec.*_deflev and net.inet6.ipsec6.*_deflev sysctls make "use" by default), and the packet is meant to leave with the transforms of the other requests. ipsec_process_done() applies the next request of a bundle once a transform completes. When all remaining requests are skipped, ipsec{4,6}_perform_request() returns…

bhyve: Reject unsupported checkpoints before saving RAM

pci_snapshot() rejects devices without a pe_snapshot callback, but vm_checkpoint() reaches that check only after truncating checkpoint files, pausing the VM, and saving RAM and kernel state. Check for unsupported PCI devices at the start of vm_checkpoint(), before creating files or pausing the VM. This preserves existing checkpoint files when the request cannot succeed. Add pci_can_snapshot() so that the new check and pci_snapshot() use the same test. Reviewed by: markj, kevans Approved by:…

tests/sys/pmc: add PERF, RDPMC, row, sampling and unload tests

- pmc_perf_test: the pmc.perf(3) class (MPERF, APERF, IRPERF). - pmc_rdpmc_test: pmc_get_msr() and RDPMC. - pmc_row_test: row disposition per mode; system sampling needs a log. - pmc_ss_test: system sampling into a log, and its interrupt accounting. - pmc_unload_test: unloading hwpmc.ko leaks no memory. Reviewed by: mhorne Sponsored by: Advanced Micro Devices, Inc. Signed-off-by: Osvaldo Janeri Filho Signed-off-by: Davi C.A Differential Revision: https://reviews.freebsd.org/D61062

hwpmc: call the thread-create hook for Linux and kernel threads

linux_clone_thread() and kthread_add() did not call the PMC_FN_THR_CREATE hook. Their new threads had no hwpmc thread descriptor. If the process had a sampling PMC, the first switch-in of such a thread hit KASSERT(pt != NULL) in pmc_process_csw_in(). An unprivileged user could panic an INVARIANTS kernel with "pmcstat -P" on a threaded Linux program. Call the hook in both functions, as thread_create() does. kern_kthread.c did not include opt_hwpmc_hooks.h, so its hwpmc code never compiled.…

vmm: do not let the RTC's periodic interrupt drift

The callout of the periodic interrupt was rearmed from its handler with a timeout of one period from the time the handler ran. Each period was longer than programmed by the latency of the callout, so the interrupt came at a lower rate than the guest asked for. A guest that counts these interrupts to keep its time runs slow. Give the callout absolute deadlines one period apart, as vatpit does. If a deadline has already passed when it is computed, for instance after the VM was paused, start again…

ipfw_nat: fix the buffer length check in IP_FW_NAT44_XGETLOG

nat44_get_log() compared the user buffer length against the request header plus another ipfw_obj_header instead of the request header plus the log buffer. A buffer that passed this check but was shorter than the full reply left too little room in the sockopt window, so ipfw_get_sopt_space() returned NULL and the following memcpy() of the log wrote through a NULL pointer, panicking the kernel. The handler was cloned from nat44_get_cfg() in the commit below, under the convention of that time…

ixgbe: Restore EEE exclusion for X550EM_X KR

X550EM_X KR devices do not support EEE and have no setup_eee operation. The shared-code update restored the capability removed by d61b6a41dd30, and the E610 EEE support subsequently added an unchecked call during attach. Together these changes allow a NULL function pointer call when attaching a KR device. Remove the incorrect EEE capability and use the NULL-safe ixgbe_setup_eee() wrapper when enabling EEE at attach. Removing the unsupported capability also stops exposing eee_state and the…