aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Invalidate inode extents cache on truncation.stable/13Fedor Uporov2026-06-241-0/+1
| | | | | | | | | | | It is needed to invalidate cache in case of inode space removal to avoid situation, when extents cache returns not exist extent. Reviewed by: pfg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29931 (cherry picked from commit b3f46656393f5c8a6e8305afeb5e8c3638025c26)
* mxge(4): Fix a typo in a source code commentGordon Bergling2026-06-141-1/+1
| | | | | | - s/deterimine/determine/ (cherry picked from commit 14e93e3e360718f2272028fbf99775df3c192e83)
* vt: Avoid integer overflow in CONS_HISTORY ioctlEd Maste2026-06-072-7/+8
| | | | | | | | | | Reviewed by: markj, vexeduxr Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57250 (cherry picked from commit 0ae946e7223df5ef3f7980af1d774d7f593f6421) (cherry picked from commit deaaddf1d3c4283649945553ad7e3208c8424308) (cherry picked from commit b5a4f4bfbc95d5d5361da708728f7f4a6db2ee60)
* net: bandaid for plugging a fw_com leak in fwip_detach()Tai-hwa Liang2026-05-191-0/+1
| | | | | | | | | | | | | | | | | | | | | Adding a temporary workaround for plugging a fw_com upon if_fwip unloading. Steps to reproduce(needs two hosts connected with firewire): while true; do ifconfig fwip0 10.0.0.5 up fwcontrol -r ping -c 10.0.0.3 kldunload if_fwip done There's a chance that the unloading of if_fwip.ko triggers following warning: Warning: memory type fw_com leaked memory on destroy (1 allocations, 64 bytes leaked). commit d79b6b8ec267e7eef6e07cf4245159705e24acd5 (origin/main, origin/HEAD) (cherry picked from commit 25a5bb7318052322190a2880e0e7ef18e06d54bd)
* freebsd-update: Skip /etc/ssl/cert.pemDag-Erling Smørgrav2026-05-191-1/+1
| | | | | | | | | | | We already run `certctl rehash` at the end, there is no point in asking users upgrading from 15.0 to 15.1 to manually merge the trust store. MFC after: 3 days Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D57028 (cherry picked from commit 2509ddee9bdb2240ba2f622e3a55a98ebc2aa4ae)
* compat/linux: Avoid waitid() kernel stack disclosureEd Maste2026-05-131-0/+1
| | | | | | | | | | | Reported by: Adam Crosser, Praetorian Reviewed by: philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55812 (cherry picked from commit 9a9f93bcf1aa0059d759b2f3ea6faeb2760a11bd) (cherry picked from commit 9f8db9cc67fb86eeb2b645ce7f8aa748e99241a9) (cherry picked from commit a347e6e20e75ad6224afefcf650ef738c3de094d)
* compat32: Zero struct to avoid stack disclosureEd Maste2026-05-131-1/+1
| | | | | | | | | | | Reported by: Adam Crosser, Praetorian Reviewed by: philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55811 (cherry picked from commit 097cb4e9f0432c543c704cec712ce1cd3302335c) (cherry picked from commit 4551ea3b3f04650cd5300a9eae8994bdb080db91) (cherry picked from commit 6a808cd7534802d30010fb0a7f46381ff9f6ef3f)
* shm: Zero struct kinfo_file in sysctl handlerEd Maste2026-05-131-1/+1
| | | | | | | | | | | Reported by: Calif.io in collaboration with Claude and Anthropic Research Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55806 (cherry picked from commit 25cc459286a02b646751541ccde5a33319471c73) (cherry picked from commit 6348a5fd0d4792e752cb714f2a536c3287b8d580) (cherry picked from commit e61804ae6380c8d1db4b8c43bf7821e5d31ca04e)
* sys: Fix heap disclosure in compat7 kern.proc.filedesc sysctlEd Maste2026-05-131-1/+1
| | | | | | | | | | | | Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56976 (cherry picked from commit e68433e1990d5f1bcc1bdd270d65f1e4792a8e1b) (cherry picked from commit 0cef1a9ae5ec90b2c4717de9bc33fc7c3b1fd705) (cherry picked from commit 5e6b16f4555cba4422dde7c63344359019a23722)
* Define stdint.h macros unconditionallyDimitry Andric2026-05-085-40/+0
| | | | | | | | | | | | | | | | | Similar to glibc, define all the stdint.h macros such as `SIZE_MAX`, `UINT64_C`, etc unconditionally. I.e. no longer check whether `__STDC_CONSTANT_MACROS` or `__STDC_LIMIT_MACROS` are defined. See also <https://sourceware.org/bugzilla/show_bug.cgi?id=15366>. This is part of reverting base 00bee6fcd77f, which reverted an upstream libc++ commit that eliminated libc++'s stdint.h wrapper header. Submitted by: Nikolas Klauser <nikolasklauser@berlin.de> MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D56746 (cherry picked from commit 966fb94cb3575ccd39da211165d0858fd0eb0ef2)
* Remove extraneous tab characters at EOL in various _stdint.h filesDimitry Andric2026-05-083-4/+4
| | | | | | MFC after: 3 days (cherry picked from commit daeab702f9adbbb718ecf48e17de8dd619cfe7b8)
* lockf: Test that lockf does not spin on fdDag-Erling Smørgrav2026-05-061-0/+18
| | | | | | | | | PR: 294832 MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56723 (cherry picked from commit 0733afdb4dad58cfe7ad7f5994e26bf148d78199)
* lockf: Avoid spinning when operating on an fdChristian Ullrich2026-05-061-1/+5
| | | | | | | | | | | | | When operating on a file descriptor, acquire_lock() would ignore the flags argument and always operate in non-blocking mode, resulting in unnecessary busy-looping. PR: 294832 MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56722 (cherry picked from commit d90513ea85693da0ca5955173609f4e81e38ae16)
* mfi(4)/mrsas(4): Set sysctl name for driver versions consistentlyMichael Osipov2026-05-032-6/+4
| | | | | | | | | | | Instead of printing the driver version over and over again if multiple controllers are used, set a sysctl name for the used driver version. Approved by: imp, ziaee MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D56110 (cherry picked from commit ea1764e5fcf0fc11680dc104e663ae3d1d0fd7be)
* mfi(4)/mrsas(4): Print driver versions consistentlyMichael Osipov2026-05-032-7/+4
| | | | | | | | Reviewed by: ziaee, des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54519 (cherry picked from commit 93122ead724b3ba0ccdaedadcd371ec53f9a9844)
* dhclient: Improve server and filename validationDag-Erling Smørgrav2026-04-301-21/+54
| | | | | | | | | | | | | | | | | | | | | | | | | * Don't iterate over each string three times; once is enough. * Reject control characters (anything below space) in addition to the double quote and backslash. * If an unsafe character is encountered, discard the string instead of rejecting the entire lease. * If backslashes are encountered in the file name option, convert them to forward slashes instead of rejecting the option. * Tweak the warning messages a bit. Looking through the rest of the code, it seems to me that notes generally end with a period while warnings generally don't. Fixes: 8008e4b88daf ("dhclient: Check for unexpected characters in some DHCP server options") PR: 294886 MFC after: 1 week Reviewed by: brooks, markj Differential Revision: https://reviews.freebsd.org/D56740 (cherry picked from commit 873a195ba63575e46686cfd6ea9670a0ca340fa0)
* arm64: Ditch arm64-specific unsound PCPU optimisationJessica Clarke2026-04-301-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current arm64 PCPU implementation uses a global register asm variable to use x18, which we reserve with -ffixed-x18, from C. Inside a critical_enter() or sched_pin(), it is vital that any PCPU reads use the right PCPU pointer, as often the whole point of the critical_enter() or sched_pin() is to ensure consistent PCPU use (e.g. for SMR it relies on zpcpu giving the same SMR state). critical_enter() and sched_pin() both include atomic_interrupt_fence(), i.e. asm volatile("" ::: "memory"), barriers to ensure that memory accesses don't get moved by the compiler outside the critical section, which on most architectures will also order the read of the PCPU pointer itself (whether due to the read being another asm volatile statement, or due to using a segment-relative memory access as on x86). However, this approach on arm64 is in no sense a memory access, and therefore the register access is not ordered with respect to the the critical_enter() or sched_pin(), or more specifically the curthread->td_critnest++ / curthread->td_pinned++ within. In practice upstream today this works out ok because the read of x18 is inlined into the actual PCPU_GET/ADD/SET memory accesses (i.e. you will get something like ldr xN, [x18, #imm-or-xM] for PCPU_GET, etc.), and since *that* instruction is ordered properly due to being a memory access, the x18 ends up being read in the right place. However, that is not in any way guaranteed, it just relies on the hope that compiler optimisations will be perfect at inlining the use. Moreover, PCPU_PTR is definitely not a memory access in this world, it's just pointer arithmetic on x18, and so that has nothing ordering it. This can be observed with the following test function compiled into the kernel: void pcpu_test(void) { extern void __weak_symbol use_pcpu_ptr(void *); critical_enter(); use_pcpu_ptr(PCPU_PTR(curthread)); critical_exit(); } Obviously, this is a bit contrived as you could just read curthread directly via its atomic definition that bypasses any worries about PCPU atomicity, but it illustrates the point. With the in-tree LLVM*, this ends up being compiled for me to: paciasp stp x29, x30, [sp, #-0x10]! mov x29, sp ldr x8, [x18] ldr w9, [x8, #0x4fc] mov x0, x18 add w9, w9, #0x1 str w9, [x8, #0x4fc] bl use_pcpu_ptr ... Note that, although the PCPU_PTR was within the critical section in the C source, the read of x18 into x0, the argument register passed to use_pcpu_ptr, has been hoisted to before the str, which is storing the new, incremented, value of td_critnest to curthread, and so there is a window within which we have to hope the thread is not preempted and migrated to a different CPU, otherwise it will pass a pointer to the wrong CPU's pc_curthread PCPU member. Initially it would seem as though the solution to this would be to add an additional barrier to critical_enter() / sched_pin() to ensure the register reads could not be hoisted like this. However, I have not been able to find a sequence that works reliably across both GCC and Clang, independent of optimisation level. Using inline asm with x18 marked as a clobber, using "=r"(pcpup), and using "+r"(pcpup) all run into various issues; some combinations don't actually seem to be a barrier, and for Clang at -O0 some combinations will actually generate writes to x18**, at which point you then have to hope that the kernel is compiled with optimisations, and that the redundant writes are optimised away such that x18 is just passed through. But that just gets us back to hoping optimisation works, which isn't a solution to the problem, it just trades one point of fragility for another. In talking to GCC developers, who seemed rather horrified by the implications of trying to do this (which is effectively "register volatile", a combination that's explicitly forbidden), we could not find a solution to this, and so I have concluded that the only reliable to have a sound PCPU implementation is to ditch this optimisation and follow other non-x86 architectures in using inline asm in one form or another; specifically, this adopts riscv's approach of just calling get_pcpu(), which, curiously, was already implemented in inline asm here on arm64, rather than reading pcpup. Anyone who feels strongly enough about PCPU performance is welcome to try to find a working approach, but such proposals should be heavily scrutinised to be certain that they won't come back to bite us in future. In particular, this caused a lot of problems downstream in CheriBSD's experimental compartmentalised kernel, which is trialling interposing on PCPU accesses in order to restrict access within compartments. As a result, even PCPU_GET/SET/ADD can look like PCPU_PTR, as they pass an opaque PCPU reference to wrapper functions, and so this case gets hit all over the kernel, giving highly-confusing panics with locks that aren't owned by the current thread or SMR use allegedly not within an smr_enter(). The ia64 port encountered the same issue and reached the same conclusion in e31ece45b7a4 ("Fix the PCPU access macros."), though went to the trouble of trying to fold the offset into the inline assembly (assuming it fit, with no fallback if not, since it's using the add pseudo-op that will be expanded to either adds with a 14-bit immediate or, if somehow that doesn't fit, addl with a 22-bit immediate). Curiously though it left pcpup around as a footgun. sparc64 had similar code but was never fixed. It also defined a curpcb in the same manner which was presumably similarly broken, but looks to have been entirely unreferenced from C, only referenced in actual assembly files. Alpha also had the same design, but it was removed whilst critical_enter() was extern rather than static inline so uses of the pointer could not have been hoisted, and whilst sched_pin() didn't have any form of atomic_interrupt_fence() to even try to make PCPU well-ordered. * At time of writing, when that was LLVM 19, not verified at time of commit with LLVM 21. ** For "+r"(pcpup), Clang's initial code generation is to do: mov xTtmp1, x18 mov x18, xTmp1 /* asm (empty) */ mov xTmp2, x18 mov x18, xTmp2 since its interpretation of what that means is "read the value of pcpup, and make sure that value is in x18 for the duration of the assembly due to the asm("x18") on pcpup", and similarly for the output side. Reviewed by: andrew, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56601 (cherry picked from commit 551d47c5677a5eaf0a1ed2ea3b2b1406b192764d)
* loader.efi: Defer efi_translate(e_entry) until after bi_loadJessica Clarke2026-04-303-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bi_load itself loads various things into the staging area which can cause it to grow, which may result in the staging area moving, including the kernel. Therefore the address we get for the kernel entry point prior to bi_load may not be correct afterwards when we actually call it, and so we must defer the translation. On arm and riscv (but not arm64, which predates both of them in loader.efi and did not gain a copy of arm's added printf when arm support was added) we also printf this entry point to the console, which we can no longer do since bi_load calls ExitBootServices, so remove this printf that, in practice, seems to not be so useful, given nobody ever felt the need to add it to arm64. If anyone really feels this is an important printf to have then bi_load will need to be split so we can call printf after all the loading and potential reallocation of the staging area, but before ExitBootServices is called. We may also want to make this code more uniform and shared between the three architectures here, since there isn't much architecture-specific about this (and something like the RISC-V boot hart protocol could easily be made an MD hook). Reviewed by: imp Fixes: 0cafabf97fae ("Add support for arm64 to loader.efi and boot1.efi") Fixes: ea7796a9ae6b ("EFI: don't call printf after ExitBootServices, since it uses Boot Services") Fixes: 2192efc03bc4 ("RISC-V boot1.efi and loader.efi support") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56431 (cherry picked from commit ab1d659e78e454995b7c2b4566e035269b215e48)
* caroot: RegenerateDag-Erling Smørgrav2026-04-30106-5662/+3273
| | | | | | | | | Regenerate using certificate data from NSS 3.123.1. MFC after: 1 week Reviewed by: kevans (cherry picked from commit 07b52233e8b74c5ac884b9c9a894f57fad8dbd00)
* caroot: Clean upDag-Erling Smørgrav2026-04-30194-1300/+800
| | | | | | | | | | | | | | | | | | | | | | * Get certdata.txt directly from the NSS Mercurial repository, rather than from the Mozilla Firefox repository which imports it from NSS at irregular intervals. * Instead of always fetching the latest certdata.txt, fetch a specific version. For this commit, we set this to the version that was last imported in May 2025. * Add a refrence to the MPL to the generated files. * Regenerate with latest OpenSSL. This is purely cosmetic; mostly, the certificate names now contain less unnecessary whitespace and some elements are quoted. MFC after: 1 week Reviewed by: michaelo, kevans Differential Revision: https://reviews.freebsd.org/D56620 (cherry picked from commit ce33d6396aadb0613f1e74661bdbec571f836a60)
* caroot: Rename script and normalize licenseDag-Erling Smørgrav2026-04-302-35/+35
| | | | | | | | MFC after: 1 week Reviewed by: mandree, markj Differential Revision: https://reviews.freebsd.org/D51775 (cherry picked from commit 0886019bf853bd30b70aa4b8cdb059830ca6aaad)
* caroot: Generate both trusted and untrustedDag-Erling Smørgrav2026-04-304-99/+51
| | | | | | | | | | | | Until now, the untrusted directory has been maintained manually. Modify the script used to maintain the trusted directory so it can handle both. While here, clean it up a bit. MFC after: 1 week Reviewed by: mandree, markj Differential Revision: https://reviews.freebsd.org/D51774 (cherry picked from commit b88b0bb784c7fdcfb8174806e822c1f8983c223f)
* ahci(4): Add another device ID for Marvell 9128 SATA controller: 0x91a3John W2026-04-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | This was encountered on a Gigabyte GA-P55A-UD4 motherboard identifying itself as: ahci0@pci0:2:0:0: class=0x01018f rev=0x11 hdr=0x00 vendor=0x1b4b device=0x91a3 subvendor=0x1458 subdevice=0xb000 vendor = 'Marvell Technology Group Ltd.' class = mass storage subclass = ATA The physical chip has "88SE9128-NAA2" printed on it. Similar code has been in Linux for a long time: https://github.com/torvalds/linux/commit/50be5e3657cd2851a297dc0b3fd459f25829d29b Co-authored-by: Michael Osipov <michaelo@FreeBSD.org> PR: 288526 Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56464 (cherry picked from commit c72edc2b2eb283450df8db05cf9321aee7de0bcb)
* libnv: fix heap overflow in nvlist_recv()Mariusz Zaborski2026-04-281-4/+5
| | | | | | | | | | | | | | | | nvlist_check_header() validated nvlh_size for overflow before performing conversion. An mallicous user can set NV_FLAG_BIG_ENDIAN in the header and craft nvlh_size so that the orginall value passes the check, but after the conversion the sizeof(nvlist_header) + size can overflow. This can lead to a heap buffer overflow. Approved by: so Security: FreeBSD-SA-26:17.libnv Security: CVE-2026-35547 Fixes: 36fa90dbde0060aacb5677d0b113ee168e839071 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56342
* libnv: switch fd_wait() from select(2) to poll(2)Mariusz Zaborski2026-04-281-6/+6
| | | | | | | | | | | | | The previous implementation used FD_SET() on a stack-allocated fd_set, which is an out-of-bounds write whenever the socket fd is >= FD_SETSIZE (1024). Approved by: so Security: FreeBSD-SA-26:16.libnv Security: CVE-2026-39457 Reported by: Joshua Rogers of AISLE Research Team (https://aisle.com/) Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56689
* pf: improve SCTP validationKristof Provost2026-04-282-5/+36
| | | | | | | | | | | | | | | | As per RFC5061 "4.2. New Parameter Types" the add/delete IP address parameters (0xc001, 0xc002) may not be present in an INIT or INIT-ACK chunk. They are only allowed to be present in an ASCONF chunk. This also prevents unbounded recursion while parsing an SCTP packet. Approved by: so Security: FreeBSD-SA-26:14.pf Security: CVE-2026-7164 PR: 294799 Reported by: Igor Gabriel Sousa e Souza MFC after: 3 days Sponsored by: Orange Business Services
* dhclient: Fix reallocation of dhclient script environmentsMark Johnston2026-04-281-2/+2
| | | | | | | | | | | | | When the number of DHCP options exceeds a threshold, script_set_env() will reallocate the environment, stored as an array of pointers. The calculation of the array size failed to multiply by the pointer size, resulting in a smaller than expected buffer which admits out-of-bounds writes. Approved by: so Security: FreeBSD-SA-26:15.dhclient Security: CVE-2026-42511 Reported by: Joshua Rogers of AISLE Research Team (https://aisle.com/)
* dhclient: Check for unexpected characters in some DHCP server optionsMark Johnston2026-04-281-0/+12
| | | | | | | | | | | | | Some options are written directly to the lease file, which may be parsed by subsequent dhclient invocations. We must make sure that a malicious server can't control the "medium" field of a lease definition, otherwise they can achieve RCE by injecting one into the lease file, whereupon it will be passed to dhclient-script, which passes it through eval. Approved by: so Security: FreeBSD-SA-26:12.dhclient Security: CVE-2026-42511 Reported by: Joshua Rogers of AISLE Research Team (https://aisle.com/)
* execve: Fix an operator precedence bugMark Johnston2026-04-281-1/+1
| | | | | | | | | | | | | | The buggy version allowed userspace to overflow the copy into adjacent execve KVA regions, which enables, among other things, injecting environment variables into privileged processes. Approved by: so Security: FreeBSD-SA-26:13.exec Security: CVE-2026-7270 Reported by: Ryan Austin of Calif.io Reviewed by: brooks, kib Fixes: f373437a01a3 ("Add helper functions to copy strings into struct image_args.") Differential Revision: https://reviews.freebsd.org/D56665
* termcap: fix screen entry standout mode (so/se) capabilitiesDan Mahoney2026-04-281-2/+2
| | | | | | | | | | | | | | | so=\E[3m (italic) is incorrect, should be so=\E[7m (reverse video). se=\E[23m (italic off) is incorrect, should be se=\E[27m (reverse off). mr=\E[7m (reverse video) is correctly defined in the same entry. screen-256color inherits from screen via tc=screen and is fixed transitively. PR: 294499 Pull Request: https://github.com/freebsd/freebsd-src/pull/2139 Signed-off-by: Dan Mahoney <freebsd@gushi.org> (cherry picked from commit 2bff747bb04db6beb19678abc45edd96be0a1347)
* tuning.7: Fix suds typo in manual pagesAlice Cariboni2026-04-271-2/+2
| | | | | | | | MFC after: 3 days Fixes: fc32c802158f Add two new manual pages Differential Revision: https://reviews.freebsd.org/D55814 (cherry picked from commit f9160912415eef078c32317e02695bc0cc775d39)
* contrib/tzdata: import tzdata 2026bPhilip Paeps2026-04-266-12/+106
| | | | | | Changes: https://github.com/eggert/tz/blob/2026b/NEWS (cherry picked from commit 9b95cab0a2927dfe07dbe6dc0056a80d5c730414)
* mfiutil(8): "show drives" truncates informationMichael Osipov2026-04-252-48/+13
| | | | | | | | | | | | | | | | Improve mfi_pd_inq_string() by * Reusing buffer sizes from cam/cam.h according to SCSI specification + NULL byte * Don't truncate vendor-specific information by escaping into a too small buffer * Use cam_strvis() from libcam instead of old, outdated local copy * Recaculate size of inq_string based on the reused buffer sizes and format statements PR: 294354 Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D56328 (cherry picked from commit 850eb149e7ab0733fcf9469a607dca223ff467ad)
* ippool(5): Correct example in man pageCy Schubert2026-04-241-1/+1
| | | | | | | The example provided puts the semicolon in the wrong place. It must come after the file:// specification, not in it. (cherry picked from commit f5d0b30e4af1163bdc18a893b17236517b67790a)
* ping6: treat setsockopt failures as fatalChristos Longros2026-04-241-4/+4
| | | | | | | | | | | | | | | ping6 needs IPV6_RECVPKTINFO and IPV6_RECVHOPLIMIT to process incoming replies. When these options fail, replies are silently dropped and ping6 appears to hang. Use err(3) instead of warn(3) so the user gets a clear error and immediate exit. Signed-off-by: Christos Longros <chris.longros@gmail.com> Reviewed by: pouria, jlduran, glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56237 (cherry picked from commit 9a4a9f623bbaf991b3ba580593d47f2ee9f7b03b)
* libarchive: Staticize some variablesDag-Erling Smørgrav2026-04-231-3/+3
| | | | | | | | | | | | | This code was not being built due to errors in our libarchive configuration. Now that those have been addressed, staticize some variables that trip a “no previous extern declaration” error. This is a subset of upstream PR 2962. MFC after: 1 week Reviewed by: mm Differential Revision: https://reviews.freebsd.org/D56471 (cherry picked from commit 7e9d974bc023755161742f66c8c77546bab88586)
* libarchive: Update configurationDag-Erling Smørgrav2026-04-231-35/+89
| | | | | | | | | PR: 294577 MFC after: 1 week Reviewed by: mm Differential Revision: https://reviews.freebsd.org/D56468 (cherry picked from commit 05bbe5e3883492dd2afa52039da1fac45c5059a0)
* libarchive: merge from vendor branchMartin Matuska2026-04-2395-372/+3019
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libarchive 3.8.7 Important bugfixes: #2871 libarchive: fix handling of option failures #2897 iso9660: fix undefined behavior #2898 RAR: fix LZSS window size mismatch after PPMd block #2900 CAB: fix NULL pointer dereference during skip #2911 libarchive: do not continue with truncated numbers #2919 CAB: Fix Heap OOB Write in CAB LZX decoder #2934 iso9660: fix posibble heap buffer overflow on 32-bit systems #2939 cpio: Fix -R memory leak #2947 libarchive: lzop and grzip filter support Important bugfixes between 3.8.5 and 3.8.6: #2860 bsdunzip: fix ISO week year and Gregorian year confusion #2864 7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation #2875 7zip: fix out-of-bounds access on ELF 64-bit header #2877 RAR5 reader: fix infinite loop in rar5 decompression #2878 mtree reader: Fix file descriptor leak in mtree parser cleanup (CWE-775) #2892 RAR5 reader: fix potential memory leak #2893 RAR5: fix SIGSEGV when archive_read_support_format_rar5 is called twice #2895 CAB reader: fix memory leak on repeated calls to archive_read_support_format_cab Obtained from: libarchive Vendor commit: ded82291ab41d5e355831b96b0e1ff49e24d8939 MFC after: 1 week (cherry picked from commit eb5165bb491138f60d9004bc4c781490016d9288)
* glabel(8): Fix debug message for already existing labelsMichael Osipov2026-04-221-2/+2
| | | | | | | | | | | Remove the duplicate (incorrect) name. PR: 294542 Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56400 (cherry picked from commit 92c69c791c436eb966fab806393b70e53cde6874)
* du: Set BLOCKSIZE before running testsDag-Erling Smørgrav2026-04-221-0/+4
| | | | | | | | | | | | | Several testcases assume BLOCKSIZE=K, so set it at the top of the script. This fixes an issue where the tests would sometimes fail when run under sudo. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D56476 (cherry picked from commit d618ba314d1452c1cb4360e15ae1c80adac48306)
* pkru: Fix handling of 1GB largepage mappingsMark Johnston2026-04-216-12/+274
| | | | | | | | | | | | | | pmap_pkru_update_range() did not handle the case where a PDPE has PG_PS set. More generally, the SET_PKRU and CLEAR_PKRU sysarch implementations did not check whether the request covers a "boundary" vm map entry. Fix this, add the missing PG_PS test, and add some tests. Approved by: so Security: FreeBSD-SA-26:11.amd64 Security: CVE-2026-6386 Reported by: Nicholas Carlini <npc@anthropic.com> Reviewed by: kib, alc Differential Revision: https://reviews.freebsd.org/D56184
* tty: Avoid leaving dangling pointers in tty_drop_ctty()Mark Johnston2026-04-213-0/+87
| | | | | | | | | | | | | | | | | | | The TIOCNOTTY handler detaches the calling process from its controlling terminal. It clears the link from the session to the tty, but not the pointers from the tty to the session and process group. This means that sess_release() doesn't call tty_rel_sess(), and that pgdelete() doesn't call tty_rel_pgrp(), so the pointers are left dangling. Fix this by clearing pointers in tty_drop_ctty(). Add a standalone regression test. Approved by: so Security: FreeBSD-SA-26:10.tty Security: CVE-2026-5398 Reported by: Nicholas Carlini <npc@anthropic.com> Reviewed by: kib, kevans Fixes: 1b50b999f9b5 ("tty: implement TIOCNOTTY") Differential Revision: https://reviews.freebsd.org/D56046
* rc.conf: Fix typo in commentJose Luis Duran2026-04-201-1/+1
| | | | | | | | | | | The correct path is /etc/defaults/rc.conf (defaults in plural). Reviewed by: netchild Fixes: cc4eb1ea1040 ("Add support for a /etc/defaults/vendor.conf override file") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D56456 (cherry picked from commit 8e08080ee581dfd30c128d032035da7b6ae44463)
* ixgbe: Fix MRQC register value.Yuichiro NAITO2026-04-193-4/+4
| | | | | | | | | | | | | | | | | | | Focus on the MRQE field of the MRQC register, which is 4 bits wide, and we use these 3 types of values. - IXGBE_MRQC_RSSEN 0x1 (non VF mode) - IXGBE_MRQC_VMDQRSS32EN 0xA (less than 33 VFs) - IXGBE_MRQC_VMDQRSS64EN 0xB (less than 65 VFs) If we always take a bitwise OR with IXGBE_MRQC_RSSEN, IXGBE_MRQC_VMDQRSS32EN will never be chosen. Select these 3 types of values for the proper case. Signed-off-by: Yuichiro NAITO <naito.yuichiro@gmail.com> Pull Request: https://github.com/freebsd/freebsd-src/pull/2132 (cherry picked from commit 938c076b9b0bc458a3877b52535527d37199fc09)
* ciss.4: List all devices supported by ciss(4)Michael Osipov2026-04-171-1/+47
| | | | | | | | | PR: 285744 Reviewed by: ziaee MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D56285 (cherry picked from commit 54f5d20492d231b5c2ddc6f1d94dbffa1707d820)
* daemon(8): Add "--output-file -o" to list of options enabling supervision modeAndre Albsmeier2026-04-151-0/+1
| | | | | | | | | | | This is the small internal doc fix from https://reviews.freebsd.org/D46313 Reviewed by: michaelo Approved by: (blanket; comment fix) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D55325 (cherry picked from commit e9a69948a8837601d71e556550a272ca85c03e48)
* loader.efi.8/efibootmgr.8: Don't use contradicting term 'EFI BIOS'Michael Osipov2026-04-143-11/+11
| | | | | | | | | | | Both (U)EFI and BIOS are completely different things, be precise and don't use them together. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D56329 (cherry picked from commit 4f684e929de1275b1099b17b2a2cff0d3f4af223)
* vm_fault: Reset m_needs_zeroing properlyMark Johnston2026-04-131-4/+3
| | | | | | | | | | | | | | | | - When allocating a page, we should only consider the PG_ZERO flag when handling the top-level page. - Unconditionally reset the flag when restarting the fault handler. Previously, vm_fault_busy_sleep() would fail to reset it. PR: 294039 Reviewed by: kib Tested by: Peter Much <pmc@citylink.dinoex.sub.org> MFC after: 3 days Fixes: cff67bc43df1 ("vm_fault: only rely on PG_ZERO when the page was newly allocated") Differential Revision: https://reviews.freebsd.org/D56234 (cherry picked from commit 04132e01004316ddd0e0cde6ef15b100b7b1844d)
* kqueue: Fix a race when adding an fd-based knote to a queueMark Johnston2026-04-132-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | When registering a new kevent backed by a file descriptor, we first look up the file description with fget(), then lock the kqueue, then see if a corresponding knote is already registered. If not, and KN_ADD is specified, we add the knote to the kqueue. closefp_impl() interlocks with this process by calling knote_fdclose(), which locks each kqueue and checks to see if the fd is registered with a knote. But, if userspace closes an fd while a different thread is registering it, i.e., after fget() succeeds but before the kqueue is locked, then we may end up with a mismatch in the knote table, where the knote kn_fp field points to a different file description than the knote ident. Fix the problem by double-checking before registering a knote. Add a new fget_noref_unlocked() helper for this purpose. It is a clone of fget_noref(). We could simply use fget_noref(), but I like having an explicit unlocked variant. PR: 293382 Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D55852 (cherry picked from commit 8f3227f527567aef53da845ab78da8e16d9051c1)
* libc: Add missing MLINK for stravis(3)Dag-Erling Smørgrav2026-04-121-0/+1
| | | | | | | | | MFC after: 1 week Fixes: 8dfeba04eb36 ("Update to a June 8th snapshot of (un)vis form NetBSD.") Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D56260 (cherry picked from commit a09d06bc5bff64baab76220a66c3501b89899134)