]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 months agoAdd UPDATING entries and bump version releng/13.1
Mark Johnston [Tue, 1 Aug 2023 15:16:09 +0000 (11:16 -0400)]
Add UPDATING entries and bump version

Approved by: so

8 months agofrag6: Avoid a possible integer overflow in fragment handling
Jonathan T. Looney [Tue, 1 Aug 2023 14:58:34 +0000 (10:58 -0400)]
frag6: Avoid a possible integer overflow in fragment handling

Reviewed by: kp, markj, bz
Approved by: so
Security: FreeBSD-SA-23:06.ipv6
Security: CVE-2023-3107

(cherry picked from commit ff3d1a3f9d71e706f320f51bae258e4e1a51b388)
(cherry picked from commit 9515f04fe3b12b9e6ef6c802b647dd4cbdba621b)

8 months agobhyve: Fully reset the fwctl state machine if the guest requests a reset.
John Baldwin [Thu, 29 Jun 2023 18:27:12 +0000 (11:27 -0700)]
bhyve: Fully reset the fwctl state machine if the guest requests a reset.

If a guest tries to reset the fwctl device while a pending request was
in flight, the fwctl state machine can be left in an incomplete state.
Specifically, rinfo is not cleared.

Normally the state machine for fwctl alternates between REQ (receiving
request) and RESP (sending response) and ignores port writes while in
RESP or port reads while in REQ.  Once a guest completes the writes to
the port to send a request, the state machine transitions to RESP and
ignores future writes.

However, if a guest writes a full request and then resets the fwctl
device, the state would transition to REQ without draining the pending
response or discarding the received request.  Instead, additional
port writes after the reset were treated as new payload bytes, but
were appended to the previously-received request and could overflow
the fget_str buffer.

To fix, fully reset the fwctl state machine if the guest requests a
reset.

admbugs: 998
Approved by: so
Reviewed by: markj
Reported by: Omri Ben Bassat <t-benbassato@microsoft.com>
Security: FreeBSD-SA-23:07.bhyve
Security: CVE-2023-3494

(cherry picked from commit bed3ae1d7863ac1e0b1e82ae7bf952937e921efe)
(cherry picked from commit 9fe302d78109b12867bd933bb68cd900c9940b7d)

8 months agossh: Apply CVE-2023-38408 fix from OpenSSH 9.3p2
Ed Maste [Tue, 1 Aug 2023 14:40:02 +0000 (10:40 -0400)]
ssh: Apply CVE-2023-38408 fix from OpenSSH 9.3p2

Approved by: so
Security: FreeBSD-SA-23:08.ssh
Security: CVE-2023-38408

8 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)
(cherry picked from commit d295e418ae7e60d87af6576ecdfad41a98d7442c)

Approved by: so
Security: FreeBSD-SA-23:09.pam_krb5
Security: CVE-2023-3326

10 months agoAdd UPDATING entries and bump version.
Gordon Tetlow [Wed, 21 Jun 2023 05:38:21 +0000 (22:38 -0700)]
Add UPDATING entries and bump version.

Approved by: so

10 months agopam_krb5: Fix spoofing vulnerability
Cy Schubert [Wed, 31 May 2023 19:20:27 +0000 (12:20 -0700)]
pam_krb5: Fix spoofing vulnerability

An adversary on the network can log in via ssh as any user by spoofing
the KDC. When the machine has a keytab installed the keytab is used to
verify the service ticket. However, without a keytab there is no way
for pam_krb5 to verify the KDC's response and get a TGT with the
password.

If both the password _and_ the KDC are controlled by an adversary, the
adversary can provide a password that the adversary's spoofed KDC will
return a valid tgt for.  Currently, without a keytab, pam_krb5 is
vulnerable to this attack.

Reported by: Taylor R Campbell <riastradh@netbsd.org> via emaste@
Reviewed by: so
Approved by: so
Security: FreeBSD-SA-23:04.pam_krb5
Security: CVE-2023-3326

(cherry picked from commit 813847e49e35439ba5d7bf16034b0691312068a4)
(cherry picked from commit 6322a6c9daaabbf0b5d17c5d5a4f245f474a7e30)

10 months agompr: fix copying of event_mask
Mariusz Zaborski [Fri, 21 Apr 2023 07:50:16 +0000 (09:50 +0200)]
mpr: fix copying of event_mask

Before the commit 6cc44223cb6717795afdac4348bbe7e2a968a07d the
field event_mask was fully copied to the EventMasks field.
After this commit the event_mask (uint8_t) is 4 times casted to
EventMask (uint32_t). Because of that 24 bits of each event_mask array
is lost.

This commits brings back simple copying of field, and after words
converting 32 bits field to the requested endian.

I don't think we need more sophisticated method,
as the array is of size 4 (for 32 bits version).

Reviewed by: imp
MFC after: 1 week
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D39562

(cherry picked from commit ea6597c38c77c7bfaae71259d8636cbb89add6a3)
(cherry picked from commit e7a3a08febd01c95b74185bb971ec29cca64b8e1)

Approved by: so
Security: FreeBSD-EN-23:07.mpr

10 months agoloader: comconsole: don't unconditionally wipe out hw.uart.console
Kyle Evans [Fri, 14 Apr 2023 04:41:22 +0000 (23:41 -0500)]
loader: comconsole: don't unconditionally wipe out hw.uart.console

It may be the case that we need to set hw.uart.console manually in some
scenarios that comconsole can't necessarily support.  Avoid clobbering
hw.uart.console unless we've actually selected comconsole so that one
could at least get kernel console output..

Discussed with: imp
Sponsored by: Zenith Electronics LLC
Sponsored by: Klara, Inc.

(cherry picked from commit ec671f4980437008b0119c6367816083e15fa503)
(cherry picked from commit 362677cae8e9ac4c6f7ff4d74a4378ea11d47797)

Approved by:    so
Security:       FreeBSD-EN-23:06.loader

10 months agocontrib/tzdata: import tzdata 2023c
Gordon Tetlow [Wed, 21 Jun 2023 05:03:18 +0000 (22:03 -0700)]
contrib/tzdata: import tzdata 2023c

Changes: https://github.com/eggert/tz/blob/2023c/NEWS

The tzdata 2023c release reverts all changes made in 2023b other than
commentary, as that appears to be the best of a bad set of short-notice
choices for modeling this week's daylight saving chaos in Lebanon.

(cherry picked from commit 9fbeeb6e38310b4f42a14c4b043bbee82c5e4752)

Cumulative commit including the following cherry-picks:
9cb5b954606ec8a49b6127d2f58f7ee37ca0bb9c
38e0d28fa4e2f98ebb060441f0aeb0536d6fd202
bb7b15831531a85b1d29e80358e3b80cc799094a

Approved by: so
Security: FreeBSD-EN-23:05.tzdata

14 months agoAdd UPDATING entries and bump version.
Gordon Tetlow [Thu, 16 Feb 2023 17:56:53 +0000 (09:56 -0800)]
Add UPDATING entries and bump version.

Approved by: so

14 months agoFix multiple OpenSSL vulnerabilities.
Gordon Tetlow [Thu, 16 Feb 2023 17:20:43 +0000 (09:20 -0800)]
Fix multiple OpenSSL vulnerabilities.

Approved by: so
Security: FreeBSD-SA-23:03.openssl
Security: CVE-2023-0286
Security: CVE-2023-0215
Security: CVE-2022-4450
Security: CVE-2022-4304

14 months agoAdd UPDATING entries and bump version.
Gordon Tetlow [Wed, 8 Feb 2023 18:12:59 +0000 (10:12 -0800)]
Add UPDATING entries and bump version.

Approved by: so

14 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
Approved by: so
Security: FreeBSD-SA-23:01.geli
Security: CVE-2023-0751

(cherry picked from commit 5fff09660e06a66bed6482da9c70df328e16bbb6)
(cherry picked from commit 88bb08452ee3bbf67ad701a4909bbee6e8b200a6)

14 months agoixgbe: workaround errata about UDP frames with zero checksum
Andrey V. Elsukov [Thu, 10 Nov 2022 09:34:40 +0000 (12:34 +0300)]
ixgbe: workaround errata about UDP frames with zero checksum

Intel 82599 has errata related to IPv4 UDP frames with zero checksum.
It reports such datagrams with L4 integrity errors in IXGBE_XEC
register. And after afb1aa4e6df2 commit such errors are reported
via IFCOUNTER_IERRORS. This confuses users, since actually all frames
are handled correctly by the system.
To workaround the problem, let's ignore the XEC register value for
82599 cards for now.

PR: 266048
Discussed with: erj
Sponsored by: Yandex LLC
Approved by: so
Security: FreeBSD-EN-23:04.ixgbe

(cherry picked from commit 8526120ad41ca47367b43f8f4459e0fa61285571)
(cherry picked from commit daf3d88ac1849c9a6c5f05d2a663c7fe57453b37)

14 months agoFix ena driver crash after reset in 7th gen AWS instance types.
Gordon Tetlow [Wed, 8 Feb 2023 16:18:27 +0000 (08:18 -0800)]
Fix ena driver crash after reset in 7th gen AWS instance types.

Approved by: so
Security: FreeBSD-EN-23:03.ena

14 months agoFix sdhci(4) broken write-protect settings.
Gordon Tetlow [Wed, 8 Feb 2023 16:16:31 +0000 (08:16 -0800)]
Fix sdhci(4) broken write-protect settings.

Approved by: so
Security: FreeBSD-EN-23:02.sdhci

14 months agocontrib/tzdata: import tzdata 2022g
Philip Paeps [Wed, 30 Nov 2022 01:36:28 +0000 (09:36 +0800)]
contrib/tzdata: import tzdata 2022g

Changes: https://github.com/eggert/tz/blob/2022g/NEWS

tzdata 2022g and later split America/Ciudad_Juarez from America/Ojinaga.
Ensure this file is removed in builds WITHOUT_ZONEINFO.

Approved by: so
Security: FreeBSD-EN-23:01.tzdata

(cherry picked from commit cf1ad5351036884e0a2e21d1bc9b712448467741)
(cherry picked from commit 821549a9dfdf69f533feb84914b09450cd7311b6)
(cherry picked from commit e851e0aabdffb4f193e05645ffa45593f0603a1d)

16 months agoAdd UPDATING entries and bump version.
Gordon Tetlow [Tue, 29 Nov 2022 23:10:47 +0000 (15:10 -0800)]
Add UPDATING entries and bump version.

Approved by: so

16 months agoheimdal: Fix: Too large time skew, client time 1970-01-01T01:00:00
Cy Schubert [Thu, 17 Nov 2022 15:43:29 +0000 (07:43 -0800)]
heimdal: Fix: Too large time skew, client time 1970-01-01T01:00:00

Part of ed549cb0c53f zeroed out a data structure in the resulting code-file
when a TUTCTime type was freed. This part of the patch applies to Heimdal
7.1+ and not our Heimdal 1.5.2.

PR: 267827
Reported by: Peter Much <pmc@citylink.dinoex.sub.org>
Tested by: Peter Much <pmc@citylink.dinoex.sub.org>
Approved by: so
Security: FreeBSD-EN-22:28.heimdal
Fixes: ed549cb0c53f

(cherry picked from commit f556a05c49261af3d373c599d05fa250f3563b59)
(cherry picked from commit b23fe6badebad9a9b2022e95b50451a41c7b4f7a)

16 months agoping: Fix handling of IP packet sizes
Tom Jones [Thu, 17 Nov 2022 10:31:38 +0000 (10:31 +0000)]
ping: Fix handling of IP packet sizes

Ping reads raw IP packets to parse ICMP responses. When reading the
IP Header Len (IHL) ping was was taking the value from the provided
packet without any validation. This could lead to remotely triggerable
stack corruption.

Validate the IHL against expected and recieved data sizes when reading
from the received packet and when reading any quoted packets from within
the ICMP response.

Approved by: so
Reviewed by: markj, asomers
Security: FreeBSD-SA-22:15.ping
Security: CVE-2022-23093
Sponsored by:   NetApp, Inc.
Sponsored by:   Klara, Inc.
X-NetApp-PR:    #77
Differential Revision: https://reviews.freebsd.org/D37195

(cherry picked from commit 46d7b45a267b3d78c5054b210ff7b6c55bfca42b)
(cherry picked from commit 186f495d4be12a9184d2b11183c55b27b879765f)

17 months agoAdd UPDATING entries and bump version
Ed Maste [Wed, 16 Nov 2022 00:22:22 +0000 (19:22 -0500)]
Add UPDATING entries and bump version

Approved by: so

17 months agoheimdal: Fix multiple security vulnerabilities
Cy Schubert [Tue, 8 Nov 2022 08:53:29 +0000 (00:53 -0800)]
heimdal: Fix multiple security vulnerabilities

The following issues are patched:

 - CVE-2022-42898 PAC parse integer overflows
 - CVE-2022-3437 Overflows and non-constant time leaks in DES{,3} and arcfour
 - CVE-2021-44758 NULL dereference DoS in SPNEGO acceptors
 - CVE-2022-44640 Heimdal KDC: invalid free in ASN.1 codec

    Note that CVE-2022-44640 is a severe vulnerability, possibly a 10.0
    on the Common Vulnerability Scoring System (CVSS) v3, as we believe
    it should be possible to get an RCE on a KDC, which means that
    credentials can be compromised that can be used to impersonate
    anyone in a realm or forest of realms.

    Heimdal's ASN.1 compiler generates code that allows specially
    crafted DER encodings of CHOICEs to invoke the wrong free function
    on the decoded structure upon decode error.  This is known to impact
    the Heimdal KDC, leading to an invalid free() of an address partly
    or wholly under the control of the attacker, in turn leading to a
    potential remote code execution (RCE) vulnerability.

    This error affects the DER codec for all extensible CHOICE types
    used in Heimdal, though not all cases will be exploitable.  We have
    not completed a thorough analysis of all the Heimdal components
    affected, thus the Kerberos client, the X.509 library, and other
    parts, may be affected as well.

    This bug has been in Heimdal's ASN.1 compiler since 2005, but it may
    only affect Heimdal 1.6 and up.  It was first reported by Douglas
    Bagnall, though it had been found independently by the Heimdal
    maintainers via fuzzing a few weeks earlier.

    While no zero-day exploit is known, such an exploit will likely be
    available soon after public disclosure.

 - CVE-2019-14870: Validate client attributes in protocol-transition
 - CVE-2019-14870: Apply forwardable policy in protocol-transition
 - CVE-2019-14870: Always lookup impersonate client in DB

Sponsored by: so (philip)
Obtained from: so (philip)
Tested by: philip, cy

(cherry picked from commit ed549cb0c53f8438c52593ce811f6fcc812248e9)
(cherry picked from commit d0b6550173d25689ee820c1e0a0aea36f6806098)

Approved by: so
Security: FreeBSD-SA-22:14.heimdal

17 months agozfs: Fix an improperly resolved merge conflict
Mark Johnston [Tue, 1 Nov 2022 20:54:33 +0000 (16:54 -0400)]
zfs: Fix an improperly resolved merge conflict

Approved by: so
Fixes: 8838c650cb59 ("Fix use-after-free in btree code")

17 months agoAdd UPDATING entries and bump version
Mark Johnston [Mon, 31 Oct 2022 23:06:46 +0000 (19:06 -0400)]
Add UPDATING entries and bump version

Approved by: so

17 months agoFix use-after-free in btree code
Richard Yao [Mon, 12 Sep 2022 18:22:15 +0000 (14:22 -0400)]
Fix use-after-free in btree code

Coverty static analysis found these.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #10989
Closes #13861

Approved by: so
Security: FreeBSD-EN-22:21.zfs

(cherry picked from commit 8131a96544fd19411c23424af85140e91e41c001)

17 months agoloader: fix elf lookup_symbol type filtering
Kyle Evans [Fri, 14 Oct 2022 03:06:13 +0000 (22:06 -0500)]
loader: fix elf lookup_symbol type filtering

The existing logic doesn't seem to make much sense, as we won't filter
on the type if st_shndx != SHN_UNDEF.  In practice, this breaks booting
12.3 kernels on newer loaders, as they do have a `kernphys` symbol of
the wrong type (NOTYPE, rather than OBJECT) -- we end up deriving the
wrong value for copy_staging.

It's unclear if this version makes any more sense, but it seems to match
what rtld's matched_symbol() does.  Loader doesn't need to care about
STT_FUNC w/ UND shndx, because we won't encounter those; in kmods,
undefined (kernel) functions are NOTYPE.

Approved by: so
Security: FreeBSD-EN-22:27.loader
Reported by: Christian McDonald <cmcdonald netgate com>
Reviewed by: imp, kib, tsoome

(cherry picked from commit 0701dbda94f21de8ddab3113f79262a26cc7b96c)
(cherry picked from commit 2b31059ea701957584e68a75857206d80a230211)

17 months agocontrib/tzdata: import tzdata 2022f
Philip Paeps [Sat, 29 Oct 2022 02:38:01 +0000 (10:38 +0800)]
contrib/tzdata: import tzdata 2022f

Changes: https://github.com/eggert/tz/blob/2022f/NEWS

Approved by: so
Security: FreeBSD-EN-22:22.tzdata

(cherry picked from commit 9142a2a37b2fe65d46ace08a098ad26b8ff81541)
(cherry picked from commit 46d324ec6502758cbb17866e3de5e11981f03f15)

17 months agocontrib/tzdata: import tzdata 2022e
Philip Paeps [Wed, 12 Oct 2022 01:50:03 +0000 (09:50 +0800)]
contrib/tzdata: import tzdata 2022e

Changes: https://github.com/eggert/tz/blob/2022e/NEWS

Approved by: so
Security: FreeBSD-EN-22:22.tzdata

(cherry picked from commit 5d56371c70d785c222ff086ba8a83b408111acbf)
(cherry picked from commit af335a43669b6b516bf6d1b5835e575e892b9758)

17 months agocontrib/tzdata: import tzdata 2022d
Philip Paeps [Sun, 25 Sep 2022 05:50:36 +0000 (13:50 +0800)]
contrib/tzdata: import tzdata 2022d

Changes: https://github.com/eggert/tz/blob/2022d/NEWS

The /usr/share/zoneinfo/SystemV directory has been empty on FreeBSD
since 2006.  The upstream source file was removed in 2020.  Also stop
passing yearisdate to zic(8).  This has not been necessary for years.
The script has been removed upstream since 2020.

Approved by: so
Security: FreeBSD-EN-22:22.tzdata

(cherry picked from commit 1576451a39487b982c961f32bbab71c71890dc0c)
(cherry picked from commit da038df8c92b71060965bdc5dc400db54de35587)
(cherry picked from commit 57338837aef51923ebafc3656e38d4be5c50a60d)
(cherry picked from commit 77596427bd7aec9c8d538936caaa04914d7bead7)

17 months agotcp: finish SACK loss recovery on sudden lack of SACK blocks
Richard Scheffenegger [Wed, 31 Aug 2022 12:49:25 +0000 (14:49 +0200)]
tcp: finish SACK loss recovery on sudden lack of SACK blocks

While a receiver should continue sending SACK blocks for the
duration of a SACK loss recovery, if for some reason the
TCP options no longer contain these SACK blocks, but we
already started maintaining the Scoreboard, keep on handling
incoming ACKs (without SACK) as belonging to the SACK recovery.

Approved by: so
Security: FreeBSD-EN-22:25.tcp
Reported by: thj
Reviewed by: tuexen, #transport
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36046

(cherry picked from commit c21b7b55bea2cc2bf3b420c70a9018e703ed6f00)
(cherry picked from commit 2b8ee332b9384596cefc91fead1c294fdd9252b4)

17 months agocam: Provide compatibility for CAMGETPASSTHRU for periph drivers
Mark Johnston [Thu, 29 Sep 2022 17:07:52 +0000 (13:07 -0400)]
cam: Provide compatibility for CAMGETPASSTHRU for periph drivers

The CAM version bump 0x19 -> 0x1a changed the CAMGETPASSTHRU definition,
so applications using the old ioctl are broken.  However, that version
change did not affect anything relating to the ioctl implementation for
periphs.

Approved by: so
Security: FreeBSD-EN-22:26.cam
Fixes: 8f9be1eed11c ("cam(4): Improve XPT_DEV_MATCH")
PR: 264709
Tested by: andreas.mahling@googlemail.com
Reviewed by: imp

(cherry picked from commit 0cd631ee0693dd7337c38b251044e018aad6fbaf)
(cherry picked from commit 16d4c1de7b40f1cc0d323b9ecc5a38afb7a42f8a)

17 months agovm_page: Fix a logic error in the handling of PQ_ACTIVE operations
Mark Johnston [Wed, 5 Oct 2022 19:12:46 +0000 (15:12 -0400)]
vm_page: Fix a logic error in the handling of PQ_ACTIVE operations

As an optimization, vm_page_activate() avoids requeuing a page that's
already in the active queue.  A page's location in the active queue is
mostly unimportant.

When a page is unwired and placed back in the page queues,
vm_page_unwire() avoids moving pages out of PQ_ACTIVE to honour the
request, the idea being that they're likely mapped and so will simply
get bounced back in to PQ_ACTIVE during a queue scan.

In both cases, if the page was logically in PQ_ACTIVE but had not yet
been physically enqueued (i.e., the page is in a per-CPU batch), we
would end up clearing PGA_REQUEUE from the page.  Then, batch processing
would ignore the page, so it would end up unwired and not in any queues.
This can arise, for example, when a page is allocated and then
vm_page_activate() is called multiple times in quick succession.  The
result is that the page is hidden from the page daemon, so while it will
be freed when its VM object is destroyed, it cannot be reclaimed under
memory pressure.

Fix the bug: when checking if a page is in PQ_ACTIVE, only perform the
optimization if the page is physically enqueued.

Approved by: so
Security: FreeBSD-EN-22:23.vm
PR: 256507
Fixes: f3f38e2580f1 ("Start implementing queue state updates using fcmpset loops.")
Reviewed by: alc, kib
Sponsored by: E-CARD Ltd.
Sponsored by: Klara, Inc.

(cherry picked from commit 2c9dc2384f85a4ccc44a79b349f4fb0253a2f254)
(cherry picked from commit 6094749a1a5dafb8daf98deab23fc968070bc695)

17 months agozfs: Fix a pair of bugs in zfs_fhtovp()
Mark Johnston [Mon, 24 Oct 2022 15:55:48 +0000 (11:55 -0400)]
zfs: Fix a pair of bugs in zfs_fhtovp()

This cherry-picks upstream ed566bf1cd0bdbf85e8c63c1c119e3d2ef5db1f6

    - Add a zfs_exit() call in an error path, otherwise a lock is
      leaked.
    - Remove the fid_gen > 1 check.  That appears to be Linux-specific:
      zfsctl_snapdir_fid() sets fid_gen to 0 or 1 depending on whether
      the snapshot directory is mounted.  On FreeBSD it fails, making
      snapshot dirs inaccessible via NFS.

Approved by: so
PR: 266236
Security: FreeBSD-EN-22:24.zfs

(cherry picked from commit 6fe0a6c80a1aff14236924eb33e4013aa8c14f91)
(cherry picked from commit 562c9ac58c7678b13f52b0bfe63148e40d7bf63d)

19 months agoAdd UPDATING entries and bump version
Ed Maste [Tue, 30 Aug 2022 23:06:09 +0000 (19:06 -0400)]
Add UPDATING entries and bump version

Approved by: so

19 months agocontrib/tzdata: import tzdata 2022b and 2022c
Philip Paeps [Thu, 11 Aug 2022 02:48:24 +0000 (10:48 +0800)]
contrib/tzdata: import tzdata 2022b and 2022c

Changes: https://github.com/eggert/tz/blob/2022b/NEWS
Changes: https://github.com/eggert/tz/blob/2022c/NEWS

The tzdata2022b import restored the zoneinfo/GMT link.
Don't delete it again with 'make delete-old'.

(cherry picked from commit 9f9fc6bb8028ea29da6b04c338c750cedc3040f3)
(cherry picked from commit f5d5282cf7d1181f933626dcdc3525db0d70a266)
(cherry picked from commit 5f33eb7266f938857ce2fc9ea59679ea46a0694b)
(cherry picked from commit f7cb47731675828d27ebd55c9fc46953ee168d48)

Approved by: so

19 months agozlib: Fix a bug when getting a gzip header extra field with inflate().
Mark Adler [Sat, 30 Jul 2022 22:51:11 +0000 (15:51 -0700)]
zlib: Fix a bug when getting a gzip header extra field with inflate().

If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided space is not
exceeded.

(cherry picked from zlib commit eff308af425b67093bab25f80f1ae950166bece1)
(cherry picked from zlib commit 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d)

(cherry picked from commit dc3509f1aafcd966f3dd9226115cf94b691ff3c7)
(cherry picked from commit 2969066f73fc67a614144ac09b9f3f5291937fed)
(cherry picked from commit 10cc2bf5f7a592981ee00d22eb13e100beed1e64)

Approved by: so
Security: CVE-2022-37434

20 months agoAdd UPDATING entries and bump version
Mark Johnston [Tue, 26 Jul 2022 13:50:43 +0000 (09:50 -0400)]
Add UPDATING entries and bump version

Approved by: so

20 months agolib9p: Remove potential buffer overwrite in l9p_puqids()
Konrad Sewiłło-Jopek [Mon, 8 Aug 2022 16:25:48 +0000 (12:25 -0400)]
lib9p: Remove potential buffer overwrite in l9p_puqids()

Structure l9p_f_wralk reserves at most L9P_MAX_WELEM entries
and that number actually set the maximum we can safely use.

Approved by: so
Security: FreeBSD-SA-22:12.lib9p
PR: 265385
Reviewed by: markj

(cherry picked from commit 2dd83b3f0507fc7bc64b908fb88f285a3b9663c8)
(cherry picked from commit c536045c51da78a85138e963d3b7e13a547713c9)

20 months agovm_fault: Shoot down shared mappings in vm_fault_copy_entry()
Mark Johnston [Mon, 25 Jul 2022 20:53:21 +0000 (16:53 -0400)]
vm_fault: Shoot down shared mappings in vm_fault_copy_entry()

As in vm_fault_cow(), it's possible, albeit rare, for multiple vm_maps
to share a shadow object.  When copying a page from a backing object
into the shadow, all mappings of the source page must therefore be
removed.  Otherwise, future operations on the object tree may detect
that the source page is fully shadowed and thus can be freed.

Approved by: so
Security: FreeBSD-SA-22:11.vm
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35635

(cherry picked from commit 5c50e900ad779fccbf0a230bfb6a68a3e93ccf60)
(cherry picked from commit 3ea8c7ad90f75129c52a2b64213c5578af23dc8d)

20 months agoelf_note_prpsinfo: handle more failures from proc_getargv()
Konstantin Belousov [Fri, 3 Jun 2022 08:21:23 +0000 (11:21 +0300)]
elf_note_prpsinfo: handle more failures from proc_getargv()

Resulting sbuf_len() from proc_getargv() might return 0 if user mangled
ps_strings enough. Also, sbuf_len() API contract is to return -1 if the
buffer overflowed. The later should not occur because get_ps_strings()
checks for catenated length, but check for this subtle detail explicitly
as well to be more resilent.

The end result is that p_comm is used in this situations.

Approved by: so
Security: FreeBSD-SA-22:09.elf
Reported by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: delphij, markj
admbugs: 988
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35391

(cherry picked from commit 00d17cf342cd9f4f8fd1dcd79c8caec359145532)
(cherry picked from commit 8a44a2c644fc6d4ec1740fcc0b3ff01eac989ddf)

21 months agopam_exec: fix segfault when authtok is null
Yan Ka Chiu [Sun, 22 May 2022 16:33:02 +0000 (12:33 -0400)]
pam_exec: fix segfault when authtok is null

According to pam_exec(8), the `expose_authtok` option should be ignored
when the service function is `pam_sm_setcred`. Currently `pam_exec` only
prevent prompt for anth token when `expose_authtok` is set on
`pam_sm_setcred`. This subsequently led to segfault when there isn't an
existing auth token available.

Bug reported on this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263893

After reading https://reviews.freebsd.org/rS349556 I am not sure if the
default behaviour supposed to be simply not prompt for authentication
token, or is it to ignore the option entirely as stated in the man page.

This patch is therefore only adding an additional NULL check on the item
`pam_get_item` provide, and exit with `PAM_SYSTEM_ERR` when such item is
NULL.

Approved by: so
Security: FreeBSD-EN-22:19.pam_exec
MFC after: 1 week
Reviewed by: des, khng
Differential Revision: https://reviews.freebsd.org/D35169

(cherry picked from commit b75e0eed345d2ab047a6b1b00a9a7c3bf92e992c)
(cherry picked from commit ea80848e1c0639e2ac8d3f974ddb9c6233491eb3)

21 months agokevent: Fix an off-by-one in filt_timerexpire_l()
Mark Johnston [Wed, 25 May 2022 00:14:33 +0000 (20:14 -0400)]
kevent: Fix an off-by-one in filt_timerexpire_l()

Suppose a periodic kevent timer fires close to its deadline, so that
now - kc->next is small.  Then delta ends up being 1, and the next timer
deadline is set to (delta + 1) * kc->to, where kc->to is the timer
period.  This means that the timer fires at half of the requested rate,
and the value returned in kn_data is similarly inaccurate.

Approved by: so
Security: FreeBSD-EN-22:16.kqueue
PR: 264131
Fixes: 7cb40543e964 ("filt_timerexpire: do not iterate over the interval")
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 524dadf7a8725dea144571843e611dbdbd59d668)
(cherry picked from commit 129112f80d2bfe6091ebb8656912fb55d6192e1f)

21 months agoCAM: Keep periph_links when restoring CCB in camperiphdone().
Alexander Motin [Thu, 28 Apr 2022 01:39:50 +0000 (21:39 -0400)]
CAM: Keep periph_links when restoring CCB in camperiphdone().

While recovery command executed, some other commands from the periph
may complete, that may affect periph_links of this CCB.  So restoring
original CCB we must keep current periph_links as more up to date.

I've found this triggering assertions with debug kernel and suspect
some memory corruptions otherwise when spun down disk receives two
or sometimes more concurrent requests.

Approved by: so
Security: FreeBSD-EN22:17.cam
MFC after: 1 week
Sponsored by: iXsystems, Inc.

(cherry picked from commit 404f001161b975164d8b52d9f404d07ac7584027)
(cherry picked from commit 84849cfd1dc016917402511bc5a55d3d7317ce39)

23 months agoUpdate in preparation of 13.1-RELEASE
Glen Barber [Wed, 11 May 2022 23:59:24 +0000 (19:59 -0400)]
Update in preparation of 13.1-RELEASE

- Bump BRANCH to RELEASE
- Add the anticipated RELEASE announcement date
- Set a static __FreeBSD_version

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

23 months agoclockcalib: Fix an overflow bug
Mark Johnston [Thu, 20 Jan 2022 13:23:38 +0000 (08:23 -0500)]
clockcalib: Fix an overflow bug

tc_counter_mask is an unsigned int and in the TSC timecounter is equal
to UINT_MAX, so the addition tc->tc_counter_mask + 1 can overflow to 0,
resulting in a hang during boot.

Approved by: re (gjb)
Fixes: c2705ceaeb09 ("x86: Speed up clock calibration")
Reviewed by: cperciva
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c3196306f092e46008d5ffa626fbafe1f8a94848)
(cherry picked from commit 58f49b7da7da50d1ea66b5d810a5e8769b5319f4)

23 months agoUpdate to RC6
Glen Barber [Thu, 5 May 2022 00:06:39 +0000 (20:06 -0400)]
Update to RC6

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

23 months agoxhci(4): Always add and evaluate the slot context.
Hans Petter Selasky [Tue, 3 May 2022 16:10:49 +0000 (18:10 +0200)]
xhci(4): Always add and evaluate the slot context.

Because the maximum number of endpoint contexts is stored there.

Tested by: ehaupt@
PR: 262882
Approved by: re (gjb, early MFC)
Sponsored by: NVIDIA Networking

(cherry picked from commit 09dd1adfa4c9bb1b49f4ef5524a308732883e132)
(cherry picked from commit 6d8c6b24ee0a0416204356a98e4e7606489894c5)

23 months agoxhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle.
Hans Petter Selasky [Tue, 3 May 2022 16:09:17 +0000 (18:09 +0200)]
xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle.

Only drop BULK and INTERRUPT endpoints, to reset the data toggle,
because for other endpoint types this is not critical.

While at it fix some whitespace.

Tested by: ehaupt@
PR: 262882
Approved by: re (gjb, early MFC)
Sponsored by: NVIDIA Networking

(cherry picked from commit e276d281503160ba3648bd394cde95736ee53329)
(cherry picked from commit 610528736f3f0bf51f990dd93c5061a7a437e519)

23 months agoOpenSSL: Regen manual pages for OpenSSL 1.1.1o
Jung-uk Kim [Tue, 3 May 2022 19:12:42 +0000 (15:12 -0400)]
OpenSSL: Regen manual pages for OpenSSL 1.1.1o

Approved by: re (gjb, implicit, security)

(cherry picked from commit 9a3583bfbd1740a158b3916432286190e0f2bf60)
(cherry picked from commit 225a1494a5538364cddf9080b57d65277c6bfdf4)

23 months agoOpenSSL: Merge OpenSSL 1.1.1o
Jung-uk Kim [Tue, 3 May 2022 19:07:06 +0000 (15:07 -0400)]
OpenSSL: Merge OpenSSL 1.1.1o

Approved by: re (gjb, implicit, security)

(cherry picked from commit 34252e89a96c8d498d7537ade16d20602bf2106a)
(cherry picked from commit 1b7b799f9ebaa6d558523498005ca0e698051274)

2 years ago13.1: Update to RC5
Glen Barber [Thu, 28 Apr 2022 00:06:34 +0000 (20:06 -0400)]
13.1: Update to RC5

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoxhci(4): Ensure the so-called data toggle gets properly reset.
Hans Petter Selasky [Thu, 21 Apr 2022 14:59:09 +0000 (16:59 +0200)]
xhci(4): Ensure the so-called data toggle gets properly reset.

Use the drop and enable endpoint context commands to force a reset of
the data toggle for USB 2.0 and USB 3.0 after:
 - clear endpoint halt command (when the driver wishes).
 - set config command (when the kernel or user-space wants).
 - set alternate setting command (only affected endpoints).

Some XHCI HW implementations may not allow the endpoint reset command when
the endpoint context is not in the halted state.

Reported by: Juniper and Gary Jennejohn
Approved by: re (gjb)
Sponsored by: NVIDIA Networking

(cherry picked from commit cda31e734925346328fd2369585ab3f6767ec225)

2 years agolibcxxrt: Insert padding in __cxa_dependent_exception
Ed Maste [Wed, 27 Apr 2022 13:15:09 +0000 (09:15 -0400)]
libcxxrt: Insert padding in __cxa_dependent_exception

Padding was added to __cxa_exception in 45ca8b19 and
__cxa_dependent_exception needs the same layout.
Add some static_asserts to detect this in the future.

Merge of libcxxrt commit b00c6c564357

(cherry picked from commit c40e4349889b32500e51e60f9529dbcc080f468b)
(cherry picked from commit 69a40d924128b88ff2c82a35ab1b4509e1bdca56)

Approved by: re (gjb)

2 years agoStop using the kmem for PCPU memory on arm64
Andrew Turner [Wed, 27 Apr 2022 13:42:21 +0000 (14:42 +0100)]
Stop using the kmem for PCPU memory on arm64

When allocating memory with a kernel memory allocator we may get
memory that will later be promoted to a superpage. If this happens
while another CPU is using the pointer they can race and when the
promotion passes through the break-before-make sequence the pointer
will be invalid for a short length of time.

Revert the commit that added the use of the kernel allocator and
subsequent fixes to the original change.

Revert "Pass the ACPI ID when reading the ACPI domain"

This reverts commit aa3b5d79b2acc508cca63c24251d65f4d2d76fa5.

Revert "Stop reading the arm64 domain when it's known"

This reverts commit b7c23efd7428256f69ccfd65a9c5e9f50585bf66.

Revert "Allocate arm64 per-CPU data in the correct domain"

This reverts commit f51997c6e410e2413686983d8fd57c1877f8c0ad.

Approved by: re (gjb)
Reported by: dch
Sponsored by: The FreeBSD Foundation

2 years agoif_bnxt: Allow bnxt interfaces to use vlans
Misho [Thu, 21 Apr 2022 08:24:04 +0000 (09:24 +0100)]
if_bnxt: Allow bnxt interfaces to use vlans

When VLAN HW filter is disabled, the NIC does not pass any vlan tagged
traffic. Setting these flags on the device allows vlan tagged traffic to
pass.

Approved by: re (gjb)
PR: 236983
Tested by: pi
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D34824

(cherry picked from commit 0c6a2fa33e36ac0b5d51cbae39a9c5564ad61788)
(cherry picked from commit e54505277c39cad32f999fd72033f6fa9594b130)

2 years agorelease: fix on-disc pkg binary symbolic links
Glen Barber [Tue, 26 Apr 2022 19:52:40 +0000 (15:52 -0400)]
release: fix on-disc pkg binary symbolic links

Approved by: re (kib)
PR: 263574
Reported by: loader
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 68b0a79b7c7ab75597e2511f880238fbf8cfad32)
(cherry picked from commit fab1a7b9b6210257c5c048cdf754ca201fae7669)

2 years agostand: zfs: handle holes at the tail end correctly
Kyle Evans [Thu, 21 Apr 2022 19:57:24 +0000 (14:57 -0500)]
stand: zfs: handle holes at the tail end correctly

This mirrors dmu_read_impl(), zeroing out the tail end of the buffer and
clipping the read to what's contained by the block that exists.

This fixes an issue that arose during the 13.1 release process; in
13.1-RC1 and later, setting up GELI+ZFS will result in a failure to
boot.  The culprit is this, which causes us to fail to load geom_eli.ko
as there's a residual portion after the single datablk that should be
zeroed out.

PR: 263407
Reviewed by: tsoome
Approved by: re (gjb)

(cherry picked from commit 914dc91d12198352b7878a88d30e2a6373a936e1)
(cherry picked from commit 0c9c8a4c6459a8cd1b7290ae7dcd9452d3a4dbc1)

2 years agotime(3): Refine history in the manual page
Gordon Bergling [Thu, 14 Apr 2022 08:04:14 +0000 (10:04 +0200)]
time(3): Refine history in the manual page

The time() system call first appeared in VersionĀ 1 AT&T UNIX.  Through
the VersionĀ 3 AT&T UNIX, it returned 60 Hz ticks since an epoch that
changed occasionally, because it was a 32-bit value that overflowed in a
little over 2 years.

In VersionĀ 4 AT&T UNIX the granularity of the return value was reduced to
whole seconds, delaying the aforementioned overflow until 2038.

VersionĀ 7 AT&T UNIX introduced the ftime() system call, which returned
time at a millisecond level, though retained the gtime() system call
(exposed as time() in userland).  time() could have been implemented as a
wrapper around ftime(), but that wasn't done.

4.1cBSD implemented a higher-precision time function gettimeofday() to
replace ftime() and reimplemented time() in terms of that.

Since FreeBSD 9 the implementation of time() uses
clock_gettime(CLOCK_SECOND) instead of gettimeofday() for performance
reasons.

With most valuable input from Warner (imp@).

Reviewed by: 0mp, jilles, imp
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D34751

(cherry picked from commit 3e0f3678eca7c3f296b9f702992737356f1792da)

2 years ago13.1: update to RC4
Glen Barber [Thu, 21 Apr 2022 00:10:33 +0000 (20:10 -0400)]
13.1: update to RC4

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoMostly revert a5970a529c2d95271: Make files opened with O_PATH to not block non-force...
Konstantin Belousov [Wed, 13 Apr 2022 00:47:45 +0000 (03:47 +0300)]
Mostly revert a5970a529c2d95271: Make files opened with O_PATH to not block non-forced unmount

Approved by: re (gjb)

(cherry picked from commit bf13db086b84c29ce901145f2800c561dcbf4d1e)
(cherry picked from commit 6daddc54debbf590cae17bead4864c7f640c07d0)

2 years agoMerge libcxxrt commit 45ca8b1942090226ba9368caeeeabc0d4ee41ad6
Dimitry Andric [Tue, 19 Apr 2022 16:11:11 +0000 (18:11 +0200)]
Merge libcxxrt commit 45ca8b1942090226ba9368caeeeabc0d4ee41ad6

  Insert padding in __cxa_exception struct for compatibility

  Similar to https://github.com/llvm/llvm-project/commit/f2a436058fcb, the
  addition of __attribute__((__aligned__)) to _Unwind_Exception (in commit
  b9616964) causes implicit padding to be inserted before the unwindHeader
  field in __cxa_exception.

  Applications attempt to get at the earlier fields in __cxa_exception, so
  preserve the same negative offsets in __cxa_exception, by moving the
  padding to the beginning of the struct.

  The assumption here is that if the ABI is not aware of the padding
  before unwindHeader and put the referenceCount/primaryException in
  there, no padding should exist before unwindHeader.

This should make libreoffice's custom exception handling mechanisms work
correctly, even if it was built against an older cxxabi.h/unwind.h pair.

PR: 263370
Approved by: re (gjb)
MFC after: immediately

(cherry picked from commit 434215c26da3c6acf2423ab93ff2b41b2d823cc8)
(cherry picked from commit 06394327dd1fd77c66af06f6f89713c5142fe1b2)

2 years agolibctf: Fix recursive descent into anonymous SOU fields
Mark Johnston [Tue, 12 Apr 2022 19:24:40 +0000 (15:24 -0400)]
libctf: Fix recursive descent into anonymous SOU fields

Approved by: re (gjb)
PR: 262412
Tested by: dhw, gallatin
Fixes: a6fb86917362 ("libctf: Handle CTFv3 containers")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6e563a1b608438504d963c2d7c70e50d2e75af46)
(cherry picked from commit 8b01c3026b78152d9e0ca6f3758ea226f32e48b9)

2 years agoctf: Avoid passing a caddr_t to roundup2()
Mark Johnston [Mon, 7 Mar 2022 16:18:40 +0000 (11:18 -0500)]
ctf: Avoid passing a caddr_t to roundup2()

For some reason I can't reproduce this locally, but Jenkins complains.

Approved by: re (gjb)
Reported by: Jenkins
Fixes: bdf290cd3e1a ("ctf: Add v3 support to CTF tools, ctf{convert,dump,merge}")

(cherry picked from commit 3fe1f21fb364e38f2bf7e7100dad59b067b27080)
(cherry picked from commit fb89cf93a5c79f60e8eb38db77294f8c713c4081)

2 years agoctf: Fix a -Wunused-but-set-variable warning
Mark Johnston [Mon, 7 Mar 2022 15:34:11 +0000 (10:34 -0500)]
ctf: Fix a -Wunused-but-set-variable warning

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit cb6f7225629301d3179f6e9f6d3be4d80f57a31f)
(cherry picked from commit d80faf878a4473c6136f06b774d9176ec9449479)

2 years agoctf: Add v3 support to CTF tools, ctf{convert,dump,merge}
Mark Johnston [Mon, 7 Mar 2022 13:54:18 +0000 (08:54 -0500)]
ctf: Add v3 support to CTF tools, ctf{convert,dump,merge}

ctfdump handles v2 and v3.  ctfconvert now emits only CTFv3, whereas
ctfmerge can merge v2 and v3 containers into v3 containers.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit bdf290cd3e1a69d41c2f8bb60bd415cfa78adba2)
(cherry picked from commit e5b54808f735f1a74716f1320916b8a961ddf92d)

2 years agolibctf: Handle CTFv3 containers
Mark Johnston [Mon, 7 Mar 2022 13:53:27 +0000 (08:53 -0500)]
libctf: Handle CTFv3 containers

In general, the patch adds indirection to minimize the amount of code
that needs to know about differences between v2 and v3.  Specifically,
some new ctf_get_ctt_* functions are added, and new LCTF_* macros are
added to use the underlying container's version to do the right thing.

CTF containers can have parent/child relationships, wherein a type ID in
one container refers to a type in the parent.  It is permitted for the
parent and child to have different versions.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit a6fb86917362e3f6d24e95e940e80845c2cfde8a)
(cherry picked from commit a49aa9da7835742aa455c7eec4493f0034b4e197)

2 years agolinker: Permit CTFv3 containers
Mark Johnston [Mon, 7 Mar 2022 13:53:05 +0000 (08:53 -0500)]
linker: Permit CTFv3 containers

Approved by: re (gjb)
Reviewed by: Domagoj Stolfa
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 8dbae4ce32bde42daee050ccfceee5eb2d306786)
(cherry picked from commit 8409eb0251ce54b4a901b534198ca82f5048c7fe)

2 years agofbt: Add support for CTFv3 containers
Mark Johnston [Mon, 7 Mar 2022 13:45:53 +0000 (08:45 -0500)]
fbt: Add support for CTFv3 containers

The general aim in this and subsequent patches is to minimize the
amount of code that directly references CTF types such as ctf_type_t,
ctf_array_t, etc.  To that end, introduce some routines similar to the
existing fbt_get_ctt_size() (which exists to deal with differences
between v1 and v2) and change ctf_lookup_by_id() to return a void
pointer.

Support for v2 containers is preserved.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit d9175438c0e77ef2b400601aa8cf8098c82a77a7)
(cherry picked from commit 2ecf3b58ebdfd6452b8ce269943da362b40c2e63)

2 years agoctf: Add definitions for CTFv3
Mark Johnston [Mon, 7 Mar 2022 13:44:02 +0000 (08:44 -0500)]
ctf: Add definitions for CTFv3

These are based on definitions added to binutils' libctf.  Specifically:
- Type IDs are now encoded in 32 bits rather than 16, changing the
  layout of ctf_type_t, ctf_array_t, ctf_member_t and ctf_lmember_t.
- Type info is encoded in 32 bits rather than 16.  The type "kind" is
  extended from 5 bits to 6, and the type "vlen" is extended from 10
  bits to 25.

The main upside is that we remove the current limit, imposed by CTFv2,
of 2^{15} distinct types in the main kernel executable.  Other limits,
such as that on the number of elements in an enum, imposed by the vlen
limit, are also raised.

This change adds v2 and v3 flavours of macros and type definitions which
differ between the two versions.  Compatibility is preserved for now by
having generic names refer to the v2 definitions, so, e.g., ctf_type_t
is still a v2 type.

No functional change intended.

Approved by: re (gjb)
Reviewed by: Domagoj Stolfa
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 994297b01b98816bea1abf45ae4bac1bc69ee7a0)
(cherry picked from commit 9818e5ebf3376ee5dbd01afe24e9972d9201633e)

2 years agolinker: Simplify CTF container handling
Mark Johnston [Mon, 7 Mar 2022 13:43:42 +0000 (08:43 -0500)]
linker: Simplify CTF container handling

Use sys/ctf.h to provide various definitions required to parse the CTF
header.  No functional change intended.

Approved by: re (gjb)
Reviewed by: Domagoj Stolfa, emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit cab9382a2cdf88b3027370cbdf73b095598eb7c1)
(cherry picked from commit 24597a09b946ccaec4c7e43eae45c81b21d247a3)

2 years agoctf: Import ctf.h from OpenBSD
Mark Johnston [Mon, 7 Mar 2022 13:42:57 +0000 (08:42 -0500)]
ctf: Import ctf.h from OpenBSD

Use it instead of the existing ctf.h from OpenSolaris.  This makes it
easier to use CTF in the core kernel, and to extend the CTF format to
support wider type IDs.

The imported ctf.h is modified to depend only on _types.h, and also to
provide macros which use the "parent" bit of a type ID to refer to types
in a parent CTF container.

No functional change intended.

Approved by: re (gjb)
Reviewed by: Domagoj Stolfa, emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 2d5d2a986ce1a93b8567dbdf3f80bc2b545d6998)
(cherry picked from commit 3681c4f065f1028ff84b654cfbfb238f2723b78c)

2 years agoisci(4): Remove a double word in an error message
Gordon Bergling [Sun, 3 Apr 2022 14:07:20 +0000 (16:07 +0200)]
isci(4): Remove a double word in an error message

- s/is is/is/

Approved by: re@ (gjb)

(cherry picked from commit 756220b5152526a5a89ca16df31d8acf0a7795bb)

2 years agotty(4): Add a HISTORY section to the manual page
Gordon Bergling [Sun, 3 Apr 2022 13:12:41 +0000 (15:12 +0200)]
tty(4): Add a HISTORY section to the manual page

Note that a console typewriter device /dev/tty
and asynchronous communication interfaces /dev/tty[0-5]
first appeared in VersionĀ 1 AT&T UNIX.

Obtained from: OpenBSD
Approved by: re@ (gjb)

(cherry picked from commit b988af5b439220f37159ed18318e8e4baeedc6a7)

2 years agopass(4): Fix a typo in the manual page
Gordon Bergling [Wed, 6 Apr 2022 16:46:26 +0000 (18:46 +0200)]
pass(4): Fix a typo in the manual page

- s/modfied/modified/

Approved by: re@ (gjb)

(cherry picked from commit 3dcfd6c266d492075e8f8481a60170b22866db56)

2 years agomt(3): Fix a typo in the manual page
Gordon Bergling [Wed, 6 Apr 2022 16:41:08 +0000 (18:41 +0200)]
mt(3): Fix a typo in the manual page

- s/mulitple/multiple/

Approved by: re@ (gjb)

(cherry picked from commit 656d68a711952ac2b92ed258502978c5ba1dbc73)

2 years agoown(9): Fix a typo in a function name in the manual page
Gordon Bergling [Sat, 2 Apr 2022 13:26:40 +0000 (15:26 +0200)]
own(9): Fix a typo in a function name in the manual page

- s/own_commmand_wait/own_command_wait/

Approved by: re@ (gjb)

(cherry picked from commit a95850f10af4fb4102f4c4f7c16775dbcd6568e6)

2 years agohtu21(4): Correct a typo in the manual page
Gordon Bergling [Sat, 2 Apr 2022 12:06:14 +0000 (14:06 +0200)]
htu21(4): Correct a typo in the manual page

- s/measurment/measurement/

Approved by: re@ (gjb)

(cherry picked from commit 0d40cd15240503931f493c0c97d8db0914bfbfbd)

2 years agoipf(5): Fix a typo in the manual page
Gordon Bergling [Sat, 2 Apr 2022 12:50:45 +0000 (14:50 +0200)]
ipf(5): Fix a typo in the manual page

- s/accomodate/accommodate/

Approved by: re@ (gjb)

(cherry picked from commit 8a3568b584cb9e1abab94c047172fc99421e99a9)

2 years agocrypto(9): Fix a typo in the manual page
Gordon Bergling [Sat, 2 Apr 2022 12:35:55 +0000 (14:35 +0200)]
crypto(9): Fix a typo in the manual page

- s/faciliate/facilitate/

Approved by: re@ (gjb)

(cherry picked from commit 8e8d2a722e82eaaaab7a63704285a23166775904)

2 years agoloader.4th(8): Fix a typo in the manual page
Gordon Bergling [Sat, 2 Apr 2022 13:11:59 +0000 (15:11 +0200)]
loader.4th(8): Fix a typo in the manual page

- s/commmand/command/

Approved by: re@ (gjb)

(cherry picked from commit ad49d7c54cca4906179369e2196c1edbcf509342)

2 years agopnfsserver(4): Fix a typo in the manual page
Gordon Bergling [Sat, 2 Apr 2022 13:12:51 +0000 (15:12 +0200)]
pnfsserver(4): Fix a typo in the manual page

- s/commmand/command/

Approved by: re@ (gjb)

(cherry picked from commit a16977209bc261239022fac2cab6956a8e9676b5)

2 years ago13.1: update to RC3
Glen Barber [Thu, 14 Apr 2022 01:15:25 +0000 (21:15 -0400)]
13.1: update to RC3

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoSwitch RELNOTES to 13.1
Mike Karels [Tue, 12 Apr 2022 00:02:14 +0000 (19:02 -0500)]
Switch RELNOTES to 13.1

Truncate entries from 13.0; change 13.0 to 13.1.

This is a direct commit.

Approved by: re (gjb)

2 years agonet: Fix LLE lock leaks
Mark Johnston [Fri, 8 Apr 2022 15:46:19 +0000 (11:46 -0400)]
net: Fix LLE lock leaks

Historically, lltable_try_set_entry_addr() would release the LLE lock
upon failure.  After some refactoring, it no longer does so, but
consumers were not adjusted accordingly.

Also fix a leak that can occur if lltable_calc_llheader() fails in the
ARP code, but I suspect that such a failure can only occur due to a code
bug.

Approved by: re (gjb)
Reviewed by: bz, melifaro
Reported by: pho
Fixes: 0b79b007ebfc ("[lltable] Restructure nd6 code.")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit dd91d8448665dd31df5be7341756394293c6e36c)
(cherry picked from commit 078d50f9dd14ac77145b2cf8f143d49329b2c4f7)

2 years agoi386: Fix the nodevice apic build
Mark Johnston [Fri, 8 Apr 2022 15:47:52 +0000 (11:47 -0400)]
i386: Fix the nodevice apic build

Approved by: re (gjb)
PR: 263124
Fixes: 62d09b46ad75 ("x86: Defer LAPIC calibration until after timecounters are available")
Reviewed by: kib, jhb, emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit aa597d4049ffee69d413ea2154f4b312ffbaf646)
(cherry picked from commit 4f659ce4daf82ac3335abf3aab7181f2ac90a4cd)

2 years agoinstallworld: handle ldd including preloaded objects
Ed Maste [Fri, 1 Apr 2022 13:58:47 +0000 (09:58 -0400)]
installworld: handle ldd including preloaded objects

The installworld target makes a temporary copy of binaries to be used
during the install.  Libraries that they depend on are also included,
found by using `ldd`.

After commit 0913953c9ed0 ldd started listing preloaded objects,
including [vdso], under a [preloaded] header.  Skip ldd output that is
enclosed in square brackets.

Reviewed by: cy, kib [earlier version]
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34734

(cherry picked from commit b3b462229f972e2ed24d450d7d2f8855cdd58a87)
(cherry picked from commit e10026a406b21b3f1581ee15a88def2b640dffe7)

Approved by: re (gjb)

2 years agolibarchive: fix zstd compression support
Martin Matuska [Fri, 8 Apr 2022 08:09:32 +0000 (10:09 +0200)]
libarchive: fix zstd compression support

The commit 833a452e9 introduced a change that detached
the zstd compression (not decompression) support from base build.

Reported by: kevans
Approved by: re (delphij)

(cherry picked from commit 7f815d4f128f063c1bac361c8f26b52ab7df1e6c)
(cherry picked from commit 3caf7dd45d08a5b7b7fafe39e7aae7d7f8d1a684)

2 years ago13.1: update to RC2
Glen Barber [Thu, 7 Apr 2022 00:07:08 +0000 (20:07 -0400)]
13.1: update to RC2

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agovfs: fixup WANTIOCTLCAPS on open
Mateusz Guzik [Sat, 2 Apr 2022 18:35:58 +0000 (20:35 +0200)]
vfs: fixup WANTIOCTLCAPS on open

In some cases vn_open_cred overwrites cn_flags, effectively nullifying
initialisation done in NDINIT. This will have to be fixed.

In the meantime make sure the flag is passed.

Reported by: jenkins
Noted by: Mathieu <sigsys@gmail.com>
Approved by: re (gjb)

(cherry picked from commit b7262756e2f471f6481070e2473af7853506b150)
(cherry picked from commit 792ebbb1557e290805d84b87653110681c7338a0)

2 years agovfs: fix memory leak on lookup with fds with ioctl caps
Mateusz Guzik [Thu, 24 Mar 2022 20:51:03 +0000 (21:51 +0100)]
vfs: fix memory leak on lookup with fds with ioctl caps

Reviewed by: markj
PR: 262515
Noted by: firk@cantconnect.ru
Differential Revision: https://reviews.freebsd.org/D34667
Approved by: re (gjb)

(cherry picked from commit 0c805718cbd3709e3ffc1a0d41612168c8242360)
(cherry picked from commit 838d8e6fb60e12e610701ae10be717309f3ea935)

2 years agofix integer overflow bugs in *stosbt
Warner Losh [Wed, 6 Apr 2022 03:35:27 +0000 (21:35 -0600)]
fix integer overflow bugs in *stosbt

68f57679d660 Fixed another class of integer overflows, but introduced a
boundary condition for 2-4s in ns conversion, 2-~4000s in us conversions
and 2-~4,000,000s in ms conversions. This was because we bogusly used
SBT_1S for the notion of 1 second, instead of the appropriate power of
10. To fix, just use the appropriate power of 10, which avoids these
overflows.

This caused some sleeps in ZFS to be on the order of an hour.

Approved by: re@ (gjb)
MFC: 1 day
PR: 263073
Sponsored by: Netflix
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D34790

(cherry picked from commit 4c30b9ecd47a2d92565731082a6a4f2bd1e6e051)
(cherry picked from commit c43786cc37641cef02171a3c5be5a588d850e6ab)

2 years agomrsas: if controller reset is in progress, refrain from firing DCMDs to
Chandrakanth Patil [Fri, 21 Jan 2022 09:24:37 +0000 (14:54 +0530)]
mrsas: if controller reset is in progress, refrain from firing DCMDs to
firmware in shutdown

If controller reset is in progress, at same time if system shutdown is
issued then corresponding shutdown function in driver will be invoked
where driver is waiting 15 seconds to complete the controller reset.

If the reset is not complteted within that time frame driver will go
ahead and fire cache flush and shutdown DCMDs which will end up
accessing the the queues which are not initialized due to undergoing
reset leads to FMU error in firmware.

Fix:
In shutdown function, if controller reset is not finished within 15
seconds than driver will return to the OS without firing any DCMDs.

Approved by: re@ (gjb)
Reviewed by: imp
PR: 261375

(cherry picked from commit 79c4c4be9618470711480f46ef2cd3a15c00cdd2)
(cherry picked from commit 09e161a29ee5b0e52494c861f451de35b286e327)

2 years agomrsas: remove additional MPT command allocation for R1 FP command
Chandrakanth Patil [Fri, 21 Jan 2022 12:11:49 +0000 (17:41 +0530)]
mrsas: remove additional MPT command allocation for R1 FP command

There is an additional MPT command allocation for R1 fp command which
will lead to MPT command unavailablity in case of rigorous R1 FP IOs.

Remove additional MPT command allocation for R1 FP.

Approved by: re@ (gjb)
Reviewed by: imp
PR: 261377

(cherry picked from commit 241bb95552a39d440519162b544c776adcb7cf57)
(cherry picked from commit 2ebe51859723fd3cb4cf02dc560441fc0ec50dc1)

2 years agolinuxkpi: move io_mapping_create_wc to .c
Warner Losh [Tue, 5 Apr 2022 05:06:37 +0000 (23:06 -0600)]
linuxkpi: move io_mapping_create_wc to .c

Move io_mapping_create_wc to .c because it encodes the size of struct
io_mapping so we move this from the client module to the linuxkpi
module.

Approved by: re@ (gjb)
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34776

(cherry picked from commit 132b00f90613d8cc797137d4c3d2dcb99ba3c690)
(cherry picked from commit 4e94b3542dd6a5c3f60431e811013f4dbf603227)

2 years agolinuxkpi: Move lkpi_pcim_iomap_devres_find to .c file
Warner Losh [Tue, 5 Apr 2022 05:06:29 +0000 (23:06 -0600)]
linuxkpi: Move lkpi_pcim_iomap_devres_find to .c file

lkpi_pcim_iomap_devres_find encodes the size of struct pcim_iomap_devres
in the code, so move from .h to .c to move from client driver to
linuxkpi module.

Approved by: re@ (gjb)
Sponsored by: Netflix
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D34775

(cherry picked from commit 2bf3361d56f70d87a19f5d2bc8d258d418fb7a24)
(cherry picked from commit 211621030e19553c7bd321b05694418920517736)

2 years agolinuxkpi: Move pci_alloc_irq_vectors to .c file
Warner Losh [Tue, 5 Apr 2022 05:06:21 +0000 (23:06 -0600)]
linuxkpi: Move pci_alloc_irq_vectors to .c file

pci_alloc_irq_vectors encodes the size of struct msix_entry
into its code. Move from .h to .c to move this knowledge from
client modules to linuxkpi module.

Approved by: re@ (gjb)
Sponsored by: Netflix
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D34774

(cherry picked from commit 36b5c440028b44b22cfc0596125f575ca513656f)
(cherry picked from commit bc01b383945ca4f327ddb5cc940dcbafa3aaff7c)

2 years agolinuxkpi: Move pci_request_region and _lkpi_pci_iomap into .c
Warner Losh [Tue, 5 Apr 2022 05:06:14 +0000 (23:06 -0600)]
linuxkpi: Move pci_request_region and _lkpi_pci_iomap into .c

Both pci_request_region and _lkpi_pci_iomap encode the size of struct
pci_mmio_region into their code. Move from .h to .c files to move that
knowledge from the client drivers into the linuxkpi module.

Approved by: re@ (gjb)
Sponsored by: Netflix
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D34773

(cherry picked from commit 1cdb25340f8ee5dd145b0dc370cbab1bd7bdca65)
(cherry picked from commit 4859994c42950600b57e9d2259bd027562eefbe3)

2 years agolinuxkpi: Move lkpi_pci_devres_get_alloc into .c file
Warner Losh [Tue, 5 Apr 2022 05:06:06 +0000 (23:06 -0600)]
linuxkpi: Move lkpi_pci_devres_get_alloc into .c file

lkpi_pci_devres_get_alloc encodes the struct pci_devres into its
code. Move from .h file to .c file to move this knowledge into linuxkpi
module.

Approved by: re@ (gjb)
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34772

(cherry picked from commit 3ea682e21eed92f31dcfb8a34409580d36c452f7)
(cherry picked from commit 2cd55de380d3d6f02c9b40ea53a319b477268f1c)

2 years agolinuxkpi: Move cdev_alloc into .c file
Warner Losh [Tue, 5 Apr 2022 05:05:59 +0000 (23:05 -0600)]
linuxkpi: Move cdev_alloc into .c file

Move cdev_alloc into linux_compat.c since it encodes the size of struct
linux_cdev into the client modules otherwise.

Approved by: re@ (gjb)
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34771

(cherry picked from commit aca0bcbca344b39f2a448e8c1c0d80bac8c0d6de)
(cherry picked from commit d1f93d6721a6c51c0cb49078ad5c5d535a383964)