]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 months agoheimdal: Resolve hdb_free_entry() SIGSEGV/SIGILL
Cy Schubert [Tue, 7 Feb 2023 15:46:59 +0000 (07:46 -0800)]
heimdal: Resolve hdb_free_entry() SIGSEGV/SIGILL

When the client sends kadmind a create principal (kadm_create) request
kadm_s_create_principal() returns an error before zeroing out ent (an
hdb entry structure wrapper -- hdb_entry_ex), resulting in a NULL
reference.

Fix obtained from upstream commit 35ea4955a.

PR: 268059
Reported by: Robert Morris <rtm@lcs.mit.edu>
Obtained from: Heimdal commit 35ea4955a
MFC after: 3 days

15 months agodepend-cleanup.sh: Simplify the logic, and clean bootstrap tools.
Dag-Erling Smørgrav [Wed, 8 Feb 2023 22:58:51 +0000 (23:58 +0100)]
depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.

* There's no need to check if the file exists before grepping it; if it does not exist, grep will fail, which is what we want.  Just redirect the error message to /dev/null.
* There's no need to split the .o and .pico cases; the bodies are identical, so combine the conditions.  Use a glob to avoid a false negative if one exists but not the other.
* Also run depend-cleanup.sh on the bootstrap build tree.  This unbreaks the build after 29c5f8bf9a01.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D38447

15 months agonfscl: Fix interaction between mmap'd and VOP_WRITE file updates
Rick Macklem [Wed, 8 Feb 2023 22:25:01 +0000 (14:25 -0800)]
nfscl: Fix interaction between mmap'd and VOP_WRITE file updates

asomers@ found a problem with the NFS client, where a write to
an NFS mounted file done via mmap(2) was lost when fspacectl(2)
was done before it.  This turned out to be caused by clearing the
dirty bit on pages when the client was doing commit RPCs,
due to the second argument to vfs_busy_pages() being set to 1.
Commit RPCs tell the server to commit previously written data to
stable storage.  However, Commit RPCs do not write data from the
client to the server.  As such, if the dirty bit on the page has
been set by a mmap'd write to an address in the page, it should
not be cleared.  Clearing it causes the mmap'd write to by lost.

This patch fixes the problem by changing the 2nd argument to
vfs_busy_pages() to 0 for this case.

I doubt this bug has affected many, since it was inherited from
the old NFS client and was in 4.3 FreeBSD twenty years ago.
Although fspacectl(2) is FreeBSD 14 specific, a write(2) would
cause the same failure.

Reviewed by: kib
Tested by: asomers
PR: 269328
MFC after: 1 week

15 months agonfsd: Fix handling of the error case for nfsvno_open
Rick Macklem [Wed, 8 Feb 2023 21:06:07 +0000 (13:06 -0800)]
nfsd: Fix handling of the error case for nfsvno_open

Using done_namei instead of ni_startdir did not
fix the crashes reported in the PR. Upon looking
more closely at the code, the only case where the
code near the end of nfsvno_open() needs to be
executed is when nfsvno_namei() has succeeded,
but a subsequent error was detected.

This patch uses done_namei to indicate this case.

Also, nfsvno_relpathbuf() should only be called for
this case and not whenever nfsvno_open() is called
with nd_repstat != 0. A bug was introduced here when
the HASBUF flag was deleted.

Reviewed by: mjg
PR: 268971
Tested by: ish@amail.plala.or.jp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38430

15 months agonetmap: drop redundant if_mtu assignment
Vincenzo Maffione [Wed, 8 Feb 2023 21:05:32 +0000 (21:05 +0000)]
netmap: drop redundant if_mtu assignment

Reported by: zlei
MFC after 3 days

15 months agophysmem: add ram0 pseudo-driver
Mitchell Horne [Thu, 27 May 2021 14:27:40 +0000 (11:27 -0300)]
physmem: add ram0 pseudo-driver

Its purpose is to reserve all I/O space belonging to physical memory
from nexus, preventing it from being handed out by bus_alloc_resource()
to callers such as xenpv_alloc_physmem(), which looks for the first
available free range it can get. This mimics the existing pseudo-driver
on x86.

If needed, the device can be disabled with hint.ram.0.disabled="1" in
/boot/device.hints.

Reviewed by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D32343

15 months agoofwbus: remove handling of resources from ofwbus
Elliott Mitchell [Wed, 8 Feb 2023 20:17:03 +0000 (16:17 -0400)]
ofwbus: remove handling of resources from ofwbus

The architecture nexus should handle allocation and release of memory and
interrupts. This is to ensure that system-wide resources such as these
are available to all devices, not just children of ofwbus0.

On powerpc this moves the ownership of these resources up one level,
from ofwbus0 to nexus0. Other architectures already have the required
logic in their nexus implementation, so this eliminates the duplication
of resources. An implementation of nexus_adjust_resource() is added for
arm, arm64, and riscv.

As noted by ian@ in the review, resource handling was the main bit of
logic distinguishing ofwbus from simplebus. With some attention to
detail, it should be possible to merge the two in the future.

Co-authored by: mhorne
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D30554

15 months agoarm: add an interrupt rman to nexus
Mitchell Horne [Sun, 5 Dec 2021 15:27:50 +0000 (11:27 -0400)]
arm: add an interrupt rman to nexus

Allow the nexus bus to own and manage interrupt resources. Currently,
interrupt resources on this architecture are managed completely by
ofwbus, but it is desirable that system-wide memory and interrupt
resources be managed by the top-level bus.

This is a pre-requisite to moving this resource management out of
ofwbus.

Reviewed By: ian, Elliott Mitchell <ehem+freebsd@m5p.com>
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D32357

15 months agoAdd nproc(1)
Mateusz Guzik [Sat, 4 Feb 2023 23:33:48 +0000 (23:33 +0000)]
Add nproc(1)

This program prints the number of CPU threads it can run on, while
respecting cpusets (or not, depending on switches).

It aims to be compatible with nproc as found in GNU coreutils.

Reviewed by: des
Reviewed by: pstef
Differential Revision: https://reviews.freebsd.org/D38386

15 months agoe1000: bump driver version
Kevin Bowling [Wed, 8 Feb 2023 19:25:58 +0000 (12:25 -0700)]
e1000: bump driver version

Incrementing these to avoid confusion in users; we are on par with these
out of tree versions.

Reviewed by: erj
MFC after: 2 weeks
Sponsored by: BBOX.io
Pull Request: https://github.com/freebsd/freebsd-src/pull/540

15 months agoe1000: fix I219 hang on reset
Kevin Bowling [Wed, 8 Feb 2023 19:21:45 +0000 (12:21 -0700)]
e1000: fix I219 hang on reset

Clear the rings before reset to avoid a HW hang.

Inspired by em-7.7.8 and DPDK (1fc9701238edcf0541289b9ae15565b6d9d7ab30)

Reviewed by: erj
MFC after: 2 weeks
Sponsored by: BBOX.io
Pull Request: https://github.com/freebsd/freebsd-src/pull/540

15 months agoMakefile.amd64: remove construct that serves no purpose
Alexander Kabaev [Wed, 8 Feb 2023 18:36:46 +0000 (11:36 -0700)]
Makefile.amd64: remove construct that serves no purpose

The variable expansion as written will never match anything but
'amd64/.8' in OBJDIR. The original intention behind the construct
remains unclear, but "as is" it serves no other purpose but to
generate the warning. Remove it altogether.

Fixes: df90aeac24c9
Reviewed by: imp
Differential Revision:   https://reviews.freebsd.org/D38440

15 months agoBump __FreeBSD_version for llvm 15.0.7 merge
Dimitry Andric [Wed, 8 Feb 2023 19:20:21 +0000 (20:20 +0100)]
Bump __FreeBSD_version for llvm 15.0.7 merge

PR: 265425
MFC after: 2 weeks

15 months agoMerge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6
Dimitry Andric [Sat, 14 Jan 2023 16:33:24 +0000 (17:33 +0100)]
Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6.

PR: 265425
MFC after: 2 weeks

15 months agoMerge llvm-project release/15.x llvmorg-15.0.6-0-g088f33605d8a
Dimitry Andric [Sun, 4 Dec 2022 22:09:55 +0000 (23:09 +0100)]
Merge llvm-project release/15.x llvmorg-15.0.6-0-g088f33605d8a

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.6-0-g088f33605d8a.

PR: 265425
MFC after: 2 weeks

15 months agoMerge llvm-project release/15.x llvmorg-15.0.2-10-gf3c5289e7846
Dimitry Andric [Sun, 16 Oct 2022 19:03:40 +0000 (21:03 +0200)]
Merge llvm-project release/15.x llvmorg-15.0.2-10-gf3c5289e7846

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.2-10-gf3c5289e7846.

PR: 265425
MFC after: 2 weeks

15 months agoMerge llvm-project release/15.x llvmorg-15.0.0-9-g1c73596d3454
Dimitry Andric [Sat, 10 Sep 2022 18:56:18 +0000 (20:56 +0200)]
Merge llvm-project release/15.x llvmorg-15.0.0-9-g1c73596d3454

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.0-9-g1c73596d3454.

PR: 265425
MFC after: 2 weeks

15 months agoMerge llvm-project release/15.x llvmorg-15.0.0-rc2-40-gfbd2950d8d0d
Dimitry Andric [Sat, 13 Aug 2022 15:37:04 +0000 (17:37 +0200)]
Merge llvm-project release/15.x llvmorg-15.0.0-rc2-40-gfbd2950d8d0d

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.0-rc2-40-gfbd2950d8d0d.

PR: 265425
MFC after: 2 weeks

15 months agoMerge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4
Dimitry Andric [Wed, 27 Jul 2022 20:11:54 +0000 (22:11 +0200)]
Merge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17826-g1f8ae9d7e7e4, the last commit before
the upstream release/16.x branch was created.

PR: 265425
MFC after: 2 weeks

15 months agoMerge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b
Dimitry Andric [Sun, 24 Jul 2022 15:11:41 +0000 (17:11 +0200)]
Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17485-ga3e38b4a206b.

PR: 265425
MFC after: 2 weeks

15 months agoMerge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f
Dimitry Andric [Thu, 14 Jul 2022 18:58:48 +0000 (20:58 +0200)]
Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks

15 months agoMerge llvm-project main llvmorg-15-init-15358-g53dc0f10787
Dimitry Andric [Mon, 4 Jul 2022 19:20:19 +0000 (21:20 +0200)]
Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks

15 months agogeli: split the initalization of HMAC
Mariusz Zaborski [Wed, 8 Feb 2023 16:41:06 +0000 (08:41 -0800)]
geli: split the initalization of HMAC

GELI allows to read a user key from a standard input.
However if user initialize multiple providers at once, the standard
input will be empty for the second and next providers.
This caused GELI to encrypt a master key with an empty key file.

This commits initialize the HMAC with the key file, and then reuse the
finalized structure to generate different encryption keys for different
providers.

Reported by: Nathan Dorfman
Tested by: philip
Security: FreeBSD-SA-23:01.geli
Security: CVE-2023-0751

15 months agolua: Update to 5.4.4
Warner Losh [Tue, 7 Feb 2023 22:07:08 +0000 (15:07 -0700)]
lua: Update to 5.4.4

Merge commit '755d9301ca89f02956fd17858b9d4d821ab5c972' from the
vendor branch. This updates us from lua 5.4.2 to 5.4.4.

In addition, it switches around how we flavor liblua for the boot loader
and flua. This is done to reduce diffs with upstream and make it easier
to import new versions (the current method has too many conflicts to
resolve by hand): we include luaconf.local.h from luaconf.h (the only
change to this file is now that #include at the end). We then define
what we need to: for flua (which does very little) and one for stand
(which creates the new FLOAT type out of int64).

Sponsored by: Netflix

15 months agoiommu_gas: initialize start_gap as first node
Doug Moore [Wed, 8 Feb 2023 17:04:13 +0000 (11:04 -0600)]
iommu_gas: initialize start_gap as first node

In iommu_gas.c, domain->start_gap points to one of the nodes on either
side of the first free, unallocated range. In iommu_gas_init_domain,
it is initialized to point to the node after the single free
range. Change it to point to the node before that free range, so that,
when 'lowaddr' is within the initial free range, the first allocation
search for free space below 'lowaddr' does not begin and end at an
address above 'lowaddr'. This fixes problems on a machine with Intel
DMAR enabled.

Reported by: jah
Reviewed by: dougm
Tested by: jah
Obtained from: jah
Fixes: commit db151ca0c343531256b8839f938a4ecbd8b4fd7e iommu_gas: start space search from 1st free space
MFC after: 1 day

15 months agocp: Adjust the sparse file tests.
Dag-Erling Smørgrav [Wed, 8 Feb 2023 16:49:29 +0000 (16:49 +0000)]
cp: Adjust the sparse file tests.

* The sparsity check was ineffective: it compared the apparent size in bytes to the actual size in blocks.  Instead, write a tool that reliably detects sparseness.
* Some of the seq commands were missing an argument.
* Based on empirical evidence, 1 MB holes are not necessarily large enough to be preserved by the underlying filesystem.  Increase the hole size to 16 MB.

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

15 months agobpf: Add missing NOP stubs
Zhenlei Huang [Wed, 8 Feb 2023 04:35:02 +0000 (12:35 +0800)]
bpf: Add missing NOP stubs

This fixes kernel build with nodevice bpf [1].

[1] https://lists.freebsd.org/archives/freebsd-current/2023-February/003178.html

Reported by: Gary Jennejohn <garyj@gmx.de>
Reviewed by: jhibbits
Fixes: 950cc1f44fbd bpf: Add "_if" tap APIs
Differential Revision: https://reviews.freebsd.org/D38432

15 months agorc: syscons: Add UEFI special case
Emmanuel Vadot [Tue, 31 Jan 2023 10:26:36 +0000 (11:26 +0100)]
rc: syscons: Add UEFI special case

Changing cursor, screenmap and setting blanktime doesn't work when booted
with vt(4) and UEFI so add a special case for those depending on machdep.bootmethods.
I have no way to test if this can work with vt(4) and bios boot so just in case
keep calling those for this.

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

15 months agoutx: Allow disabling user accounting
Emmanuel Vadot [Tue, 31 Jan 2023 09:05:32 +0000 (10:05 +0100)]
utx: Allow disabling user accounting

Make it possible to not run utx at boot.
Default to yes so this is a no-op for everyone.

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

15 months agopkgbase: Create a FreeBSD-console-tools package
Emmanuel Vadot [Wed, 1 Feb 2023 09:35:56 +0000 (10:35 +0100)]
pkgbase: Create a FreeBSD-console-tools package

And put in it:
 - kbdcontrol
 - vidcontrol
 - moused
 - kbdmap

Those aren't useful in a jail or for a modern desktop.
While here, split the devd.conf part into some new files.

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

15 months agodevd: Move power_profile part in devd/power_profile.conf
Emmanuel Vadot [Wed, 1 Feb 2023 07:49:18 +0000 (08:49 +0100)]
devd: Move power_profile part in devd/power_profile.conf

And make it part of the FreeBSD-acpi package.
This avoid calling service power_profile on an installation without it
installed.

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

15 months agodevd: Move bluetooth part in devd/bluetooth.conf
Emmanuel Vadot [Wed, 1 Feb 2023 07:44:46 +0000 (08:44 +0100)]
devd: Move bluetooth part in devd/bluetooth.conf

And make it part of the FreeBSD-bluetooth package.
This avoid calling service bluetooth on an installation without it
installed.

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

15 months agodevd: Move dhclient part in devd/dhclient.conf
Emmanuel Vadot [Wed, 1 Feb 2023 07:41:56 +0000 (08:41 +0100)]
devd: Move dhclient part in devd/dhclient.conf

And make it part of the FreeBSD-dhclient package.
This avoid calling dhclient on an installation without dhclient
installed.

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

15 months agopkgbase: Put sendmail example in the sendmail package
Emmanuel Vadot [Tue, 31 Jan 2023 15:15:11 +0000 (16:15 +0100)]
pkgbase: Put sendmail example in the sendmail package

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

15 months agopkgbase: Do not override packages for FILES
Emmanuel Vadot [Tue, 31 Jan 2023 15:14:27 +0000 (16:14 +0100)]
pkgbase: Do not override packages for FILES

Not all FILES entries should end up in FreeBSD-utilities

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

15 months agopkgbase: Put libpanelw and libform in FreeBSD-clibs
Emmanuel Vadot [Fri, 27 Jan 2023 15:17:32 +0000 (16:17 +0100)]
pkgbase: Put libpanelw and libform in FreeBSD-clibs

Put them with the others ncurses libs.

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

15 months agopkgbase: Put ftp-proxy in the FreeBSD-pf package
Emmanuel Vadot [Fri, 27 Jan 2023 14:57:56 +0000 (15:57 +0100)]
pkgbase: Put ftp-proxy in the FreeBSD-pf package

It belongs here.
Also this unbloat FreeBSD-utilities a bit and it will not depend
on the FreeBSD-libevent1 package now.

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

15 months agopkgbase: Create a FreeBSD-netmap package
Emmanuel Vadot [Fri, 27 Jan 2023 14:45:44 +0000 (15:45 +0100)]
pkgbase: Create a FreeBSD-netmap package

This unbloat FreeBSD-utilities a bit and not everyone uses
valectl which is the only in-tree consumer of libnetmap

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

15 months agopkgbase: Create a FreeBSD-elftoolchain package
Emmanuel Vadot [Fri, 27 Jan 2023 14:26:06 +0000 (15:26 +0100)]
pkgbase: Create a FreeBSD-elftoolchain package

It contain all the binaries and libs from the elftoolchain contrib
project except for libelf which is used everywhere.
All of those tools are never used by the average user.

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

15 months agopkgbase: Create a FreeBSD-ctf-tools package
Emmanuel Vadot [Fri, 27 Jan 2023 14:25:21 +0000 (15:25 +0100)]
pkgbase: Create a FreeBSD-ctf-tools package

It contains the ctf tools that most users will never use.

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

15 months agopkgbase: Create a FreeBSD-inetd package
Emmanuel Vadot [Fri, 27 Jan 2023 09:48:11 +0000 (10:48 +0100)]
pkgbase: Create a FreeBSD-inetd package

And put inetd and its config file in it.
This unbloat a bit FreeBSD-utilities and some people might not
want inetd always installed.

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

15 months agopkgbase: Create a FreeBSD-smbutils package
Emmanuel Vadot [Fri, 27 Jan 2023 09:45:21 +0000 (10:45 +0100)]
pkgbase: Create a FreeBSD-smbutils package

And put smb related programs and lib in it.

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

15 months agolibc: base64: trim some bogus trailing whitespace
Kyle Evans [Wed, 8 Feb 2023 06:39:25 +0000 (00:39 -0600)]
libc: base64: trim some bogus trailing whitespace

No functional change, just a style fix.

Sponsored by: Klara, Inc.

15 months agotools: cleanup stale dependencies from recent config(8) change
Kyle Evans [Wed, 8 Feb 2023 06:05:58 +0000 (00:05 -0600)]
tools: cleanup stale dependencies from recent config(8) change

mkmakefile.c moved to mkmakefile.cc, let's preemptively handle it.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D38275

15 months agoconfig: drop dependency on libnv
Kyle Evans [Wed, 8 Feb 2023 06:02:56 +0000 (00:02 -0600)]
config: drop dependency on libnv

Compile mkmakefile.c as C++ instead and use an std::unordered_map to
accomplish the same goal.

Reviewed by: imp
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D38275

15 months agoconfig: make changes to allow some parts to build as C++
Kyle Evans [Wed, 8 Feb 2023 06:02:56 +0000 (00:02 -0600)]
config: make changes to allow some parts to build as C++

Highlights:
- Avoid keywords (this, not) as variable names
- Move yyparse into config.h with other declarations
- All declarations in config.h are assumed guilty until proven innocent
- Some const-correctness
- Casting malloc/calloc returns

Note that we're not building any C++ here yet, this will be introduced
in other commits to replace some of the lib dependencies.  Reducing the
number of FreeBSD-specific dependencies we have reduces some friction
for building our bootstrap tools independently in other environments.

Reviewed by: imp
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D38274

15 months agoasmc: Add support for 10 byte light sensor payloads; MacBookAir6,1
Adrian Chadd [Wed, 8 Feb 2023 04:06:16 +0000 (04:06 +0000)]
asmc: Add support for 10 byte light sensor payloads; MacBookAir6,1

The later macbook models use a different packet payload for the light
sensors:

* There's only one, done in the camera
* It's a 4 byte sensor value, not a 2 byte value
* It's in a 10 byte payload.

So, this adds support for that and flips it on for the MacbookAir6,2.

It also adds support for MacBookAir6,1 as that now works fine here.

Tested - MacBookAir6,1 and 6,2

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38365

15 months agocommitters-ports.dot: add fuz
Robert Clausecker [Tue, 7 Feb 2023 14:00:04 +0000 (15:00 +0100)]
committers-ports.dot: add fuz

Onboard new ports committer Robert Clausecker (fuz)
in accordance with step 5 of sec. 7.1 committers guide.

Approved by: eduardo (mentor)
See also: D38416 (steps 1--4)
Differential Revision: https://reviews.freebsd.org/D38417

15 months agosysv: ansify
Mateusz Guzik [Wed, 8 Feb 2023 00:11:10 +0000 (00:11 +0000)]
sysv: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agoddb: ansify
Mateusz Guzik [Wed, 8 Feb 2023 00:09:23 +0000 (00:09 +0000)]
ddb: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agosk: ansify
Mateusz Guzik [Wed, 8 Feb 2023 00:05:03 +0000 (00:05 +0000)]
sk: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agosmbfs: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:35:11 +0000 (23:35 +0000)]
smbfs: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agoudf: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:24:24 +0000 (23:24 +0000)]
udf: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agonullfs: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:22:27 +0000 (23:22 +0000)]
nullfs: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agofifofs: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:18:51 +0000 (23:18 +0000)]
fifofs: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agovfs: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:03:20 +0000 (23:03 +0000)]
vfs: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agoamd64: ansify
Mateusz Guzik [Tue, 7 Feb 2023 22:52:06 +0000 (22:52 +0000)]
amd64: ansify

Reported by:    clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agossh: add information on hostname canonicalization patch
Ed Maste [Tue, 7 Feb 2023 20:09:30 +0000 (15:09 -0500)]
ssh: add information on hostname canonicalization patch

We introduced hostname canonicalization in 2002, while upstream OpenSSH
added similar support in 2014.

It would be good to review our handling of CNAMEs in hostname
canonicalization.

Sponsored by: The FreeBSD Foundation

15 months agotcp: Remove a couple of always-false checks from syncache_socket()
Mark Johnston [Tue, 7 Feb 2023 20:12:10 +0000 (15:12 -0500)]
tcp: Remove a couple of always-false checks from syncache_socket()

syncache_socket() does some unnecessary work: before connecting the PCB,
it saves the local address on the stack and restores it before freeing
the PCB in case of an error.  However:
- There's no need to restore the old address in the error case.
- The PCB's local address will always be equal to that of the syncache
  entry anyway.

So just remove this unnecessary code, which appears to date from the
introduction of the syncache 20+ years ago.

No functional change intended.

Reviewed by: tuexen, glebius
Sponsored by: Klara, Inc.
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D38391

15 months agoLinuxKPI: 802.11: deal with stopped queues
Bjoern A. Zeeb [Tue, 7 Feb 2023 20:18:08 +0000 (20:18 +0000)]
LinuxKPI: 802.11: deal with stopped queues

Following 5a9a0d7803382321b5f9fff1deae5fb08463cf1a initialize the
queue values explicitly and deal with a stopped queue in
ieee80211_tx_dequeue().

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

15 months agojail: Use atomic(9) instead of CK atomics
Mark Johnston [Tue, 7 Feb 2023 19:35:44 +0000 (14:35 -0500)]
jail: Use atomic(9) instead of CK atomics

There's no reason to use one over the other here, let's prefer the
interface that's used elsewhere in the kernel.

No functional change intended.

Reviewed by: mjg
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38360

15 months agobridge: Make the ioctl table local to if_bridge.c
Mark Johnston [Tue, 7 Feb 2023 19:34:37 +0000 (14:34 -0500)]
bridge: Make the ioctl table local to if_bridge.c

No functional change intended.

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

15 months agolibdwarf: Add some constants from DWARF 5
Mark Johnston [Tue, 7 Feb 2023 19:33:27 +0000 (14:33 -0500)]
libdwarf: Add some constants from DWARF 5

This is not exhaustive - DWARF 5 has some new enumeration types not
implemented here - but I think I caught all the ones that are extended
in DWARF 5, plus the new compilation unit type (DW_UT_*), needed when
parsing .debug_info headers.

These were useful when extending libdwarf/ctfconvert/readelf to handle
DWARF generated by gcc 12, which is version 5 by default.

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

15 months agotcp_var.h: Fix spelling of independent in comment
John Baldwin [Tue, 7 Feb 2023 20:01:29 +0000 (12:01 -0800)]
tcp_var.h: Fix spelling of independent in comment

15 months agomvneta: add the missing include opt_mvneta.h
Mateusz Guzik [Tue, 7 Feb 2023 19:20:05 +0000 (19:20 +0000)]
mvneta: add the missing include opt_mvneta.h

Sponsored by: Rubicon Communications, LLC ("Netgate")

15 months agoMechanically convert vtbe(4) to IfAPI
Justin Hibbits [Fri, 19 Aug 2022 19:47:32 +0000 (15:47 -0400)]
Mechanically convert vtbe(4) to IfAPI

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

15 months agoMechanically convert mana to IfAPI
Justin Hibbits [Fri, 19 Aug 2022 16:06:32 +0000 (12:06 -0400)]
Mechanically convert mana to IfAPI

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

15 months agoMechanically convert oce(4) to IfAPI
Justin Hibbits [Fri, 19 Aug 2022 15:51:49 +0000 (11:51 -0400)]
Mechanically convert oce(4) to IfAPI

Reviewed By: zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37829

15 months agoMechanically convert liquidio(4) to IfAPI
Justin Hibbits [Wed, 17 Aug 2022 20:45:22 +0000 (16:45 -0400)]
Mechanically convert liquidio(4) to IfAPI

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

15 months agoMechanically convert vnic to IfAPI
Justin Hibbits [Wed, 17 Aug 2022 20:42:35 +0000 (16:42 -0400)]
Mechanically convert vnic to IfAPI

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

15 months agoMechanically convert mlx4(4) to IfAPI
Justin Hibbits [Wed, 17 Aug 2022 20:30:39 +0000 (16:30 -0400)]
Mechanically convert mlx4(4) to IfAPI

Reviewed by: hselasky, zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37823

15 months agoMechanically convert sfxge(4) to IfAPI
Justin Hibbits [Wed, 17 Aug 2022 20:15:14 +0000 (16:15 -0400)]
Mechanically convert sfxge(4) to IfAPI

Reviewed by: arybchik, zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37817

15 months agoMechanically convert if_sume(4) to IfAPI
Justin Hibbits [Tue, 1 Mar 2022 19:54:34 +0000 (13:54 -0600)]
Mechanically convert if_sume(4) to IfAPI

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

15 months agoMechanically convert stge(4) to IfAPI
Justin Hibbits [Tue, 1 Mar 2022 19:51:27 +0000 (13:51 -0600)]
Mechanically convert stge(4) to IfAPI

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

15 months agoMechanically convert usb_ethernet(4) to IfAPI
Justin Hibbits [Tue, 1 Mar 2022 19:19:18 +0000 (13:19 -0600)]
Mechanically convert usb_ethernet(4) to IfAPI

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

15 months agoMechanically convert if_xae to IfAPI
Justin Hibbits [Tue, 1 Mar 2022 17:00:21 +0000 (11:00 -0600)]
Mechanically convert if_xae to IfAPI

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

15 months agoMechanically convert atse(4) to IfAPI
Justin Hibbits [Tue, 1 Mar 2022 16:28:01 +0000 (10:28 -0600)]
Mechanically convert atse(4) to IfAPI

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

15 months agoOpenSSL: Regen manual pages for OpenSSL 1.1.1t
Jung-uk Kim [Tue, 7 Feb 2023 19:01:15 +0000 (14:01 -0500)]
OpenSSL: Regen manual pages for OpenSSL 1.1.1t

15 months agoOpenSSL: Regen assembly files for OpenSSL 1.1.1t
Jung-uk Kim [Tue, 7 Feb 2023 18:55:17 +0000 (13:55 -0500)]
OpenSSL: Regen assembly files for OpenSSL 1.1.1t

15 months agoOpenSSL: Merge OpenSSL 1.1.1t
Jung-uk Kim [Tue, 7 Feb 2023 18:54:16 +0000 (13:54 -0500)]
OpenSSL: Merge OpenSSL 1.1.1t

15 months agoOpenSSL: Merge OpenSSL 1.1.1t
Jung-uk Kim [Tue, 7 Feb 2023 18:51:38 +0000 (13:51 -0500)]
OpenSSL: Merge OpenSSL 1.1.1t
Merge commit '0d51f658515c605fcc4a8073cb5a8e0d7d904088'

15 months agotarfs: Silence warnings when no supported compression is enabled.
Dag-Erling Smørgrav [Tue, 7 Feb 2023 17:27:35 +0000 (18:27 +0100)]
tarfs: Silence warnings when no supported compression is enabled.

Some of the code in sys/fs/tarfs/tarfs_io.c is not specific to zstd, but is still only used when some form of decompression is enabled.  Put it behind #ifdef TARFS_ZIO to silence warnings.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D38415

15 months agoinpcb: immediately return matching pcb on lookup
Gleb Smirnoff [Tue, 7 Feb 2023 17:21:52 +0000 (09:21 -0800)]
inpcb: immediately return matching pcb on lookup

This saves a lot of CPU cycles if you got large connection table.

The code removed originates from 413628a7e3d, a very large changeset.
Discussed that with Bjoern, Jamie we can't recover why would we ever
have identical 4-tuples in the hash, even in the presence of jails.
Bjoern did a test that confirms that it is impossible to allocate an
identical connection from a jail to a host. Code review also confirms
that system shouldn't allow for such connections to exist.

With a lack of proper test suite we decided to take a risk and go
forward with removing that code.

Reviewed by: gallatin, bz, markj
Differential Revision: https://reviews.freebsd.org/D38015

15 months agotcp: use straight in_pcbconnect() in tcp_connect()
Gleb Smirnoff [Tue, 7 Feb 2023 17:21:52 +0000 (09:21 -0800)]
tcp: use straight in_pcbconnect() in tcp_connect()

This brings tcp_connect() par with tcp6_connect().  The code removed
now is a remnant of "truncating old TIME-WAIT" removed back in 2004
in c94c54e4df9a.

Reviewed by: markj, tuexen
Differential Revision: https://reviews.freebsd.org/D38405

15 months agoImport OpenSSL 1.1.1t
Jung-uk Kim [Tue, 7 Feb 2023 17:05:11 +0000 (12:05 -0500)]
Import OpenSSL 1.1.1t

15 months agolocal-unbound-setup: Use default root certificates
Tijl Coosemans [Thu, 19 Jan 2023 17:13:35 +0000 (18:13 +0100)]
local-unbound-setup: Use default root certificates

Don't force /etc/ssl/cert.pem.  It does not exist by default, only if
security/ca_root_nss is installed.  Just use the default OpenSSL search
locations which are /etc/ssl/cert.pem and /etc/ssl/certs/.

The tls-system-cert option was added in Unbound 1.16.0.

Reviewed by: zlei
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38243

15 months agobsdlabel: Fix whitespace.
Dmitry Chagin [Tue, 7 Feb 2023 07:43:40 +0000 (10:43 +0300)]
bsdlabel: Fix whitespace.

MFC after: 1 week

15 months agobsdlabel: Remove a write-only variable.
Dmitry Chagin [Tue, 7 Feb 2023 07:43:18 +0000 (10:43 +0300)]
bsdlabel: Remove a write-only variable.

Since r149061 (2005) the total_size variable is write-only.

Differential Revision: https://reviews.freebsd.org/D38368
MFC after: 2 weeks

15 months agocxgbe T6 KTLS: Use intotcpcb().
John Baldwin [Tue, 7 Feb 2023 01:05:18 +0000 (17:05 -0800)]
cxgbe T6 KTLS: Use intotcpcb().

Fixes: e68b3792440c tcp: embed inpcb into tcpcb
Sponsored by: Chelsio Communications

15 months agossh: default X11Forwarding to no, following upstream
Ed Maste [Mon, 14 Nov 2022 20:24:54 +0000 (15:24 -0500)]
ssh: default X11Forwarding to no, following upstream

Administrators can enable it if required.

Reviewed by: bz, kevans
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37411

15 months agoSkip if_wg regression tests if module doesn't exist
Olivier Cochard [Mon, 6 Feb 2023 23:06:48 +0000 (00:06 +0100)]
Skip if_wg regression tests if module doesn't exist

Approved by: jhb
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D38406

15 months agousr.sbin/kbdcontrol.c: Add backwards compatibility functions
Stefan Eßer [Mon, 6 Feb 2023 22:56:44 +0000 (23:56 +0100)]
usr.sbin/kbdcontrol.c: Add backwards compatibility functions

This commit allows a kbdcontrol binary built with a version of kbio.h
that supports Unicode characters in dead key maps to load and display
keymaps including the dead key tables on a kernel built with a
previous version of kbio.h (that only supported 8 bit characters in
the dead key map).

This commit is meant as a temporary compatibility shim that will be
reverted when it can be assumed that all relevant systems have been
upgraded to a kernel that uses the updated kbio.h.

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38388

15 months agoSupport Unicode characters in keymap dead key tables
Stefan Eßer [Mon, 6 Feb 2023 22:48:47 +0000 (23:48 +0100)]
Support Unicode characters in keymap dead key tables

Support for Unicode characters had been added to the keyboard code,
but there are keymaps that have accented characters accessed via dead
key combinations, and those were still restricted to 8 bit codes.

This update to kbd.c adds support for Unicode characters and
compatibility code that allows a kbdcontrol command built from kbio.h
without these patches to work on a new kernel.

Compatibility code that allows a new kbdcontrol binary running on an
old kernel to load and display the dead key map will be committed in a
separate commit.

Reviewed by: imp, brooks
Approved by: brooks
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38381

15 months agoirdma(4): Add code for compilation on stable/13 branch
Bartosz Sobczak [Mon, 6 Feb 2023 22:37:39 +0000 (14:37 -0800)]
irdma(4): Add code for compilation on stable/13 branch

Current content of the irdma(4) driver consists only of code that is
compilable on current 14-CURRENT branch which makes it impossible to
merge into stable/13 branch because of missing dependencies in the ofed
tree.

This patch adds missing code that allows for merging into stable branch.
Once it is there, code relating only to version 14 or higher should be
removed.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: erj@
MFC after: 1 day
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D38170

15 months agoem(4): Add IDs for new Intel(R) I219 devices
Piotr Kubaj [Mon, 6 Feb 2023 22:31:00 +0000 (14:31 -0800)]
em(4): Add IDs for new Intel(R) I219 devices

These include I219 (20) through I219 (23), which ends at Raptor Lake.

This also corrects a discrepancy where the (16) devices should be
mac type "e1000_pch_tgp" and not "e1000_pch_adp".

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
PR: 269224
Reviewed by: erj@
MFC after: 1 day
Relnotes: yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D38376

15 months agoamd64 pmap: patch up a comment in pmap_init_pv_table
Mateusz Guzik [Mon, 6 Feb 2023 22:33:28 +0000 (22:33 +0000)]
amd64 pmap: patch up a comment in pmap_init_pv_table

Requested by: jhb

15 months agoLinuxKPI: return an address string in pci_name()
Val Packett [Mon, 6 Feb 2023 21:50:13 +0000 (21:50 +0000)]
LinuxKPI: return an address string in pci_name()

amdgpu's virtual display feature uses pci_name() to match a module parameter
string, and the documentation shows an example of `0000:26:00.0` for the name.
In our case the name was just `drmn`, which is not actually unique across
devices.

The other consumers are wireless drivers, which will benefit from this
change.

Generate the expected string for pci_name() to return.

Related to: https://github.com/freebsd/drm-kmod/issues/134
Sponsored by: https://www.patreon.com/valpackett
Reviewed by: bz, hselasky, manu (earlier)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34248

15 months agossh: update to OpenSSH 9.2p1
Ed Maste [Mon, 6 Feb 2023 21:54:56 +0000 (16:54 -0500)]
ssh: update to OpenSSH 9.2p1

Release notes are available at https://www.openssh.com/txt/release-9.2

OpenSSH 9.2 contains fixes for two security problems and a memory safety
problem.  The memory safety problem is not believed to be exploitable.
These fixes have already been committed to OpenSSH 9.1 in FreeBSD.

Some other notable items from the release notes:

 * ssh(1): add a new EnableEscapeCommandline ssh_config(5) option that
   controls whether the client-side ~C escape sequence that provides a
   command-line is available. Among other things, the ~C command-line
   could be used to add additional port-forwards at runtime.

 * sshd(8): add support for channel inactivity timeouts via a new
   sshd_config(5) ChannelTimeout directive. This allows channels that
   have not seen traffic in a configurable interval to be
   automatically closed. Different timeouts may be applied to session,
   X11, agent and TCP forwarding channels.

 * sshd(8): add a sshd_config UnusedConnectionTimeout option to
   terminate client connections that have no open channels for a
   length of time. This complements the ChannelTimeout option above.

 * sshd(8): add a -V (version) option to sshd like the ssh client has.

 * scp(1), sftp(1): add a -X option to both scp(1) and sftp(1) to
   allow control over some SFTP protocol parameters: the copy buffer
   length and the number of in-flight requests, both of which are used
   during upload/download. Previously these could be controlled in
   sftp(1) only. This makes them available in both SFTP protocol
   clients using the same option character sequence.

 * ssh-keyscan(1): allow scanning of complete CIDR address ranges,
   e.g.  "ssh-keyscan 192.168.0.0/24". If a CIDR range is passed, then
   it will be expanded to all possible addresses in the range
   including the all-0s and all-1s addresses. bz#976

 * ssh(1): support dynamic remote port forwarding in escape
   command-line's -R processing. bz#3499

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

15 months agoccr,ccp: Fix argument order to sglist_append_vmpages.
John Baldwin [Mon, 6 Feb 2023 21:51:57 +0000 (13:51 -0800)]
ccr,ccp: Fix argument order to sglist_append_vmpages.

The offset comes before the byte count.

Reported by: br
Reviewed by: asomers, markj
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38375

15 months agocontrib/bc: uodate to version 6.2.4
Stefan Eßer [Mon, 6 Feb 2023 21:33:56 +0000 (22:33 +0100)]
contrib/bc: uodate to version 6.2.4

This update contains only documentation changes (new main repository
URL and changed mail address of the program author) and changes to
the build system that do not affect the FreeBSD base system build.

MFC after: 3 days