if_awg: Add missing awg_poll() prototype
The function awg_poll() was missing a prototype, which causes the build
to fail if DEVICE_POLLING is enabled, which it is in the ARMADAXP config.
MFC after: 2 weeks
Reviewed by: tuexen, mmel, adrian
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D56651
amd64: ia32_fetch_syscall_args() does not need to check params != NULL
Whatever params pointer is, it does not matter. copyin() handles any
values. In fact, params cannot be ever NULL.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56630
amd64 ia32_syscall(): only allow for ILP32 processes
64bit processes can issue INT $0x80 instruction, and get the syscall
dispatched through ia32_syscall(). This works because syscall argument
fetch and result return are selected from the process sysent.
But, ia32_syscall() does not verify some conditions and does not perform
some actions which are considered unnecessary because the caller is
supposed to only access lower 4G. The INT syscall path breaks this
assumption.
We never supported such hack, so disable it. Send the offending thread
SIGBUS as if #GP was issued by hardware due to IDT vector 0x80 having
not numerically high enough DPL value.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56630
kern/init_main.c: path is for the binary, not process
Reviewed by: imp, jilles
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56536
bin/sh: make it possible to use as interactive init
If the /sbin/init binary is broken somehow, the way out is to set the
loader environment variable init_path to something else. The most
natural choice would be either /bin/sh or /rescue/sh. Unfortunately,
this does not work because the init process starts withoud stdin/out
descriptors.
Make it nicer to users by teaching /bin/sh startup code to open standard
descriptors on /dev/console if the shell is run as init.
Reviewed by: imp, jilles, zlei
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56536
init: build dynamically
This makes it easier to downgrade kernel when it stops providing some
syscall required by libc. In this case, it is enough to downgrade libc
as well, our crt1 delegates all non-trivial work to
libc::__libc_start1(). With static init, the /sbin/init should be
downgraded as well, which might be not easy.
This does not mean that we support forward compatibility.
Reviewed by: imp, jilles, zlei
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56536
tests/tcp_hpts_test: Fix resource leaks
When a KTEST_EQUAL assertion fails, the test function returns, but this
can cause it to leak locks, which can trigger a panic under witness.
Add a variant which causes control flow to jump to a label in case of
failure, and use that to prevent this problem.
Reviewed by: Nick Banks <nickbanks at netflix.com>, tuexen
MFC after: 1 weeks
Differential Revision: https://reviews.freebsd.org/D56647
include/stdbit.h: declare size_t, (u)int*_t, and (u)int_least*_t
These are required by ISO/IEC 9899:2024 § 7.18.1 ¶ 1 but were forgotten
in my initial work.
The current approach leaks intptr_t, uintptr_t, intmax_t, and uintmax_t
through <sys/_stdint.h>. This could be avoided using a more complicated
approach if desired.
PR: 294131
Fixes: 6296500a85c8474e3ff3fe2f8e4a9d56dd0acd64
Reported by: Collin Funk <collin.funk1 at gmail.com>
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56515
(cherry picked from commit c8c9324c94dfd4eeecbcfe4a1d3daa047420d3e5)
x86/ucode: fix gcc uninitialised warning
This fixes the case where selected_size is never set to anything
in the loop. Whilst here, also set selected_fw to NULL so the case
of "no firmware" correctly sets everything to NULL/0.
```
--- ucode_subr.o ---
/workspace/src/sys/x86/x86/ucode_subr.c: In function 'ucode_amd_find':
/workspace/src/sys/x86/x86/ucode_subr.c:237:25: warning: 'selected_size' may be used uninitialized [-Wmaybe-uninitialized]
237 | *selected_sizep = selected_size;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/ workspace/src/sys/x86/x86/ucode_subr.c:105:16: note: 'selected_size' was declared here
105 | size_t selected_size;
| ^~~~~~~~~~~~~
```
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D55439
tail(1): Fix -r (reverse) to work on pseudo filesystems
Pseudo filesystems (e.g., procfs) advertise a zero file size.
Fix reverse() to handle such a case similarly as forward() so
that '-r' works on pseudo filesystems.
Signed-off-by: Aaron LI <aly at aaronly.me>
Reviewed by: pouria, Ricardo Branco <rbranco at suse.de>, des
Fixes: 1fb3caee7 ("tail: Do not trust st_size if it equals zero.")
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2080
packages: make bhyve depend on acpi
bhyve(8) on amd64 needs iasl(8) to run, otherwise it fails with:
/bin/sh: /usr/sbin/iasl: not found
bhyve: BASL failed @ build_dsdt:484
Failed to execute basl_compile(ctx, basl_fwrite_dsdt): Unknown
error: 32512
bhyve: BASL failed @ acpi_build:899
Failed to execute build_dsdt(ctx): Unknown error: 32512
Assertion failed: (error == 0), function bhyve_init_platform_late, file
/home/pkgbuild/worktrees/main/usr.sbin/bhyve/amd64/bhyverun_machdep.c,
line 394.
Register the "acpi" package which provides iasl(8) as a dependency for
bhyve on amd64.
Reviewed by: markj (previous revision), ivy
Differential Revision: https://reviews.freebsd.org/D56498
Sponsored by: The FreeBSD Foundation
apm: Only install rc script on i386
The apm(8) rc script only works on i386, but it's installed on all
platforms. Only install it on i386, which avoids creating a useless
FreeBSD-apm package on other platforms.
While here, build the acpi package on i386.
MFC after: 2 weeks
Reviewed by: imp
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D56629
service(8): Replace indentation in usage()
The -d option was indented with spaces instead of tabs, and this broke
formatting.
Before:
-d Enable debugging of rc.d scripts
-j Perform actions within the named jail
After:
-d Enable debugging of rc.d scripts
-j Perform actions within the named jail
MFC after: 1 week
(cherry picked from commit 554f5aa526266057672740e22af0a75cc32bddd5)
libpkgconf: Fix paths
${LOCALBASE:U} evaluates to exactly the same thing as ${LOCALBASE}.
Presumably what was meant was ${LOCALBASE:U/usr/local}.
Fixes: b8352da33f34 ("pkgconf: import into the base system")
Reviewed by: khorben
Differential Revision: https://reviews.freebsd.org/D56642
pf: fix duplicate rule detection for automatic tables
We should look at the table name for automatic tables as well. These
are different tables, so the rules using them are (or can be) different
as well.
MFC after: 3 days
Reported by: Michael Sinatra <michael at burnttofu.net>
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit fb838352751767e756bd45cd2040fa464ed4de20)
pf: fix duplicate rule detection for automatic tables
We should look at the table name for automatic tables as well. These
are different tables, so the rules using them are (or can be) different
as well.
MFC after: 3 days
Reported by: Michael Sinatra <michael at burnttofu.net>
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit fb838352751767e756bd45cd2040fa464ed4de20)
tuntap: add SIOCGIFCAP and SIOCSIFCAP ioctls
Add SIOCGIFCAP ioctl-command for tun/tap character device to be used
by bhyve for offloading in the future.
Add SIOCSIFCAP for symmetry.
Reviewed by: markj, pouria, tuexen
MFC after: 1 week
Event: Wiesbaden Hackathon 2026
Differential Revision: https://reviews.freebsd.org/D51289
vtnet: remove loader tunable fixup_needs_csum
Removes the deprecated loader tunable fixup_needs_csum. Removes also
the sysctl counter rx_csum_bad_offset that is no longer in use.
Reviewed by: tuexen
Event: Wiesbaden Hackathon 2026
Differential Revision: https://reviews.freebsd.org/D55588
tcp: use RFC 6191 for connection recycling in TIME-WAIT
Implement the criteria specified in RFC 6191 for recycling TCP
connections in TIME-WAIT.
Reviewed by: rscheff, Marius Halden
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D56321
Event: Wiesbaden Hackathon 2026
(cherry picked from commit 3a54aa3b0911bef15e014b8a8185e116efb0a918)