]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 months agoMerge branch 'releng/12.3' into releng-CDN/12.3 releng-CDN/12.3
Merge Robot [Fri, 17 Feb 2023 06:16:52 +0000 (00:16 -0600)]
Merge branch 'releng/12.3' into releng-CDN/12.3

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

Approved by: so

14 months agoFix multiple OpenSSL vulnerabilities.
Gordon Tetlow [Thu, 16 Feb 2023 17:25:39 +0000 (09:25 -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 agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Thu, 9 Feb 2023 06:16:43 +0000 (00:16 -0600)]
Merge branch 'releng/12.3' into releng-CDN/12.3

14 months agoAdd UPDATING entries and bump version.
Gordon Tetlow [Wed, 8 Feb 2023 16:58:20 +0000 (08:58 -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 a5afaf4e9abd8d5e6cce5d6c433d2276bf9b8721)

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 fe9c4deda9d4aa2c5bed75071f8006bd2a0734a2)

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 e2861c40b1aac3e4592a7d618418914b8f13c1dc)

16 months agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 30 Nov 2022 06:17:21 +0000 (00:17 -0600)]
Merge branch 'releng/12.3' into releng-CDN/12.3

16 months agoAdd UPDATING entries and bump version.
Gordon Tetlow [Tue, 29 Nov 2022 23:12:50 +0000 (15:12 -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 5afe36c8b79547cda2bdd7297e5e2507a9135945)

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 94395be05c14649cfc8e98551be9b2da8535637e)

17 months agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 16 Nov 2022 06:18:29 +0000 (00:18 -0600)]
Merge branch 'releng/12.3' into releng-CDN/12.3

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 f8a825bde75cb5164a896c9234979e9c18e97361)

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

17 months agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 2 Nov 2022 05:17:27 +0000 (00:17 -0500)]
Merge branch 'releng/12.3' into releng-CDN/12.3

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

Approved by: so

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 6f2acba9969a81d63e2854b44ed82af864108108)

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 56a111e10fadeb29aacc7fbdfcd6ab87c0b60b4e)

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 3d77b72b33c09e42ea3dd8ba6bd0387ae298d0ba)

19 months agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 31 Aug 2022 05:17:10 +0000 (00:17 -0500)]
Merge branch 'releng/12.3' into releng-CDN/12.3

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 7fb15b35cc2299341bc423209b4c6586164b6b37)

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 72bc320879944fecae59e903381c33ab4d5e443b)
(cherry picked from commit bd8faba77f6f8eb344ab4f5b44536dab87b2b05c)

Approved by: so
Security: CVE-2022-37434

20 months agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 10 Aug 2022 05:16:49 +0000 (00:16 -0500)]
Merge branch 'releng/12.3' into releng-CDN/12.3

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

Approved by: so

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 9a2a2871c4908cfe7012236912918622e0ed0b32)

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 2170511d491b65a07dc4416ecda2fbb37349aa10)

20 months agoaio_aqueue(): avoid ucred leak on failure path
Konstantin Belousov [Fri, 24 Sep 2021 00:14:56 +0000 (03:14 +0300)]
aio_aqueue(): avoid ucred leak on failure path

Approved by: so
Security: FreeBSD-SA-22:10.aio
PR: 258698
Submitted by: sigsys@gmail.com

(cherry picked from commit 45c2c7c484de7747014492b17ff89e323ee66496)
(cherry picked from commit 76ed54dda74ffe8c7284cab10a4b30445a8db12f)

20 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-EN-22:17.cam
MFC after: 1 week
Sponsored by: iXsystems, Inc.

(cherry picked from commit 404f001161b975164d8b52d9f404d07ac7584027)
(cherry picked from commit 8dab6aba5f6ee635e4ff3f313d0209af718ea42f)

2 years agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 6 Apr 2022 05:16:41 +0000 (00:16 -0500)]
Merge branch 'releng/12.3' into releng-CDN/12.3

2 years agoAdd UPDATING entries and bump version.
Ed Maste [Tue, 5 Apr 2022 23:24:47 +0000 (23:24 +0000)]
Add UPDATING entries and bump version.

Approved by:    so

2 years agoAssure that the number of bits for deflatePrime() is valid.
Ed Maste [Tue, 5 Apr 2022 23:34:52 +0000 (23:34 +0000)]
Assure that the number of bits for deflatePrime() is valid.

Cherry picked from zlib 4346a16853e19b45787ce933666026903fb8f3f8

Approved by: so
Security: FreeBSD-SA-22:08.zlib

2 years agozlib: Fix a bug that can crash deflate on some input when using Z_FIXED.
Ed Maste [Tue, 5 Apr 2022 23:34:30 +0000 (23:34 +0000)]
zlib: Fix a bug that can crash deflate on some input when using Z_FIXED.

Cherry picked from zlib 5c44459c3b28a9bd3283aaceab7c615f8020c531:

This bug was reported by Danilo Ramos of Eideticom, Inc. It has
lain in wait 13 years before being found! The bug was introduced
in zlib 1.2.2.2, with the addition of the Z_FIXED option. That
option forces the use of fixed Huffman codes. For rare inputs with
a large number of distant matches, the pending buffer into which
the compressed data is written can overwrite the distance symbol
table which it overlays. That results in corrupted output due to
invalid distances, and can result in out-of-bound accesses,
crashing the application.

The fix here combines the distance buffer and literal/length
buffers into a single symbol buffer. Now three bytes of pending
buffer space are opened up for each literal or length/distance
pair consumed, instead of the previous two bytes. This assures
that the pending buffer cannot overwrite the symbol table, since
the maximum fixed code compressed length/distance is 31 bits, and
since there are four bytes of pending space for every three bytes
of symbol space.

Approved by: so
Security: CVE-2018-25032
Security: FreeBSD-SA-22:08.zlib

2 years agonet80211: validate Mesh ID length in ieee80211_parse_beacon
Bjoern A. Zeeb [Tue, 5 Apr 2022 23:21:44 +0000 (23:21 +0000)]
net80211: validate Mesh ID length in ieee80211_parse_beacon

Reported by: m00nbsd working with Trend Micro Zero Day Initiative

(cherry picked from commit fb8c87b4f3bfdfac014f9d894fe75fbad0391b24)
(cherry picked from commit 72617f9246e3a4be28eeafeae1bdd983143eef3e)
(cherry picked from commit 8373df6aa0acc70343864075b08507ccea24aa5d)

Approved by: so
Security: CVE-2022-23088
Security: FreeBSD-SA-22:07.wifi_meshid

2 years agompr/mps/mpt: verify cfg page ioctl lengths
Ed Maste [Tue, 5 Apr 2022 23:21:30 +0000 (23:21 +0000)]
mpr/mps/mpt: verify cfg page ioctl lengths

*_CFG_PAGE ioctl handlers in the mpr, mps, and mpt drivers allocated a
buffer of a caller-specified size, but copied to it a fixed size header.
Add checks that the size is at least the required minimum.

Note that the device nodes are owned by root:operator with 0640
permissions so the ioctls are not available to unprivileged users.

This change includes suggestions from scottl, markj and mav.

Two of the mpt cases were reported by Lucas Leong (@_wmliang_) of
Trend Micro Zero Day Initiative; scottl reported the third case in mpt.
Same issue found in mpr and mps after discussion with imp.

Reported by: Lucas Leong (@_wmliang_), Trend Micro Zero Day Initiative
Reviewed by: imp, mav
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34692

(cherry picked from commit 8276c4149b5fc7c755d6b244fbbf6dae1939f087)
(cherry picked from commit 56d0638c738e3f9b7fbc7f78bd49590523e01ada)

Approved by: so
Security: CVE-2022-23086
Security: FreeBSD-SA-22:06.ioctl

2 years agobhyve: validate e82545 checksum offset field
Mark Johnston [Tue, 5 Apr 2022 23:20:50 +0000 (23:20 +0000)]
bhyve: validate e82545 checksum offset field

Reported by: Mehdi Talbi, Synacktiv

(cherry picked from commit b0aa20bec5db244980a0248e24dd6b8e1e68c4d0)
(cherry picked from commit 53f72209479885dfa6a7e6ed68cbc82c68464f4b)
(cherry picked from commit 1da62e16e4a2270c85db1f507cc3025c5e0d9fdd)

Approved by: so
Security: CVE-2022-23087
Security: FreeBSD-SA-22:05.bhyve

2 years agonetmap: Fix TOCTOU vulnerability in nmreq_copyin
Vincenzo Maffione [Tue, 5 Apr 2022 23:20:34 +0000 (23:20 +0000)]
netmap: Fix TOCTOU vulnerability in nmreq_copyin

The total size of the user-provided nmreq was first computed and then
trusted during the copyin. This might lead to kernel memory corruption
and escape from jails/containers.

Reported by: Lucas Leong (@_wmliang_) of Trend Micro Zero Day Initiative
Security: CVE-2022-23084
MFC after: 3 days

(cherry picked from commit 393729916564ed13f966e09129a24e6931898d12)
(cherry picked from commit 6fa8af618475024262fc99b0f0e6c2aa0e1340fe)

Approved by: so
Security: FreeBSD-SA-22:04.netmap

2 years agonetmap: Fix integer overflow in nmreq_copyin
Vincenzo Maffione [Tue, 5 Apr 2022 23:19:58 +0000 (23:19 +0000)]
netmap: Fix integer overflow in nmreq_copyin

An unsanitized field in an option could be abused, causing an integer
overflow followed by kernel memory corruption. This might be used
to escape jails/containers.

Reported by: Reno Robert and Lucas Leong (@_wmliang_) of Trend Micro
Zero Day Initiative
Security: CVE-2022-23085

(cherry picked from commit 694ea59c7021c25417e6d516362d2f59b4e2c343)
(cherry picked from commit 95602165e33a3045a27245cc1e61e67bf4feeed1)

Approved by: so
Security: FreeBSD-SA-22:04.netmap

2 years agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 23 Mar 2022 05:17:29 +0000 (00:17 -0500)]
Merge branch 'releng/12.3' into releng-CDN/12.3

2 years agoAdd UPDATING entries and bump version.
Gordon Tetlow [Tue, 22 Mar 2022 16:20:21 +0000 (09:20 -0700)]
Add UPDATING entries and bump version.

Approved by: so

2 years agocontrib/tzdata: import tzdata 2022a
Philip Paeps [Tue, 22 Mar 2022 15:54:07 +0000 (15:54 +0000)]
contrib/tzdata: import tzdata 2022a

Merge commit '971fa603f2bdf16273135a00ff16c5585520c53f'

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

With this merge, we return to our previous long-standing practice of
distributing the IANA Time Zone Database unmodified.

Releases of tzdb since 2021b have merged some time zones where clocks
have agreed since 1970.  The overwhelming majority of users will not be
affected by this change.  A port of the newly created global-tz fork of
the IANA Time Zone database (misc/global-tz) is available for users who
need more granular pre-1970 time zone history.

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

(cherry picked from commit 8ea5af2b77f2b43c250cacb257f42c0a54d644c4)
(cherry picked from commit 803b4b7f22ef9be408d81480cf70ca3afb7c7c53)

2 years agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 16 Mar 2022 05:16:27 +0000 (00:16 -0500)]
Merge branch 'releng/12.3' into releng-CDN/12.3

2 years agoAdd UPDATING entries and bump version
Mark Johnston [Tue, 15 Mar 2022 17:04:23 +0000 (13:04 -0400)]
Add UPDATING entries and bump version

Approved by: so

2 years agonet80211: prevent plaintext injection by A-MSDU RFC1042/EAPOL frames
Mathy Vanhoef [Sun, 6 Jun 2021 22:10:56 +0000 (22:10 +0000)]
net80211: prevent plaintext injection by A-MSDU RFC1042/EAPOL frames

No longer accept plaintext A-MSDU frames that start with an RFC1042
header with EtherType EAPOL.  This is done by only accepting EAPOL
packets that are included in non-aggregated 802.11 frames.

Note that before this patch, FreeBSD also only accepted EAPOL frames
that are sent in a non-aggregated 802.11 frame due to bugs in
processing EAPOL packets inside A-MSDUs. In other words,
compatibility with legitimate devices remains the same.

This relates to section 6.5 in the 2021 Usenix "FragAttacks" (Fragment
and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation)
paper.

Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be)
Security: CVE-2020-26144
PR: 256120

(cherry picked from commit ffc19cf52da5546973965f78cf32aa0f2c9657f8)
(cherry picked from commit 8b2ba742cc2c732bc4bc1d43f8256adce06657d0)
(cherry picked from commit 2d09e4366b67dd719ebae5390436868e5430d833)

Approved by: so
Security: FreeBSD-SA-22:02.wifi

2 years agonet80211: reject mixed plaintext/encrypted fragments
Mathy Vanhoef [Sun, 6 Jun 2021 22:10:41 +0000 (22:10 +0000)]
net80211: reject mixed plaintext/encrypted fragments

ieee80211_defrag() accepts fragmented 802.11 frames in a protected Wi-Fi
network even when some of the fragments are not encrypted.
Track whether the fragments are encrypted or not and only accept
successive ones if they match the state of the first fragment.

This relates to section 6.3 in the 2021 Usenix "FragAttacks" (Fragment
and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation)
paper.

Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be)
Security: CVE-2020-26147
PR: 256118

(cherry picked from commit 11572d7d7fb9802ceb46ea9dc6cbe3bb95373e55)
(cherry picked from commit e13d483c5677d12b52f1c81537d54faa85ed43b9)
(cherry picked from commit 00cd5a2f614ae2cf1daa30cde7f91de9cdde2393)

Approved by: so
Security: FreeBSD-SA-22:02.wifi

2 years agonet80211: proper ssid length check in setmlme_assoc_adhoc()
Bjoern A. Zeeb [Wed, 6 Oct 2021 18:41:37 +0000 (18:41 +0000)]
net80211: proper ssid length check in setmlme_assoc_adhoc()

A user supplied SSID length is used without proper checks in
setmlme_assoc_adhoc() which can lead to copies beyond the end
of the user supplied buffer.
The ssid is a fixed size array for the ioctl and the argument
to setmlme_assoc_adhoc().
In addition to an ssid_len check of 0 also error in case the
ssid_len is larger than the size of the ssid array to prevent
problems.

PR: 254737
Reported by: Tommaso (cutesmilee.research protonmail.com)

(cherry picked from commit 526370fb85db4b659cff4625eb2f379acaa4a1a8)
(cherry picked from commit 0525ece3554edce14fa68a7fb61078ae2110c44b)
(cherry picked from commit ab5678c6c0d0b28feafdb2fd397866d6088f37d8)
(cherry picked from commit f4d0e8787a09f4cdfb856924aaca97f1c78b65b1)

Approved by: so
Security: FreeBSD-SA-22:02.wifi

2 years agonet80211: correct length check in ieee80211_ies_expand()
Bjoern A. Zeeb [Wed, 6 Oct 2021 18:09:39 +0000 (18:09 +0000)]
net80211: correct length check in ieee80211_ies_expand()

In ieee80211_ies_expand() we are looping over Elements
(also known as Information Elements or IEs).
The comment suggests that we assume well-formedness of
the IEs themselves.
Checking the buffer length being least 2 (1 byte Element ID and
1 byte Length fields) rather than just 1 before accessing ie[1]
is still good practise and can prevent and out-of-bounds read in
case the input is not behaving according to the comment.

Reported by: (coypu sdf.org)
admbugs: 857
MFC after: 3 days
Reviewed by: adrian, markj
Differential Revision: https://reviews.freebsd.org/D32340

(cherry picked from commit 09dd08f167812a5fdb516fc98f14dbb43221432f)
(cherry picked from commit 8dc4c0a922b7e7a0ee682f4e1426f876692c0828)

Approved by: so
Security: FreeBSD-SA-22:02.wifi

2 years agonet80211: mitigation against A-MSDU design flaw
Mathy Vanhoef [Sun, 6 Jun 2021 22:10:52 +0000 (22:10 +0000)]
net80211: mitigation against A-MSDU design flaw

Mitigate A-MSDU injection attacks by detecting if the destination address
of a subframe equals an RFC1042 (i.e., LLC/SNAP) header, and if so
dropping the complete A-MSDU frame.  This mitigates known attacks,
although new (unknown) aggregation-based attacks may remain possible.

This defense works because in A-MSDU aggregation injection attacks, a
normal encrypted Wi-Fi frame is turned into an A-MSDU frame. This means
the first 6 bytes of the first A-MSDU subframe correspond to an RFC1042
header. In other words, the destination MAC address of the first A-MSDU
subframe contains the start of an RFC1042 header during an aggregation
attack. We can detect this and thereby prevent this specific attack.

This relates to section 7.2 in the 2021 Usenix "FragAttacks" (Fragment
and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation)
paper.

Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be)
Security: CVE-2020-24588
PR: 256119

(cherry picked from commit f024bdf1155f36d2d8c4caa533b66e4040c4c469)
(cherry picked from commit 41ca1d50a8657959df2009daa300dda56a090d5e)
(cherry picked from commit 76ee776f4d9f146f7a97ac9bab388c51a1c787c9)

Approved by: so
Security: FreeBSD-SA-22:02.wifi

2 years agofreebsd-update: improve BE creation feature
Kyle Evans [Sat, 12 Feb 2022 21:36:24 +0000 (15:36 -0600)]
freebsd-update: improve BE creation feature

This addresses one nit and one bug in the BE creation feature of
freebsd-update:

The nit addressed is that it currently only names the BEs after the
userland version, but the kernel version may be higher.  After this
change, we request both and pass them through sort(1) to choose the
highest.  This is especially helpful if a freebsd-update patch touched
one but not the other.

The bug fixed is that roots updated that are not located at '/', e.g.,
by using -b or -j, will no longer create boot environments
automatically.  There's a very low chance these will actually change the
BE in any meaningful way, anyways.  It could make sense in the future
to allow an argument-override to create the BE anyways if someone comes
up with a non-standard setup, e.g., where a jail is an important part of
their boot environment on an appliance or some such setup.

Half of this patch is submitted by delphij@, the other half kevans@.

PR: 261446

(cherry picked from commit e01e8f911b935eabcc35b4d121951e4e21042ee5)
(cherry picked from commit 35d33d408213d20c63d60c0dfcdf77b2b36f5eee)

Approved by: so
Security: FreeBSD-EN-22:09.freebsd-update

2 years agoFix a bug in BN_mod_sqrt() that can cause it to loop forever.
Gordon Tetlow [Tue, 15 Mar 2022 16:48:59 +0000 (09:48 -0700)]
Fix a bug in BN_mod_sqrt() that can cause it to loop forever.

Obtained from: OpenSSL Project
Security: CVE-2022-0778
Security:       FreeBSD-SA-22:03.openssl

(cherry picked from commit fdc418f15e92732a3551832bcb625ba9b47242df)
(cherry picked from commit c2a7d6e643bbc8801b1b83c9e64d57e726eeed98)

Approved by: so

2 years agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 2 Feb 2022 06:17:56 +0000 (00:17 -0600)]
Merge branch 'releng/12.3' into releng-CDN/12.3

2 years agoAdd UPDATING entries and bump version.
Gordon Tetlow [Tue, 1 Feb 2022 17:56:30 +0000 (09:56 -0800)]
Add UPDATING entries and bump version.

Approved by: so

2 years agosmp_targeted_tlb_shootdown has to pin the CPU on i386
Andriy Gapon [Tue, 25 Jan 2022 10:34:08 +0000 (12:34 +0200)]
smp_targeted_tlb_shootdown has to pin the CPU on i386

This should fix a regression in 1820ca215461 which happened
because pmap -> shootdown contracts on amd64 and i386 diverged.
On amd64 the pmap code always pins the CPU before calling the shootdown
code and expects it to unpin on return.
On i386 the pmap code either has pins and unpins around the shootdown
calls or does not pin at all.
This change should account for that difference.

In main and stable/13 the contracts are also different, but the
shootdown code is split into the i386 and amd64 variants and each
variant is tailored towards the platform's pmap.

PR: 261338
Reported by: Dmitry K. <thedix@yandex.ru>
Debugged by: Dmitry K. <thedix@yandex.ru>
Tested by: Dmitry K. <thedix@yandex.ru>
Fixes: 1820ca215461 MFC r368649 / 3fd989da by kib: amd64 pmap: fix PCID mode invalidations
Reviewed by: kib
X-Pointyhat to: avg
Differential Revision: https://reviews.freebsd.org/D33980

(cherry picked from commit e0cc1ce7c0866d6a5c42ef09cfca9582c4a8343c)

Approved by: so
Security: FreeBSD-EN-22:08.i386

2 years agoMerge branch 'releng/12.3' into releng-CDN/12.3
Merge Robot [Wed, 12 Jan 2022 06:17:18 +0000 (00:17 -0600)]
Merge branch 'releng/12.3' into releng-CDN/12.3

2 years agoAdd UPDATING entries and bump version
Ed Maste [Tue, 11 Jan 2022 17:42:59 +0000 (12:42 -0500)]
Add UPDATING entries and bump version

Approved by: so

2 years agoFix fragmented UDP packets handling since rev.360967.
Maxim Sobolev [Thu, 7 Oct 2021 20:41:40 +0000 (13:41 -0700)]
Fix fragmented UDP packets handling since rev.360967.

Consider IP_MF flag when checking length of the UDP packet to
match the declared value.

Sponsored by: Sippy Software, Inc.
Differential Revision: https://reviews.freebsd.org/D32363
MFC after: 2 weeks

(cherry picked from commit 461e6f23db3b9794e6af88b381b066a2c0463d1c)
(cherry picked from commit 73c5a2566dbb3ae57970b203d4de6fcf6088701c)

Approved by: so
Errata: EN-22:06.libalias

2 years agoMFC r368649 / 3fd989da by kib: amd64 pmap: fix PCID mode invalidations
Andriy Gapon [Tue, 14 Dec 2021 14:43:29 +0000 (16:43 +0200)]
MFC r368649 / 3fd989da by kib: amd64 pmap: fix PCID mode invalidations

r368649 fixed a regression in r362031 that was MFC-ed to stable/12 as
a part of r362572.  That commit reordered IPI send and local TLB flush in
TLB invalidations.

Without this fix we've been seeing problems with stale memory content
where changes done under a mutex were not immediately observed by
another thread after taking the same mutex.  Those inconsistenices were
correlated to copy-on-write faults for pages contaning the data.

The change needed some adaptations as I elected to skip two significant
intermediate changes:
- r363195 / dc43978a, amd64: allow parallel shootdown IPIs
- r363311 / 3ec7e169, amd64 pmap: microoptimize local shootdowns for
  PCID PTI configurations

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

(cherry picked from commit 1820ca2154611d6f27ce5a5fdd561a16ac54fdd8)

Approved by: so
Errata: FreeBSD-EN-22:04.pcid

2 years agoHyper-V: vPCI: Prepopulate device bars
Wei Hu [Sat, 27 Nov 2021 06:42:34 +0000 (06:42 +0000)]
Hyper-V: vPCI: Prepopulate device bars

In recent Hyper-V releases on Windows Server 2022, vPCI code does not
initialize the last 4 bit of device bar registers. This behavior change
could result weird problems cuasing PCI code failure when configuring
bars.

Just write all 1's to those bars whose probed values are not the same
as current read ones. This seems to make Hyper-V vPCI and
pci_write_bar() to cooperate correctly on these releases.

Reported by: khng@freebsd.org
Tested by: khng@freebsd.org
MFC after: 2 weeks
Sponsored by: Microsoft

(cherry picked from commit 75412a521f60d4b0393c730ffb284e7c6ff9d2de)
(cherry picked from commit eabea1c700ad8eacb8dc780d8620b59ce72b2cf2)

Approved by: so
Errata: FreeBSD-EN-22:03.hyperv

2 years agoamd64: correct size of the SSE area in the xsave layout
Konstantin Belousov [Sun, 12 Dec 2021 02:49:50 +0000 (04:49 +0200)]
amd64: correct size of the SSE area in the xsave layout

(cherry picked from commit 73b357be92385cbb70ba19e7023a736af2c6b493)
(cherry picked from commit 7e45b72844768d7fd5c3c4d4e29f4e84b4bc0402)

Approved by: so
Errata: FreeBSD-EN-22:02.xsave

2 years agocdn-patch: offer option to mount /etc/keys before attaching geli devices
CyberLeo [Fri, 22 Nov 2019 02:17:38 +0000 (20:17 -0600)]
cdn-patch: offer option to mount /etc/keys before attaching geli devices

2 years agocdn-patch: fix checkyesno warning in efi keysource
CyberLeo [Fri, 22 Nov 2019 02:14:09 +0000 (20:14 -0600)]
cdn-patch: fix checkyesno warning in efi keysource

2 years agocdn-patch: use key from efi if it exists
CyberLeo [Sat, 9 Nov 2019 04:12:26 +0000 (22:12 -0600)]
cdn-patch: use key from efi if it exists

2 years agocdn-patch: mark unionfs as jail-safe
CyberLeo [Sun, 23 Jul 2017 08:42:13 +0000 (03:42 -0500)]
cdn-patch: mark unionfs as jail-safe

2 years ago12.3: update to -RELEASE
Glen Barber [Thu, 2 Dec 2021 00:08:38 +0000 (19:08 -0500)]
12.3: update to -RELEASE

- Switch releng/12.3 from RC2 to RELEASE.
- Add the anticipated 12.3-RELEASE date to UPDATING.
- Set a static __FreeBSD_version.

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

2 years agoopenssl: Fix detection of ARMv7 and ARM64 CPU features
Allan Jude [Fri, 19 Nov 2021 15:14:30 +0000 (15:14 +0000)]
openssl: Fix detection of ARMv7 and ARM64 CPU features

OpenSSL assumes the same value for AT_HWCAP=16 (Linux)
So it ends up calling elf_auxv_info() with AT_CANARY which
returns ENOENT, and all acceleration features are disabled.

With this, my ARM64 test machine runs the benchmark
`openssl speed -evp aes-256-gcm` nearly 20x faster
going from 100 MB/sec to 2000 MB/sec

It also improves sha256 from 300 MB/sec to 1800 MB/sec

This fix has been accepted but not yet merged upstream:
https://github.com/openssl/openssl/pull/17082

PR: 259937
Reviewed by: manu, imp
Approved by: re (gjb)
Relnotes: yes
Fixes: 88e852c0b5c872b1a ("OpenSSL: Merge OpenSSL 1.1.1j")
Sponsored by: Ampere Computing LLC
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D33060

(cherry picked from commit d9bb798725cfce9c72b80440659b48e8668eb10d)
(cherry picked from commit 0ed191d116f511c1e67338f05386d87aad53076f)

2 years agolibctf: Improve check for duplicate SOU definitions in ctf_add_type()
Mark Johnston [Mon, 4 Oct 2021 16:28:22 +0000 (12:28 -0400)]
libctf: Improve check for duplicate SOU definitions in ctf_add_type()

When copying a struct or union from one CTF container to another,
ctf_add_type() checks whether it matches an existing type in the
destination container.  It does so by looking for a type with the same
name and kind as the new type, and if one exists, it iterates over all
members of the source type and checks whether a member with matching
name and offset exists in the matched destination type.  This can
produce false positives, for example because member types are not
compared, but this is not expected to arise in practice.  If the match
fails, ctf_add_type() returns an error.

The procedure used for member comparison breaks down in the face of
anonymous struct and union members.  ctf_member_iter() visits each
member in the source definition and looks up the corresponding member in
the desination definition by name using ctf_member_info(), but this
function will descend into anonymous members and thus fail to match.
Fix the problem by introducing a custom comparison routine which does
not assume member names are unique.  This should also be faster for
types with many members; in the previous scheme, membcmp() would perform
a linear scan of the desination type's members to perform a lookup by
name.  The new routine steps through the members of both types in a
single loop.

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

(cherry picked from commit 105fd928b0b5b35ab529e5f6914788dc49582901)
(cherry picked from commit 39545ce06ca8088aecc68b92c028b78bcae888a2)

2 years agoWhen copying types from one CTF container to another, ensure that we
Jonathan T. Looney [Tue, 17 Nov 2020 14:07:27 +0000 (14:07 +0000)]
When copying types from one CTF container to another, ensure that we
always copy intrinsic data types before copying bitfields which are
based on those types. This ensures the type ordering in the destination
CTF container matches the assumption made elsewhere in the CTF code
that instrinsic data types will always appear before bitfields based on
those types.

This resolves the following error message some users have seen after
r366908:
    "/usr/lib/dtrace/ipfw.d", line 121: failed to copy type of 'ip6p':
    Conflicting type is already defined

Reviewed by: markj
Approved by: re (gjb)
Sponsored by: Netflix

(cherry picked from commit 3cbb4cc200f8a0ad7ed08233425ea54524a21f1c)
(cherry picked from commit 4faff19d63053defffe707312c6208c2b1e934ef)

2 years agoMFC: rc.d/rctl: unbreak for distinct /usr filesystem
Eugene Grosbein [Sat, 20 Nov 2021 08:54:39 +0000 (15:54 +0700)]
MFC: rc.d/rctl: unbreak for distinct /usr filesystem

Both rctl and used xargs utility live in /usr/bin
so add REQUIRE: FILESYSTEMS

Approved by: re (gjb)
Reported by: Peter <pmc@citylink.dinoex.sub.org>

(cherry picked from commit 0c54fe172ad365e7e60d6249484a7579c18b7d2d)
(cherry picked from commit 92b40444d07aeef2bf4b20109f3f90ac343b90df)

2 years agolibarchive: cherry-pick bugfix from vendor
Martin Matuska [Wed, 17 Nov 2021 21:21:19 +0000 (22:21 +0100)]
libarchive: cherry-pick bugfix from vendor

Vendor commit message (ede459d2e):
  archive_write_disk_posix: fix writing fflags broken in 8a1bd5c

  The fixup list was erroneously assumed to be directories only.
  Only in the case of critical file flags modification (e.g.
  SF_IMMUTABLE on BSD systems), other file types (e.g. regular files
  or symbolic links) may be added to the fixup list. We still need to
  verify that we are writing to the correct file type, so compare the
  archive entry file type with the file type of the file to be
  modified.

Fixes vendor issue #1617:
  Immutable flag no longer preserved during tar extraction on FreeBSD

Approved by: re (gjb)
Reported by: markj
Libarchive commit: ede459d2ebb879f5eedb6f7abea203be0b334230

(cherry picked from commit 201d0ebee321fb1a5501e17a4f150aa211020c5c)
(cherry picked from commit f2b106ec4e5a8488883c58480cf576d18010d263)

2 years ago12.3: update to RC2
Glen Barber [Thu, 18 Nov 2021 00:04:36 +0000 (19:04 -0500)]
12.3: update to RC2

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

2 years agoigc: Use hardware routine for PHY reset
Peter Grehan [Mon, 1 Nov 2021 13:35:43 +0000 (23:35 +1000)]
igc: Use hardware routine for PHY reset

Summary:
The previously used software reset routine wasn't sufficient
to reset the PHY if the bootloader hadn't left the device in
an initialized state. This was seen with the onboard igc port
on an 11th-gen Intel NUC.

The software reset isn't used in the Linux driver so all related
code has been removed.

Tested on: Netgate 6100 onboard ports, a discrete PCIe I225-LM card,
and an 11th-gen Intel NUC.

Approved by: re (gjb)
Reported by: woodsb02
Tested by: woodsb02 (NUC)
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 561cd74b1704ab76a3286733fb43da53b6892ea4)
(cherry picked from commit 267a39780ea8c89b7a89ca9e91dcfff02c69656f)

2 years agoigc: correctly update RCTL when changing multicast filters.
Peter Grehan [Mon, 11 Oct 2021 17:49:01 +0000 (03:49 +1000)]
igc: correctly update RCTL when changing multicast filters.

Fix clearing of bits in RCTL for the non-bpf/non-allmulti case.
Update RCTL after modifying the multicast filter registers as per
the Linux driver.

This fixes LACP on igc interfaces, where incoming LACP multicasti
control packets were being dropped.

Approved by: re  (gjb)
Obtained from: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 5a3eb6207a353c3a18da8abcf00a2d75276dd29e)
(cherry picked from commit 73e1138208a5888aaabfc44d8e48aa04554c9146)

2 years ago12.3: update DVD pkg configuration
Glen Barber [Fri, 12 Nov 2021 15:29:53 +0000 (10:29 -0500)]
12.3: update DVD pkg configuration

Use the release_3 package repository to populate the dvd1.iso
images.

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

2 years ago12.3: update to RC1
Glen Barber [Thu, 11 Nov 2021 00:01:38 +0000 (19:01 -0500)]
12.3: update to RC1

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

2 years agoscsi_cd: Improve TOC access validation
Mark Johnston [Wed, 3 Nov 2021 19:09:17 +0000 (15:09 -0400)]
scsi_cd: Improve TOC access validation

1. During CD probing, we read the TOC header to find the number of
   entries, then read the TOC itself.  The header determines the number
   of entries, which determines the amount of data to read from the
   device into the softc in the CD_STATE_MEDIA_TOC_FULL state.  We
   hard-code a limit of 99 tracks (plus one for the lead-out) in the
   softc, but were not validating that the size reported by the media
   would fit in this hard-coded limit.  Kernel memory corruption could
   occur if not.[1]  Add validation to check this, and refuse to cache
   the TOC if it would not fit.

2. The CDIOCPLAYTRACKS ioctl uses caller provided track numbers to index
   into the TOC, but we only validate the starting index.  Add
   validation of the ending index.

Also, raise the hard-coded limit from 100 tracks to 170, per a
suggestion from Ken.

Approved by: re (gjb)
Reported by: C Turt <ecturt@gmail.com> [1]
Reviewed by: ken, avg
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6afabf00920fb8d41b8f013090f282c17c117efc)
(cherry picked from commit f607b686f9a96745e337a8d045f0f51b599a245e)

2 years ago12.3: update to BETA3
Glen Barber [Thu, 4 Nov 2021 01:07:01 +0000 (21:07 -0400)]
12.3: update to BETA3

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

2 years agousb(4): Fix for use after free in combination with EVDEV_SUPPORT.
Hans Petter Selasky [Sun, 24 Oct 2021 11:38:04 +0000 (13:38 +0200)]
usb(4): Fix for use after free in combination with EVDEV_SUPPORT.

When EVDEV_SUPPORT was introduced, the USB transfers may be running
after the main FIFO is closed. In connection to this a race may appear
which can lead to use-after-free scenarios. Fix this for all FIFO
consumers by initializing and resetting the FIFO queues under the
lock used by the client. Then the client driver will see an empty
queue in all cases a race may appear.

Approved by: re@ (gjb)
Found by: pho@
Sponsored by: NVIDIA Networking

(cherry picked from commit aad0c65d6b37364d8ba92ecb8c85e004398a5194)
(cherry picked from commit bb9bee1ffbb27f903bfd2c11d681d331bea727ea)

2 years ago12.3: Update to BETA2
Glen Barber [Thu, 28 Oct 2021 00:00:45 +0000 (20:00 -0400)]
12.3: Update to BETA2

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

2 years agocmp: initialize limit to avoid stack garbage limits
Kyle Evans [Thu, 21 Oct 2021 16:30:55 +0000 (11:30 -0500)]
cmp: initialize limit to avoid stack garbage limits

Approved by: re (gjb)
Pointy hat: kevans
Fixes: 4e380e847460 ("cmp: add -n, --bytes to limit number of bytes [...]")
Sponsored by: Klara, Inc.

(cherry picked from commit f1f7f31366e5830f4f5b96c6394a0b91475744f4)
(cherry picked from commit aba2dc46dfa51cf9e1b1987ca4e91f703ae7e368)

2 years agocontrib/tzdata: correct DST in Palestine
Philip Paeps [Mon, 25 Oct 2021 01:09:08 +0000 (01:09 +0000)]
contrib/tzdata: correct DST in Palestine

Direct commit to stable/12.

Merge the corrected DST transition date from tzdata 2021e.  This
corrects future timestamps in Palestine.

Approved by: re (blanket)

(cherry picked from commit 89e293e5dcb42e1fd312aab79d045c3eaa017bb6)

2 years agocontrib/tzdata: correct DST in Fiji
Philip Paeps [Mon, 18 Oct 2021 06:19:42 +0000 (14:19 +0800)]
contrib/tzdata: correct DST in Fiji

Direct commit to stable/12.

Unfortunately, there is still no clear consensus on the tz mailing list
about some of the changes introduced by tzdata 2021b and later releases.
Pending consensus, only merge the recently announced DST transition date
for Fiji and corrections to commentary from tzdata 2021d.  This corrects
future timestamps in Fiji.

Approved by: re (gjb)

(cherry picked from commit 74a0f31dbbd0b32689d63d8c965c611bdfc4da2f)

2 years agoRevert "12.3: Makefile: add a newline to validate the git->svn exporter"
Glen Barber [Thu, 21 Oct 2021 23:08:30 +0000 (19:08 -0400)]
Revert "12.3: Makefile: add a newline to validate the git->svn exporter"

This reverts commit 51a3024ee71a1ffebed139a40a534cdb2284d888.

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

2 years ago12.3: Makefile: add a newline to validate the git->svn exporter
Glen Barber [Thu, 21 Oct 2021 22:47:31 +0000 (18:47 -0400)]
12.3: Makefile: add a newline to validate the git->svn exporter

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

2 years ago12.3: create releng/12.3 branch
Glen Barber [Thu, 21 Oct 2021 00:44:32 +0000 (20:44 -0400)]
12.3: create releng/12.3 branch

Update from PRERELEASE to BETA1
switch pkg(8) configuration to use 'quarterly'
Bump __FreeBSD_version

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

2 years agocxgbe(4): Stop but don't free netmap queues when netmap is switched off.
Navdeep Parhar [Thu, 3 Dec 2020 08:30:29 +0000 (08:30 +0000)]
cxgbe(4): Stop but don't free netmap queues when netmap is switched off.

It is common for freelists to be starving when a netmap application
stops.  Mailbox commands to free queues can hang in such a situation.
Avoid that by not freeing the queues when netmap is switched off.
Instead, use an alternate method to stop the queues without releasing
the context ids.  If netmap is enabled again later then the same queue
is reinitialized for use.  Move alloc_nm_rxq and txq to t4_netmap.c
while here.

Sponsored by: Chelsio Communications

(cherry picked from commit 8eba75ed68854188c01a2058fe1f826b3428dbfa)

2 years agocxgbe(4): Revert r367917.
Navdeep Parhar [Wed, 2 Dec 2020 20:54:03 +0000 (20:54 +0000)]
cxgbe(4): Revert r367917.

r367917 fixed the backpressure on the netmap rxq being stopped but that
doesn't help if some other netmap rxq is starved (because it is stopping
too although the driver doesn't know this yet) and blocks the pipeline.
An alternate fix that works in all cases will be checked in instead.

Sponsored by: Chelsio Communications

(cherry picked from commit f42f3b2955e5afa770275fd76b4f754fbd67bbeb)

2 years agocxgbe(4): Catch up with in-flight netmap rx before destroying queues.
Navdeep Parhar [Sat, 21 Nov 2020 03:27:32 +0000 (03:27 +0000)]
cxgbe(4): Catch up with in-flight netmap rx before destroying queues.

The netmap application using the driver is responsible for replenishing
the receive freelists and they may be totally depleted when the
application exits.  Packets in flight, if any, might block the pipeline
in case there aren't enough buffers left in the freelist.  Avoid this by
filling up the freelists with a driver allocated buffer.

Sponsored by: Chelsio Communications

(cherry picked from commit b3718e2d7ebfe7fc0bb57bd0906aacc28dd755b2)

2 years agoselsocket: handle sopoll() errors correctly
Brooks Davis [Wed, 20 Oct 2021 16:00:38 +0000 (17:00 +0100)]
selsocket: handle sopoll() errors correctly

Without this change, unmounting smbfs filesystems with an INVARIANTS
kernel would panic after 10e64782ed59727e8c9fe4a5c7e17f497903c8eb.

PR: 253079
Found by: markj
Reviewed by: markj, jhb
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D32492

(cherry picked from commit 04c91ac48ad13ce0d1392cedbd69c2c0223d206f)

2 years agopf: Introduce pf_nvbool()
Kristof Provost [Wed, 13 Oct 2021 09:00:46 +0000 (11:00 +0200)]
pf: Introduce pf_nvbool()

Similar to the existing functions for strings and ints, this lets us
simplify some of the nvlist conversion code.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 776df104fa54bb581e1fb88ac44af4fa7fd4052b)

2 years agosbuf(9): Microoptimize sbuf_put_byte()
Alexander Motin [Tue, 5 Oct 2021 18:42:47 +0000 (14:42 -0400)]
sbuf(9): Microoptimize sbuf_put_byte()

This function is actively used by sbuf_vprintf(), so this simple
inlining in half reduces time of kern.geom.confxml generation.

MFC after: 2 weeks
Sponsored by: iXsystem, Inc.

(cherry picked from commit 7835b2cb4a1ae57f403739a2f1076ec7188f18c9)

2 years agociss(4): Fix typo.
Alexander Motin [Sun, 19 Sep 2021 18:01:40 +0000 (14:01 -0400)]
ciss(4): Fix typo.

(cherry picked from commit 5f8cb13cfb0c91a4ec1a9648a3ae245b1dff36f6)

2 years agociss(4): Properly handle data underrun.
Alexander Motin [Sun, 19 Sep 2021 17:45:51 +0000 (13:45 -0400)]
ciss(4): Properly handle data underrun.

For SCSI data underrun is a part of normal life.  It should not be
reported as error.  This fixes MODE SENSE used by modern CAM.

MFC after: 1 month

(cherry picked from commit e8144a13e075ff13c1f162690c7f14dd3f0a4862)

2 years agoFix two typos in source code comments
Gordon Bergling [Sat, 16 Oct 2021 06:09:31 +0000 (08:09 +0200)]
Fix two typos in source code comments

- s/alocated/allocated/
- s/realocated/reallocated/

(cherry picked from commit 899a3b38f5172d70360396caeebb5b694638282e)

2 years agonfscl: Fix another deadlock related to the NFSv4 clientID lock
Rick Macklem [Wed, 13 Oct 2021 00:21:01 +0000 (17:21 -0700)]
nfscl: Fix another deadlock related to the NFSv4 clientID lock

Without this patch, it is possible to hang the NFSv4 client,
when a rename/remove is being done on a file where the client
holds a delegation, if pNFS is being used.  For a delegation
to be returned, dirty data blocks must be flushed to the NFSv4
server.  When pNFS is in use, a shared lock on the clientID
must be acquired while doing a write to the DS(s).
However, if rename/remove is doing the delegation return
an exclusive lock will be acquired on the clientID, preventing
the write to the DS(s) from acquiring a shared lock on the clientID.

This patch stops rename/remove from doing a delegation return
if pNFS is enabled.  Since doing delegation return in the same
compound as rename/remove is only an optimization, not doing
so should not cause problems.

This problem was detected during a recent NFSv4 interoperability
testing event held by the IETF working group.

(cherry picked from commit b82168e657d378ff86ea18c4f03b98aac9ee9bb3)

2 years agonfscl: Fix a deadlock related to the NFSv4 clientID lock
Rick Macklem [Tue, 12 Oct 2021 04:58:24 +0000 (21:58 -0700)]
nfscl: Fix a deadlock related to the NFSv4 clientID lock

Without this patch, it is possible for a process doing an NFSv4
Open/create of a file to block to allow another process
to acquire the exclusive lock on the clientID when holding
a shared lock on the clientID.  As such, both processes
deadlock, with one wanting the exclusive lock, while the
other holds the shared lock.  This deadlock is unlikely to occur
unless delegations are in use on the NFSv4 mount.

This patch fixes the problem by not deferring to the process
waiting for the exclusive lock when a shared lock (reference cnt)
is already held by the process.

This problem was detected during a recent NFSv4 interoperability
testing event held by the IETF working group.

(cherry picked from commit 120b20bdf49630cf2a7dbc5f93b9e985e1f4f198)

2 years agogeom_label: Fix the stable/12 build
Mark Johnston [Mon, 18 Oct 2021 13:16:47 +0000 (09:16 -0400)]
geom_label: Fix the stable/12 build

MAXPHYS is a constant here, use the right name.  This is a direct commit
to stable/12.

Fixes: 116a988f99cd ("geom_label: Add more validation for NTFS volume tasting")
Reported by: Jenkins

2 years agogeom_label: Add more validation for NTFS volume tasting
Mark Johnston [Mon, 4 Oct 2021 21:48:44 +0000 (17:48 -0400)]
geom_label: Add more validation for NTFS volume tasting

- Ensure that the computed MFT record size isn't negative or larger than
  maxphys before trying to read $Volume.
- Guard against truncated records in volume metadata.
- Ensure that the record length is large enough to contain the volume
  name.
- Verify that the (UTF-16-encoded) volume name's length is a multiple of
  two.

PR: 258833, 258914
Sponsored by: The FreeBSD Foundation

(cherry picked from commit f0a08fa9f532a58f5d7a4814d6eb7ddd49f368da)

2 years agounzip: Fix segmentation fault if a zip file contains buggy filename.
Yoshihiro Takahashi [Sun, 10 Oct 2021 11:49:19 +0000 (20:49 +0900)]
unzip: Fix segmentation fault if a zip file contains buggy filename.

PR:             259011
Reported by:    Robert Morris
Submitted by:   ak

(cherry picked from commit 2c614481fd5248c1685e713f67d40cf2d5fba494)

2 years agovmci: fix panic due to freeing unallocated resources
Mark Peek [Sat, 9 Oct 2021 21:21:16 +0000 (14:21 -0700)]
vmci: fix panic due to freeing unallocated resources

Summary:
An error mapping PCI resources results in a panic due to unallocated
resources being freed up. This change puts the appropriate checks in
place to prevent the panic.

PR: 252445
Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Tested by: marcus
MFC after: 1 week
Sponsored by: VMware

Test Plan:
Along with user testing, also simulated error by inserting a ENXIO
return in vmci_map_bars().

Reviewed by: marcus
Subscribers: imp
Differential Revision: https://reviews.freebsd.org/D32016

(cherry picked from commit 0f14bcbe384091c729464cb770372aeb79061070)