]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 months agoMerge llvm-project release/16.x llvmorg-16.0.4-0-gae42196bc493
Dimitry Andric [Mon, 22 May 2023 17:29:55 +0000 (19:29 +0200)]
Merge llvm-project release/16.x llvmorg-16.0.4-0-gae42196bc493

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.4-0-gae42196bc493 (aka 16.0.4 release).

PR: 271047
MFC after: 1 month

(cherry picked from commit a324c34037ef2e1101962fca4ad0c021253288e1)

11 months agoMerge llvm-project release/16.x llvmorg-16.0.3-0-gda3cd333bea5
Dimitry Andric [Fri, 5 May 2023 17:37:33 +0000 (19:37 +0200)]
Merge llvm-project release/16.x llvmorg-16.0.3-0-gda3cd333bea5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.3-0-gda3cd333bea5 (aka 16.0.3 release).

PR: 271047
MFC after: 1 month

(cherry picked from commit cbe9438cfe07adfbcdeafe8e363614f83b03a055)

11 months agoclang: re-downgrade implicit int/function declarations to warning only
Dimitry Andric [Tue, 25 Apr 2023 19:24:04 +0000 (21:24 +0200)]
clang: re-downgrade implicit int/function declarations to warning only

This reapplies upstream commit c0141f3c300f by Aaron Ballman:

  Downgrade implicit int and implicit function declaration to warning only

  The changes in Clang 15.0.0 which enabled these diagnostics as a
  warning which defaulted to an error caused disruption for people
  working on distributions such as Gentoo. There was an explicit request
  to downgrade these to be warning-only in Clang 15.0.1 with the
  expectation that Clang 16 will default the diagnostics to an error.

  See
  https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
  for more details on the discussion.

  See https://reviews.llvm.org/D133800 for the public review of these
  changes.

As noted in the upstream discussion, there are many programs that fail
to configure or build correctly, if these warnings are turned into
errors by default.

Note that most affected programs in ports are relatively old, and are
unlikely to be fixed by actually adjusting their declarations, but by
compiling with -std=gnu89, which downgrades the errors back to warning
again. Lots of tedious work for very little gain.

(cherry picked from commit c3450ad127e94d3fa67ae337310e59c002f51bfc)

11 months agoMerge llvm-project release/16.x llvmorg-16.0.2-0-g18ddebe1a1a9
Dimitry Andric [Sat, 22 Apr 2023 17:27:13 +0000 (19:27 +0200)]
Merge llvm-project release/16.x llvmorg-16.0.2-0-g18ddebe1a1a9

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.2-0-g18ddebe1a1a9 (aka 16.0.2 release).

PR: 271047
MFC after: 1 month

(cherry picked from commit 9e7101a856ad738879b0bde099bfb2ba08b7995c)

11 months agoMerge commit db492316399a from llvm-project (by Dimitry Andric):
Dimitry Andric [Thu, 20 Apr 2023 19:22:59 +0000 (21:22 +0200)]
Merge commit db492316399a from llvm-project (by Dimitry Andric):

  [clang][BFloat] Avoid redefining bfloat16_t in arm_neon.h

  As of https://reviews.llvm.org/D79708, clang-tblgen generates `arm_neon.h`,
  `arm_sve.h` and `arm_bf16.h`, and all those generated files will contain a
  typedef of `bfloat16_t`. However, `arm_neon.h` and `arm_sve.h` include
  `arm_bf16.h` immediately before their own typedef:

      #include <arm_bf16.h>
      typedef __bf16 bfloat16_t;

  With a recent version of clang (I used 16.0.1) this results in warnings:

      /usr/lib/clang/16/include/arm_neon.h:38:16: error: redefinition of typedef 'bfloat16_t' is a C11 feature [-Werror,-Wtypedef-redefinition]

  Since `arm_bf16.h` is very likely supposed to be the one true place where
  `bfloat16_t` is defined, I propose to delete the duplicate typedefs from the
  generated `arm_neon.h` and `arm_sve.h`.

  Reviewed By: sdesmalen, simonbutcher

  Differential Revision: https://reviews.llvm.org/D148822

PR: 271047
MFC after: 1 month

(cherry picked from commit 1ac57eed95099f4d9da2ecab6000ad66d05c1018)

11 months agoMerge commit 16949c5c48ab from llvm-project (by Dimitry Andric):
Dimitry Andric [Thu, 20 Apr 2023 19:21:37 +0000 (21:21 +0200)]
Merge commit 16949c5c48ab from llvm-project (by Dimitry Andric):

  [compiler-rt] Include system headers before optionally defining HWCAP macros

  In https://reviews.llvm.org/D141285 the optional definitions of `HWCAP`
  macros were moved to before their usage. However, they were also moved
  to before the inclusion of system headers which can optionally define
  them. If any of those system headers then actually defined any of the
  `HWCAP` macros, it would result in a redefinition error.

  Move the system header includes to just before the optional definitions,
  to avoid this problem.

  Reviewed By: ilinpv

  Differential Revision: https://reviews.llvm.org/D148819

PR: 271047
MFC after: 1 month

(cherry picked from commit 482e0fcdf745981f2c2b12311405fe93563cefc4)

11 months agoMerge llvm-project release/16.x llvmorg-16.0.1-0-gcd89023f7979
Dimitry Andric [Mon, 17 Apr 2023 17:14:23 +0000 (19:14 +0200)]
Merge llvm-project release/16.x llvmorg-16.0.1-0-gcd89023f7979

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.1-0-gcd89023f7979 (aka 16.0.1 release).

PR: 271047
MFC after: 1 month

(cherry picked from commit 1ac55f4cb0001fed92329746c730aa9a947c09a5)

11 months agoMerge llvm-project main llvmorg-16-init-18548-gb0daacf58f41
Dimitry Andric [Fri, 14 Apr 2023 21:41:27 +0000 (23:41 +0200)]
Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16-init-18548-gb0daacf58f41.

PR: 271047
MFC after: 1 month

(cherry picked from commit bdd1243df58e60e85101c09001d9812a789b6bc4)

11 months agolibarchive: make single bit bitfields unsigned to avoid clang 16 warning
Dimitry Andric [Mon, 17 Apr 2023 16:20:56 +0000 (18:20 +0200)]
libarchive: make single bit bitfields unsigned to avoid clang 16 warning

Clang 16 introduced a warning about single bit bitfields in structs,
which is triggered by various declarations in libarchive:

    contrib/libarchive/libarchive/archive_write_set_format_7zip.c:1541:13: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
                    file->dir = 1;
                              ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:5127:15: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
                    isoent->dir = 1;
                                ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:5213:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
            isoent->dir = 1;
                        ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:5214:18: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
            isoent->virtual = 1;
                            ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:7149:18: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
            isoent->virtual = 1;
                            ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:7435:32: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
                    iso9660->zisofs.detect_magic = 1;
                                                 ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:7495:25: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
            iso9660->zisofs.making = 1;
                                   ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:7496:26: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
            iso9660->zisofs.allzero = 1;
                                    ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:7702:28: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
                            iso9660->zisofs.allzero = 1;
                                                    ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:7871:25: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
                    zisofs->header_passed = 1;
                                          ^ ~
    contrib/libarchive/libarchive/archive_write_set_format_iso9660.c:7894:24: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
                            zisofs->initialized = 1;
                                                ^ ~

Signed one-bit bitfields can only have values -1 and 0, but the intent
here is to use the fields as booleans, so make them unsigned.

This has also been sent upstream.

MFC after: 3 days

(cherry picked from commit 67ecab6f50ff29e9bda340be1e9d2acc963c9a2b)

11 months agolibm: correctly test for for NaN and Infinity in sinpi(), cospi(), and tanpi()
Steve Kargl [Mon, 17 Jul 2023 05:19:28 +0000 (08:19 +0300)]
libm: correctly test for for NaN and Infinity in sinpi(), cospi(), and tanpi()

PR: 272539

(cherry picked from commit be4c7f273508994638b68d2fae742be37d3cb117)

11 months agolibthr: trigger library initialization on rwlock calls
Konstantin Belousov [Thu, 13 Jul 2023 15:56:11 +0000 (18:56 +0300)]
libthr: trigger library initialization on rwlock calls

(cherry picked from commit ad056b5d35d9957b1bd023abeb6461601449b725)

11 months agodepend-cleanup.sh: handle 32-bit dependencies having no 64-bit equivalent
Dimitry Andric [Mon, 10 Jul 2023 22:50:09 +0000 (00:50 +0200)]
depend-cleanup.sh: handle 32-bit dependencies having no 64-bit equivalent

For example with the recent removal of ffs.S for 32-bit arm and i386,
the egrep in clean_dep() did not find any files to remove, even if you
added a "clean_dep lib/libc ffs S" line. This is because it will never
find the ffs.S filename in the 64-bit .depend files for libc.

Split the searching and removing of 32-bit dependencies and objects into
a separate part to cope with this. This can be used similarly later on,
for other bitnesses.

MFC after: 3 days

(cherry picked from commit 7ba8cc9b7b6bdea142d7ecb82c7d3a9b095e967d)

11 months agorelease: pass UNAME_r to fix building 14.x ports on 13.x
Glen Barber [Thu, 18 Feb 2021 23:52:39 +0000 (18:52 -0500)]
release: pass UNAME_r to fix building 14.x ports on 13.x

Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

(cherry picked from commit 80ab50e1de19ca125f05a13937c796d48c4edd4a)

11 months agorelease: Adjust where UNAME_r is defined for ports builds
Glen Barber [Tue, 2 Mar 2021 15:11:04 +0000 (10:11 -0500)]
release: Adjust where UNAME_r is defined for ports builds

In followup to 80ab50e1de19ca125f05a13937c796d48c4edd4a,
export UNAME_r in Makefile.inc1 instead of Makefile.vm.

Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

(cherry picked from commit 0be274d3737972532c042d06c53b5807e95aa845)

11 months agorelease: Include Makefile.inc1 in Makefile.vm
Glen Barber [Tue, 2 Mar 2021 15:19:59 +0000 (10:19 -0500)]
release: Include Makefile.inc1 in Makefile.vm

Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

(cherry picked from commit c883b6fd8ccd8d9c50b3f8fbb04da20ac0dec1c4)

11 months agorelease: sprinkle UNAME_r hacks following c883b6fd8ccd
Glen Barber [Thu, 4 Mar 2021 14:22:45 +0000 (09:22 -0500)]
release: sprinkle UNAME_r hacks following c883b6fd8ccd

Pass UNAME_r override to make(1) for ports builds when building
ports for another branch.

Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

(cherry picked from commit 63749bfe96b792b3a435f84ad81a47888cae1dea)

11 months agoWrite out corrected superblock when creating a UFS/FFS snapshot.
Kirk McKusick [Tue, 13 Jun 2023 07:21:43 +0000 (00:21 -0700)]
Write out corrected superblock when creating a UFS/FFS snapshot.

PR:           271352
Tested-by: Peter Holm
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit f1549d7d522995bf5d821ae08cc2f500ba545285)

11 months agolibfido2: update to 1.10.0
Ed Maste [Fri, 5 May 2023 23:57:34 +0000 (19:57 -0400)]
libfido2: update to 1.10.0

Some highlights from NEWS:

 ** bio: fix CTAP2 canonical CBOR encoding in fido_bio_dev_enroll_*();
    gh#480.
 ** New API calls:
  - fido_dev_info_set;
  - fido_dev_io_handle;
  - fido_dev_new_with_info;
  - fido_dev_open_with_info.
 ** Documentation and reliability fixes.
 ** Support for TPM 2.0 attestation of COSE_ES256 credentials.

Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 3e696dfb7009cd8ffa12e36f48f4339bb7a2048d)

11 months agolibfido2: update to 1.9.0
Ed Maste [Fri, 5 May 2023 23:11:52 +0000 (19:11 -0400)]
libfido2: update to 1.9.0

Some highlights from NEWS:

 ** Added OpenSSL 3.0 compatibility.
 ** Removed OpenSSL 1.0 compatibility.
 ** Support for FIDO 2.1 "minPinLength" extension.
 ** Support for COSE_EDDSA, COSE_ES256, and COSE_RS1 attestation.
 ** Support for TPM 2.0 attestation.
 ** Support for device timeouts; see fido_dev_set_timeout().
 ** New API calls:
  - es256_pk_from_EVP_PKEY;
  - fido_cred_attstmt_len;
  - fido_cred_attstmt_ptr;
  - fido_cred_pin_minlen;
  - fido_cred_set_attstmt;
  - fido_cred_set_pin_minlen;
  - fido_dev_set_pin_minlen_rpid;
  - fido_dev_set_timeout;
  - rs256_pk_from_EVP_PKEY.
 ** Reliability and portability fixes.
 ** Better handling of HID devices without identification strings; gh#381.

Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit f540a43052c12c76d3453ead881248d5467a1ab0)

11 months agolibcbor: update to 0.10.2
Ed Maste [Fri, 21 Apr 2023 20:09:03 +0000 (16:09 -0400)]
libcbor: update to 0.10.2

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5d3e7166f6a0187fa3f8831b16a06bd9955c21ff)

11 months agossh: Update to OpenSSH 9.3p2
Ed Maste [Wed, 19 Jul 2023 17:02:33 +0000 (13:02 -0400)]
ssh: Update to OpenSSH 9.3p2

From the release notes:

Changes since OpenSSH 9.3
=========================

This release fixes a security bug.

Security
========

Fix CVE-2023-38408 - a condition where specific libaries loaded via
ssh-agent(1)'s PKCS#11 support could be abused to achieve remote
code execution via a forwarded agent socket if the following
conditions are met:

* Exploitation requires the presence of specific libraries on
  the victim system.
* Remote exploitation requires that the agent was forwarded
  to an attacker-controlled system.

Exploitation can also be prevented by starting ssh-agent(1) with an
empty PKCS#11/FIDO allowlist (ssh-agent -P '') or by configuring
an allowlist that contains only specific provider libraries.

This vulnerability was discovered and demonstrated to be exploitable
by the Qualys Security Advisory team.

In addition to removing the main precondition for exploitation,
this release removes the ability for remote ssh-agent(1) clients
to load PKCS#11 modules by default (see below).

Potentially-incompatible changes
--------------------------------

 * ssh-agent(8): the agent will now refuse requests to load PKCS#11
   modules issued by remote clients by default. A flag has been added
   to restore the previous behaviour "-Oallow-remote-pkcs11".

   Note that ssh-agent(8) depends on the SSH client to identify
   requests that are remote. The OpenSSH >=8.9 ssh(1) client does
   this, but forwarding access to an agent socket using other tools
   may circumvent this restriction.

Security: CVE-2023-38408
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 66fd12cf4896eb08ad8e7a2627537f84ead84dd3)

11 months agovfs: Add a parenthese to vn_lock_pair() asserts to silence gcc
Dmitry Chagin [Wed, 19 Jul 2023 13:51:07 +0000 (16:51 +0300)]
vfs: Add a parenthese to vn_lock_pair() asserts to silence gcc

(cherry picked from commit e38c634b77dec76c03613bd84b37ae22d3bb5699)

11 months agovn_lock_pair(): Support passing LK_NODDLKTREAT
Olivier Certner [Sun, 9 Jul 2023 17:12:52 +0000 (19:12 +0200)]
vn_lock_pair(): Support passing LK_NODDLKTREAT

(cherry picked from commit f58378393fb00f1683bc15f1ae7cbb83e047b9fb)

11 months agolib/libc/string/bcmp.c: fix integer overflow bug
Robert Clausecker [Wed, 12 Jul 2023 18:23:21 +0000 (20:23 +0200)]
lib/libc/string/bcmp.c: fix integer overflow bug

bcmp() returned the number of remaining bytes when the main loop exits.
In case of a match, this is zero, else a positive integer.  On systems
where SIZE_MAX > INT_MAX, the implicit conversion from size_t to int in
the return value may cause the number of remaining bytes to overflow,
becoming zero and falsely indicating a successful comparison.

Fix the bug by always returning 0 on equality, 1 otherwise.

PR: 272474
Approved by: emaste
Reviewed by: imp
MFC After: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41011

(cherry picked from commit 4da7282a1882fc03c99591c27d44a2e6dfda364b)

11 months agolib/libc/string: replace ffs/fls implementations with clang builtins
Robert Clausecker [Fri, 23 Jun 2023 16:22:54 +0000 (18:22 +0200)]
lib/libc/string: replace ffs/fls implementations with clang builtins

Most architectures we support (except for riscv64) have instructions
to compute these functions very quickly.  Replace old code with the
ftz and clz builtin functions, allowing clang to generate good code
for all architectures.

We cannot use the ffs builtins as gcc uses ffs() to implement these on
some platforms, potentially causing an infinite loop.

As a consequence, toss out arm and i386 ffs() implementations.

Sponsored by: The FreeBSD Foundation
Reported by: jlduran@gmail.com, jhb
Approved by: mhorne, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40730
Differential Revision: https://reviews.freebsd.org/D40966

(cherry picked from commit ee8b0c436d7221c25e8be3c3fe1f9da78b9d5b16)
(cherry picked from commit 3f5788e0ed8e85567f651ad360596b8c330af5a9)

11 months agolib/libc/tests/string: add unit tests for ffs, ffsl, ffsll, fls, flsl, and flsll
Robert Clausecker [Fri, 23 Jun 2023 17:26:44 +0000 (19:26 +0200)]
lib/libc/tests/string: add unit tests for ffs, ffsl, ffsll, fls, flsl, and flsll

Also supply CFLAGS+=-fno-builtin to ensure our unit tests
actually test libc functions and not clang's builtins.

Sponsored by: FreeBSD Foundation
Approved by: kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40729

(cherry picked from commit 49390697b9265d08d3f831cf38cdc2f79e216c48)

11 months agoiflib: Unlock ctx lock around call to ether_ifattach()
Przemyslaw Lewandowski [Wed, 19 Jul 2023 22:40:46 +0000 (15:40 -0700)]
iflib: Unlock ctx lock around call to ether_ifattach()

Panic occurs during loading driver using kldload. It exists since netlink is
enabled.  There is problem with double locking ctx. This fix allows to call
ether_ifattach() without locked ctx.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
PR: 271768
Reviewed by: erj@, jhb@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D40557

(cherry picked from commit a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d)

11 months agole(4): deprecate and mark for removal before 15.0
Brooks Davis [Wed, 21 Jun 2023 23:50:12 +0000 (00:50 +0100)]
le(4): deprecate and mark for removal before 15.0

We kept le(4) in the pre-12.0 purge because it was needed for Qemu/MIPS
(virtio networking didn't work) but the MIPS port has been removed.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40683

(cherry picked from commit b95d2237af403049d48c23229aa8bace3594970e)

11 months agooce(4): deprecate
Brooks Davis [Wed, 14 Jun 2023 17:55:54 +0000 (18:55 +0100)]
oce(4): deprecate

The Emulex OneConnect NIC driver hasn't seen any commits other than ioctl
bug fixes (some severe) and sweeping commits since 2016.  There is no
indication of new parts since 2014 or earlier.  As such, deprecate the
driver with the aim of removing it prior to FreeBSD 15.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40531

(cherry picked from commit 4591322980a37d6ee38a3ed70569366e16ca71f6)

11 months agooce(4): Don't directly access usespace
Brooks Davis [Wed, 14 Jun 2023 17:55:41 +0000 (18:55 +0100)]
oce(4): Don't directly access usespace

Replace direct stores to userspace addresses (never safe and broken on
modern CPUs) with a copyout.  Use a static assert on the size to ensure
we don't overflow the field.

Reviewed by: markj, jhb
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D40519

(cherry picked from commit 758927a982db0ae3ebb02c05aec8a53bcc0c20cb)

11 months agoDocument fdescfs mount option "rdlnk"
Konstantin Belousov [Tue, 11 Jul 2023 05:09:11 +0000 (08:09 +0300)]
Document fdescfs mount option "rdlnk"

(cherry picked from commit 7cd7a3204153fc8ddf7d06cd0d924d5c3ef5ff35)

11 months agofdescfs: add a mount option rdlnk
Konstantin Belousov [Tue, 11 Jul 2023 05:03:49 +0000 (08:03 +0300)]
fdescfs: add a mount option rdlnk

PR: 272127

(cherry picked from commit 3905309dfeeb89f03b09c347f7ac0a863faa3975)

11 months agoRevert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option"
Konstantin Belousov [Tue, 11 Jul 2023 04:58:06 +0000 (07:58 +0300)]
Revert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option"

(cherry picked from commit 9c3bfe2ad07170cd7d3645a7c24f4d80a509c2b7)

11 months agorelease: adjust lang/python* dependencies for GCE
Glen Barber [Mon, 17 Jul 2023 20:16:46 +0000 (16:16 -0400)]
release: adjust lang/python* dependencies for GCE

The lang/python3 port had failed to properly install because
it did in fact already exist and FORCE_PKG_REGISTER was not
set.  So, behaviorally everything here was correct.  However,
installing lang/python3 is in fact not correct and not needed,
so only install the lang/python port to provide symbolic links.

PR: 272354
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

(cherry picked from commit b24c35b326dbd355070335e63d02e7c29ee58bf0)

11 months agorelease: remove a stray backslash
Glen Barber [Wed, 12 Jul 2023 20:57:57 +0000 (16:57 -0400)]
release: remove a stray backslash

PR: 272354 (related)
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

(cherry picked from commit 510fd83138001b0a6e45b3fa6a7249377f806171)

11 months agorelease: follow-up to previous commit to install lang/python{,3}
Glen Barber [Wed, 12 Jul 2023 20:49:53 +0000 (16:49 -0400)]
release: follow-up to previous commit to install lang/python{,3}

PR: 272354
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

(cherry picked from commit cd8cad0ef5cd534dc7ae1dd9a470cac2057ed957)

11 months agorelease: ensure gce-check-depends installs lang/python{,3}
Glen Barber [Wed, 12 Jul 2023 20:08:40 +0000 (16:08 -0400)]
release: ensure gce-check-depends installs lang/python{,3}

PR: 272354
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

(cherry picked from commit 0ed426276fd52e917506ab87c05a61c6641ae298)

11 months agopf: fix error descriptions in the man page
Kristof Provost [Wed, 12 Jul 2023 11:17:14 +0000 (13:17 +0200)]
pf: fix error descriptions in the man page

PR: 272459
Submitted by: alex@inferiorhumanorgans.com
MFC after: 1 week

(cherry picked from commit df56c8069a4c920392ac9fec0adfcc03d9607abc)

11 months agopf: fix pfi_kif definition in the man page
Kristof Provost [Wed, 12 Jul 2023 09:43:43 +0000 (11:43 +0200)]
pf: fix pfi_kif definition in the man page

PR: 272455
Submitted by: alex@inferiorhumanorgans.com
MFC after: 1 week

(cherry picked from commit 64b30b7aeb6d0dc48d038b3df033328c8d8c3141)

11 months agobhyve: Deduplicate some code in modify_bar_registration()
Mark Johnston [Tue, 11 Jul 2023 19:22:37 +0000 (15:22 -0400)]
bhyve: Deduplicate some code in modify_bar_registration()

No functional change intended.

Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40877

(cherry picked from commit 0dea4f064dfcd0725d02b9b2d02b2494ca866857)

11 months agoure(4): add support for Thinkpad Hybrid USB-C with USB-A dock
Joerg Pulz [Tue, 4 Jul 2023 16:08:13 +0000 (18:08 +0200)]
ure(4): add support for Thinkpad Hybrid USB-C with USB-A dock

Add support for LAN port found on Thinkpad Hybrid USB-C with USB-A dock.
While here fix a small typo
  - s/UBS/USB/

Sponsored by: Technical University of Munich
Reviewed by: markj
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/791

(cherry picked from commit 53a03e312cf27fca9b672c22d9b1687a66785cfb)

11 months agoman(1): use gzcat for .gz files
Mohamed Akram [Mon, 3 Jul 2023 15:20:51 +0000 (19:20 +0400)]
man(1): use gzcat for .gz files

POSIX zcat appends the .Z suffix to file arguments causing the command to fail
with .gz files.

Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Reviewed by: markj
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/789

(cherry picked from commit b35ea9bac974a5650dcc234c06b3dc41d127f1d7)

11 months agosyslog.3: MFC: document ident[N] format
Eugene Grosbein [Mon, 3 Jul 2023 12:35:37 +0000 (19:35 +0700)]
syslog.3: MFC: document ident[N] format

When libc switched to generation of logs as per RFC 5424,
that change broke application ability to insert specific process id
using ident[N] format, the feature existed for decades.
Some processes rely on it (including logger and syslogd).

Later the regression was fixed but the feature remained undocumented.
This change documents it.

(cherry picked from commit 5aee3e14d4914c7c99bce80da17b3100cb1f4490)

11 months agolibthr: some style in thr_rwlock.c
Konstantin Belousov [Thu, 13 Jul 2023 15:55:50 +0000 (18:55 +0300)]
libthr: some style in thr_rwlock.c

(cherry picked from commit 80c5588495674fc6501700fccb0ed4a37183c89c)

11 months agomsdosfs: zero partially valid extended cluster
Konstantin Belousov [Thu, 6 Jul 2023 01:51:07 +0000 (04:51 +0300)]
msdosfs: zero partially valid extended cluster

(cherry picked from commit 7e4c6b2163fbed6be92b1e19f0eec4da973cfaec)

11 months agopmc_events.h: update top-level comment
Mitchell Horne [Mon, 26 Jun 2023 17:08:56 +0000 (14:08 -0300)]
pmc_events.h: update top-level comment

It points to non-existent documentation. The wiki page still contains a
useful overview, so keep this link.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit f7a217060608b5fa9e7c59724a617b7241a3ee3b)

11 months agopmcstat(8): Drop .Ud
Mitchell Horne [Mon, 10 Jul 2023 17:23:36 +0000 (14:23 -0300)]
pmcstat(8): Drop .Ud

This utility has existed for a long time and should not be advertised as
"currently under development".

While here, fix the one other warning from igor about using a newline
for a new sentence.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit a5b3e56330b07c8163b4d62ec55edf37746c11cf)

11 months agopmclog(3): Drop .Ud
Mitchell Horne [Mon, 10 Jul 2023 17:20:54 +0000 (14:20 -0300)]
pmclog(3): Drop .Ud

This API is stable and should not be advertised as "currently under
development".

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 398fb4a592a3509cc73c3fc99d44712b0505fb7a)

11 months agoRemove GCC 4.2 include dirs
Mitchell Horne [Mon, 10 Jul 2023 13:16:13 +0000 (10:16 -0300)]
Remove GCC 4.2 include dirs

These are present (and empty) on a system installed post-GCC removal.

Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D40878

(cherry picked from commit 8ab2da68283b7228f2caa7e7df173d6d46a224f9)

11 months agopmc: clean up remaining Pentium man page references
Mitchell Horne [Sat, 24 Jun 2023 17:09:00 +0000 (14:09 -0300)]
pmc: clean up remaining Pentium man page references

These have been removed.

Fixes: d78896e46f1d ("pmc(3): remove Pentium-related man pages...")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ba84e87055de71452291e229f8087d612999da40)

11 months agohwpmc(4): document debugging options
Mitchell Horne [Fri, 16 Jun 2023 16:38:43 +0000 (13:38 -0300)]
hwpmc(4): document debugging options

The debug options for hwpmc are not documented in detail anywhere, and
setting it up was error-prone the first time I had to figure it out (and
each time I've had to remember it). Add some explanation of the required
options and describe the kern.hwpmc.debugflags sysctl format.

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

(cherry picked from commit 5fc97cc32553c4073c7dafd67a2d489b8af8563e)
(cherry picked from commit 89240e0ab60a29a47c9af9f952a09a7f2e1bb72c)

11 months agopmc: clarify and strengthen statements about API/ABI
Mitchell Horne [Fri, 16 Jun 2023 16:38:19 +0000 (13:38 -0300)]
pmc: clarify and strengthen statements about API/ABI

- Make it clear that applications are not only encouraged to use the
  pmc(3) library, but use of the hwpmc(4) interface directly is a
  use-case we do not support
- Move the COMPATIBILITY section above PROGRAMMING API in hwpmc(4)
- Drop statements about the driver and library being "under development"

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40543

(cherry picked from commit 3977781b987e369a9fe23bb642b9680b0a3887c1)

11 months agohwpmc(4): more detailed SYNOPSYS
Mitchell Horne [Fri, 16 Jun 2023 16:38:03 +0000 (13:38 -0300)]
hwpmc(4): more detailed SYNOPSYS

Include some boilerplate similar to other section 4 man pages,
describing how to load the module at boot-time or include it in the
kernel.

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40542

(cherry picked from commit 0a1a48148ccd561464d643c05597cec2ae9e88b8)

11 months agohwpmc(4): remove paragraph about Pentium Pro handling
Mitchell Horne [Fri, 16 Jun 2023 16:34:02 +0000 (13:34 -0300)]
hwpmc(4): remove paragraph about Pentium Pro handling

Support for these CPUs was removed in 2018 (e92a1350b50e).

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40541

(cherry picked from commit 0a0c599ab9a578dd175e626144eacdbb4c5ac6bc)

11 months agohpwmc: add __pmcdbg_used annotation
Mitchell Horne [Wed, 14 Jun 2023 16:30:32 +0000 (13:30 -0300)]
hpwmc: add __pmcdbg_used annotation

For variables which are only used in PMCDBG* macros.

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

(cherry picked from commit 0589e7059bcd238027953d1311137512cc6dddea)

11 months agohwpmc: add error for HWPMC_DEBUG without KTR
Mitchell Horne [Fri, 16 Jun 2023 16:38:26 +0000 (13:38 -0300)]
hwpmc: add error for HWPMC_DEBUG without KTR

The option is a no-op otherwise, but this is not necessarily obvious.
Failing the compile gives the user a hint.

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40544

(cherry picked from commit 569f89b2f442e2187f750a5892a1662390364cc6)

11 months agoseq: combine asprintf return value checks
Ed Maste [Mon, 19 Jun 2023 02:10:32 +0000 (22:10 -0400)]
seq: combine asprintf return value checks

Error handling is identical for all of these failure cases.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5dae8905a5141e0cba1f4f3f94116440a5ce2abb)

11 months agologin.conf: document how to specify env var values with commas
Ed Maste [Wed, 28 Jun 2023 18:50:49 +0000 (14:50 -0400)]
login.conf: document how to specify env var values with commas

As of f32db406504e quotes may be used to specify login class
capabilities that include commas.  This is true in general but is
particularly relevant for setenv, a comma-separated list of environment
variables and values, so mention it there.

PR: 236204
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ab2f6ae8d1742f57552c37425e9cab8499d2d4ea)

11 months agopf: Add code to enable filtering for locally delivered packets
Doug Rabson [Tue, 20 Jun 2023 13:01:58 +0000 (14:01 +0100)]
pf: Add code to enable filtering for locally delivered packets

This is disabled by default since it potentially changes the behavior of
existing filter rule sets. To enable this extra filter for packets being
delivered locally, use:

sysctl net.pf.filter_local=1
service pf restart

PR:             268717
Reviewed-by: kp
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40373

(cherry picked from commit 3a1f834b5228986a7c14fd60da13cf2700e80996)

11 months agonetinet*: Fix redirects for connections from localhost
Doug Rabson [Wed, 24 May 2023 13:11:37 +0000 (14:11 +0100)]
netinet*: Fix redirects for connections from localhost

Redirect rules use PFIL_IN and PFIL_OUT events to allow packet filter
rules to change the destination address and port for a connection.
Typically, the rule triggers on an input event when a packet is received
by a router and the destination address and/or port is changed to
implement the redirect. When a reply packet on this connection is output
to the network, the rule triggers again, reversing the modification.

When the connection is initiated on the same host as the packet filter,
it is initially output via lo0 which queues it for input processing.
This causes an input event on the lo0 interface, allowing redirect
processing to rewrite the destination and create state for the
connection. However, when the reply is received, no corresponding output
event is generated; instead, the packet is delivered to the higher level
protocol (e.g. tcp or udp) without reversing the redirect, the reply is
not matched to the connection and the packet is dropped (for tcp, a
connection reset is also sent).

This commit fixes the problem by adding a second packet filter call in
the input path. The second call happens right before the handoff to
higher level processing and provides the missing output event to allow
the redirect's reply processing to perform its rewrite. This extra
processing is disabled by default and can be enabled using pfilctl:

pfilctl link -o pf:default-out inet-local
pfilctl link -o pf:default-out6 inet6-local

PR: 268717
Reviewed-by: kp, melifaro
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40256

(cherry picked from commit 5ab151574c8a1824c6cd8eded28506cb983284bc)

11 months agolibthr: Patch to reduce latency to acquire+release a pthread mutex.
Greg Becker [Fri, 7 Jul 2023 22:03:14 +0000 (17:03 -0500)]
libthr: Patch to reduce latency to acquire+release a pthread mutex.

(cherry picked from commit b370ef156ab9d88450e9bc0440df522aec88cc44)

11 months agosrc.conf.5: regen
Konstantin Belousov [Fri, 7 Jul 2023 01:51:56 +0000 (04:51 +0300)]
src.conf.5: regen

11 months agolibthr: Add src.conf variable WITHOUT_PTHREADS_ASSERTIONS
Greg Becker [Fri, 7 Jul 2023 00:30:02 +0000 (19:30 -0500)]
libthr: Add src.conf variable WITHOUT_PTHREADS_ASSERTIONS

(cherry picked from commit 642cd511028b8839db2c89a44cf7807d80664f38)

11 months agolibbe: bail out early if the zfs kmod isn't loaded
Kyle Evans [Fri, 7 Jul 2023 00:41:14 +0000 (19:41 -0500)]
libbe: bail out early if the zfs kmod isn't loaded

As noted in the comment, we already know the rest of libbe_init() will
fail because there's no pool imported.  Avoid the side effect by
checking beforehand and bailing out early.

With this, freebsd-update(8) should no longer trigger a load of the zfs
kmod just because it runs `bectl check`.

Reviewed by: jwmaag_gmail.com, rew

(cherry picked from commit 2f700ca965a04c4a03b6f760da6a210b6ca4df4b)

11 months agocaroot: add new certs
Kyle Evans [Sun, 25 Jun 2023 23:47:49 +0000 (18:47 -0500)]
caroot: add new certs

Based on dates, these were likely just missed in the last update... add
them now.

- Twenty (20) new

(cherry picked from commit ee0aa1ce12b3caea34477a31e9d2111a329e33b9)

11 months agowg: fix a number of issues with module load failure handling
Kyle Evans [Wed, 21 Jun 2023 18:56:58 +0000 (13:56 -0500)]
wg: fix a number of issues with module load failure handling

If MOD_LOAD fails, then MOD_UNLOAD will be called to unwind module
state, but wg_module_init() will have already deinitialized everything
it needs to in a manner that renders it unsafe to call MOD_UNLOAD
after (e.g., freed zone not reset to NULL, wg_osd_jail_slot not reset
to 0).  Let's simply stop trying to handle freeing everything in
wg_module_init() to simplify it; let the subsequent MOD_UNLOAD deal with
it, and let's make that robust against partially-constructed state.

jhb@ notes that MOD_UNLOAD being called if MOD_LOAD fails is kind of an
anomaly that doesn't match other paradigms in the kernel; e.g., if
device_attach() fails, we don't invoke device_detach().  It's likely
that a future commit will revert this and instead stop calling
MOD_UNLOAD if MOD_LOAD fails, expecting modules to clean up after
themselves in MOD_LOAD upon failure.  Some other modules already do this
and may see similar problems to the wg module (see: carp).  The proper
fix is decidedly a bit too invasive to do this close to 14 branching,
and it requires auditing all kmods (base + ports) for potential leaks.

PR: 272089
Reviewed by: emaste

(cherry picked from commit b08ee10c0646e683cd03c9e28f537d9a7ba306af)

11 months agowg: fix MOD_LOAD to fail properly if cookie_init() fails
Kyle Evans [Fri, 23 Jun 2023 16:41:07 +0000 (11:41 -0500)]
wg: fix MOD_LOAD to fail properly if cookie_init() fails

Previously we'd jump to the `free_crypto` label, but never set `ret` to
a failure value -- it would retain success from the call just prior.

Set ret up properly.

(cherry picked from commit ad9f4e6351fb23ee81bc940638d20af3ca7c278d)

11 months agobug: efi_print_global only checks for the first 5 letters of "Driver"
Alfonso Gregory [Mon, 8 May 2023 21:48:50 +0000 (17:48 -0400)]
bug: efi_print_global only checks for the first 5 letters of "Driver"

As a result, it is only really checking for the word Drive, making
"Drive" appended to anything else considered for efi env.

Reviewed by: imp, kevans

(cherry picked from commit 39ae24e3bf1c8e7d053d0249a6bc88f65eff6de1)

11 months agogetfacl: free `acl` in print_acl error path
Kyle Evans [Thu, 22 Jun 2023 04:58:33 +0000 (23:58 -0500)]
getfacl: free `acl` in print_acl error path

Sponsored by: Klara, Inc.

(cherry picked from commit 781624ca2d054430052c828ba8d2c2eaf2d733e7)

11 months agoacl_is_trivial_np(3): minor fixes
Kyle Evans [Mon, 19 Jun 2023 05:31:16 +0000 (00:31 -0500)]
acl_is_trivial_np(3): minor fixes

- Correct the document title
- This function has an _np suffix
- acl_strip_np has a manpage, xref it
- RETURN VALUES should describe acl_is_trivial_np, not acl_get_tag_type

Sponsored by: Klara, Inc.

(cherry picked from commit 0e96337b11910b444763439a722c89983d660a09)

11 months agovn_path_to_global_path_hardlink(): initialize len
Konstantin Belousov [Tue, 4 Jul 2023 07:46:15 +0000 (10:46 +0300)]
vn_path_to_global_path_hardlink(): initialize len

(cherry picked from commit d7614c010c762dcb29110073e7fbecf048fa3a32)

11 months agovn_path_to_global_path_hardlink(): avoid freeing non-initialized pointer
Konstantin Belousov [Mon, 3 Jul 2023 17:22:33 +0000 (20:22 +0300)]
vn_path_to_global_path_hardlink(): avoid freeing non-initialized pointer

(cherry picked from commit d6b900c915c19ac1bb5d57659695fd143864be66)

11 months agosys_setpgid(): style, remove extra ()s
Konstantin Belousov [Fri, 7 Jul 2023 16:59:41 +0000 (19:59 +0300)]
sys_setpgid(): style, remove extra ()s

(cherry picked from commit ed84cb591df70b860f988c455d70731e6df15186)

11 months agoifconfig.8: Document limitation of groupname
Koichiro Iwao [Tue, 20 Jun 2023 10:14:39 +0000 (19:14 +0900)]
ifconfig.8: Document limitation of groupname

Approved by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40645

(cherry picked from commit 9aca30d87804b9b9f646f9ef3ad5ae6af81fd40a)

12 months agohier(7): remove entry for non-existent /usr/compat
Mitchell Horne [Thu, 6 Jul 2023 14:11:21 +0000 (11:11 -0300)]
hier(7): remove entry for non-existent /usr/compat

This is historical (?), but today /compat is the default according to
linux(4). The only remaining reference to /usr/compat in the src tree is
under tools/test/stress2.

Add a next-level entry for /compat/linux.

PR: 261349
Reviewed by: grahamperrin, karels, dchagin
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40876

(cherry picked from commit 5e7308a7bcb6675de6049afd4a5dd9d6795057b2)

12 months agoif_bridge: fix potential panic
Kristof Provost [Thu, 18 May 2023 18:04:45 +0000 (20:04 +0200)]
if_bridge: fix potential panic

When a new bridge_rtnode is added it is added with a NULL brt_dst. The
brt_dst is set after the entry is added. This means there's a small
window where another core could also attempt to add this node, leading
to the code attempting to log that the MAC addresses moved to a new
interface.
Aside from that being a spurious log entry it also panics, because
obif is NULL (and we attempt to dereference it).

Avoid this by settings brt_dst before we insert the bridge_rtnode.
Assert that obif is non-NULL, as an extra precaution.

Reported by: olivier@
Reviewed by: zlei@
Differential Revision: https://reviews.freebsd.org/D40147

(cherry picked from commit f3546eacf0daac55fe08b6ad5849b0e440f75ffb)

12 months agopam_krb5: Add missing patch
Cy Schubert [Sat, 8 Jul 2023 03:09:18 +0000 (20:09 -0700)]
pam_krb5: Add missing patch

Include a portion of the patch that was missed in 813847e49e35.

Reported by: markj
Fixes: 813847e49e35

(cherry picked from commit bfa51318dee8afd9307f15e49a6a521938dccd06)

12 months agorelease/DVD_PACKAGES: Update the names of drm-kmod ports
Li-Wen Hsu [Tue, 4 Jul 2023 20:24:52 +0000 (04:24 +0800)]
release/DVD_PACKAGES: Update the names of drm-kmod ports

When MFC, graphics/drm-515-kmod is not merged as it only suports 14+.

Reviewed by: x11 (manu), re (gjb)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40770

(cherry picked from commit fea4a44c1965d4b709362a74abb0ab4b28ec29ac)

12 months agoriscv: improve KTR_TRAP trace entries
Mitchell Horne [Tue, 20 Jun 2023 14:52:26 +0000 (11:52 -0300)]
riscv: improve KTR_TRAP trace entries

For more informative records of exceptions, include key details such as
the exception code and stval register contents. Remove the curthread
argument as it is redundant (saved with every ktr entry), and the
trapframe as it is somewhat meaningless.

Add a new KTR_TRAP trace record for interrupts.

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

(cherry picked from commit 7756232199adf60343ae0b940e2b27fe363905bc)

12 months agoamdtemp: Fix missing 49 degree offset on current EPYC CPUs
Val Packett [Sat, 17 Jun 2023 16:29:53 +0000 (13:29 -0300)]
amdtemp: Fix missing 49 degree offset on current EPYC CPUs

On an EPYC 7313P, the temperature reported by amdtemp was off, because
the offset was not applied. Turns out it needs to be applied with one
more condition: https://lkml.org/lkml/2023/4/13/1095

Reviewed by: mhorne
Tested by: mike.jakubik@gmail.com
MFC after: 1 week
Sponsored by: https://www.patreon.com/valpackett
Pull Request: https://github.com/freebsd/freebsd-src/pull/754

(cherry picked from commit c1cbabe8ae5702a1e54d62401fe3b58a84fcb3e4)

12 months agoarm64/disassem.c: Add shifted register definitions with ror
Mykola Hohsadze [Sat, 17 Jun 2023 15:31:25 +0000 (12:31 -0300)]
arm64/disassem.c: Add shifted register definitions with ror

Add disassembly support for the following shifted register instructions:
* mvn
* orn
* orr
* and
* ands
* bic
* bics
* eon
* eor
* tst

According to Arm64 documenation, operational pseuducode of shifted
register instruction must return `UNDEFINED` if shift type is `RESERVED`
('11'). Hence, removed "rsv" from `shift_2` array and add "ror". In case
of shift type is 3 and this type is `RESERVED`, we will return
`undefined`.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40386

(cherry picked from commit 9aef25d2686b9e7fb9cb700d63291338e8e30bb6)

12 months agohier(7): adjust overlays/ subdirectory
Mitchell Horne [Thu, 29 Jun 2023 16:53:52 +0000 (13:53 -0300)]
hier(7): adjust overlays/ subdirectory

Device tree overlays are installed in /boot/dtb/overlays by default.
Adjust the comment to mention fdt_overlays and loader.conf, but do not
repeat what is said in the parent directory's description.

PR: 261349
Reviewed by: grahamperrin, kevans
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40785

(cherry picked from commit 651d1efd96a692a141a4c61d54d6a41ee2c0d851)

12 months agohier(7): tweak /media description
Mitchell Horne [Wed, 28 Jun 2023 16:21:28 +0000 (13:21 -0300)]
hier(7): tweak /media description

It comes as an empty directory by default. While here, use a serial
(Oxford) comma, per the FDP Primer.

PR: 261349
Reported by: karels
Reviewed by: grahamperrin, karels
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40774

(cherry picked from commit acdf666147eea8bf8626d3733087861493d90e23)

12 months agohier(7): improvement, modernisation
Graham Perrin [Sat, 10 Jun 2023 08:41:35 +0000 (09:41 +0100)]
hier(7): improvement, modernisation

Consistent use of lowercase, spacing between sections, etc.

Cease mentioning floppy disks.

De-list /usr/share/misc/fonts/, which has been ??? (without a
description) for twenty-seven years.

Change zpool to pool. (zpool is a command.)

Uppercase PPP for Point-to-Point Protocol.

A few other changes to wording, including avoidance of the phrase
pre-fab.

Update the descriptions of:

* /tmp/
* /usr/share/misc/
* /var/preserve/
* /var/tmp/
* /var/tmp/vi.recover/.

Refer to vi(1) instead of ex(1).

https://bugs.freebsd.org/261349

PR:                      261349
Reviewed by:             mhorne
Approved by:             mhorne
Pull request:            https://github.com/freebsd/freebsd-src/pull/763

(cherry picked from commit 6469f9c595c609dd552ec198a16c471c87df7c57)
(cherry picked from commit 5ca7f02946940ff698741d4da4a30b554cb0f592)
(cherry picked from commit b374a3921d97bdb20b103aaeb91988c3d355ea71)

12 months agohier(7): alphabetical order
Graham Perrin [Tue, 30 May 2023 19:30:20 +0000 (20:30 +0100)]
hier(7): alphabetical order

Approved by:  mhorne
Pull request: https://github.com/freebsd/freebsd-src/pull/756

(cherry picked from commit 2071e54c226a120a62baa710bef225c4f6ad5ee3)

12 months agomac(9): update SEE ALSO
Mitchell Horne [Mon, 12 Jun 2023 18:59:00 +0000 (15:59 -0300)]
mac(9): update SEE ALSO

Rather than maintaining an incomplete list of MAC modules references,
just reference mac(4), where such a list can be found.

Reviewed by: Mina Galić <freebsd@igalic.co>
Reviewed by: Pau Amma <pauamma@gundo.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40485

(cherry picked from commit 0449bc249b78a8c85afe375e581432351f90427d)

12 months agomac(4): update the references to MAC modules
Mitchell Horne [Mon, 12 Jun 2023 18:56:34 +0000 (15:56 -0300)]
mac(4): update the references to MAC modules

Add entries for mac_ntpd(4) and mac_priority(4) to the table of MAC
modules.

Drop the entry for mac_none(4) from the list, but retain the
cross-reference in SEE ALSO. This module has no functional impact and is
of minimal interest to users. Add a new cross-reference to the similar
mac_stub(4), limited to SEE ALSO for the same reasoning.

Reviewed by: Pau Amma <pauamma@gundo.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40483

(cherry picked from commit e2cb7201015dbd2d4cea5c9b4e0385d11614263c)

12 months agohier(7): document libdata/pkgconfig
Baptiste Daroussin [Mon, 25 Jul 2022 09:14:50 +0000 (11:14 +0200)]
hier(7): document libdata/pkgconfig

(cherry picked from commit 94778fc7382d2d9dd474eca1f88a86364f768f15)

12 months agohier.7: Document /var/db/freebsd-update
Mateusz Piotrowski [Thu, 4 Aug 2022 13:57:18 +0000 (15:57 +0200)]
hier.7: Document /var/db/freebsd-update

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

(cherry picked from commit 3c4f8adc794d769bdc332a92f0920af928002441)

12 months agohier.7: Add some missing Xr's
Mateusz Piotrowski [Tue, 28 Jun 2022 13:15:53 +0000 (15:15 +0200)]
hier.7: Add some missing Xr's

MFC after: 3 days

(cherry picked from commit c618ee727712900105212af29b3ebf16b1076875)

12 months agonetinet6: Implement in6_cksum_partial() using m_apply()
Mark Johnston [Fri, 23 Jun 2023 13:55:43 +0000 (09:55 -0400)]
netinet6: Implement in6_cksum_partial() using m_apply()

This ensures that in6_cksum_partial() can be applied to unmapped mbufs,
which can happen at least when icmp6_reflect() quotes a packet.

The basic idea is to restructure in6_cksum_partial() to operate on one
mbuf at a time.  If the buffer length is odd or unaligned, an extra
residual byte may be returned, to be incorporated into the checksum when
processing the next buffer.

PR: 268400
Reviewed by: cy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40598

(cherry picked from commit 6775ef4188b4d4c023e76ebd2b71fa8c2c7e7cd2)

12 months agonetinet tests: Add a test which connects a disconnected socket
Mark Johnston [Fri, 23 Jun 2023 14:06:13 +0000 (10:06 -0400)]
netinet tests: Add a test which connects a disconnected socket

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b1c66bc44af099174afb9840c7db011a5bd0225d)

12 months agopseudofs: Fix a potential out-of-bounds access in pfs_lookup()
Mark Johnston [Fri, 23 Jun 2023 13:54:39 +0000 (09:54 -0400)]
pseudofs: Fix a potential out-of-bounds access in pfs_lookup()

pseudofs nodes store their name in a flexible array member, so the node
allocation is sized using the length of the name, including a nul
terminator.  pfs_lookup() scans a directory of nodes, comparing names to
find a match.  The comparison was incorrect and assumed that all node
names were at least as long as the name being looked up, which of course
isn't true.

I believe the bug is mostly harmless since it cannot result in false
positive or negative matches from the lookup, but it triggers a KASAN
check.

Reported by: pho
Reviewed by: kib, Olivier Certner <olce.freebsd@certner.fr>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40692

(cherry picked from commit fc915f1be145a52c53f6f1c37525043216e32bb8)

12 months agoperiodic: Honor kern.localbase
Juraj Lutter [Tue, 6 Jun 2023 11:40:49 +0000 (13:40 +0200)]
periodic: Honor kern.localbase

Take kern.localbase into account with fallback to /usr/local and
also allow for LOCALBASE/etc/periodic.conf (similarly to what
many other utilities do).

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

(cherry picked from commit e5d7100c09e03e66535eee69d7e454c01e4a9d28)

12 months agokern_lockf.c: fix typo
Konstantin Belousov [Tue, 4 Jul 2023 22:23:57 +0000 (01:23 +0300)]
kern_lockf.c: fix typo

(cherry picked from commit 658e7620672f8eb650695992b4a73e004c5f101b)

12 months agokillpg1(): update the herald comment
Konstantin Belousov [Fri, 16 Jun 2023 09:02:04 +0000 (12:02 +0300)]
killpg1(): update the herald comment

(cherry picked from commit 4b59d1724b765063891cb44c28079b4c503a02fd)

12 months agonfscl: Fix support for doing Null RPCs
Rick Macklem [Fri, 7 Apr 2023 19:57:26 +0000 (12:57 -0700)]
nfscl: Fix support for doing Null RPCs

Although the NFS client does not currently perform Null RPCs,
this fix is needed if/when it might do so.
Found during testing of experimental code that uses Null RPCs
to maintain/monitor TCP connections for "nconnect" mounts.

(cherry picked from commit 4adb28c0abfa3b8d076c7249f61a093c6eb9dac2)

12 months agorelease: update GCE configuration for python3
Glen Barber [Mon, 3 Jul 2023 19:28:33 +0000 (15:28 -0400)]
release: update GCE configuration for python3

Reported by: asomers
PR: 272354
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd

(cherry picked from commit 3f21d3e0babacabb9a32e0e9a8ab290025d5577c)

12 months agorelease: allow VM_EXTRA_PACKAGES to be specified in the environment
Brad Davis [Mon, 9 Aug 2021 16:31:51 +0000 (10:31 -0600)]
release: allow VM_EXTRA_PACKAGES to be specified in the environment

This is useful for adding extra packages to the build of an AMI.
For example:
env VM_EXTRA_PACKAGES="zsh" make -C release ec2ami

(cherry picked from commit 83952a5baa337cc257858feb4886d947ba1a60e3)

12 months agoctfconvert: Integer encoding types are unsigned
Mark Johnston [Tue, 6 Jun 2023 17:28:02 +0000 (13:28 -0400)]
ctfconvert: Integer encoding types are unsigned

Before this change, encodings in the user-defined range were being
sign-extended.

MFC after: 1 week
Sponsored by: Innovate UK

(cherry picked from commit 258a0d760aa8b42899a000e30f610f900a402556)