]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 months agodtrace: remove unused defines
Mitchell Horne [Wed, 11 Jan 2023 18:05:38 +0000 (14:05 -0400)]
dtrace: remove unused defines

Reviewed by: markj, emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37659

17 months agodtrace: include fbt module unconditionally
Mitchell Horne [Wed, 11 Jan 2023 18:05:18 +0000 (14:05 -0400)]
dtrace: include fbt module unconditionally

It is supported on all platforms.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37658

17 months agoriscv: always include frame pointer
Mitchell Horne [Wed, 11 Jan 2023 18:04:45 +0000 (14:04 -0400)]
riscv: always include frame pointer

Specifically it is missing in kernel modules, meaning a proper backtrace
can't be constructed.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37657

17 months agoClarify DTR_ENABLED make variable
Mitchell Horne [Tue, 3 Jan 2023 17:54:15 +0000 (13:54 -0400)]
Clarify DTR_ENABLED make variable

Rename it to DTRACE_ENABLED.

Suggested by: jhb
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

17 months agox86: ignore stepping for APL30 errata
Corvin Köhne [Thu, 12 Jan 2023 08:59:28 +0000 (09:59 +0100)]
x86: ignore stepping for APL30 errata

The issue is present in all apollolake cpus and it doesn't look like
there'll be a fix in the future.

See
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/pentium-celeron-n-series-j-series-datasheet-spec-update.pdf

MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37621

17 months agoRevert "gssd: Fix handling of the gssname=<name> NFS mount option"
Rick Macklem [Thu, 12 Jan 2023 02:23:17 +0000 (18:23 -0800)]
Revert "gssd: Fix handling of the gssname=<name> NFS mount option"

This reverts commit c33509d49a6fdcf86ef280a78f428d3cb7012c4a.

It turns out that the long 27 second delay I saw in the
gss_acquire_cred() call was caused by a (mis)configured
DNS.  Although I did not specify "dns" in /etc/nsswitch.conf,
I did have a /etc/resolv.conf file on the system (left
there by wpa_supplicant).  As such, with no route, it was
somehow trying to contact the DNS server, although there was none.

Once I got rid of the /etc/resolv.conf file, it worked
as expected.

Since there is now a large 5 minute timeout on the
kernel to gssd(8) upcalls, the gssd(8) daemon will not
get terminated when this delay occurs and the only affect
is a 30 second delay during the mount.

Discussed with: bjk

17 months agoLinuxKPI: fix possible NULL dereference in linuxkpi_page_frag_alloc()
Bjoern A. Zeeb [Wed, 11 Jan 2023 23:40:05 +0000 (23:40 +0000)]
LinuxKPI: fix possible NULL dereference in linuxkpi_page_frag_alloc()

Fix a possible NULL pointer deref in case alloc_pages() fails.
This is theoretical so far as up to now no code in the tree uses
linuxkpi_page_frag_alloc().

Reported by: Coverity via emaste
Coverity ID: 1502345
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-MFC-with: 55038a6306a570c9f2df89f5ad076de0f7d98152

17 months agostand: create common set_currdev
Warner Losh [Wed, 11 Jan 2023 22:14:28 +0000 (15:14 -0700)]
stand: create common set_currdev

Pull together the nearly identical copies of set_currdev in i386,
userboot and efi. Other boot loaders have variances that might be fine
to use the common routine, or not. Since they are harder to test for me,
and ofw and uboot do handle these setting differently, leave them be for
now.

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

17 months agostand: Move dev_cleanup into libsa
Warner Losh [Wed, 11 Jan 2023 22:14:17 +0000 (15:14 -0700)]
stand: Move dev_cleanup into libsa

Since dev_cleanup() walks through all the devsw devices with dv_cleanup
rotuines, move it into libsa rather than having it in
'common'. Logically, it operates only on things that are in libsa, and
would never be different for different loaders: either people would call
it as is, or they'd do the loop themselves with 'special' things inline
between calls to cleanup (not that I think that will ever be needed
though).

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

17 months agostand: Create common gen_setcurrdev and replace code
Warner Losh [Wed, 11 Jan 2023 22:14:02 +0000 (15:14 -0700)]
stand: Create common gen_setcurrdev and replace code

Replace 4 identical copies of *_setcurrdev with gen_setcurrdev to avoid
having to create a 5th copy. uboot_setcurrdev is actually different and
needs to remain separate (even though it's quite similar).

Sponsored by: Netflix
Reviewed by: fuz@fuz.su, kevans
Differential Revision: https://reviews.freebsd.org/D38003

17 months agonfscl: Improve NFSv4 error message for NFSERR_WRONGSEC
Rick Macklem [Wed, 11 Jan 2023 21:28:44 +0000 (13:28 -0800)]
nfscl: Improve NFSv4 error message for NFSERR_WRONGSEC

The usual reason for an NFSv4 server replying NFSERR_WRONGSEC
to an operation is that a Kerberos credential is required.
This patch replaces a cryptic "err=10016" with a message
suggesting that a Kerberos TGT is probably needed.

MFC after: 2 weeks

17 months agokgssapi: Increase timeout for kernel to gssd(8) upcalls
Rick Macklem [Wed, 11 Jan 2023 21:20:31 +0000 (13:20 -0800)]
kgssapi: Increase timeout for kernel to gssd(8) upcalls

It turns out that the underlying problem that caused
a Kerberized NFS mount with the "gssname" option to
fail was that the kernel upcall to the gssd(8) daemon
would time out prematurely after 25 seconds.  The
gss_acquire_cred() GSSAPI library call
takes about 27 seconds for the case where a desired_name
argument is specified.  A similarly long delay occurs
when the gss_init_sec_context() call is made and the
user principal's TGT has expired.

Once the upcall timed out, the kernel code assumed that
the gssd(8) daemon had died and closed the socket.
Ironically, closing the socket did cause the gssd(8)
daemon to terminate via a SIGPIPE signal.

This patch increases the timeout to 5 minutes.  Since
a timeout should only occur when the gssd(8) daemon
has died, a long timeout should be ok and seems to fix this
problem.

I still think that commit c33509d49a should remain in the
system, since it allows the mount to complete quickly
and not take nearly 30 seconds.

PR: 268823
MFC after: 2 weeks

17 months agotests: Add an IPv4 loopback address of 127.0.0.1/8 to the lo0
Jose Luis Duran [Wed, 11 Jan 2023 14:33:58 +0000 (14:33 +0000)]
tests: Add an IPv4 loopback address of 127.0.0.1/8 to the lo0
 interface by default when creating VNETSs using pytest.

Reviewed By: asomers
Differential Revision: https://reviews.freebsd.org/D38021

17 months agoqat(4): Fix common typos in source code comments
Gordon Bergling [Wed, 11 Jan 2023 12:27:56 +0000 (13:27 +0100)]
qat(4): Fix common typos in source code comments

- s/desciptor/descriptor/

MFC after: 3 days

17 months agoiwmbtfw(8): Fix a typo in a kernel message
Gordon Bergling [Wed, 11 Jan 2023 11:22:18 +0000 (12:22 +0100)]
iwmbtfw(8): Fix a typo in a kernel message

- s/succesful/successful/

MFC after: 5 days

17 months agotty(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 11:12:48 +0000 (12:12 +0100)]
tty(4): Fix a typo in a source code comment

- s/charaters/characters/

MFC after: 3 days

17 months agotcp_rack(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 11:02:25 +0000 (12:02 +0100)]
tcp_rack(4): Fix a typo in a source code comment

- s/postion/position/

MFC after: 3 days

17 months agolibiscsiutil: Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 10:52:55 +0000 (11:52 +0100)]
libiscsiutil: Fix a typo in a source code comment

- s/sesion/session/

MFC after: 3 days

17 months agolibthr(3): Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 10:48:14 +0000 (11:48 +0100)]
libthr(3): Fix a typo in a source code comment

- s/extentions/extensions/

MFC after: 3 days

17 months agotzcode: Move configuration into separate header.
Dag-Erling Smørgrav [Wed, 11 Jan 2023 09:20:46 +0000 (10:20 +0100)]
tzcode: Move configuration into separate header.

MFC after: 1 week
Sponsored by: Klara, Inc.

17 months agotcp_hpts: Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 10:33:29 +0000 (11:33 +0100)]
tcp_hpts: Fix a typo in a source code comment

- s/subract/subtract/

MFC after: 3 days

17 months agoi386: Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 10:29:23 +0000 (11:29 +0100)]
i386: Fix a typo in a source code comment

- s/betwen/between/

MFC after: 3 days

17 months agogit-arc.1: Fix a typo in the manual page
Gordon Bergling [Wed, 11 Jan 2023 10:28:20 +0000 (11:28 +0100)]
git-arc.1: Fix a typo in the manual page

- s/betwen/between/

MFC after: 3 days

17 months agocxgbe(4): Fix a few common typos in source code comments
Gordon Bergling [Wed, 11 Jan 2023 09:53:07 +0000 (10:53 +0100)]
cxgbe(4): Fix a few common typos in source code comments

- s/Reqests/Requests/

MFC after: 3 days

17 months agovr(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 09:51:34 +0000 (10:51 +0100)]
vr(4): Fix a typo in a source code comment

- s/reuqest/request/

MFC after: 3 days

17 months agoice: Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 09:50:32 +0000 (10:50 +0100)]
ice: Fix a typo in a source code comment

- s/reqest/requests/

MFC after: 3 days

17 months agomvs(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 09:49:22 +0000 (10:49 +0100)]
mvs(4): Fix a typo in a source code comment

- s/reqests/requests/

MFC after: 3 days

17 months agomrsas(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 09:48:14 +0000 (10:48 +0100)]
mrsas(4): Fix a typo in a source code comment

- s/reqest/request/

MFC after: 3 days

17 months agoahci(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 11 Jan 2023 09:46:58 +0000 (10:46 +0100)]
ahci(4): Fix a typo in a source code comment

- s/reqests/requests/

MFC after: 3 days

17 months agoisci(4): Fix common typos in source code comments
Gordon Bergling [Wed, 11 Jan 2023 09:45:08 +0000 (10:45 +0100)]
isci(4): Fix common typos in source code comments

- s/reuqest/request/
- s/requst/request/

MFC after: 3 days

17 months agoqcom_clk: Fix a typo in an error message
Gordon Bergling [Wed, 11 Jan 2023 09:42:09 +0000 (10:42 +0100)]
qcom_clk: Fix a typo in an error message

- s/requsted/requested/

MFC after: 5 days

17 months agovtblk: Bypass iommu on powerpc
Colin Percival [Wed, 28 Dec 2022 06:23:05 +0000 (22:23 -0800)]
vtblk: Bypass iommu on powerpc

Virtio operates with physical addresses, while busdma is designed to
map these to produce bus addresses.  On most supported platforms,
these two are interchangeable; on powerpc platforms, they are not.

When on powerpc, set an IOMMU of NULL, which causes the powerpc busdma
code to bypass the iommu mapping; this leaves us with the physical
buffer addresses which the virtio host expects to see.

Tested by: alfredo
Fixes: 782105f7c898 ("vtblk: Use busdma")
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D37891

17 months agotcp: Build RACK and BBR stacks as a part of LINT
Andrew Gallatin [Tue, 10 Jan 2023 21:09:00 +0000 (16:09 -0500)]
tcp: Build RACK and BBR stacks as a part of LINT

When RACK and BBR were added to the kernel, they were put
behind 'WITH_EXTRA_TCP_STACKS=1'.   Unfortunately that was
never added to any NOTES file, so RACK & BBR were not compiled
with the various LINT-NOINET, LINT-NOINET6, and LINT-NOIP kernels.
This lead to the stacks sometimes being broken.

This change:

- Fixes RACK so that it compiles with the various LINT-NO* kernels
- Adds WITH_EXTRA_TCP_STACKS=1 to all NOTES kernels so that
   RACK and BBR are compile tested regularly

Sponsored by: Netflix
Reviewed by: rrs
Differential Revision: https://reviews.freebsd.org/D37903

17 months agolibcasper.3: document cap_init's single-threaded program requirement
Alan Somers [Wed, 11 Jan 2023 03:01:59 +0000 (20:01 -0700)]
libcasper.3: document cap_init's single-threaded program requirement

Because it internally forks.

[skip ci]
MFC after: 1 week
Sponsored by: Axcient
Reviewed by emaste, imp
Differential Revision: https://reviews.freebsd.org/D38020

17 months agotzcode: Address some compiler warnings.
Dag-Erling Smørgrav [Tue, 10 Jan 2023 19:20:11 +0000 (20:20 +0100)]
tzcode: Address some compiler warnings.

MFC after: 1 week
Sponsored by: Klara, Inc.

17 months agoBring our tzcode up to date.
Dag-Erling Smørgrav [Tue, 10 Jan 2023 15:14:27 +0000 (16:14 +0100)]
Bring our tzcode up to date.

* Replay 2010[acflm] which had been merged but not recorded.
* Merge 2010n.
* Reorganize (unsplit) the code to match the upstream layout.
* Merge 2022[cdefg].

MFC after:      1 week
Sponsored by:   Klara, Inc.

17 months agolibc: Fix build with WITHOUT_MACHDEP_OPTIMIZATIONS=YES set.
Gleb Popov [Tue, 10 Jan 2023 10:17:01 +0000 (13:17 +0300)]
libc: Fix build with WITHOUT_MACHDEP_OPTIMIZATIONS=YES set.

Test Plan: `make buildword WITHOUT_MACHDEP_OPTIMIZATIONS=YES` on 14-CURRENT and 13-STABLE

Reviewed by: emaste

Differential Revision: https://reviews.freebsd.org/D38017

PR: 266900

17 months agostress2: Added finding to unionfs9.sh and updated the exclude list
Peter Holm [Tue, 10 Jan 2023 05:33:14 +0000 (06:33 +0100)]
stress2: Added finding to unionfs9.sh and updated the exclude list

17 months agoifnet/API: Change if_set*bit accessors to clear first
Justin Hibbits [Mon, 9 Jan 2023 19:24:08 +0000 (14:24 -0500)]
ifnet/API: Change if_set*bit accessors to clear first

Summary:
A common pattern has been to:

if (foo)
caps = IFCAP_FOO;
ifp->if_capenable &= ~IFCAP_FOO;
ifp->if_capenable |= caps;

which in the new order of things would be:

if (foo)
caps = IF_FOO;
if_setcapenablebits(ifp, 0, IFCAP_FOO);
if_setcapenablebits(ifp, caps, 0);

This change streamlines this into:

if (foo)
caps = IF_FOO;
if_setcapenablebits(ifp, caps, IFCAP_FOO);

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

17 months agotools/build: Always bootstrap (sys/)bitstring.h
Brooks Davis [Mon, 9 Jan 2023 19:09:48 +0000 (19:09 +0000)]
tools/build: Always bootstrap (sys/)bitstring.h

Older, supported FreeBSD versions lack bit_ntest() so hoist the boostrap
installation out of the OS!=FreeBSD case and always install it.  A more
precise criteria is possible, but would add little value.

This fixes bootstrapping makefs as a build tool on 13.1.

Reviewed by: jrtc27, emaste
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D37951

17 months agoifconfig: abort if loading a module fails other than for ENOENT
Alan Somers [Mon, 26 Dec 2022 02:06:21 +0000 (19:06 -0700)]
ifconfig: abort if loading a module fails other than for ENOENT

If "ifconfig create" tries to load a kernel module, and the module
exists but can't be loaded, fail the command with a useful error
message.  This is helpful, for example, when trying to create a cloned
interface in a vnet jail.  But ignore ENOENT, because sometimes ifconfig
can't correctly guess the name of the required kernel module.

MFC after: 2 weeks
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D37873

17 months agoSwitch wg(4) to the new if_clone KPI
Alan Somers [Sun, 18 Dec 2022 20:12:02 +0000 (13:12 -0700)]
Switch wg(4) to the new if_clone KPI

MFC after: 2 weeks
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D37740

17 months agolibc: Fix longjmp/_longjmp(buf, 0) for AArch64 and RISC-V
Jessica Clarke [Mon, 9 Jan 2023 18:34:43 +0000 (18:34 +0000)]
libc: Fix longjmp/_longjmp(buf, 0) for AArch64 and RISC-V

These architectures fail to handle this special case, and will cause the
corresponding setjmp/_setjmp to return 0 rather than 1. Fix this and add
regression tests (also committed upstream).

PR: 268684
Reviewed by: arichardson, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29363

17 months agostand/efi: Better variable name
Warner Losh [Sun, 8 Jan 2023 19:00:51 +0000 (12:00 -0700)]
stand/efi: Better variable name

sanity_check_currdev returns true if it found a kernel or a sane loader
config file. A better name for this would be 'bootable' rather than 'rv'
which connotes in other places an errno value or similar.

Sponsored by: Netflix

17 months agofuser: fix loop over kinfo_proc array
Gleb Smirnoff [Mon, 9 Jan 2023 16:40:20 +0000 (08:40 -0800)]
fuser: fix loop over kinfo_proc array

The previous code would skip as many entries at the end of the
array as there were zombies in the list.  While here fix type
of cnt.

Submitted by: Ali Abdallah <ali.abdallah suse.com>
PR: 232702
MFC After: 2 weeks

17 months agopkgbase: share rules for packages without pkgdeps
Ed Maste [Fri, 6 Jan 2023 14:44:54 +0000 (09:44 -0500)]
pkgbase: share rules for packages without pkgdeps

Have liby and libcompat share *-dev and *-lib32_dev rules, and share
*-man rule for libcompat and libelftc.  Also correct name substitution
and description for man rules.

Reviewed by: manu
Fixes: 5391bcf0f7e4 ("pkgbase: Do not record dependency on...")
Fixes: 65fa2fd23b9d ("pkgbase: Do record dependency on non-...")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37964

17 months agotesting: fix skipping netlink tests if netlink module is not loaded.
Alexander V. Chernikov [Sun, 8 Jan 2023 19:51:26 +0000 (19:51 +0000)]
testing: fix skipping netlink tests if netlink module is not loaded.

17 months agotesting: Make sure to specify a name for zpools
Warner Losh [Sun, 8 Jan 2023 16:43:58 +0000 (09:43 -0700)]
testing: Make sure to specify a name for zpools

Zpools have to have a name. Pools created w/o a name aren't legit and
trigger a number of bugs.

Sponsored by: Netflix

17 months agostand/zfs: Add a third argument to zfs_probe_dev: part_too
Warner Losh [Fri, 16 Dec 2022 23:19:51 +0000 (16:19 -0700)]
stand/zfs: Add a third argument to zfs_probe_dev: part_too

Pass in 'true' if you'd like to search this device's partitions or
'false' if you should just search the device. EFI and (in the future)
kboot have discrete partitions that aren't accessed via the full disk
device. Weird things happen if you try to search in these cases.

Sponsored by: Netflix

17 months agonetlink: improve RTM_GETADDR handling.
Alexander V. Chernikov [Sat, 7 Jan 2023 16:18:39 +0000 (16:18 +0000)]
netlink: improve RTM_GETADDR handling.

* Allow filtering by ifa_family & ifa_index.
* Add common RTM_<NEW|DEL|GET>ADDR parser
* Add tests verifying RTM_GETADDR filtering behaviour & output
* Factor out common netlink socket test methods into NetlinkTestTemplate
* Add NLMSG_DONE message handler

Reviewed By: pauamma
Differential Revision: https://reviews.freebsd.org/D37970

17 months agoAdd Combo PHY, RK817, Syr827, tcs4525 pmic devices to Rockchip specific config.
Søren Schmidt [Sun, 8 Jan 2023 03:07:18 +0000 (03:07 +0000)]
Add Combo PHY, RK817, Syr827, tcs4525 pmic devices to Rockchip specific config.

17 months agogssd: Fix handling of the gssname=<name> NFS mount option
Rick Macklem [Sat, 7 Jan 2023 21:49:25 +0000 (13:49 -0800)]
gssd: Fix handling of the gssname=<name> NFS mount option

If an NFS mount using "sec=krb5[ip],gssname=<name>" is
done, the gssd daemon fails.  There is a long delay
(several seconds) in the gss_acquire_cred() call and then
it returns success, but the credentials returned are
junk.

I have no idea how long this has been broken, due to some
change in the Heimdal gssapi library call, but I suspect
it has been quite some time.

Anyhow, it turns out that replacing the "desired_name"
argument with GSS_C_NO_NAME fixes the problem.
Replacing the argument should not be a problem, since the
TGT for the host based initiator credential in the default
keytab file should be the only TGT in the gssd'd credential
cache (which is not the one for uid 0).

I will try and determine if FreeBSD13 and/or FreeBSD12
needs this same fix and will MFC if they need the fix.

This problem only affected Kerberized NFS mounts when the
"gssname" mount option was used.  Other Kerberized NFS
mount cases already used GSS_C_NO_NAME and work ok.
A workaround if you do not have this patch is to do a
"kinit -k host/FQDN" as root on the machine, followed by
the Kerberized NFS mount without the "gssname" mount
option.

MFC after: 1 month

17 months agokboot: use 128MB for the heap area, ZFS needs a lot of memory
Warner Losh [Fri, 23 Dec 2022 18:26:32 +0000 (11:26 -0700)]
kboot: use 128MB for the heap area, ZFS needs a lot of memory

ZFS uses a lot of memory. The old minimal allocations won't work when
ZFS support is added. Most environments this will be used (or will
liekly be used) have >> 256MB, 128MB should be safe everywhere and allow
examination of a fair number of ZFS pools to boot from.

Sponsored by: Netflix

17 months agokboot: Sort kexec_load alphabetically
Warner Losh [Sat, 7 Jan 2023 20:24:45 +0000 (13:24 -0700)]
kboot: Sort kexec_load alphabetically

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

17 months agostand: Add macros for file types from stat
Warner Losh [Sat, 7 Jan 2023 20:23:05 +0000 (13:23 -0700)]
stand: Add macros for file types from stat

Add the familiar macros for file types for stat's st_mode
member. Prepend HOST_ to the start of these. Make sure all the values
match the linux nolibc and uapi headers. These values are the same as
native values since they appear to be required by POSIX. Define anyway
to allow the reader of the code to know that they are in the 'host (eg
Linux)' namespace rather than the 'loader' namespace.

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

17 months agokboot: Disks should be at least 16MB
Warner Losh [Tue, 13 Dec 2022 05:39:03 +0000 (22:39 -0700)]
kboot: Disks should be at least 16MB

Linux pre-boot environments will often have a number of psuedo disks
that are small, all smaller than a few MB. 16MB is a good cutoff since
it's big enough to filter these devices, yet small enough to allow a
super-minimal partition through (the smallest I've been able to make
that's useful lately is around 20MB).

Sponsored by: Netflix

17 months agokboot: hostdisk.c update copyright notice
Warner Losh [Tue, 13 Dec 2022 05:37:35 +0000 (22:37 -0700)]
kboot: hostdisk.c update copyright notice

I've rewritten a substantial portion of this file, so add Netflix
copyright.

Sponsored by: Netflix

17 months agoorganization.dot: Update Core Team Secretary
Li-Wen Hsu [Sat, 7 Jan 2023 16:05:26 +0000 (00:05 +0800)]
organization.dot: Update Core Team Secretary

17 months agoAdd delay to have things settle.
Søren Schmidt [Sat, 7 Jan 2023 07:42:44 +0000 (07:42 +0000)]
Add delay to have things settle.

17 months agoRemove unnecessary sys/cdefs.h includes.
Ganbold Tsagaankhuu [Sat, 7 Jan 2023 06:05:52 +0000 (06:05 +0000)]
Remove unnecessary sys/cdefs.h includes.

17 months agostand: Allow stand.h to be included in C++ programs
Warner Losh [Sat, 7 Jan 2023 01:39:09 +0000 (18:39 -0700)]
stand: Allow stand.h to be included in C++ programs

Allow stand.h to be included in C++ programs. This is little more than
using our stylized __BEGIN_DECL / __END_DECL around the entire
file. There's no run-time support for C++, so the C++ that can be used
is quite limited. It is enough for libunwind, though.

Sponsored by: Netflix
Reviewed by: jrtc27, kevans
Differential Revision: https://reviews.freebsd.org/D37946

17 months agostand: Add inttype.h
Warner Losh [Sat, 7 Jan 2023 01:37:56 +0000 (18:37 -0700)]
stand: Add inttype.h

libunwind files need inttype.h. It's safe so add it to the safe list.

Sponsored by: Netflix
Reviewed by: jrtc27, kevans
Differential Revision: https://reviews.freebsd.org/D37947

17 months agofsx: more consistent debug output with -[RWU]
Alan Somers [Sat, 7 Jan 2023 04:49:28 +0000 (21:49 -0700)]
fsx: more consistent debug output with -[RWU]

MFC after: 2 weeks

17 months agocopyright: chase my name and email change
Val Packett [Fri, 6 Jan 2023 15:33:07 +0000 (10:33 -0500)]
copyright: chase my name and email change

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D37945

17 months agotests: add test for ipfw fwd localaddr,port
Gleb Smirnoff [Fri, 6 Jan 2023 20:17:41 +0000 (12:17 -0800)]
tests: add test for ipfw fwd localaddr,port

Checks basic forward to local address, also with presence of
a listener that matches original port (see aab8c844b91). Based
on non-ATF test case written by Pavel Polyakov.

Reviewed by: kp, melifaro
Differential revision: https://reviews.freebsd.org/D37960

17 months agonetlink: fix ifaddr reporting.
Alexander V. Chernikov [Fri, 6 Jan 2023 19:13:42 +0000 (19:13 +0000)]
netlink: fix ifaddr reporting.

Output the proper attributes for IPv4/IPvv6 ifaddrs:
* IFA_ADDRESS contains local address in every case except p2p,
   in that case it contains the peer address
* IFA_LOCAL contains local address. It is always present in IPv4,
   or in IPv6/p2p.
* IFA_BROADCAST contains the network broadcast address (if any)

Reported by: Adam Wood <aswood@gmail.com>
Tested by: Adam Wood <aswood@gmail.com>

17 months agoasmc: Add support for MacBook5,5
Michael Gmelin [Thu, 29 Dec 2022 15:59:08 +0000 (16:59 +0100)]
asmc: Add support for MacBook5,5

This is a slightly refined version of a patch[0] by FreeBSD Forums
user "tmcclean".

[0]https://forums.freebsd.org/threads/success-installing-freebsd-13-0-on-macbook-pro-5-5.80458/

Reviewed by: adrian, emaste, imp
Differential Revision: https://reviews.freebsd.org/D37900
MFC after: 1 month

17 months agoi386: print trampoline disposition value for verbose boot
Konstantin Belousov [Fri, 6 Jan 2023 18:18:51 +0000 (20:18 +0200)]
i386: print trampoline disposition value for verbose boot

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

17 months agofsx: bounds check the inputs
Alan Somers [Sat, 7 Jan 2023 01:54:23 +0000 (18:54 -0700)]
fsx: bounds check the inputs

In particular, don't allow the user to specify a file size that can't be
expressed as an int, since fsx's random-number generator only has a 32
bit range.

MFC after: 2 weeks

17 months agosqlite3: Vendor import of sqlite3 3.40.1
Cy Schubert [Fri, 6 Jan 2023 17:10:14 +0000 (09:10 -0800)]
sqlite3: Vendor import of sqlite3 3.40.1

Release notes at https://www.sqlite.org/releaselog/3_40_1.html.

Obtained from:  https://www.sqlite.org/2022/sqlite-autoconf-3400100.tar.gz

Merge commit 'c728c97f5c838c9a873516c4499e4e1a41788ce7' into main

17 months agosqlite3: Vendor import of sqlite3 3.40.0
Cy Schubert [Fri, 6 Jan 2023 17:03:38 +0000 (09:03 -0800)]
sqlite3: Vendor import of sqlite3 3.40.0

Release notes at https://www.sqlite.org/releaselog/3_40_1.html.

Obtained from:  https://www.sqlite.org/2022/sqlite-autoconf-3400100.tar.gz

17 months agodma: dma.conf.5 as MLINK to dma.8
Ed Maste [Wed, 4 Jan 2023 18:47:26 +0000 (13:47 -0500)]
dma: dma.conf.5 as MLINK to dma.8

There's no separate man page for dma.conf, but the format is documented
in dma.8.

Reviewed by: bapt
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37944

17 months agoMissed skey(4), a copy of opie(4).
Dag-Erling Smørgrav [Fri, 6 Jan 2023 10:12:40 +0000 (11:12 +0100)]
Missed skey(4), a copy of opie(4).

17 months agoUse BSD-2-Clause for the SPDX license id as -FreeBSD variant has been deprecated.
Ganbold Tsagaankhuu [Fri, 6 Jan 2023 08:15:44 +0000 (08:15 +0000)]
Use BSD-2-Clause for the SPDX license id as  -FreeBSD variant has been deprecated.

17 months agoAdd SPDX-License-Identifier.
Ganbold Tsagaankhuu [Fri, 6 Jan 2023 04:14:49 +0000 (04:14 +0000)]
Add SPDX-License-Identifier.

17 months agoRemove unnecessary $Id string from license.
Ganbold Tsagaankhuu [Fri, 6 Jan 2023 04:10:09 +0000 (04:10 +0000)]
Remove unnecessary $Id string from license.

While there add SPDX-License-Identifier.

18 months agoAdd Naneng combo PHY support for RK3568 SoC.
Søren Schmidt [Fri, 6 Jan 2023 03:00:18 +0000 (03:00 +0000)]
Add Naneng combo PHY support for RK3568 SoC.

It can be used as pcie-phy, usb3-phy, sata-phy or sgmii-phy.

18 months agogrowfs(7): clarify assumptions and limitations
Mike Karels [Thu, 5 Jan 2023 13:15:21 +0000 (07:15 -0600)]
growfs(7): clarify assumptions and limitations

Document that the growfs(7) script works only if the root file system
is in the last partition and free space immediately follows it.
Don't imply that /usr can be a separate partition, as that would
likely mean that root is not last.

Reported by: marklmi at yahoo dot com

18 months agoamd64 pmap.h: make it easier to use the header for other consumers
Konstantin Belousov [Wed, 4 Jan 2023 10:31:16 +0000 (12:31 +0200)]
amd64 pmap.h: make it easier to use the header for other consumers

Guard pmap_invlpg() definition with checks that only provide it when
both sys/pcpu.h and machine/cpufunc.h were already included.

Requested by: Elliott Mitchell
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

18 months agoamd64: be more precise when enabling the AlderLake small core PCID workaround
Konstantin Belousov [Tue, 3 Jan 2023 10:13:07 +0000 (12:13 +0200)]
amd64: be more precise when enabling the AlderLake small core PCID workaround

In particular, do not enable the workaround if INVPCID is not supported
by the core.

Reported by: "Chen, Alvin W" <Weike.Chen@Dell.com>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37940

18 months agopkgbase: Do record dependency on non-existent libelftc package
Emmanuel Vadot [Thu, 5 Jan 2023 22:38:14 +0000 (23:38 +0100)]
pkgbase: Do record dependency on non-existent libelftc package

libelftc is an internal lib so it's never installed.
When building with WITH_MANSPLITPKG=yes the libelftc-man package
will have a dependecy on a non-existent libelftc package.

Sponsored by: Beckhoff Automation GmbH & Co. KG

18 months agopkgbase: Do not record dependency on non-existent libcompat package
Emmanuel Vadot [Thu, 5 Jan 2023 22:27:22 +0000 (23:27 +0100)]
pkgbase: Do not record dependency on non-existent libcompat package

libcompat only provides a .a which is put in the -dev package.
Add a special record for it so we do not require a dependency on the
non-existent package FreeBSD-libcompat.

Sponsored by: Beckhoff Automation GmbH & Co. KG

18 months agotcp/ipfw: fix "ipfw fwd localaddr,port"
Gleb Smirnoff [Thu, 5 Jan 2023 22:34:50 +0000 (14:34 -0800)]
tcp/ipfw: fix "ipfw fwd localaddr,port"

The ipfw(4) feature of forwarding to local address without modifying
a packet was broken.  The first lookup needs always be a non-wildcard
one, cause its goal is to find an already existing socket.  Otherwise
a local wildcard listener with the same port number may match resulting
in the connection being forwared to wrong port.

Reported by: Pavel Polyakov <bsd kobyla.org>
Fixes: d88eb4654f372d0451139a1dbf525a8f2cad1cf8

18 months agobsd-family-tree: add DragonFly 6.4.0
Sergey A. Osokin [Thu, 5 Jan 2023 21:36:57 +0000 (16:36 -0500)]
bsd-family-tree: add DragonFly 6.4.0

MFC after: 3 days

18 months agorack and bbr not loading if TCP_RATELIMIT is not configured.
Randall Stewart [Thu, 5 Jan 2023 16:59:21 +0000 (11:59 -0500)]
rack and bbr not loading if TCP_RATELIMIT is not configured.

So it turns out that rack and bbr still will not load without TCP_RATELIMIT. This needs
to be fixed and lets also at the same time bring tcp_ratelimit up to date where we allow
the transports to set a divisor (though still having a default path with the default
divisor of 1000) for setting the burst size.

Reviewed by: tuexen, gallatin
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D37954

18 months agoloader.efi: make sure kernel image is executable
Robert Clausecker [Mon, 2 Jan 2023 21:12:50 +0000 (22:12 +0100)]
loader.efi: make sure kernel image is executable

The Windows Dev Kit 2023 (Volterra) has an UEFI implementation that maps
EfiLoaderData pages as non-executable.  Map the kernel as EfiLoaderCode
to ensure that it can be executed.

With this change and another in review, FreeBSD boots to the mountroot
prompt if hw.pac.enable = 0 is set in loader.conf(5).

Reviewed by: andrew, imp, tsoome
Sponsored by: Berliner Linux User Group e.V.
Sponsored by: spline / FU-Berlin
Differential Revision: https://reviews.freebsd.org/D37931

18 months agopwd_mkdb(8): Don't copy comments from /etc/master.passwd to /etc/passwd.
Andre Albsmeier [Thu, 11 Mar 2010 10:53:47 +0000 (11:53 +0100)]
pwd_mkdb(8): Don't copy comments from /etc/master.passwd to /etc/passwd.

The intention of /etc/passwd was to support legacy applications that are
not yet converted to use modern API like getpwent(3). Comments are not
defined in the legacy format, so copying them could break these
applications. Plus, it could leak sensitive information (e.g. encrypted
form of password of an user that was commented out instead of deleted
or disabled).

PR: bin/144652
MFC after: 1 month

18 months agoAdd PCIe driver for RK3568 SoC.
Søren Schmidt [Thu, 5 Jan 2023 04:15:56 +0000 (04:15 +0000)]
Add PCIe driver for RK3568 SoC.

PCIe3 ports work, however PCIe2x1 is not working yet in this case as it depends on Naneng Combo Phy driver.

18 months agortld: Revert "When loading dso without PT_GNU_STACK phdr, only call"
John Baldwin [Wed, 4 Jan 2023 22:55:00 +0000 (14:55 -0800)]
rtld: Revert "When loading dso without PT_GNU_STACK phdr, only call"

After the removal of ia64 and sparc64, all current architectures
support executable stacks at an architectural level.

This reverts commit 1290d38ac50b3afa7e5781d9d97346a1042c736c.

Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D37904

18 months agoifnet: Expose if_t to userspace
Justin Hibbits [Wed, 4 Jan 2023 20:56:31 +0000 (15:56 -0500)]
ifnet: Expose if_t to userspace

<net/if_var.h> should be a kernel-only header, but it's included
elsewhere.  Until that's addressed expose if_t to userspace to fix the
build.

Fixes: be4315dcbb8
Sponsored by: Juniper Networks, Inc.

18 months agoifnet/DrvAPI: Move if_t typedef to a better place
Justin Hibbits [Wed, 21 Dec 2022 21:15:09 +0000 (16:15 -0500)]
ifnet/DrvAPI: Move if_t typedef to a better place

Summary:
<net/if_var.h> should really be used by the netstack only, not by
drivers.  Eventually all the accessors will be moved to <net/if.h> as
well, but for now just move the typedef while the KPI gets sorted and
drivers get converted.

Sponsored by: Juniper Networks, Inc.
Reviewed By: melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D37784

18 months agoifnet/DrvAPI: Implement if_setoutputfn() accessor
Justin Hibbits [Wed, 21 Dec 2022 21:42:42 +0000 (16:42 -0500)]
ifnet/DrvAPI: Implement if_setoutputfn() accessor

Fixes: eb1da3e5258238e1c0555c6a006a341df0821d8e
Sponsored by: Juniper Networks, Inc.

18 months agogrowfs script: fix config-dependent errors
Mike Karels [Wed, 4 Jan 2023 18:25:54 +0000 (12:25 -0600)]
growfs script: fix config-dependent errors

- awk sometimes formatted swapbase as floating point, which gpart
  does not accept; force int.

- Fix typo in code for checking vm.max_swap_pages.

- While here, do not set kernel env if "gpart add" fails.

- Add "gpart show" before modification to verbose output.

Reported by: marklmi at yahoo dot com
Tested by: marklmi at yahoo dot com

18 months agoAdd Windows Dev Kit 2023 support to if_ure
Andrew Turner [Wed, 4 Jan 2023 13:23:59 +0000 (13:23 +0000)]
Add Windows Dev Kit 2023 support to if_ure

The Windows Dev Kit 2023 has an if_ure NIC with custom vendor and
procuct IDs. Add them to the driver.

Tested by: Robert Clausecker <fuz@fuz.su>
Obtained from: OpenBSD
Sponsored by: Arm Ltd

18 months agoCheck for more XHCI ACPI IDs
Andrew Turner [Wed, 4 Jan 2023 12:33:08 +0000 (12:33 +0000)]
Check for more XHCI ACPI IDs

The Windows Dev Kit 2023 uses the XHCI-compliant USB controller without
standard debug ID in its ACPI tables. Check for both ID values found
on [1] in the XHCI ACPI attachment.

[1] https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/device-management-namespace-objects

Tested by: Robert Clausecker <fuz@fuz.su>
Sponsored by: Arm Ltd

18 months agoatomic: Make atomic_san.h self-contained
Mark Johnston [Wed, 4 Jan 2023 02:47:52 +0000 (10:47 +0800)]
atomic: Make atomic_san.h self-contained

This file assumes that uint*_t and __typeof() are defined, so ensure
that consumers don't have to pull in the requisite includes themselves.
This is consistent with sys/atomic_common.h.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D37939

18 months agogrep: properly switch EOL indicator with -z
Kyle Evans [Wed, 4 Jan 2023 05:21:10 +0000 (23:21 -0600)]
grep: properly switch EOL indicator with -z

-z is supposed to use only the NUL byte as EOL, but we were
inadvertently using both newline and NUL due to REG_NEWLINE in cflags.

The odds of anyone relying on this bsdgrep-specific bug are quite low,
so let's just fix it.  At least one port in the wild has been reported
to expect the intended behavior.

Reported by: Hill Ma <maahiuzeon@gmail.com>
Triaged by: the self-proclaimed peanut gallery on Discord

18 months agowdatwd: fix i386 build breakage.
Takanori Watanabe [Tue, 3 Jan 2023 23:30:32 +0000 (08:30 +0900)]
wdatwd: fix i386 build breakage.

Formatting string for uint64_t has portablity issue and
lead bulid breakage, so fix it.

Reviewed by hrs
Differential Revision: https://reviews.freebsd.org/D37937

18 months agoCirrus-CI: add `gpart show` to setup script
Ed Maste [Sun, 1 Jan 2023 18:58:56 +0000 (13:58 -0500)]
Cirrus-CI: add `gpart show` to setup script

GCP instances have stopped resizing the UFS root filesystem.  The 14.x
snapshot image built from b1ef176eb528 works while c89209c674f2 fails.
Discovered via testing a WIP branch in Cirrus-CI that uses
`image: family/freebsd-14-0-snap`.

Add `gpart show` to the setup script to confirm that the partition
size (as set by Cirrus config / GCP) took effect and to help when
investigating any similar issue in the future.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

18 months agowdatwd: Add support for ACPI WDAT based watchdog timer.
Takanori Watanabe [Tue, 3 Jan 2023 15:16:36 +0000 (00:16 +0900)]
wdatwd: Add support for ACPI WDAT based watchdog timer.

Simply said, WDAT is an abstraction for the real WDT hardware. For
instance, to add a newer generation WDT to ichwd(4), one must know the
detailed hardware registers, etc..

With WDAT, the necessary IO accesses to operate the WDT are comprehensively
described in it and no hardware knowledge is required.

With this driver, the WDT on Advantech ARK-1124C, Dell R210 and Dell R240 are
detected and operated flawlessly.
* While R210 is also supported by ichwd(4), others are not supported yet.

The unfortunate thing is that not all systems have WDAT defined.

Submitted by: t_uemura at macome.co.jp
Reviewed by: hrs
Differential Revision: https://reviews.freebsd.org/D37493