aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* mtree: Add missing entriesHEADmainJose Luis Duran11 min.2-0/+12
| | | | | | | | | Add missing mtree directory entries. Without them, the resulting worldstage METALOG file would produce an invalid (incomplete) mtree specification file. Reviewed by: ivy Differential Revision: https://reviews.freebsd.org/D56013
* mdo.1: Cross-reference with security.7Mateusz Piotrowski83 min.2-3/+5
| | | | | | MFC after: 3 days Reviewed by: olce Differential Revision: https://reviews.freebsd.org/D56024
* mlx5: postpone freeing the completed command entity to taskqueueKonstantin Belousov6 hours2-1/+12
| | | | | | | | because cancel_delayed_work_sync() might need to sleep, which cannot be done in the interrupt thread where the completion runs. Sponsored by: Nvidia networking MFC after: 1 week
* pfctl tests: test rdr-to and nat-to in one ruleKristof Provost25 hours3-0/+4
| | | | | | | OpenBSD fixed this separately (in their 6a338f3f70). We appear to not have had this bug, but test for it anyway. Sponsored by: Rubicon Communications, LLC ("Netgate")
* pfctl: parser must not ignore error from pfctl_optimize_ruleset()Kristof Provost27 hours1-2/+3
| | | | | | | | | | | | | Ignoring the error may cause pfctl(8) to load inconsistent ruleset preventing pf(4) to enforce desired policy. Issue reported and fix suggested by berts _from_ fastmail _dot_ com 'Looks good.' @deraadt MFC after: 1 week Obtained from: OpenBSD, sashan <sashan@openbsd.org>, 9fd28a8cca Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf tests: verify first-match-wins for nat rulesKristof Provost27 hours1-0/+45
| | | | Sponsored by: Orange Business Services
* release.sh: add chroot cleanup routineEnji Cooper28 hours1-1/+21
| | | | | | | | | | | | | | | | | | | | | The chroot_cleanup routine handles any cleanup needed post-chroot_setup, etc. This consists of purely tearing down `${CHROOTDIR}/dev` today, but might involve additional steps, as needed for custom functions. This allows end-users to override the various chroot functions without having to modify code in main() or replicate the unmount procedure in an equivalent routine setup via the trap builtin. This change modifies the /dev unmount process to use `umount -f` instead of `umount`. The latter can result in failures if resources are still mounted or are running post-build, whereas the former will clean up any resources still in use by processes running in the chroot at time of build. Moreover, the `chroot_cleanup` routine is now called when the script is killed with `SIGINT` and `SIGTERM`, as well as at `EXIT`, better ensuring that the script's resources are cleaned up in relatively common scenarios that can be detected/handled. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55450 (as part of a larger change)
* release.sh: document user-overriddable functionsEnji Cooper28 hours1-0/+9
| | | | | | | This helps others attempting to customize the behavior of `release.sh`. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55450 (as part of a larger change)
* libc: Fix cxa_thread_atexit{,nothr} test.ShengYi Hung28 hours2-5/+16
| | | | | | | | | | | | | | After patch 9d26b82, we don't provide recursive call protection anymore. Therefore, to pass the test, we adjust the testcase by protecting on caller and the testcase is to make sure the dtors is properly handled. Reported by: siva Reviewed by: kib Approved by: markj (mentor) Fixes: 9d26b82826d9 ("libc: Fix dtor order in __cxa_thread_atexit") MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55893
* hwpstate_amd: Refactor the cpufreq code by using delegation pattenrShengYi Hung28 hours1-71/+142
| | | | | | | | | | We separate the code of CPPC and legacy pstate driver to make it easier to read. Reviewed by: olce Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55604
* libcrypto: compile all PIC objects with -DOPENSSL_PIC -fPICEnji Cooper29 hours2-6/+3
| | | | | | | | | | | | This change modifies the libcrypto PIC objects to always compile with `-DOPENSSL_PIC -fPIC` to restore parity with the upstream build process. This ensures that the legacy provider is built with parity to the upstream legacy provider. MFC after: 12 days Tested with: `make check` (legacy provider), `make universe` Fixes: 14b9955e Differential Revision: https://reviews.freebsd.org/D44896
* amd64: revert back struct trapframe to the pre-FRED definitionKonstantin Belousov32 hours1-0/+4
| | | | | | | | | | | | | | | | | | Trying to use the grown struct trapframe for IDT case broke in cases where code supposed that hardware consumed sizeof(struct trapframe) of the stack space when delivering interrupt or exception. In particular, this was broken for #NM/#DB/#MC. Naive attempt of using IDT-trapframe size for stack consumption caused later problems with larger C type. Instead of pretending that IDT event delivery pushed two never-accessed doubleword to the stack, keep it honest and provide separate type for the FRED interrupt frame, i.e. struct trapframe_fred. Convert between trapframe_fred and trapframe can be done by trivial pointer arithmetic. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* LinuxKPI: add supporting #includesBjoern A. Zeeb34 hours3-0/+3
| | | | | | | | | | | | | | Compiling drm-kmod on !X86 does not include asm/smp.h which includes preempt.h on FreeBSD. In order to compile drm-kmod on other architectures add the secondary #includes for preempt.h to spinlock.h and hardirq.h (which now also gets included from highmem.h) to connect the #include chain. Sponsored by: The FreeBSD Foundation MFC after: 3 days PR: 279864 Reviewed by: jhibbits, emaste Differential Revision: https://reviews.freebsd.org/D55974
* sbuf: make assertion message a lot more useableBjoern A. Zeeb34 hours1-2/+2
| | | | | | | | | | | | | | | | | | Saying that we are called with an (un)finished or corrupted sbuf is like saying "error" (though [un]finished is an extra hint). Add the pointer to the sbuf so one could easily check it, add the flags we are checking so one could see quickly about a possible state mismatch. Given we already dereference the pointer in the KASSERT there is no extra harm adding it to the message. Found while: testing lindebugfs changes Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D55919
* EC2: Remove stale commentColin Percival39 hours1-4/+0
| | | | | MFC after: 3 days Sponsored by: Amazon
* Revert "vmimage.subr: pkg autoremove after pkg install"Colin Percival39 hours1-7/+0
| | | | | | | | | | | | This reverts commit 6a13aeac3c1f98db7cf156f24a4d6bc8d3c321f6. The "bogus dependencies being installed" issue was traced down to pkg confusion surrounding libclang_rt.asan-i386.so linking to a 32-bit libgcc_s.so.1, and a more minimal workaround of "install clibs-lib32" has been applied, so this hack is no longer required. MFC after: 3 days Sponsored by: Amazon
* EC2: Add clibs-lib32 pkg to small/builder imagesColin Percival39 hours2-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FreeBSD-clang package on amd64 contains libclang_rt.asan-i386.so, which links to the 32-bit version of libgcc_s.so.1. It is not clear if that file belongs in FreeBSD-clang or if it should be placed into a different package. For unknown reasons, pkg *sometimes* recognizes this and decides that it needs to install a package to supply libgcc_s.so.1:32. In particular, when we initially install the VM with 'pkg install [long list of FreeBSD-* packages]', pkg does not recognize that it wants this; but the *next* time 'pkg install' runs, it decides that it needs libgcc_s.so.1:32 -- even though that particular library is not needed by the particular package we're trying to install -- and goes looking for it... and ends up picking gcc12-devel as a provider. Later in the EC2 image building process, we run 'pkg autoremove' (which was added during 15.0 to get rid of the "bogus dependencies" which were added while installing other packages) and pkg is once again confused: It decides that gcc12-devel is an automatic port which is not required by anything else, but upon determining that it should be removed it then determines that FreeBSD-clang depends upon a port which is being removed and deletes FreeBSD-clang as well. It's not clear what is breaking in pkg, but as a temporary workaround add the FreeBSD-clibs-lib32 package to the "small" and "builder" EC2 image flavours in order to satisfy the libgcc_s.so.1 demand. This commit should be reverted if libclang_rt.asan-i386.so moves out of FreeBSD-clang, (i.e. if it becomes possible to install a 32-bit-free amd64 system) or when the pkg issue is resolved (i.e. pkg consistently recognizes the shared library dependency and installs clibs-lib32 automatically as a FreeBSD-clang dependency). MFC after: 3 days Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D55978
* tunefs: Don't combine GEOM journaling with SUDag-Erling Smørgrav48 hours2-6/+19
| | | | | | | | | | GEOM journaling shouldn't be used at the same time as soft updates, so don't enable one if the other is already in use. MFC after: 1 week PR: 293896 Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D56002
* newfs: Don't combine GEOM journaling with SUDag-Erling Smørgrav48 hours2-5/+13
| | | | | | | | | | | GEOM journaling shouldn't be used at the same time as soft updates, so don't enable soft updates if GEOM journaling has been requested, and error out if both are explicitly requested. MFC after: 1 week PR: 293896 Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D55999
* kernel: Be clearer about what ZSTDIO is forDag-Erling Smørgrav48 hours11-18/+42
| | | | | | | | | | ZSTDIO is not just for core dumps, and it is now required by ZFS, so move it (and GZIO, which is still just for dumps) to a new “Compression support” section in GENERIC, and add them both to MINIMAL. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D55940
* acpi_spmc: Simplify constraint freeingAymeric Wibo2 days1-7/+3
| | | | | | We don't need to check for NULL before calling free(). Sponsored by: The FreeBSD Foundation
* acpi.4: Update sysctl descriptions for new stypesAymeric Wibo2 days1-13/+14
| | | | | | | | | | | | | The previous S1-S5 options are still accepted for compatibility, but they are now deprecated in favour of the new generic sleep types. Reported by: markj Reviewed by: markj Approved by: markj Fixes: 97d152698f48 ("acpi: Use sleep types defined in sys/power.h") Event: AsiaBSDCon 2026 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56008
* acpi: Print sysctl name in deprecated sleep type warningAymeric Wibo2 days1-3/+3
| | | | | | | Reported by: markj Fixes: 97d152698f48 ("acpi: Use sleep types defined in sys/power.h") Event: AsiaBSDCon 2026 Sponsored by: The FreeBSD Foundation
* amd64 trap.c: provide tag for the struct sfhandlers definitionKonstantin Belousov2 days1-2/+4
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* amd64: add prototype for ia32_syscall()Konstantin Belousov2 days1-0/+2
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* amd64: remove assertion about sizeof(struct pcb)Konstantin Belousov2 days1-7/+0
| | | | | | | | | | | We no longer put pcb on stack, it is part of the struct thread. Similarly, we do not put user fpu save area on stack. There is no constraints on the pcb size due to the XSAVE area required alignment. Reviewed by: jhb, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55931
* sys/param.h: bump __FreeBSD_version for amd64 struct trapframe size changeKonstantin Belousov2 days1-1/+2
| | | | | | Requested by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week
* x86 FRED: add hardware definitions for the trap frames fieldsKonstantin Belousov2 days2-14/+58
| | | | | | | | | | | | | | | | as provided by the Intel document 346446-009 AKA FRED 8.0 and SDM v90, February 2026. Note that the layout of the struct trapframe does not change with FRED. The differences are in addition of two fields at the end of the structure. Other members are carved from existing tf_cs and tf_ss by limiting hw-written segments to 16 bits officially, and reusing rest from the doubleword for the new data. Reviewed by: jhb, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55831
* amd64: check that %cs and %ss values from ucontext fit into registersKonstantin Belousov2 days2-0/+47
| | | | | | | | | | | This change only checks that the values from the user-supplied context are not truncated by C implicit type convertions. The validity of the segment selectors is still checked by hardware. Reviewed by: jhb, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55861
* amd64: move code to check for traps with interrupts disabled into helpersKonstantin Belousov2 days1-38/+58
| | | | | | | Reviewed by: jhb, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55809
* Revert "libcrypto: compile all PIC objects with -DOPENSSL_PIC"Enji Cooper2 days1-2/+0
| | | | | | | | | | | | | | This commit broke the build with some build options. Some validation needs to be done to confirm that moving the preprocessor argument to `secure/lib/libcrypto/Makefile.inc` works without breaking the build, but revert for now until a `tinderbox` run can be done with the change. PR: 293934 Reported by: Jenkins, Trond Endrestøl This reverts commit 14b9955e57cc28b61e785165b9effcbe620edb46.
* Makefile.inc1: Don't force LLVM_BINUTILS off for cross-toolsEd Maste2 days1-1/+0
| | | | | | | | | | | | | | | | | | | | | Because of this setting we were still using ELF Tool Chain tools for buildworld. The sets of binary utilities are largely equivalent and this went unnoticed after commit 1cae7121c667 ("Enable LLVM_BINUTILS by default"). This was discovered recently because ELF Tool Chain objcopy produces standalone debug files without phdrs and this caused an issue with a 3rd party ELF parser [1]. Remove the forced setting so that we use LLVM's binutils to build the system. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=33876 Re-commit after fixing a bootstrapping issue with LLVM binutils (in 17494c6e6b7d "build: Boostrap LLVM_BINUTILS for cross-tools"). Reviewed by: imp, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55650
* tpm: fix multi-threaded access with per-open stateChuck Silvers3 days5-100/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TPM driver currently has a single buffer per instance to hold the result of a command, and does not allow subsequent commands to be sent until the current result is read by the same OS thread that sent the command, with a timeout to throw away the result after a while if the result is not read in a timely fashion. This has a couple problems: - The timeout code has a bug which causes all subsequent commands to hang forever if a different OS thread tries to read the result before the OS thread which sent the command, and the OS thread which sent the command never tries to read the result. - Even if the first problem is fixed, applications expect to be able to read the result from a different OS thread than the OS thread which sent the command. The particular case that we saw was a go application where the go runtime scheduled the goroutine which read the result to a different OS thread from one where the goroutine that sent the command ran, and there's no way to force these to always run on the same OS thread. Fix all of this by replacing the global result buffer with a per-open result buffer via devfs_set_cdevpriv(), so that we no longer need to block subsequent commands until the results of a previous command are retrieved or care about which OS thread is reading the result of a command. Sponsored by: Netflix Reviewed by: olivier, imp Differential Revision: https://reviews.freebsd.org/D52328
* krb5: append to LDFLAGS instead of replacingChuck Silvers3 days20-20/+20
| | | | | | Sponsored by: Netflix Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D55335
* tcp/rack: don't call call tcp_state_change() before tcp_close()Gleb Smirnoff3 days1-1/+0
| | | | | Reviewed by: tuexen, rrs Differential Revision: https://reviews.freebsd.org/D55969
* tcp: remove extraneous codeGleb Smirnoff3 days1-5/+0
| | | | | | | The tcp_close() will perform both actions. Reviewed by: pouria, tuexen, rrs Differential Revision: https://reviews.freebsd.org/D55965
* cam (scsi): silence "Medium not present" SCSI sense logging for removable mediaAbdelkader Boudih3 days1-3/+3
| | | | | | | | | | | | | | Change SS_FATAL to SS_FAIL for SCSI sense code 0x3A (Medium not present) to suppress console spam when card readers or other removable media devices have no media inserted. The error is still returned to callers (ENXIO), but no longer prints to dmesg during boot/probe. Verified with Apple SD Card Reader - reduced boot messages from 4 to 2. Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D55287
* dwcotg.4: Initial manual pageAlexander Ziaee3 days2-0/+30
| | | | | | | | Create visibility in apropos and the Hardware Release Notes. MFC after: 3 days Reviewed by: pauamma, ray Differential Revision: https://reviews.freebsd.org/D53287
* loader(8): embedded MD should be the most preferred currdevNavdeep Parhar3 days1-9/+9
| | | | | | | | | | | | A loader built with MD_IMAGE_SIZE is almost always meant for use with its embedded image and should try that as currdev before anything else. Recent changes (d69fc3a9dc71, 784150fd2535) seem to have relaxed the ZFS code's search for a rootfs and exposed this problem. Reviewed by: imp, tsoome MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D55979
* build: Boostrap LLVM_BINUTILS for cross-toolsEd Maste3 days4-2/+43
| | | | | | | | Reported by: vexeduxr, jrtc27 Reviewed by: imp Sponsored by: The FreeBSD Foundation Pull request: https://github.com/freebsd/freebsd-src/pull/2084 Differential Revision: https://reviews.freebsd.org/D55923
* src.conf(5): rebuild after introduction of WITHOUT_PKGSERVEBaptiste Daroussin3 days1-1/+4
|
* pkg-serve(8): serve pkg repositories over TCP via inetd (8)Baptiste Daroussin3 days10-0/+545
| | | | | Reviewed by: manu, bdrewery (previous version) Differential Revision: https://reviews.freebsd.org/D55895
* "Pending" is more correct than "Missing"Poul-Henning Kamp3 days1-1/+1
| | | | Pointed out by: Alex "the PS/2 guy"
* timerfd: Suppress kqueue readability after jump readJake Freeland3 days1-1/+1
| | | | | | | | | Do not report EVFILT_READ after reading a discontinuous clock jump. This makes the kqueue filter consistent with Linux epoll behavior and timerfd_poll(), which already checks tfd_jumped != TFD_READ before reporting POLLIN. MFC after: 2 weeks
* timerfd: Wake up on discontinuous jumpJake Freeland3 days1-3/+11
| | | | | | | | If a discontinous realtime clock change occurs and sets any TFD_JUMPED bits on the timerfd, then wake up waiting readers. This fixes failures from the timerfd_root__clock_change_notification test case. MFC after: 2 weeks
* timerfd: Use saturating sbintime conversionsJake Freeland3 days1-5/+5
| | | | | | | | | | | | | | | | | | | Some timerfd consumers set expirations with timespec tv_sec components larger than 2^31 - 1. In such cases, converting that timespec to sbintime results in data loss or sign flip, yielding a shorter expiration than desired. To avoid this problem, use saturating timespec-to-sbintime conversion functions. These will clamp the converted sbintime to SBT_MAX under circumstances where the normal conversion functions would overflow. Saturating conversions still result in data loss, but the consequences are less severe, causing problems only after SBT_MAX (~68 years) of system uptime elapses. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D55792 MFC after: 2 weeks
* sys/time: Add saturating sbt conversionsJake Freeland3 days1-0/+21
| | | | | | | | | | | | | | | | | | When converting from timespec to sbintime, the timespec's 64-bit tv_sec component is shifted to the left 32 bits, causing any information in the upper 32 bits to be lost. This data loss during conversion can turn timespecs with very large tv_sec counters into sbintimes that represent much smaller time durations. Add tstosbt_sat() and tvtosbt_sat(), which are saturating versions of tstosbt and tvtosbt. With these routines, any overflow resulting from the conversion is clamped to [-SBT_MAX - 1, SBT_MAX]. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D55791 MFC after: 2 weeks
* timerfd: Fix interval callout schedulingJake Freeland3 days2-11/+42
| | | | | | | | | | | | | | | | | When a timerfd interval callout misses its scheduled activation time, a differential is calculated based on the actual activation time and the scheduled activation time. This differential is divided by the timerfd's interval time and the quotient is added to the timerfd's counter. Before this change, the next callout was scheduled to activate at: scheduled activation time + timerfd interval. This change fixes the scheduling of the next callout to activate at: actual activation time + timerfd interval - remainder. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D55790 MFC after: 2 weeks
* timerfd: Add testsJake Freeland3 days2-0/+1321
| | | | | | | | | Take Jan Kokemuller's timerfd tests from the epoll-shim project, stripping out code that isn't directly related to FreeBSD. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D55789 MFC after: 2 weeks
* dtrace.1: Reference dtrace_cam.4Mateusz Piotrowski3 days1-1/+2
| | | | | Fixes: 1a7151f79664 cam: Add probes for xpt actions Event: AsiaBSDCon 2026