aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* netinet6: Fix check for pktinfo outgoing ifindex in route cacheHEADmainPouria Mousavizadeh Tehrani31 min.1-1/+1
| | | | | | | lookup_route is only called for outgoing traffic, therefore check nh_ifp index instead of nh_aifp as specified by RFC3542 sec 6. Differential Revision: https://reviews.freebsd.org/D58544
* arm64 pmap: use range-based TLBI instructionsAlan Cox39 min.1-11/+189
| | | | | | | | | | | | | Rewrite pmap_s1_invalidate_strided() to use range-based TLBI instructions when they are when available. This change can significantly reduce the number of invalidation instructions issued, leading to decreased system time. (More details on the decrease can be found in the review.) Assisted-by: Claude Code (Opus 5) Reviewed by: kib, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D58708
* nfsd: Update the rc.d script for RDMA for the nfsd serviceRick Macklem57 min.2-0/+9
| | | | | | | | | | | | | | | | | | | | | | Commit 7144a1d58c5c added the hooks for the nfsrdma.ko module. Once loaded, this module adds RDMA support to the nfsd. This patch adds a few lines to /etc/rc.d/nfsd, so that nfs_server_rdma_enable="YES" in your /etc/rc.conf will load nfsrdma.ko, so that RDMA service is enabled. It also supports nfs_server_rdma_listen="port#" so that the default of 20490 can be overridden in /etc/rc.conf. At this available as time, the nfsrdma.ko module is an unofficial port, since it was developed by Vinicius Ferrao <ferrao@versatushpc.com.br> using generative AI. As soon as it is available, it will be announced on freebsd-current@freebsd.org. Suggested by: Vinicius Ferrao <versatushpc.com.br> MFC after: 1 month
* iflib: Fix several memory handling issues around iflib_encap()Andrew Gallatin70 min.1-22/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fixed memory leaks around m_dup() not freeing the original chain on failure. If we return ENOMEM, we are expected to have freed the chain, else the mbuf would be leaked. Also updated iflib_ether_pad() to follow the same structure. - In iflib_parse_header() o Fixed a bug where the ip/ip6 and th pointers may point into a freed chain after m_pullup. Those pointers must be reset to point into the new chain. o Eliminate ENXIO returns for non-TCP TSO sends (which would violate the mbuf ownership contract if they could happen). Since they cannot happen, I made them assertions instead. - in iflib_ether_pad(), return ENOMEM after freeing mbuf, so that mp_ring knows it is free. An ENOBUFS error will cause the mp_ring path to retain the mbuf and retry - in iflib_encap(): o Fix a leak when bus_dmamap_load_mbuf_sg() returns ENOMEM o Fix a use-after-free in the mp_ring path when a driver using ktls frees an mbuf and returns ENOBUFS via iflib_encap() After this change the expection from iflib_encap is that: mp_ring: ENOBUFS can be returned only when we run out of descriptors (ENOBUFS causes mp_ring to retain the mbuf). simple_tx: iflib_encap() always consumes the mbuf, regardless of the return Note that iflib_debugnet_transmit(), like simple_tx, expects that iflib_encap() always consumes mbufs. This will be true after mp_ring is removed, and its such a rare special case (overrunning the ring during panic dumps) that I don't think its worth fixing in the meantime. Sponsored by: Netflix Reviewed by: kbowling, sumit.saxena_broadcom.com Differential Revision: https://reviews.freebsd.org/D58843 Fixes: 074ff8746388
* libc: Add <stdio.h> C23 feature test macroFaraz Vahedi81 min.7-9/+15
| | | | | | | | | | Define the __STDC_VERSION_STDIO_H__ feature test macro now that the header fully conforms to C23. Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D58842
* libc: Add _PRINTF_NAN_LEN_MAX per C23Faraz Vahedi81 min.1-0/+4
| | | | | | | Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D58842
* bhyve: document missing options in bhyve_config(5)Roman Bogorodskiy5 hours1-2/+49
| | | | | | | | | | | | | | | Document a few options that are currently supported but not covered in bhyve_config(5): - monitor - vcpu.N.cpuset - domains.N.{size,cpus,domain_policy} - console (for arm64 and riscv) MFC after: 1 week Reviewed by: bnovkov, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58399
* pmcstat.8: Add a missing ERRORS section headerMateusz Piotrowski5 hours1-2/+2
| | | | | MFC after: 3 days Sponsored by: fme AG
* clknode_if.m: fix two typosMitchell Horne5 hours1-2/+2
| | | | One is the parameter name.
* RELNOTES: Add an entry for bumping libusb versionShengYi Hung6 hours1-0/+4
|
* libusb: Bump version to 1.0.27ShengYi Hung6 hours4-3/+7
| | | | | | | PR: 296234(exp-run) Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57772
* libusb: capsicumize libusbShengYi Hung6 hours20-91/+354
| | | | | | | | | | | | | | | | | | | | | | FreeBSD's libusb has three components: libusb01, libusb10, and libusb20. libusb20 handles communication with character devices. We now requires a backend context for libusb20. The backend context contains contains the capsicumized usbctrl fd and usb directory (/dev/usb) fd so that the library user can enter the capiblity mode safely while using libusb. libusb10 is updated to support capabilities via a context option. Since libusb allows general read/write access, we preserve all possible capabilities when passing backend context to libusb20. It is the responsibility of the libusb user to call cap_enter() at an appropriate time. All base system tools using libusb and libusb20 have been updated to support Capsicum. Reviewed by: adrian, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51865
* nfsd: Add glue for the nfsrdma.ko moduleRick Macklem6 hours7-33/+148
| | | | | | | | | | | | | | | | | | | | | | | | | Thanks to Vinicius Ferrao <versatushpc.com.br>, there is now a module that implements the server side of RDMA for the FreeBSD NFS server. At least for now, it will be maintained as an "unofficial port" for FreeBSD, since it was built with generative AI and FreeBSD is working on a policy related to these submissions. This patch puts the "glue" needed by Vinicius's nfsrdma.ko module in the system. This "glue" was written by me without the use of AI. The "unofficial port" of nfsrdma.ko will be advertised on freebsd-current@ as soon as it is available. (Vinicius's work was sponsored by VersatupHPC.) Since newnfs_numnfsd is now declared extern in nfs.h, the extern declaration can be removed from assorted files. I'll do that as a separate commit. Suggested by: Vinicius Ferrao <versatushpc.com.br> MFC after: 1 month
* compat/freebsd32: set uio_rw for trailer's uio in freebsd32_sendfile()Konstantin Belousov6 hours1-0/+2
| | | | | | | | PR: 297516 Reported by: asomers Fixes: dfad790c8cca ("sendfile: stop abusing kern_writev()") Sponsored by: The FreeBSD Foundation MFC after: 3 days
* kern/sys_process.c: make vmspace_rwmem() similar to io functionsKonstantin Belousov6 hours1-4/+5
| | | | | | | | | | | | In particular, if there were any bytes moved, and then vm_fault() faulted, do not return an error, but report the short io instead. PR: 297512 Reviewed by: markj Tested by: Stéphane D'Alu <sdalu@sdalu.com> Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58838
* kern/kern_proc.c: do not throw out read data in get_ps_strings()Konstantin Belousov6 hours1-1/+4
| | | | | | | | | | | | | | Since vmspace_iop()/proc_readmem() might return -1 on error from vmspace_rwmem(), account for this and stop reading but return already accumulated data if any, instead of returning an error. PR: 297512 Reported and tested by: Stéphane D'Alu <sdalu@sdalu.com> Reviewed by: markj Fixes: e1b0d051bbf7 ("proc: Allow to make proc_rwmem() operate on a consistent address space") Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58838
* netipsec/xform_ipcomp.c: fix sockaddr type set in ipcomp6_nonexp_encapcheck()Konstantin Belousov6 hours1-1/+1
| | | | | | | Noted and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58646
* PF_KEY socket: limit the length of copied socket addressKonstantin Belousov6 hours1-59/+69
| | | | | | | | | | | | | | | | | | for SADB_UPDATE op SADB_X_EXT_NEW_ADDRESS_SRC/DST extensions, by checking the sa_len matching the address family requirements before doing the copy. Also convert KEY_SETSECASIDX() and KEY_SETSECSPIDX() to functions and apply the sa_len clamping there. See https://github.com/0xdeadbeefnetwork/pfkey-sadb-overflow PR: 297264 Tested by: Wafa Hamzah <wafah@nvidia.com> (previous version) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58646
* netipsec/key.c::key_checksockaddrs(): constify src/dst address buffer pointersKonstantin Belousov6 hours1-1/+4
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58646
* Increase the default mlock limit from 64k to 256kAlan Somers6 hours1-1/+1
| | | | | | | | | | | | The current default has been unchanged for 14 years. Increase it to keep pace with modern hardware and software. security/pinentry-gnome, in particular, can sometimes need 112 kB. PR: 297452 MFC after: 2 weeks Sponsored by: ConnectWise Reviewed by: cye, emaste Differential Revision: https://reviews.freebsd.org/D58811
* etc/rc.subr: svcj - use the filename for servicesAlexander Leidinger13 hours1-6/+6
| | | | | | | | | | | We have ports and basesystem services, where the internal name and the filename differ. While the documentation recommends to keep them in sync, the reality is different. For service jails use the basename of the service filename. Fixes: 2efbd48 rc: add service jails framework Suggested by: joneum MFC after: 1 week MFC to: stable/15
* rc.d/bgfsck: use the correct variable nameAlexander Leidinger13 hours1-1/+1
| | | | | | | The name of the script and the name used internally for rc.conf differ, as such the hardcoded disabling of service jails for the didn't work. Fix by using the correct name. Fixes: f99f0ee14e3af rc.d: add a service jails config to all base system services
* libifconfig: Fix table sizeDag-Erling Smørgrav20 hours1-1/+1
| | | | | | | | | | | | | | Tables that have one element per protocol or address family were previously sized by AF_MAX + 1 since AF_MAX was off by one. Now that AF_MAX has been corrected, we need to apply the opposite correction to these tables. Fixes: ddd850aa7720 ("sys/socket.h: Fix AF_MAX") MFC after: 3 days Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D58827
* routing: Fix table sizesDag-Erling Smørgrav20 hours1-9/+9
| | | | | | | | | | | | | | Tables that have one element per protocol or address family were previously sized by AF_MAX + 1 since AF_MAX was off by one. Now that AF_MAX has been corrected, we need to apply the opposite correction to these tables. Fixes: ddd850aa7720 ("sys/socket.h: Fix AF_MAX") MFC after: 3 days Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: pouria, kevans, glebius Differential Revision: https://reviews.freebsd.org/D58826
* git-arc: Add a diff subcommandDevin Teske24 hours2-5/+63
| | | | | | | | | | | | | | | | Show the differences between local commits and their associated Phabricator reviews, i.e., what "git arc update" would upload. For each commit, the review's current raw diff is applied to the commit's parent in a temporary index and the resulting tree is compared against the commit itself. An empty diff means the commit and the review are in sync. This makes it easy to check whether local amendments have diverged from the posted review before updating it, or to confirm that a review is current before landing. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D58789
* unix: only treat an empty sun_path as a peer descriptor for connectat(2)Devin Teske25 hours2-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | connect(2) passes AT_FDCWD to unp_connectat(), so the empty-path descriptor branch added in 6563dcb6b1f5 turned any sockaddr whose sun_path begins with a NUL byte into getsock(AT_FDCWD), failing with EBADF where the pathname lookup historically failed with ENOENT. Linux abstract namespace names are exactly that: the linuxulator passes them through with the leading NUL intact, and libxcb tries the abstract socket first, falling back to the pathname socket only on ENOENT or ECONNREFUSED. The EBADF made every Linux X11 client fail at startup with "Missing X server or $DISPLAY". Restrict the descriptor interpretation to fd != AT_FDCWD, matching the contract stated in 6563dcb6b1f5's commit message ("Accept an empty sun_path when fd is not AT_FDCWD"): connect(2) again reaches the pathname lookup and fails with ENOENT as it always did. Add a regression test: a NUL-leading, nonzero-length sun_path through connect(2) or connectat(2) with AT_FDCWD must fail the pathname lookup with ENOENT, not EBADF. Fixes: 6563dcb6b1f5 ("unix: allow connectat(2) to name the peer socket by descriptor") Reviewed by: John Ericson <John.Ericson@Obsidian.Systems>, markj Differential Revision: https://reviews.freebsd.org/D58792
* jng: Fix mislabeled stats outputFaraz Vahedi27 hours1-1/+1
| | | | | | | Reviewed by: dteske, pouria Approved by: dteske (mentor), pouria MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/2129
* libcxgb4: Use t4fw_interface.h from the cxgbe driver sourcesJohn Baldwin28 hours5-4021/+6
| | | | | | | | | | In Linux these are maintained in separate places so a separate copy is needed, but in FreeBSD take advantage of the shared tree to avoid having a duplicate copy that can be stale. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D58575
* rtld: Remove a stale #ifdef PICJohn Baldwin28 hours1-2/+0
| | | | | | | | | | rtld has always been built PIC since commit 7ca8e6a67068e8357e251bd3ea86253c8a751d59. The stale #ifdef might confuse a reader by thinking rtld can be built as non-PIC. Reviewed by: kib Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D58623
* libc: Use C23 pseudo-types in qualifier-preserving man page synopsesFaraz Vahedi28 hours9-44/+44
| | | | | | | Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/2288
* libc: Implement qualifier-preserving standard library functionsFaraz Vahedi28 hours13-33/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | Several standard library functions are specified to return an unqualified pointer while accepting a pointer to a potentially const-qualified object. N3020 addresses this behaviour, discarding qualifiers due to incompatible pointer types, by introducing qualifier-preserving macros for the affected set of standard library functions. Add `__qualsel()` helper to `<sys/cdefs.h>`, implemented using the generic selection, and define qualifier-preserving macros for that set of functions in `<string.h>`, `<wchar.h>`, and `<stdlib.h>`. Macros are gated on `_STDC_VERSION__ >= 202311L && !__cplusplus`, therefore there is no behavioural change for earlier C modes or C++ translation units. The kernel is likewise unaffected, as it does not include userland headers. As function-like macros, they are transparent except at a call site where the address-of operator is applied, the macro is suppressed via `#undef`, or the identifier appears in parenthesised form; all of which cause the underlying function designator to be used instead. Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/2288
* pfsync test: reduce the number of states to bulk-syncKristof Provost29 hours1-1/+1
| | | | | | | | | We created so many states that our bulk-sync occasionally caused epair to drop packets, which in turn caused the test to fail. That's not what we're testing here, make it more robust by creating fewer states. PR: 297307 Sponsored by: Rubicon Communications, LLC ("Netgate")
* release/riscv: tweak GENERICSD partition placementMitchell Horne29 hours1-1/+1
| | | | | | | | | Increase EFI partition size to begin rootfs at 64mb. I believe this was my original intention. I have a microSD card with 8mb block size which emits an advisory in verbose dmesg about the misaligned partition. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* libusb: Mark defualt smybol tag as latest stable versionShengYi Hung29 hours1-1/+1
| | | | | | | | | | As we might change the libusb ABI in 16, we should mark thje first version as FBSD_1.8 instead of 1.9. Since versioning patch has not landed for a long time, it makes sense to change it directly. Discussed with: kib Fixes: 527a82474cb3 ("libusb: versioning symbols") Sponsored by: The FreeBSD Foundation
* bnxt: Add led(4) identification supportKevin Bowling29 hours5-2/+169
| | | | | | | | | | | | | | | Query the firmware for the LEDs on each physical port and expose /dev/led/bnxt* only when alternate blinking is supported. Configure every LED in the advertised group for identification and restore its default firmware state before a function reset. This follows the DPDK and Linux bnxt HWRM identification paths. Reviewed against: DPDK, Linux Reviewed by: Sumit Saxena <sumit.saxena@broadcom.com> MFC after: 2 weeks Sponsored by: BBOX.io
* linuxkpi: stop inlining accesses to curthread->td_lkpi_taskKonstantin Belousov29 hours2-5/+12
| | | | | | | | | | This should provide much higher resistence against struct thread layout changes for out-of-tree modules depending on linuxkpi. Reviewed by: bz Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58733
* tty: do not recurse on ttydev_close()Konstantin Belousov29 hours2-9/+22
| | | | | | | | | | | | | | | | | | | | | | | When the terminal cdev is closed due to revoke, ttydev_close() destroys t_inpoll and t_outpoll selinfos. Since corresponding knotes reference files pointing to the same tty cdev, it fdrop()s them. But then the VOP_CLOSE() call would recurse into the ttydev_close() for the same tty. More, because the devfs vnode is already doomed, each close call gets the FREVOKE flag set. As result, the kernel is recursing as deep into the ttydev_close() as there are opened files referencing the same tty, which have the knotes installed. Basically, the recursion level is controlled by userspace. Prevent it by marking the tty that is handled by ttydev_close(), with the TF_INDEVCLOSE flag. Do nothing in ttydev_close() when the flag is already set, avoiding recursion. Fixes: acd5638e268a ("tty: delete knotes when TTY is revoked") Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58706
* vmm: fix compilation errors for static kernel on arm64Nimish Jain30 hours1-1/+13
| | | | | | | Fixes: 35164034e390 ("arm64/vmm: Make remaining registers use hypctx_*_sys_reg") Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D58690
* unix: Fix mchain handling in uipc_sosend_stream_or_seqpacket()Mark Johnston30 hours2-2/+89
| | | | | | | | | | | | | | | | | | Empty mchains cannot be copied with simple assignment. I think this bug is mostly harmless: if mcnext is empty, then it won't be accessed again before it is reinitialized in the next loop iteration. So the bug only trips an assertion in INVARIANTS kernels and won't be visible otherwise. Add a regression test which triggers this corner case. Reported by: Jan Bramkamp Fixes: d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket") Reviewed by: glebius MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58791
* daemon(8): Add option to write pidfile w/o supervising itAndre Albsmeier31 hours2-7/+39
| | | | | | | | Co-authored-by: Michael Osipov <michaelo@FreeBSD.org> PR: 280487 Reviewed by: kevans, michaelo MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46313
* cdefs(9): document __nonstringMitchell Horne31 hours1-1/+4
| | | | | | | | | Reviewed by: emaste Discussed with: imp Fixes: 802c6d5d61d1 ("cdefs.h: Introduce __nonstring attribute") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58804
* rc_subr_test: ignore stderr in no_cycles testSiva Mahadevan31 hours1-1/+1
| | | | | | | | | | | | | nuageinit_user_data_script references 'firstboot_freebsd_update' and 'firstboot_pkg_upgrade', which are from Ports. In a default base system test without sysutils/firstboot-freebsd-update and sysutils/firstboot-pkg-upgrade, rcorder will warn on "unknown provisions" to stderr, but is otherwise harmless. Reviewed by: arrowd Fixes: 16e47f317c4ce2be5fed530bf8a9af9f9bf55364 MFC after: 3 days Sponsored by: The FreeBSD Foundation
* build: Use -f when copying sourcesDag-Erling Smørgrav32 hours1-2/+2
| | | | | | | | | | | If one of the source files we copy is non-writeable, cp will create a non-writeable copy. If the original is later modified, cp will fail to overwrite the copy since it is not writeable. Using cp -f ensures the copy always succeeds, as long as the object directory is writeable. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc.
* libc/tests: Add assertions for BOOL_WIDTH, BOOL_MAX, and BITINT_MAXWIDTHFaraz Vahedi35 hours1-0/+6
| | | | | | | Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/2352
* sys/limits.h: Fix typoFaraz Vahedi35 hours1-1/+1
| | | | | | | Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/2352
* sys/limits.h: Add BOOL_MAX, BITINT_MAXWIDTH, and C23 feature test macroFaraz Vahedi35 hours3-4/+12
| | | | | | | | | | | Add BOOL_MAX and BITINT_MAXWIDTH macros for C23 compliance, and define the __STDC_VERSION_LIMITS_H__ feature test macro now that the header fully conforms to C23. Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/2352
* thunderbolt: Explicitly read NHI ISR0 register to clear itAymeric Wibo39 hours1-0/+16
| | | | | | | | | This fixes and issue where Pink Sardine controllers were not receiving interrupts for more than the first command sent on the ring. Reviewed by: emaste, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52862
* thunderbolt: Reset controllersAymeric Wibo47 hours2-0/+67
| | | | | | | | | Reset routine for both v1.0 and v2.0 routes, chosen depending on version reported in caps. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49452
* thunderbolt: Get NHI version number from capsAymeric Wibo47 hours3-9/+35
| | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49452
* iflib: Allow conditional LED device supportKevin Bowling2 days2-1/+11
| | | | | | | | | | | A driver class may implement LED control even though the capability is not available on every device or firmware version it supports. Add an optional capability method and consult it before creating the led(4) device. Default to supported so existing providers are unchanged. This will be used by bnxt which blends PF and VF in the same driver. MFC after: 2 weeks