]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 months agoloader: export the CMD_ constants in loader table
Warner Losh [Wed, 14 Feb 2024 17:51:58 +0000 (10:51 -0700)]
loader: export the CMD_ constants in loader table

Export the CMD_OK, etc constants in the loader table. They are the
return values of loader.perform, etc.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43821

3 months agoloader: Fetch initial script from loader_lua env
Warner Losh [Wed, 14 Feb 2024 17:51:38 +0000 (10:51 -0700)]
loader: Fetch initial script from loader_lua env

Sometimes it is nice to override the initial script that we run. Make it
possible by fetching loader_lua from the env and using that instead of
the default if prsent.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43819

3 months agoriscv: Introduce support for APLIC interrupt controller
Himanshu Chauhan [Wed, 14 Feb 2024 15:31:26 +0000 (11:31 -0400)]
riscv: Introduce support for APLIC interrupt controller

This patch introduces support for the RISC-V APLIC interrupt controller
[1]. Currently, it is only supports direct mode, i.e. without an IMSIC
and functionally replacing the legacy RISC-V PLIC. Work on IMSIC support
is in progress.

[1] https://github.com/riscv/riscv-aia/releases/tag/1.0

Reviewed by: mhorne
Discussed with: jrtc27
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D43293

3 months agoriscv: add firmware partitions to GENERICSD.conf
Mitchell Horne [Wed, 14 Feb 2024 15:12:57 +0000 (11:12 -0400)]
riscv: add firmware partitions to GENERICSD.conf

Create two partitions in the existing space at the beginning of the
image (8MB). These are intended to hold u-boot SPL and u-boot proper.

The partition types selected are compatible with SiFive boards, e.g. the
HiFive Unmatched. They can easily be overridden for a platform that uses
the same scheme but different partition types, e.g. the StarFive
VisionFive v2. Firmware is not actually installed, this too is left for
the user.

It is not as simple to create the firmware partitions after the fact,
e.g. with partition indices 3 and 4. It is a shortcoming of current day
u-boot that the SPL loader looks for a specific partition index, rather
than the partition type, meaning that we will fail to boot if partition
2 doesn't contain u-boot.

Thus, our GENERICSD images become more generically usable with current
RISC-V hardware/firmware platforms.

Reviewed by: manu, karels, imp
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43849

3 months agorelease: make SD card partition layout more flexible
Mitchell Horne [Wed, 14 Feb 2024 15:12:29 +0000 (11:12 -0400)]
release: make SD card partition layout more flexible

Currently the partition layout is hardcoded to create an EFI/FAT
partition and a UFS root partition, with some logic to handle GPT/MBR
differences.

On RISC-V platforms we are seeing the emerging pattern that firmware
should be placed in a partition of a known type, rather than just a
known sector of the disk. Thus, some functionality is needed to
customize the layout for SD card images.

Add a hook, arm_create_partitions(), which can be overridden to insert
additional platform-specific partitions, possibly preceding the standard
EFI and UFS ones. A couple of new variables are added to track the
indices, e.g. ROOTFSPART_SUFFIX=p2.

In a couple places this de-duplicates the GPT/MBR logic.

Reviewed by: manu, karels, imp
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43848

3 months agorelease: de-duplicate arm.subr fstab logic
Mitchell Horne [Wed, 14 Feb 2024 15:11:41 +0000 (11:11 -0400)]
release: de-duplicate arm.subr fstab logic

These days, the entries are the identical for GPT and MBR.

Reviewed by: manu, karels, imp
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43847

3 months agobuild: Do not run ctfconvert on VDSO files
Mark Johnston [Tue, 13 Feb 2024 23:06:58 +0000 (18:06 -0500)]
build: Do not run ctfconvert on VDSO files

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43877

3 months agosched_setscheduler(2): Change realtime privilege check
Florian Walpen [Wed, 14 Feb 2024 13:50:44 +0000 (14:50 +0100)]
sched_setscheduler(2): Change realtime privilege check

Check for privilege PRIV_SCHED_SETPOLICY instead of PRIV_SCHED_SET, to
at least make it coherent with what is done at thread creation when
a realtime policy is requested, and have users authorized by
mac_priority(4) pass it.

This change is good enough in practice since it only allows 'root' (as
before) and mac_priority(4)'s authorized users in (the point of this
change), without other side effects.  More changes in this area, to
generally ensure that all privilege checks are consistent, are going to
come as olce's priority revamp project lands.

(olce: Expanded the explanations.)

PR:                     276962
Reported by:            jbeich
Reviewed by:            olce
Approved by:            emaste (mentor)
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D43835

3 months agowlan(4) - remove an(4) reference
Christopher Davidson [Wed, 14 Feb 2024 04:27:13 +0000 (23:27 -0500)]
wlan(4) - remove an(4) reference

Fixes: 663b174b5b53 ("an: Remove driver")
Pull request: https://github.com/freebsd/freebsd-src/pull/1120

3 months agotcp: fix RTO ssthresh for non-6675 pipe calculation
Richard Scheffenegger [Wed, 14 Feb 2024 13:51:39 +0000 (14:51 +0100)]
tcp: fix RTO ssthresh for non-6675 pipe calculation

Follow up on D43768 to properly deal with the non-default
pipe calculation. When CC_RTO is processed, the timeout
will have already pulled back snd_nxt. Further, snd_fack
is not pulled along with snd_una.

Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43876

3 months agounbound: Vendor import 1.19.1
Cy Schubert [Mon, 13 Nov 2023 19:44:16 +0000 (11:44 -0800)]
unbound: Vendor import 1.19.1

Release notes at
    https://www.nlnetlabs.nl/news/2024/Feb/13/unbound-1.19.1-released/

Security: CVE-2023-50387, CVE-2023-50868
MFC after: 3 days

3 months agounbound: Vendor import 1.19.1
Cy Schubert [Mon, 13 Nov 2023 19:44:16 +0000 (11:44 -0800)]
unbound: Vendor import 1.19.1

Release notes at
    https://www.nlnetlabs.nl/news/2024/Feb/13/unbound-1.19.1-released/

3 months agobuild: Default to DWARF4 in the kernel
Mark Johnston [Sun, 11 Feb 2024 18:03:23 +0000 (13:03 -0500)]
build: Default to DWARF4 in the kernel

gcc 12 defaults to emitting DWARF 5, but this is not yet supported by
our libdwarf and thus by ctfconvert.

Reviewed by: emaste, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43837

3 months agoUpdate tzcode to 2024a.
Dag-Erling Smørgrav [Tue, 13 Feb 2024 20:20:44 +0000 (21:20 +0100)]
Update tzcode to 2024a.

MFC after: 3 weeks
Sponsored by: Klara, Inc.

3 months agoImport tzcode 2024a
Dag-Erling Smørgrav [Tue, 13 Feb 2024 18:30:52 +0000 (19:30 +0100)]
Import tzcode 2024a

3 months agodot.profile: handle symlinked $HOME
Edward Tomasz Napierala [Wed, 9 Jan 2019 11:04:27 +0000 (11:04 +0000)]
dot.profile: handle symlinked $HOME

Reapply 4cea05a273c875b5d5d4c41bfa6f2f0a60fa4a66:

    Make sh(1) recognize the default $HOME.  By default /home
    is a symlink; without this change, when you log in, sh(1)
    won't realize the current directory (eg '/usr/home/test')
    is the same as $HOME ('/home/test').

/home is no longer a symlink by default, but new users may be added on
systems that started out with an earlier version of FreeBSD (and still
have /home as a symlink) or admins may do so.

This test is not particularly expensive, so just restore it.

Suggested by: danfe, brooks

3 months agoFix typo in da flags reporting
Dan Kotowski [Tue, 13 Feb 2024 17:42:13 +0000 (10:42 -0700)]
Fix typo in da flags reporting

ANNOUCNED -> ANNOUNCED

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41948

3 months agox86/ucode: add const where appropriate
Chuck Silvers [Tue, 13 Feb 2024 16:15:25 +0000 (08:15 -0800)]
x86/ucode: add const where appropriate

Sponsored by:   Netflix
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43865

3 months agortld: add some dlopen tests
Kyle Evans [Tue, 13 Feb 2024 15:38:02 +0000 (09:38 -0600)]
rtld: add some dlopen tests

dlopen_basic just tests that libthr.so can be dlopen()ed, which will
just serve as a sanity check that "libthr.so" is a thing that can be
dlopened in case we get a weird failure in dlopen_recursing.

dlopen_recursing tests a regression reported after the libsys split,
where some dlopen() may cause infinite recursion and a resulting crash.
This case is inspired by bdrewery's description of what seemed to be
causing his issue.

The corresponding fix landed in commit
968a18975ad ("rtld: ignore load_filtees() calls if we already [...]")

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43859

3 months agortld: ignore load_filtees() calls if we already loading filtees for the obj
Konstantin Belousov [Tue, 13 Feb 2024 01:09:03 +0000 (03:09 +0200)]
rtld: ignore load_filtees() calls if we already loading filtees for the obj

in addition to avoiding it for already loaded filtees. Issue is that
during load, rtld needs to resolve some special ABI symbols, like
executable stack fixer and static TLS initializer, which might trigger
recursion.

Example is libthr which is filter for libsys, and which exports
__pthread_distribute_static_tls.

Tested by: kevans, krion
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43858

3 months agortld load_filtees(): reindent and reduce block nesting
Konstantin Belousov [Tue, 13 Feb 2024 01:19:43 +0000 (03:19 +0200)]
rtld load_filtees(): reindent and reduce block nesting

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43858

3 months agortld symlook_obj: move common code to check filtees into helper
Konstantin Belousov [Tue, 13 Feb 2024 00:48:42 +0000 (02:48 +0200)]
rtld symlook_obj: move common code to check filtees into helper

Revieved by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43858

3 months agoarm: Add EARLY_PRINTF and SOCDEV_PA/VA to NOTES
Andrew Turner [Tue, 13 Feb 2024 10:08:11 +0000 (10:08 +0000)]
arm: Add EARLY_PRINTF and SOCDEV_PA/VA to NOTES

This ensures they are build tested.

Sponsored by:   Arm Ltd

3 months agodev/uart: Support 8-byte register access
Andrew Turner [Tue, 9 Jan 2024 13:29:47 +0000 (13:29 +0000)]
dev/uart: Support 8-byte register access

While we only support 4-byte registers in the uart code the physical
access may be to an 8-byte register. Support this as an option on
non-i386. On i386 we lack the needed 8-byte bus_space functions.

ACPI has an option for 8-byte register io width, and FDT can be given
any size. Support these sizes, even if we don't expect to see hardware
with an 8-byte io width.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43374

3 months agoarm64: Add EARLY_PRINTF and SOCDEV_PA to NOTES
Andrew Turner [Mon, 8 Jan 2024 17:25:02 +0000 (17:25 +0000)]
arm64: Add EARLY_PRINTF and SOCDEV_PA to NOTES

This ensures they are build tested.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43364

3 months agodev/uart: Support the pl011 uart in hw.uart.console
Andrew Turner [Mon, 8 Jan 2024 15:24:33 +0000 (15:24 +0000)]
dev/uart: Support the pl011 uart in hw.uart.console

Add the pl011 uart to the list of supported uarts for use by
hw.uart.console. This is commonly found in Arm based devices, and a
variant is standardised in the Arm SBSA.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43363

3 months agodev/uart: Support setting the register io width
Andrew Turner [Mon, 8 Jan 2024 15:22:58 +0000 (15:22 +0000)]
dev/uart: Support setting the register io width

Some uarts require a specific register width. Support setting this in
the kernel environment.

Reviewed by: imp (earlier version)
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43362

3 months agodev/uart: Use a linker set to find uart classes
Andrew Turner [Mon, 8 Jan 2024 15:02:29 +0000 (15:02 +0000)]
dev/uart: Use a linker set to find uart classes

When the uart is configured via the environment we need to find the
uart class with a specified name. Currently to do this with an
incomplete list of uarts. As we may not have included all uarts in the
kernel each class is defined as weak.

Switch to a linker set so the list is always up to date based on what
is included in the kernel, and the class can be static.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43361

3 months agosys: Simplify enabling EARLY_PRINTF uarts
Andrew Turner [Mon, 8 Jan 2024 14:45:51 +0000 (14:45 +0000)]
sys: Simplify enabling EARLY_PRINTF uarts

Support selecting the early uart with "options EARLY_PRINTF=foo" in
the kernel configuration file. This allows us to not have to change
source files when enabling EARLY_PRINTF, simplifying enabling it.

New uart drivers can be enabled by defining a new early_printf_foo
value to be unique, then using "#if CHECK_EARLY_PRINTF(foo)" to decide
when to enable the uart.

While here add pl011 early printf support.

Reviewed by: imp (earlier version)
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43360

3 months agoarm: Clean up socdev_va
Andrew Turner [Mon, 8 Jan 2024 14:43:32 +0000 (14:43 +0000)]
arm: Clean up socdev_va

Support socdev_va on arm and ensure the variable is available on arm64.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43359

3 months agodomainname(1): Grammar fix
Chia-Jung Chang [Fri, 12 Jan 2024 02:30:46 +0000 (10:30 +0800)]
domainname(1): Grammar fix

Event: Advanced UNIX programming course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1038

3 months agohostname(1): Grammar fix
Chia-Jung Chang [Fri, 12 Jan 2024 02:15:01 +0000 (10:15 +0800)]
hostname(1): Grammar fix

Event: Advanced UNIX programming course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1037

3 months agodate(1): Grammar fixes
Chia-Jung Chang [Fri, 12 Jan 2024 01:58:35 +0000 (09:58 +0800)]
date(1): Grammar fixes

Event: Advanced UNIX programming course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1035

3 months agocp(1): Grammar fix in comment
Chia-Jung Chang [Fri, 12 Jan 2024 01:36:41 +0000 (09:36 +0800)]
cp(1): Grammar fix in comment

Event: Advanced UNIX programming course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1033

3 months agodf(1): Fix grammar
Chia-Jung Chang [Thu, 11 Jan 2024 22:49:37 +0000 (06:49 +0800)]
df(1): Fix grammar

Event: Advance UNIX programming course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1027

3 months agoed(1): Fix grammar in comment
Chia-Jung Chang [Thu, 11 Jan 2024 22:22:32 +0000 (06:22 +0800)]
ed(1): Fix grammar in comment

Event: Advanced UNIX programming course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1025

3 months agomana: fix leaking pci resource problem detaching mana deivces
Wei Hu [Tue, 13 Feb 2024 09:21:14 +0000 (09:21 +0000)]
mana: fix leaking pci resource problem detaching mana deivces

Fixing the error messages when detaching the mana gdma devices
showed in dmesg: "Device leaked memory resources".

Reported by: NetApp
MFC after: 3 days
Sponsored by: Microsoft

3 months agogrowfs(8): Grammar fix
HUANG,YU-JIA [Sat, 13 Jan 2024 14:07:33 +0000 (22:07 +0800)]
growfs(8): Grammar fix

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1056

3 months agogrowfs(8): Fix spelling
HUANG,YU-JIA [Sat, 13 Jan 2024 13:46:28 +0000 (21:46 +0800)]
growfs(8): Fix spelling

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1055

3 months agolibusb(3): Fix link in comment
Ting-Hsuan Huang [Fri, 12 Jan 2024 11:55:00 +0000 (19:55 +0800)]
libusb(3): Fix link in comment

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1042

3 months agolibbsdstat: Fix typo in bsdstat.h
Cheng-Yuan Wu [Fri, 12 Jan 2024 08:51:17 +0000 (16:51 +0800)]
libbsdstat: Fix typo in bsdstat.h

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1040

3 months agolibbe(3): Fix typo and grammar
Cheng-Yuan Wu [Fri, 12 Jan 2024 09:11:30 +0000 (17:11 +0800)]
libbe(3): Fix typo and grammar

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1039

3 months agodmesg(8): Fix typo timetamps -> timestamps
Yi-Chen Li [Fri, 12 Jan 2024 07:56:41 +0000 (15:56 +0800)]
dmesg(8): Fix typo timetamps -> timestamps

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1036

3 months agodevmatch(8): Grammar fix
Yi-Chen Li [Fri, 12 Jan 2024 07:50:01 +0000 (15:50 +0800)]
devmatch(8): Grammar fix

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1034

3 months agocomcontrol(8): Grammar fix
Yi-Chen Li [Fri, 12 Jan 2024 07:10:53 +0000 (15:10 +0800)]
comcontrol(8): Grammar fix

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1032

3 months agoccdconfig(8): Minor grammar fix
Yi-Chen Li [Fri, 12 Jan 2024 06:49:14 +0000 (14:49 +0800)]
ccdconfig(8): Minor grammar fix

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1031

3 months agocamcontrol(8): Fix grammar: a ATA -> an ATA
Yi-Chen Li [Fri, 12 Jan 2024 06:37:41 +0000 (14:37 +0800)]
camcontrol(8): Fix grammar: a ATA -> an ATA

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1030

3 months agorcorder(8): Fix grammar
Yi-Chen Li [Fri, 12 Jan 2024 05:27:08 +0000 (13:27 +0800)]
rcorder(8): Fix grammar

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1029

3 months agosetkey(8): Grammar fix: a FQDN -> an FQDN
Yi-Chen Li [Thu, 11 Jan 2024 06:31:13 +0000 (14:31 +0800)]
setkey(8): Grammar fix: a FQDN -> an FQDN

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1024

3 months agoveriexec(8): Fix typo
Jui-Hsuan Chang [Tue, 9 Jan 2024 16:36:18 +0000 (00:36 +0800)]
veriexec(8): Fix typo

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1018

3 months agogjournal(8): standardize capitalization for consistency
Cheng-Hsun Lin [Mon, 8 Jan 2024 09:37:47 +0000 (17:37 +0800)]
gjournal(8): standardize capitalization for consistency

Event: Advanced UNIX Programming Course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1017

3 months agostat(1): Fix grammar error in stat.c
LO WEN-CHIEN [Sun, 7 Jan 2024 13:14:12 +0000 (21:14 +0800)]
stat(1): Fix grammar error in stat.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1014

3 months agoar(1): Fix grammar error in write.c
LO WEN-CHIEN [Sun, 7 Jan 2024 13:01:56 +0000 (21:01 +0800)]
ar(1): Fix grammar error in write.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1013

3 months agoinstall(1): Fix typo in usr.bin/xinstall/xinstall.c
LO WEN-CHIEN [Sun, 7 Jan 2024 12:53:10 +0000 (20:53 +0800)]
install(1): Fix typo in usr.bin/xinstall/xinstall.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1012

3 months agoarm64/cmn600: Grammar fix
LO WEN-CHIEN [Sun, 7 Jan 2024 12:32:48 +0000 (20:32 +0800)]
arm64/cmn600: Grammar fix

Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1011

3 months agofdisk(8): Fix typo forth -> fourth
Chih-Chun Wu [Sun, 7 Jan 2024 09:00:36 +0000 (17:00 +0800)]
fdisk(8): Fix typo forth -> fourth

Event: Advanced UNIX Programming Course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1010

3 months agoGrammar fix in share/doc/IPv6/IMPLEMENTATION
Ho-Kun Lin [Fri, 5 Jan 2024 17:56:26 +0000 (01:56 +0800)]
Grammar fix in share/doc/IPv6/IMPLEMENTATION

Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1003

3 months agoipf(8): Fix typo
Shin-Yi Zheng [Fri, 5 Jan 2024 14:02:31 +0000 (22:02 +0800)]
ipf(8): Fix typo

Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1002

3 months agopax(1): Grammar fix in file_subs.c
HUNG-CHI CHANG [Sun, 7 Jan 2024 07:50:25 +0000 (15:50 +0800)]
pax(1): Grammar fix in file_subs.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/999

3 months agorestore(8): Fix typo in restore.h
Yu-Sheng Ma [Fri, 5 Jan 2024 08:42:50 +0000 (16:42 +0800)]
restore(8): Fix typo in restore.h

`operation` was spelled wrongly on line 60.
`dumped` was spelled wrongly on line 74.

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/998

3 months agonvmecontrol(8): Fix typo in ns.c
Yu-Sheng Ma [Fri, 5 Jan 2024 08:11:48 +0000 (16:11 +0800)]
nvmecontrol(8): Fix typo in ns.c

`Insufficient` was spelled wrongly on line 537.

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/997

3 months agorpc: Fix typo in comment
Assume-Zhan [Fri, 5 Jan 2024 04:51:50 +0000 (12:51 +0800)]
rpc: Fix typo in comment

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/995

3 months agoshare/examples/sound: Fix spelling "controller"
Assume-Zhan [Fri, 5 Jan 2024 04:13:58 +0000 (12:13 +0800)]
share/examples/sound: Fix spelling "controller"

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/994

3 months agosh(1): Grammar fix in jobs.c
Fu-Cheng Wang [Thu, 4 Jan 2024 06:15:09 +0000 (14:15 +0800)]
sh(1): Grammar fix in jobs.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/992

3 months agoypldap(8): Fix grammar in ypldap.c
Shi-Xin Huang [Thu, 4 Jan 2024 04:23:09 +0000 (12:23 +0800)]
ypldap(8): Fix grammar in ypldap.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/991

3 months agoed(1): Grammar fixes
Wilbert Allen Koeswoyo Suwito [Wed, 3 Jan 2024 06:15:46 +0000 (14:15 +0800)]
ed(1): Grammar fixes

- Adding a missing verb "is" on line 723
- Changing is to are on line 835

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/986

3 months agochio(8): Fix typo in the copyright section
Wilbert Allen Koeswoyo Suwito [Tue, 2 Jan 2024 13:21:07 +0000 (21:21 +0800)]
chio(8): Fix typo in the copyright section

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/978

3 months agoFix typo in share/examples/sunrpc/dir/rls.c
YuZhong-Chen [Mon, 1 Jan 2024 09:20:01 +0000 (17:20 +0800)]
Fix typo in share/examples/sunrpc/dir/rls.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/974

3 months agoFix typo in share/examples/sound/ossinit.h
YuZhong-Chen [Mon, 1 Jan 2024 08:25:52 +0000 (16:25 +0800)]
Fix typo in share/examples/sound/ossinit.h

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/974

3 months agoFix grammar error in test/sys/file/closefrom_test.c
Yen-Cheng Chang [Mon, 1 Jan 2024 06:38:02 +0000 (14:38 +0800)]
Fix grammar error in test/sys/file/closefrom_test.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/973

3 months agodump(8): Fix typo in comment
yue0211 [Sat, 30 Dec 2023 13:17:09 +0000 (21:17 +0800)]
dump(8): Fix typo in comment

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/968

3 months agoping(8): Fix typo in ping6.c
Hao-Yu Hou [Sat, 30 Dec 2023 09:59:27 +0000 (17:59 +0800)]
ping(8): Fix typo in ping6.c

Line 703 & 863: kerel -> kernel
Line 2110: resposne -> response

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/967

3 months agosysctl(8): Fix typo in comment
Hao-Yu Hou [Sat, 30 Dec 2023 09:36:11 +0000 (17:36 +0800)]
sysctl(8): Fix typo in comment

Line214: combind -> combine

Reviewed by: zlai
Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Request: https://github.com/freebsd/freebsd-src/pull/966

3 months agorescue: Fix after zfsbootcfg addition
Warner Losh [Mon, 12 Feb 2024 22:10:37 +0000 (15:10 -0700)]
rescue: Fix after zfsbootcfg addition

Get the library dependencies correct for zfsbootcfg. libzfsbootcfg
depends on a all of these...

Fixes: ac4847e6b0e9
Sponsored by: Netflix

3 months agorc.subr add Exists so we can find sed
Simon J. Gerraty [Mon, 12 Feb 2024 22:39:20 +0000 (14:39 -0800)]
rc.subr add Exists so we can find sed

SED=`Exists -x /usr/bin/sed /rescue/sed`

avoids adding /rescure to $PATH, and allows use of sed
before /usr is mounted (if a separate filesystem).

Reviewed by: jlduran_gmail.com
Differential Revision: https://reviews.freebsd.org/D43826

3 months agolibsecureboot do not report expected unverified files
Simon J. Gerraty [Mon, 12 Feb 2024 22:35:01 +0000 (14:35 -0800)]
libsecureboot do not report expected unverified files

By default only report unverified files at severity VE_WANT
and above.  This inlcudes *.conf but not *.hints, *.cookie
or *.tgz which get VE_TRY as their severity.

If Verbose is set to 0, then VerifyFlags should default to 0 too.
Thus the combination of

module_verbose=0
VE_VEBOSE=0

is sufficient to make the loader almost totally silent.

When verify_prep has to find_manifest and it is verified ok
return VE_NOT_CHECKED to verify_file so that it can skip
repeating verify_fd

Also add better debugging output for is_verified and add_verify_status.

vectx handle compressed modules

When verifying a compressed module (.ko.gz or .ko.bz2)
stat() reports the size as -1 (unknown).
vectx_lseek needs to spot this during closing - and just read until
EOF is hit.

Note: because of the way libsa's open() works, verify_prep will see
the path to be verified as module.ko not module.ko.bz2 etc.  This is
actually ok, because we need a separate module.ko.bz2 entry so that
the package can be verified, and the hash for module.ko is of the
uncompressed file which is what vectx will see.

Re-work local.trust.mk so site.trust.mk need only set
VE_SIGN_URL_LIST (if using the mentioned signing server)

interp.c: restrict interactive input

Apply the same restrictions to interactive input as for
unverified conf and hints files.

Use version.veriexec when LOADER_VERIEXEC is yes

Reviewed by: kevans
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D43810

3 months agotcp: partially undo D43792
Richard Scheffenegger [Mon, 12 Feb 2024 20:43:18 +0000 (21:43 +0100)]
tcp: partially undo D43792

At the destruction of the tcpcb, no timers are supposed to
be running. However, it turns out that stopping them in the
close() / shutdown() call does not have the desired effect
under all circumstances.

This partially reverts 62d47d73b7eb to reduce the nuisance
caused.

PR: 277009
Reported-by: syzbot+9a9aa434a14a2b35c3ba@syzkaller.appspotmail.com
Reported-by: syzbot+e82856782410e895bae7@syzkaller.appspotmail.com
Reviewed By: glebius, tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43855

3 months agorescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh
Warner Losh [Mon, 12 Feb 2024 18:46:20 +0000 (11:46 -0700)]
rescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh

Reboot now emulates the nextboot shell script completely. Retire the
nextboot.sh script and install the link. Retain the same manual page,
since there's enough differences between nextboot and reboot that
talking about nextboot would likely be confusing in nextboot.8

The nextboot.sh script no longer exists, so doesn't need to be fixed up
to create rescue. However, now we need a link from nextboot to reboot.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43831
Differential Revision: https://reviews.freebsd.org/D43843

3 months agoreboot: Allow this to be installed as nextboot
Warner Losh [Mon, 12 Feb 2024 18:46:11 +0000 (11:46 -0700)]
reboot: Allow this to be installed as nextboot

Allow nextboot to be a symlink link to reboot. It does everything reboot
does, except doesn't actually setup the sytem to reboot and reboot. Also,
don't accept the reboot args related to rebooting when in nextboot mode.

Sponsored by: Netflix
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43830

3 months agoreboot: Implement -o to set kernel options for next boot
Warner Losh [Mon, 12 Feb 2024 18:46:03 +0000 (11:46 -0700)]
reboot: Implement -o to set kernel options for next boot

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43829

3 months agoreboot: Implement -k in terms of env
Warner Losh [Mon, 12 Feb 2024 18:45:54 +0000 (11:45 -0700)]
reboot: Implement -k in terms of env

kernel isn't special, beyond the sanity checks we do. Add it to the env
rather than pass it into write_nextboot().

Sponsored by: Netflix
Reviewed by: kevans, kib
Differential Revision: https://reviews.freebsd.org/D43828

3 months agoreboot: Implement -e from nextboot
Warner Losh [Mon, 12 Feb 2024 18:45:48 +0000 (11:45 -0700)]
reboot: Implement -e from nextboot

Implement -e foo=bar to add loader environment variables to
nextboot.conf. bar is enclosed in quotes if it isn't already.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43827

3 months agoreboot: Implement zfs support
Warner Losh [Mon, 12 Feb 2024 18:45:37 +0000 (11:45 -0700)]
reboot: Implement zfs support

Implement full support for ZFS -k support. For ZFS, we have to set a
property that gets cleared by the boot loaeder for whether or not to
process nextboot.conf. Do this using system("zfsbootcfg..." rather than
coding the small subset of that program inline to avoid CDDL
contamination of reboot and the complications of disabling CDDL and/or
ZFS. The few bytes needed to implement reboot for systems with zfs is
not worth saving for systems w/o ZFS.

Only set nextboot_enable=YES for UFS filesystems. They are the only one
that need that as the first line. Its presence on ZFS can cause the
kernel to not be oneshot.

Sponsored by: Netflix
Reviewed by: kevans, kib
Differential Revision: https://reviews.freebsd.org/D43824

3 months agoreboot: Implement -D from nextboot
Warner Losh [Mon, 12 Feb 2024 18:45:29 +0000 (11:45 -0700)]
reboot: Implement -D from nextboot

Implement -D from nextboot.sh which deletes the nextboot.conf file and
exists.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43822

3 months agoreboot: Add sanity checking of write to nextboot.conf
Warner Losh [Mon, 12 Feb 2024 18:45:20 +0000 (11:45 -0700)]
reboot: Add sanity checking of write to nextboot.conf

Add sanity checking to the write to nextboot. Move to separate function
and allow force to override all errors. If we can't write nextboot.conf,
don't silently fail anymore.

Sponsored by: Netflix
Reviewed by: kevans, kib, markj, jhb
Differential Revision: https://reviews.freebsd.org/D43803

3 months agoreboot: Don't reboot if the next kernel isn't there
Warner Losh [Mon, 12 Feb 2024 18:45:01 +0000 (11:45 -0700)]
reboot: Don't reboot if the next kernel isn't there

reboot -k garbage won't boot garbage unless /boot/garbage/kernel is
there. Refuse to reboot if it is missing, though allow -f to force
it for special-use cases. This is in keeping with nextboot.sh.

Sponsored by: Netflix
Reviewed by: kevans, kib, markj, emaste
Differential Revision: https://reviews.freebsd.org/D43802

3 months agoreboot: convert flags to bools
Warner Losh [Mon, 12 Feb 2024 18:44:52 +0000 (11:44 -0700)]
reboot: convert flags to bools

Convert all the command line flags to bools, since that's how we use
them. Sort the includes while adding stdbool.h.

Sponsored by: Netflix
Reviewed by: kevans, kib, emaste
Differential Revision: https://reviews.freebsd.org/D43801

3 months agoreboot: Disallow -k and -r, it doesn't make sense.
Warner Losh [Mon, 12 Feb 2024 18:44:43 +0000 (11:44 -0700)]
reboot: Disallow -k and -r, it doesn't make sense.

When we're re-rooting to a new /, there is no next kernel. Error out
rather than leaving a timebomb in /boot/nextboot.conf.

Sponsored by: Netflix
Reviewed by: kevans, kib, emaste
Differential Revision: https://reviews.freebsd.org/D43800

3 months agorescue: belatedly add zfsbootcfg
Warner Losh [Mon, 12 Feb 2024 18:44:32 +0000 (11:44 -0700)]
rescue: belatedly add zfsbootcfg

nextboot.sh uses zfsbootcfg to enable nextboot functionality for ZFS,
but zfsbootcfg was never added. Add it now since the nextboot binary
that replaced the script also uses it via system.

Sponsored by: Netflix
Reviewed by: kevans, kib, emaste
Differential Revision: https://reviews.freebsd.org/D43844

3 months agozfsbootcfg: Remove bogus CFLAGS
Warner Losh [Mon, 12 Feb 2024 18:44:22 +0000 (11:44 -0700)]
zfsbootcfg: Remove bogus CFLAGS

When using the zfsbootcfg library, we're talking only to it, not to the
rest of ZFS, nor are we using anything that needs access to the ZFS
compilation environment. Remove all the compiling OpenZFS itself flags.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43823

3 months agopatch: Support long context lines.
Dag-Erling Smørgrav [Mon, 12 Feb 2024 18:26:13 +0000 (19:26 +0100)]
patch: Support long context lines.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D43850

3 months agofiles: make uart_bus_puc.c not depend on puc
Emmanuel Vadot [Mon, 12 Feb 2024 17:18:20 +0000 (18:18 +0100)]
files: make uart_bus_puc.c not depend on puc

If one wants to have puc working as a module we need the bus
in the kernel otherwise we won't be able to find any child to attach.

Reviewed by: imp
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43846

3 months agostyle.lua.9: remove mention of $FreeBSD$
Ed Maste [Mon, 12 Feb 2024 15:36:36 +0000 (10:36 -0500)]
style.lua.9: remove mention of $FreeBSD$

Also restore a comment line in an example which previously started with
-- $FreeBSD$ but was removed in 6ef644f5889a.  The example shows the of
a module require statement block following the license header.

3 months ago.profile: Don't bother checking for /home symlink
Collin Funk [Sun, 4 Feb 2024 12:04:52 +0000 (04:04 -0800)]
.profile: Don't bother checking for /home symlink

Since FreeBSD 14.0, user directories are created directly under /home.
This check should no longer be needed.

This reverts commit 4cea05a273c875b5d5d4c41bfa6f2f0a60fa4a66.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1102

3 months agosnd_uaudio.4: document sysctls
Christos Margiolis [Mon, 12 Feb 2024 11:06:00 +0000 (13:06 +0200)]
snd_uaudio.4: document sysctls

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D43649

3 months agosnd_uaudio.4: remove useless .Tn macro
Christos Margiolis [Mon, 12 Feb 2024 11:05:55 +0000 (13:05 +0200)]
snd_uaudio.4: remove useless .Tn macro

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D43651

3 months agosnd_uaudio: mark selected configurations
Christos Margiolis [Mon, 12 Feb 2024 11:05:47 +0000 (13:05 +0200)]
snd_uaudio: mark selected configurations

snd_uaudio(4) selects the first maching rate/channel/bit/format/buffer
configuration for use during attach, even though it will print the rest
of the supported configurations detected. To make this clear, mark the
selected playback and recording configurations with a "selected" string.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D43766

3 months agosound: remove snddev_info->inprog and pcm_inprog()
Christos Margiolis [Mon, 12 Feb 2024 11:05:33 +0000 (13:05 +0200)]
sound: remove snddev_info->inprog and pcm_inprog()

No longer used.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43737

3 months agosnd_uaudio(4): Fix config detection with defaults set.
Florian Walpen [Mon, 12 Feb 2024 11:05:27 +0000 (13:05 +0200)]
snd_uaudio(4): Fix config detection with defaults set.

Let the USB audio descriptor iteration detect configurations with more
channels and larger sample size, even when the following global sysctl
tunables are set to a lower value:

hw.usb.uaudio.default_channels hw.usb.uaudio.default_bits

This improves utility and is closer to the meaning of default.

Also, do not create duplicate sample rate entries.

MFC after: 2 weeks
Reviewed by:    christos
Differential Revision: https://reviews.freebsd.org/D43679

3 months agosnd_uaudio(4): Adapt buffer length to buffer_ms tunable.
Florian Walpen [Mon, 12 Feb 2024 11:04:57 +0000 (13:04 +0200)]
snd_uaudio(4): Adapt buffer length to buffer_ms tunable.

Adapt the length of the driver side audio buffer to the USB transfer
interval, which is adjustable through the buffer_ms tunable. This
eliminates unnecessary latency in USB audio playback.

To reduce power consumption caused by frequent CPU wakeups, increase the
default buffer_ms value to 4ms. In combination with adaptive buffer
length, this still results in less roundtrip latency compared to the
previous 2ms default.

Extend the buffer_ms value range to 1ms for low latency applications.

MFC after: 2 weeks
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D41942