]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoAdd UPDATING entries and bump version. releng/12.2
Gordon Tetlow [Tue, 22 Mar 2022 16:20:05 +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 agoAdd UPDATING entries and bump version
Mark Johnston [Tue, 15 Mar 2022 17:42:16 +0000 (13:42 -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 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.

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

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

2 years agoAdd UPDATING entries and bump version.
Gordon Tetlow [Tue, 1 Feb 2022 17:54:20 +0000 (09:54 -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 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 agovt: bound buffer access in redraw optimization
Ed Maste [Wed, 22 Sep 2021 18:41:00 +0000 (14:41 -0400)]
vt: bound buffer access in redraw optimization

PR: 248628
Reported by: oleg
Reviewed by: cem, oleg (both earlier)
Fixes: ee97b2336aa4 ("Speed up vt(4) by keeping...")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32059

(cherry picked from commit dbc7ca59451561a179f9852642e13ef024169d84)
(cherry picked from commit e4fcff8ee124f8faed2f1fcc1e15b7ae6906d4d7)

Approved by: so
Security: FreeBSD-SA-22:01.vt

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 agoCirrus-CI: use FreeBSD 12.2 image
Ed Maste [Mon, 15 Feb 2021 22:04:42 +0000 (17:04 -0500)]
Cirrus-CI: use FreeBSD 12.2 image

Direct commit to stable/12 as main has other changes here, using the
llvm package to avoid building the toolchain.

(cherry picked from commit 046f91f21ac619f7307a8e853f863ded4df7f322)

Note that this does not have any effect on built artifacts (and thus is
not an EN candidate) but allows Cirrus-CI to be used on this releng
branch.

Approved by: so

2 years agoAdd UPDATING entries and bump version.
Gordon Tetlow [Wed, 3 Nov 2021 20:53:20 +0000 (13:53 -0700)]
Add UPDATING entries and bump version.

Approved by:    so

2 years agoTimezone database information update.
Gordon Tetlow [Wed, 3 Nov 2021 20:46:24 +0000 (13:46 -0700)]
Timezone database information update.

Approved by: so
Security: EN-21:29.tzdata

2 years agoFix kernel panic in vmci driver initialization.
Gordon Tetlow [Wed, 3 Nov 2021 20:43:03 +0000 (13:43 -0700)]
Fix kernel panic in vmci driver initialization.

Approved by: so
Security: EN-21:28.vmci

2 years agoRoot certificate bundle update.
Gordon Tetlow [Wed, 3 Nov 2021 20:34:51 +0000 (13:34 -0700)]
Root certificate bundle update.

Approved by: so
Security: EN-21:27.caroot

2 years agoAdd UPDATING entries and bump version
Gordon Tetlow [Tue, 24 Aug 2021 18:19:55 +0000 (11:19 -0700)]
Add UPDATING entries and bump version

Approved by: so

2 years agoFix multiple vulnerabilities in OpenSSL.
Gordon Tetlow [Tue, 24 Aug 2021 18:09:09 +0000 (11:09 -0700)]
Fix multiple vulnerabilities in OpenSSL.

Approved by:    so
Security:       SA-21:17.openssl
Security: CVE-2021-23840
Security: CVE-2021-23841

2 years agoFix multiple OpenSSL vulnerabilities.
Gordon Tetlow [Tue, 24 Aug 2021 18:08:20 +0000 (11:08 -0700)]
Fix multiple OpenSSL vulnerabilities.

Approved by:    so
Security:       SA-21:16.openssl
Security:       CVE-2021-3711
Security:       CVE-2021-3712

2 years agoFix libfetch out of bounds read.
Gordon Tetlow [Tue, 24 Aug 2021 18:02:27 +0000 (11:02 -0700)]
Fix libfetch out of bounds read.

Approved by:    so
Security:       SA-21:15.libfetch
Security:       CVE-2021-36159

2 years agoFix remote code execution in ggatec(8).
Gordon Tetlow [Tue, 24 Aug 2021 17:40:19 +0000 (10:40 -0700)]
Fix remote code execution in ggatec(8).

Approved by:    so
Security:       SA-21:14.ggatec
Security:       CVE-2021-29630

2 years agoFix missing error handling in bhyve(8) device models.
Gordon Tetlow [Tue, 24 Aug 2021 17:34:36 +0000 (10:34 -0700)]
Fix missing error handling in bhyve(8) device models.

Approved by: so
Security: SA-21:13.bhyve
Security: CVE-2021-29631

2 years agoFix NVMe iovec construction for large IOs.
Gordon Tetlow [Tue, 24 Aug 2021 17:28:37 +0000 (10:28 -0700)]
Fix NVMe iovec construction for large IOs.

Approved by: so
Security: EN-21:25.bhyve

2 years agoFix OpenSSL 1.1.1e API functions not being exported.
Gordon Tetlow [Tue, 24 Aug 2021 17:27:05 +0000 (10:27 -0700)]
Fix OpenSSL 1.1.1e API functions not being exported.

Approved by: so
Security: EN-21:24.libcrypto

2 years agoAdd UPDATING entries and bump version
Mark Johnston [Tue, 29 Jun 2021 17:19:13 +0000 (13:19 -0400)]
Add UPDATING entries and bump version

Approved by: so

2 years agolinux(4): Prevent integer overflow in futex_requeue.
Dmitry Chagin [Thu, 10 Jun 2021 11:23:11 +0000 (14:23 +0300)]
linux(4): Prevent integer overflow in futex_requeue.

To prevent a signed integer overflow in futex_requeue add a sanity check
to catch negative values of nrwake or nrrequeue.

Approved by: so
Security: EN-21:22.linux_futex

(cherry picked from commit 25b09d6f398ea8a260ee8e2e8209fd76c61e13ee)
(cherry picked from commit 43a58daffe7256f0948ce895fed9fae55dec98fc)

2 years agolibcasper: fix descriptors numbers
Mariusz Zaborski [Wed, 9 Jun 2021 21:46:51 +0000 (23:46 +0200)]
libcasper: fix descriptors numbers

Casper services expect that the first 3 descriptors (stdin/stdout/stderr)
will point to /dev/null. Which Casper will ensure later. The Casper
services are forked from the original process. If the initial process
closes one of those descriptors, Casper may reuse one of them for it on
purpose. If this is the case, then renumarate the descriptors used by
Casper to higher numbers. This is done already after the fork, so it
doesn't break the parent process.

Approved by: so
Security: EN-21:19.libcasper
PR: 255339
Reported by: Borja Marcos <borjam (at) sarenet.es>
Tested by: jkim@

(cherry picked from commit aa310ebfba3d49a0b6b03a103b969731a8136a73)
(cherry picked from commit 4e2ae05c3ae8c470829b4c3a78aa8c34a7f0b617)

2 years agoAdd UPDATING entries and bump version
Mark Johnston [Tue, 1 Jun 2021 20:32:27 +0000 (16:32 -0400)]
Add UPDATING entries and bump version

Approved by: so

2 years agolibradius: Fix attribute length validation in rad_get_attr(3)
Mark Johnston [Fri, 28 May 2021 14:41:43 +0000 (10:41 -0400)]
libradius: Fix attribute length validation in rad_get_attr(3)

The length of the attribute header needs to be excluded when comparing
the attribute length against the length of the packet.  Otherwise,
validation may incorrectly fail when fetching the final attribute in a
message.

Approved by: so
Security: FreeBSD-EN-21:17.libradius
Fixes: 8d5c78130 ("libradius: Fix input validation bugs")
Reported by: Peter Eriksson
Tested by: Peter Eriksson
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6bb5699d2b59491097bc21ffa3c097cdd4853f89)
(cherry picked from commit f9972532343bb1eb101bf7afef2966972eea3b5e)

2 years agoAdd UPDATING entries and bump version
Mark Johnston [Wed, 26 May 2021 20:23:58 +0000 (16:23 -0400)]
Add UPDATING entries and bump version

Approved by: so

2 years agolibradius: Fix input validation bugs
Mark Johnston [Tue, 25 May 2021 17:59:09 +0000 (13:59 -0400)]
libradius: Fix input validation bugs

Approved by: so
Security: FreeBSD-SA-21:12.libradius
Security: CVE-2021-29629
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 8d5c7813061dfa0b187500dfe3aeea7a28181c13)
(cherry picked from commit 83280d17fccff2db7d79c7f38e80ec29078ef35e)

2 years agoamd64/linux*: add required header to get the constant value
Konstantin Belousov [Tue, 25 May 2021 22:19:44 +0000 (01:19 +0300)]
amd64/linux*: add required header to get the constant value

Otherwise asm silently interpret it as the external global symbol.

Approved by: so
Security: FreeBSD-SA-21:11.smap
Security: CVE-2021-29628
Reported by: bz
Sponsored by: The FreeBSD Foundation
Fixes: 91aae953cb80

(cherry picked from commit a59f0285377aa3d61cccda64e9ade126ecb3d2d9)
(cherry picked from commit b25bb77861640456a77fbf6f34cac4a3b69f0e5f)

2 years agoamd64: clear PSL.AC in the right frame
Konstantin Belousov [Sat, 22 May 2021 19:48:36 +0000 (22:48 +0300)]
amd64: clear PSL.AC in the right frame

If copyin family of routines fault, kernel does clear PSL.AC on the
fault entry, but the AC flag of the faulted frame is kept intact.  Since
onfault handler is effectively jump, AC survives until syscall exit.

Approved by: so
Security: FreeBSD-SA-21:11.smap
Security: CVE-2021-29628
Reported by: m00nbsd, via Sony
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
admbugs: 975

(cherry picked from commit 91aae953cb807d6fb7a70782b323bf9beb60d7c9)
(cherry picked from commit 4590f0345956329d414611c6cee300f486732b53)

2 years agopms(4): Do not return CAM_REQ_CMP on errors.
Alexander Motin [Fri, 16 Apr 2021 19:16:09 +0000 (15:16 -0400)]
pms(4): Do not return CAM_REQ_CMP on errors.

It is a direct request for data corruptions, one report of which we
have received.  I am very surprised that only one.

Approved by: so
Security: EN-21:14.pms
MFC after: 1 week
Sponsored by: iXsystems, Inc.

(cherry picked from commit 8434a65ce49bd6bc6779f0e57b0ce0f4bc46f48e)
(cherry picked from commit 320fd259c69ef16e9b8d64424f66eeed8ddc3c77)

2 years agoaesni: Avoid modifying session keys in hmac_update()
Mark Johnston [Tue, 27 Apr 2021 00:04:25 +0000 (20:04 -0400)]
aesni: Avoid modifying session keys in hmac_update()

Otherwise aesni_process() is not thread-safe for AES+SHA-HMAC
transforms, since hmac_update() updates the caller-supplied key directly
to create the derived key.  Use a buffer on the stack to store a copy of
the key used for computing inner and outer digests.

This is a direct commit to stable/12 as the bug is not present in later
branches.

Approved by: so
Security: EN-21:11.aesni
Reviewed by: kib

(cherry picked from commit 62e32cf9140e6c13663dcd69ec3b3c7ca4579782)

3 years agoCorrect EN numbers in the most recent UPDATING entry
Mark Johnston [Tue, 6 Apr 2021 20:18:44 +0000 (16:18 -0400)]
Correct EN numbers in the most recent UPDATING entry

Approved by: so

3 years agoAdd UPDATING entries and bump version
Mark Johnston [Tue, 6 Apr 2021 19:07:29 +0000 (15:07 -0400)]
Add UPDATING entries and bump version

Approved by: so

3 years agomount: Disallow mounting over a jail root
Mark Johnston [Tue, 6 Apr 2021 18:57:57 +0000 (14:57 -0400)]
mount: Disallow mounting over a jail root

Discussed with: jamie
Approved by: so
Security: CVE-2020-25584
Security: FreeBSD-SA-21:10.jail_mount

(cherry picked from commit 110ebf0886825227d03d2ab17139a8741272aef5)

3 years agovm_fault: Shoot down multiply mapped COW source page mappings
Mark Johnston [Tue, 6 Apr 2021 18:56:37 +0000 (14:56 -0400)]
vm_fault: Shoot down multiply mapped COW source page mappings

Reviewed by: kib, rlibby
Discussed with: alc
Approved by: so
Security: CVE-2021-29626
Security: FreeBSD-SA-21:08.vm

(cherry picked from commit 304a533fd2ec6d61805eb7c991b3e9ce502fc730)

3 years agoMFC r364480:
Dimitry Andric [Sat, 31 Oct 2020 18:42:03 +0000 (18:42 +0000)]
MFC r364480:

Merge commit 1ce07cd614be from llvm git (by me):

  Instantiate Error in Target::GetEntryPointAddress() only when
  necessary

  When Target::GetEntryPointAddress() calls
  exe_module->GetObjectFile()->GetEntryPointAddress(), and the returned
  entry_addr is valid, it can immediately be returned.

  However, just before that, an llvm::Error value has been setup, but
  in this case it is not consumed before returning, like is done
  further below in the function.

  In https://bugs.freebsd.org/248745 we got a bug report for this,
  where a very simple test case aborts and dumps core:

  * thread #1, name = 'testcase', stop reason = breakpoint 1.1
      frame #0: 0x00000000002018d4 testcase`main(argc=1, argv=0x00007fffffffea18) at testcase.c:3:5
     1    int main(int argc, char *argv[])
     2    {
  -> 3        return 0;
     4    }
  (lldb) p argc
  Program aborted due to an unhandled Error:
  Error value was Success. (Note: Success values must still be checked prior to being destroyed).

  Thread 1 received signal SIGABRT, Aborted.
  thr_kill () at thr_kill.S:3
  3       thr_kill.S: No such file or directory.
  (gdb) bt
  #0  thr_kill () at thr_kill.S:3
  #1  0x00000008049a0004 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
  #2  0x0000000804916229 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
  #3  0x000000000451b5f5 in fatalUncheckedError () at /usr/src/contrib/llvm-project/llvm/lib/Support/Error.cpp:112
  #4  0x00000000019cf008 in GetEntryPointAddress () at /usr/src/contrib/llvm-project/llvm/include/llvm/Support/Error.h:267
  #5  0x0000000001bccbd8 in ConstructorSetup () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:67
  #6  0x0000000001bcd2c0 in ThreadPlanCallFunction () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:114
  #7  0x00000000020076d4 in InferiorCallMmap () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp:97
  #8  0x0000000001f4be33 in DoAllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp:604
  #9  0x0000000001fe51b9 in AllocatePage () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:347
  #10 0x0000000001fe5385 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:383
  #11 0x0000000001974da2 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2301
  #12 CanJIT () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2331
  #13 0x0000000001a1bf3d in Evaluate () at /usr/src/contrib/llvm-project/lldb/source/Expression/UserExpression.cpp:190
  #14 0x00000000019ce7a2 in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Target/Target.cpp:2372
  #15 0x0000000001ad784c in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:414
  #16 0x0000000001ad86ae in DoExecute () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:646
  #17 0x0000000001a5e3ed in Execute () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp:1003
  #18 0x0000000001a6c4a3 in HandleCommand () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1762
  #19 0x0000000001a6f98c in IOHandlerInputComplete () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2760
  #20 0x0000000001a90b08 in Run () at /usr/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:548
  #21 0x00000000019a6c6a in ExecuteIOHandlers () at /usr/src/contrib/llvm-project/lldb/source/Core/Debugger.cpp:903
  #22 0x0000000001a70337 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2946
  #23 0x0000000001d9d812 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/API/SBDebugger.cpp:1169
  #24 0x0000000001918be8 in MainLoop () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:675
  #25 0x000000000191a114 in main () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:890

  Fix the incorrect error catch by only instantiating an Error object
  if it is necessary.

  Reviewed By: JDevlieghere

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

This should fix lldb aborting as described in the scenario above.

Reported by: dmgk
PR: 248745
Approved by: so
Security: FreeBSD-EN-21:07.lldb

(cherry picked from commit eb41eed03c084bd6eefe91992b0f704caa0fb58b)

3 years agoMFC r368588:
Kristof Provost [Tue, 15 Dec 2020 08:29:45 +0000 (08:29 +0000)]
MFC r368588:

pf: Allow net.pf.request_maxcount to be set from loader.conf

Mark request_maxcount as RWTUN so we can set it both at runtime and from
loader.conf. This avoids users getting caught out by the change from tunable to
run time configuration.

Suggested by: Franco Fichtner
Approved by: so
Security: FreeBSD-EN-21:06.pf

(cherry picked from commit 08d13750ebdae45bcdb73d52665b823e9ba93db1)

3 years agoaccept_filter: Fix filter parameter handling
Mark Johnston [Thu, 25 Mar 2021 21:55:20 +0000 (17:55 -0400)]
accept_filter: Fix filter parameter handling

For filters which implement accf_create, the setsockopt(2) handler
caches the filter name in the socket, but it also incorrectly frees the
buffer containing the copy, leaving a dangling pointer.  Note that no
accept filters provided in the base system are susceptible to this, as
they don't implement accf_create.

Reported by: Alexey Kulaev <alex.qart@gmail.com>
Discussed with: emaste
Sponsored by: The FreeBSD Foundation
Approved by: so
Security: CVE-2021-29627
Security: FreeBSD-SA-21:09.accept_filter

(cherry picked from commit 653a437c04440495cd8e7712c7cf39444f26f1ee)
(cherry picked from commit 6008a5fad3c110c4ec03cc3fe60ce41c4e548b98)

3 years agoFix multiple OpenSSL vulnerabilities. Add UPDATING and bump version.
Gordon Tetlow [Thu, 25 Mar 2021 23:42:19 +0000 (23:42 +0000)]
Fix multiple OpenSSL vulnerabilities. Add UPDATING and bump version.

Approved by: so
Security: FreeBSD-SA-21:07.openssl
Security: CVE-2021-3449
Security: CVE-2021-3450

3 years agoAdd UPDATING entry and bump version
Mark Johnston [Tue, 23 Feb 2021 23:00:02 +0000 (18:00 -0500)]
Add UPDATING entry and bump version

Approved by: so

3 years agopam_login_access: Fix negative entry matching logic
Mark Johnston [Tue, 23 Feb 2021 22:01:29 +0000 (17:01 -0500)]
pam_login_access: Fix negative entry matching logic

PR: 252194
Approved by: so
Security: CVE-2020-25580
Security: FreeBSD-SA-21:03.pam_login_access

(cherry picked from commit 6ab923cbca8759503a08683a5978b9ebf5efd607)
(cherry picked from commit c99e3e2d96935ae4d61948bf7660e9b9c2afb4d9)

3 years agoxen-blkback: fix leak of grant maps on ring setup failure
Roger Pau Monné [Wed, 20 Jan 2021 18:40:51 +0000 (19:40 +0100)]
xen-blkback: fix leak of grant maps on ring setup failure

Multi page rings are mapped using a single hypercall that gets passed
an array of grants to map. One of the grants in the array failing to
map would lead to the failure of the whole ring setup operation, but
there was no cleanup of the rest of the grant maps in the array that
could have likely been created as a result of the hypercall.

Add proper cleanup on the failure path during ring setup to unmap any
grants that could have been created.

This is part of XSA-361.

Approved by: so
Security: CVE-2021-26932
Security: FreeBSD-SA-21:06.xen
Security: XSA-361
Sponsored by: Citrix Systems R&D

(cherry picked from commit 808d4aad1022a2a33d222663b0c9badde30b9d45)
(cherry picked from commit dfb372f5d38c302953a6a4e2838179cd0a1a6438)

3 years agoMFC r368555: caroot: update bundle
Kyle Evans [Tue, 15 Dec 2020 21:50:05 +0000 (21:50 +0000)]
MFC r368555: caroot: update bundle

Summary:
- One (1) added
- Ten (10) removed

Approved by: so
Security: FreeBSD-EN-21:07.caroot

(cherry picked from commit e4e8ecaf63ba6f2767680a7b4666461243d88749)

3 years agoMFC freebsd-update: unconditionally regenerate passwd/login.conf files
Kyle Evans [Thu, 17 Dec 2020 03:42:54 +0000 (03:42 +0000)]
MFC freebsd-update: unconditionally regenerate passwd/login.conf files

The existing logic is nice in theory, but in practice freebsd-update will
not preserve the timestamps on these files. When doing a major upgrade, e.g.
from 12.1-RELEASE -> 12.2-RELEASE, pwd.mkdb et al. appear in the INDEX and
we clobber the timestamp several times in the process of packaging up the
existing system into /var/db/freebsd-update/files and extracting for
comparisons. This leads to these files not getting regenerated when they're
most likely to be needed.

Measures could be taken to preserve timestamps, but it's unclear whether
the complexity and overhead of doing so is really outweighed by the marginal
benefit.

I observed this issue when pkg subsequently failed to install a package that
wanted to add a user, claiming that the user was removed in the process.
bapt@ pointed to this pre-existing bug with freebsd-update as the cause.

PR: 234014, 232921
Approved by: so
Security: FreeBSD-EN-21:08.freebsd-update

(cherry picked from commit ebebc41e4cfe44b8e8fd881badf2fa2c4be65aa4)
(cherry picked from commit 5cf1ba21eebaf89cf4d8639a18345dc49116d1d5)

3 years agoFree microcode memory later.
Konstantin Belousov [Fri, 17 May 2019 17:11:01 +0000 (17:11 +0000)]
Free microcode memory later.

Approved by: so
Security: FreeBSD-EN-21:06.microcode

(cherry picked from commit 8f7f38457f940798c149ae40b73e0d20672812de)
(cherry picked from commit 79bee465de342b82fa300293d04f155f2d6a6183)

3 years agoMFC jail: Change both root and working directories in jail_attach(2)
Jamie Gritton [Fri, 19 Feb 2021 22:13:35 +0000 (14:13 -0800)]
MFC jail: Change both root and working directories in jail_attach(2)

jail_attach(2) performs an internal chroot operation, leaving it up to
the calling process to assure the working directory is inside the jail.

Add a matching internal chdir operation to the jail's root.  Also
ignore kern.chroot_allow_open_directories, and always disallow the
operation if there are any directory descriptors open.

Approved by: so
Security: CVE-2020-25582
Security: FreeBSD-SA-21:05.jail_chdir
Reported by:    mjg
Approved by:    markj, kib

(cherry picked from commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5)
(cherry picked from commit ca9ab8ea17748a1758701fde262cb272fb757989)

3 years agoMFC jail: Handle a possible race between jail_remove(2) and fork(2)
Jamie Gritton [Tue, 16 Feb 2021 19:19:13 +0000 (11:19 -0800)]
MFC jail: Handle a possible race between jail_remove(2) and fork(2)

jail_remove(2) includes a loop that sends SIGKILL to all processes
in a jail, but skips processes in PRS_NEW state.  Thus it is possible
the a process in mid-fork(2) during jail removal can survive the jail
being removed.

Add a prison flag PR_REMOVE, which is checked before the new process
returns.  If the jail is being removed, the process will then exit.
Also check this flag in jail_attach(2) which has a similar issue.

Approved by: so
Security: CVE-2020-25581
Security: FreeBSD-SA-21:04.jail_remove
Reported by: mjg
Approved by: kib

(cherry picked from commit cc7b73065302005ebc4a19503188c8d6d5eb923d)
(cherry picked from commit f7007a7d05255a6859dea0982b1f0a6d695e8881)

3 years agoAdd UPDATING entry and bump version
Ed Maste [Fri, 29 Jan 2021 01:09:12 +0000 (20:09 -0500)]
Add UPDATING entry and bump version

Approved by: so

3 years agoxen: allow limiting the amount of duplicated pending xenstore watches
Roger Pau Monné [Wed, 25 Nov 2020 11:34:38 +0000 (12:34 +0100)]
xen: allow limiting the amount of duplicated pending xenstore watches

Xenstore watches received are queued in a list and processed in a
deferred thread. Such queuing was done without any checking, so a
guest could potentially trigger a resource starvation against the
FreeBSD kernel if such kernel is watching any user-controlled xenstore
path.

Allowing limiting the amount of pending events a watch can accumulate
to prevent a remote guest from triggering this resource starvation
issue.

For the PV device backends and frontends this limitation is only
applied to the other end /state node, which is limited to 1 pending
event, the rest of the watched paths can still have unlimited pending
watches because they are either local or controlled by a privileged
domain.

The xenstore user-space device gets special treatment as it's not
possible for the kernel to know whether the paths being watched by
user-space processes are controlled by a guest domain. For this reason
watches set by the xenstore user-space device are limited to 1000
pending events. Note this can be modified using the
max_pending_watch_events sysctl of the device.

This is XSA-349.

Sponsored by: Citrix Systems R&D
MFC after: 3 days

(cherry picked from commit 4e4e43dc9e1afc863670a031cc5cc75eb5e668d6)
(cherry picked from commit 2d194dc219892049dd03564c4083080cac1aa688)

Approved by: so
Security: XSA-349, CVE-2020-29568

3 years agoxen/xenstore: remove unused functions
Roger Pau Monné [Thu, 26 Nov 2020 08:57:47 +0000 (09:57 +0100)]
xen/xenstore: remove unused functions

Those helpers are not used, so remove them. No functional change.

Sponsored by: Citrix Systems R&D
MFC after: 3 days

(cherry picked from commit 2ae75536d370c238f77ad09e5e994d2b8bdf010c)
(cherry picked from commit af4ed05c3dd25c957b657f92f953bd9f00f818a8)

Approved by: so

3 years agomsdosfs: Fix a leak of dirent padding bytes
Mark Johnston [Sun, 27 Dec 2020 21:52:30 +0000 (16:52 -0500)]
msdosfs: Fix a leak of dirent padding bytes

This was missed in r340856 / commit
6d2e2df764199f0a15fd743e79599391959cc17d.  Three bytes from the kernel
stack may be leaked when reading directory entries.

Reported by: Syed Faraz Abrar <faraz@elttam.com>

(cherry picked from commit 599f90446376370eb365a0fde857ea2b5766873a)
(cherry picked from commit 5ece34669c27a61f78cd0f6e0759c17f7787aebb)

Approved by: so
Security: CVE-2020-25579

3 years agoEnsure that dirent's d_off field is initialized
Mark Johnston [Sun, 3 Jan 2021 16:32:30 +0000 (11:32 -0500)]
Ensure that dirent's d_off field is initialized

We have the d_off field in struct dirent for providing the seek offset
of the next directory entry.  Several filesystems were not initializing
the field, which ends up being copied out to userland.

Reported by: Syed Faraz Abrar <faraz@elttam.com>
Reviewed by: kib

(cherry picked from commit 90f580b954090e669da234f6c8e8d0379ff9d8bc)
(cherry picked from commit acaac0eefa1f2675dfc49faa077e3fb10949d540)

Approved by: so
Security: CVE-2020-25578

3 years agoFix error merging r354116 from OpenZFS
Alan Somers [Tue, 1 Dec 2020 15:15:18 +0000 (15:15 +0000)]
Fix error merging r354116 from OpenZFS

When we merged 4c0883fb4af0d5565459099b98fcf90ecbfa1ca1 from OpenZFS (svn
r354116), there were some merge conflicts.  One of those was resolved
incorrectly, causing "zfs receive" to fail to delete snapshots that a "zfs
send -R" stream has deleted.

This change corrects that merge conflict, and also reduces some harmless
diffs vis-a-vis OpenZFS that were also introduced by the same revision.
Direct commit to stable/12 because head has moved on to OpenZFS.

PR: 249438
Reported by: Dmitry Wagin <dmitry.wagin@ya.ru>
Reviewed by: mmacy
Sponsored by: Axcient
(cherry picked from commit 861515418ac385f4198c38c28f6203135d72e651)

Approved by: so

3 years agoMFC r368237: if: Fix panic when destroying vnet and epair simultaneously
Kristof Provost [Sat, 12 Sep 2020 16:33:05 +0000 (16:33 +0000)]
MFC r368237: if: Fix panic when destroying vnet and epair simultaneously

When destroying a vnet and an epair (with one end in the vnet) we often
panicked. This was the result of the destruction of the epair, which destroys
both ends simultaneously, happening while vnet_if_return() was moving the
struct ifnet to its home vnet. This can result in a freed ifnet being re-added
to the home vnet V_ifnet list. That in turn panics the next time the ifnet is
used.

Prevent this race by ensuring that vnet_if_return() cannot run at the same time
as if_detach() or epair_clone_destroy().

PR: 238870, 234985, 244703, 250870
Sponsored by: Modirum MDPay
Approved by: so

3 years agocontrib/tzdata: import tzdata 2021a
Philip Paeps [Mon, 25 Jan 2021 00:18:14 +0000 (08:18 +0800)]
contrib/tzdata: import tzdata 2021a

Merge commit '4cd7e1071de16a7392b0e466287f13e9e6f2081a'

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

(cherry picked from commit 8c5bef2eb24cb191c87712a56a9860d8c29415a0)
(cherry picked from commit 085997e8f05e69c66a8ffc0804b275a386ba1ca8)

Approved by: so

3 years agoMFC: contrib/tzdata: import tzdata 2020f
Philip Paeps [Wed, 30 Dec 2020 04:50:26 +0000 (12:50 +0800)]
MFC: contrib/tzdata: import tzdata 2020f

Merge commit '96b88ac701b35ce68425046d4be8f51cb75b5d5b' into main

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

(cherry picked from commit e35a01eec6926bfb5c088ca8961079b51a067bf3)
(cherry picked from commit ce87312019a18e6bd0c97c50e5762b38ffc21e76)

Approved by: so

3 years agoMFC: contrib/tzdata: import tzdata 2020e
Philip Paeps [Fri, 25 Dec 2020 15:16:38 +0000 (23:16 +0800)]
MFC: contrib/tzdata: import tzdata 2020e

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

(cherry picked from commit dc505d53dcc15636aea9df8c03298f8c32147fa9)
(cherry picked from commit 1a8f8af03320165b33526d44de4f12360aa5440a)

Approved by: so

3 years agoFix OpenSSL NULL pointer de-reference.
Gordon Tetlow [Tue, 8 Dec 2020 19:10:40 +0000 (19:10 +0000)]
Fix OpenSSL NULL pointer de-reference.

Approved by: so
Security: FreeBSD-SA-20:33.openssl
Security: CVE-2020-1971

3 years agoAdd UPDATING entries and bump version.
Gordon Tetlow [Tue, 1 Dec 2020 19:40:58 +0000 (19:40 +0000)]
Add UPDATING entries and bump version.

Approved by: so

3 years agoFix multiple vulnerabilities in rtsold.
Gordon Tetlow [Tue, 1 Dec 2020 19:39:44 +0000 (19:39 +0000)]
Fix multiple vulnerabilities in rtsold.

Approved by: so
Security: FreeBSD-SA-20:32.rtsold
Security: CVE-2020-25577

3 years agoFix ICMPv6 use-after-free in error message handling.
Gordon Tetlow [Tue, 1 Dec 2020 19:38:52 +0000 (19:38 +0000)]
Fix ICMPv6 use-after-free in error message handling.

Approved by: so
Security: FreeBSD-SA-20:31.icmp6
Security: CVE-2020-7469

3 years agoFix race condition in callout CPU migration.
Gordon Tetlow [Tue, 1 Dec 2020 19:37:33 +0000 (19:37 +0000)]
Fix race condition in callout CPU migration.

Approved by: so
Security: FreeBSD-EN-20:22.callout

3 years agoFix uninitialized variable in ipfw.
Gordon Tetlow [Tue, 1 Dec 2020 19:36:36 +0000 (19:36 +0000)]
Fix uninitialized variable in ipfw.

Approved by: so
Security: FreeBSD-EN-20:21.ipfw

3 years agoUpdate timezone database information.
Gordon Tetlow [Tue, 1 Dec 2020 19:35:48 +0000 (19:35 +0000)]
Update timezone database information.

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

3 years agoFix execve/fexecve system call auditing.
Gordon Tetlow [Tue, 1 Dec 2020 19:34:45 +0000 (19:34 +0000)]
Fix execve/fexecve system call auditing.

Approved by: so
Security: FreeBSD-EN-20:19.audit

3 years ago- Switch releng/12.2 from RC3 to RELEASE.
Glen Barber [Fri, 23 Oct 2020 00:00:52 +0000 (00:00 +0000)]
- Switch releng/12.2 from RC3 to RELEASE.
- Add the anticipated 12.2-RELEASE date to UPDATING.  Fix
  a missing colon in the previous UPDATING entry while here.
- Set a static __FreeBSD_version.

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoUpdate releng/12.2 to RC3 as part of the 12.2-RELEASE cycle.
Glen Barber [Fri, 16 Oct 2020 00:01:01 +0000 (00:01 +0000)]
Update releng/12.2 to RC3 as part of the 12.2-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoZFS: whitelist zstd and encryption in the loader
Allan Jude [Thu, 15 Oct 2020 15:07:25 +0000 (15:07 +0000)]
ZFS: whitelist zstd and encryption in the loader

MFC r364787:
MFS r366593:

Please note that neither zstd nor encryption is
supported by the loader at this instant. This
change makes it safe to use those features in
one's root pool, but not in one's root dataset.

Approved by: re (gjb)

3 years agoMFS r365964:
Ganael LAPLANCHE [Wed, 14 Oct 2020 06:25:55 +0000 (06:25 +0000)]
MFS r365964:
Allow slow USB devices to be given more time to return their USB descriptors,
like Logitech HD Pro Webcam C920.

PR: 248926
Approved by: re (gjb), hselasky

3 years agoMFS12: r366422 r366588
Warner Losh [Wed, 14 Oct 2020 01:47:00 +0000 (01:47 +0000)]
MFS12: r366422 r366588

r366588: fixes video display heuristic that prevented byhve and vmware
from detecting dual consoles.

r366422: Report the kernel console on the boot screen
Report what console the boot loader is telling the kernel to use and allow
toggling between them.

Approved by: re@ (gjb)

3 years agoUpdate releng/12.2 to RC2 as part of the 12.2-RELEASE cycle.
Glen Barber [Thu, 8 Oct 2020 23:59:58 +0000 (23:59 +0000)]
Update releng/12.2 to RC2 as part of the 12.2-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoUpdate the 12.2 pkg_repos/release-dvd.conf file to use the
Glen Barber [Thu, 8 Oct 2020 02:56:11 +0000 (02:56 +0000)]
Update the 12.2 pkg_repos/release-dvd.conf file to use the
release_2 set for dvd1.iso builds for reproducibility.

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoMFS r366360,r366361:
Mitchell Horne [Wed, 7 Oct 2020 20:09:26 +0000 (20:09 +0000)]
MFS r366360,r366361:
MFC r366271:
arm64: set the correct HWCAP

Approved by: re (gjb)

3 years agoMFS12 r366180, r366341:
Glen Barber [Tue, 6 Oct 2020 15:17:41 +0000 (15:17 +0000)]
MFS12 r366180, r366341:
 r366180 (asomers):
  Fix resuming receive stream to dataset with mounted clone

 r366341 (asomers):
  Fix "zfs receive" of interrupted stream without "-F"

Approved by: re (kib)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoMFS r366438:
Navdeep Parhar [Mon, 5 Oct 2020 16:39:38 +0000 (16:39 +0000)]
MFS r366438:
cxgbe(4): set up the firmware flowc for the tid before send_abort_rpl.

Approved by: re@ (gjb@)
Sponsored by: Chelsio Communications

3 years agoMFS r366395: Fix Typo in ng_hci_le_connection_complete_ep struct.
Kyle Evans [Sun, 4 Oct 2020 01:39:29 +0000 (01:39 +0000)]
MFS r366395: Fix Typo in ng_hci_le_connection_complete_ep struct.

Approved by: re (gjb)

3 years agoRename releng/12.2 to RC1 as part of the 12.2-RELEASE cycle.
Glen Barber [Fri, 2 Oct 2020 01:08:11 +0000 (01:08 +0000)]
Rename releng/12.2 to RC1 as part of the 12.2-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoMFS r366305: MFC r366064, r366065, r366215
Xin LI [Thu, 1 Oct 2020 18:58:06 +0000 (18:58 +0000)]
MFS r366305: MFC r366064, r366065, r366215

sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms

Approved by: re (gjb)

3 years agoMFS r366324:
Michael Tuexen [Thu, 1 Oct 2020 18:17:56 +0000 (18:17 +0000)]
MFS r366324:
Improve the handling of receiving unordered and unreliable user
messages using DATA chunks. Don't use fsn_included when not being
sure that it is set to an appropriate value. If the default is
used, which is -1, this can result in SCTP associaitons not
making any user visible progress.

Thanks to Yutaka Takeda for reporting this issue for the the
userland stack in https://github.com/pion/sctp/issues/138.

MFS r366329:
Improve the input validation and processing of cookies.
This avoids setting the association in an inconsistent
state, which could result in a use-after-free situation.
This can be triggered by a malicious peer, if the peer
can modify the cookie without the local endpoint recognizing
it.
Thanks to Ned Williamson for reporting the issue.

Approved by: re (gjb)

3 years agoMFS 366297: Revert most of r360179.
John Baldwin [Thu, 1 Oct 2020 17:30:38 +0000 (17:30 +0000)]
MFS 366297: Revert most of r360179.

I had failed to notice that sgsendccb() was using cam_periph_mapmem()
and thus was not passing down user pointers directly to drivers.  In
practice this broke requests submitted from userland.

PR: 249395
Approved by: re (gjb)

3 years agoMFS r365996:
Mitchell Horne [Wed, 30 Sep 2020 22:41:24 +0000 (22:41 +0000)]
MFS r365996:
MFC r365304:
arm64: update the set of HWCAP definitions

MFC r365459:
arm64: fix incorrect HWCAP definitions

Approved by: re (gjb)

3 years agoMFC r357530/MFS r357530:
Konstantin Belousov [Wed, 30 Sep 2020 16:11:37 +0000 (16:11 +0000)]
MFC r357530/MFS r357530:
Remove unneeded assert for curproc.  Simplify.

Approved by: re (gjb)

3 years agoMF stable/12 r366258:
Niclas Zeising [Tue, 29 Sep 2020 17:22:14 +0000 (17:22 +0000)]
MF stable/12 r366258:

bsdconfig, bsdinstall: Prune dead mirrors

Prune dead mirrors from the list of mirrors in bsdconfig and bsdinstall.
All these return NXDOMAIN when trying to resolve them.

Approved by: re (gjb), emaste

3 years agoMFS: r366238
Rick Macklem [Tue, 29 Sep 2020 15:09:38 +0000 (15:09 +0000)]
MFS: r366238
Bjorn reported a problem where the Linux NFSv4.1 client is
using an open_to_lock_owner4 when that lock_owner4 has already
been created by a previous open_to_lock_owner4. This caused the NFS server
to reply NFSERR_INVAL.

For NFSv4.0, this is an error, although the updated NFSv4.0 RFC7530 notes
that the correct error reply is NFSERR_BADSEQID (RFC3530 did not specify
what error to return).

For NFSv4.1, it is not obvious whether or not this is allowed by RFC5661,
but the NFSv4.1 server can handle this case without error.
This patch changes the NFSv4.1 (and NFSv4.2) server to handle multiple
uses of the same lock_owner in open_to_lock_owner so that it now correctly
interoperates with the Linux NFS client.
It also changes the error returned for NFSv4.0 to be NFSERR_BADSEQID.

Thanks go to Bjorn for diagnosing this and testing the patch.
He also provided a program that I could use to reproduce the problem.

PR: 249567
Approved by: re (gjb)

3 years agoMFS r366028: Spawn the DHCPv6 client in EC2 instances via rtsold.
Colin Percival [Mon, 28 Sep 2020 17:32:18 +0000 (17:32 +0000)]
MFS r366028: Spawn the DHCPv6 client in EC2 instances via rtsold.

Approved by: re (gjb)
Sponsored by: https://www.patreon.com/cperciva

3 years agoMF12 r366218:
Stefan Eßer [Mon, 28 Sep 2020 14:47:36 +0000 (14:47 +0000)]
MF12 r366218:

Add documentation of the build options WITH_GH_BC and WITHOUT_GH_BC to
optionally replace the traditional implementation of bc(1) and dc(1) with
the new implementation that has become the default version in -CURRENT.

The man-page differs from the one in -CURRENT due to different default
values of that build option.

Approved by:  re (gjb)

3 years agoMFS r366220:
Mark Johnston [Mon, 28 Sep 2020 12:14:38 +0000 (12:14 +0000)]
MFS r366220:
MFC r366167:
ng_l2tp: Fix callout synchronization in the rexmit timeout handler

PR: 241133
Approved by: re (gjb)

3 years agoMFS r366178: Move finalize_components_config from get_params to cmd_*.
Colin Percival [Mon, 28 Sep 2020 00:54:50 +0000 (00:54 +0000)]
MFS r366178: Move finalize_components_config from get_params to cmd_*.

This eliminates spurious emails from `freebsd-update cron` when the src
component is listed in freebsd-update.conf but is not present.

Approved by: re (delphij)
Sponsored by: https://www.patreon.com/cperciva

3 years agoMFS r366179: Make nvmecontrol work with nda like it does with nvd, and
Colin Percival [Mon, 28 Sep 2020 00:53:45 +0000 (00:53 +0000)]
MFS r366179: Make nvmecontrol work with nda like it does with nvd, and
associated bits.

Approved by: re (delphij)
Sponsored by: https://www.patreon.com/cperciva

3 years agoMFS r366009: Include ebsnvme-id in arm64 AMIs.
Colin Percival [Mon, 28 Sep 2020 00:52:16 +0000 (00:52 +0000)]
MFS r366009: Include ebsnvme-id in arm64 AMIs.

Approved by: re (delphij)
Sponsored by: https://www.patreon.com/cperciva

3 years agoMF stable/12 r366190:
Alan Somers [Mon, 28 Sep 2020 00:23:59 +0000 (00:23 +0000)]
MF stable/12 r366190:

fusefs: fix mmap'd writes in direct_io mode

If a FUSE server returns FOPEN_DIRECT_IO in response to FUSE_OPEN, that
instructs the kernel to bypass the page cache for that file. This feature
is also known by libfuse's name: "direct_io".

However, when accessing a file via mmap, there is no possible way to bypass
the cache completely. This change fixes a deadlock that would happen when
an mmap'd write tried to invalidate a portion of the cache, wrongly assuming
that a write couldn't possibly come from cache if direct_io were set.

Arguably, we could instead disable mmap for files with FOPEN_DIRECT_IO set.
But allowing it is less likely to cause user complaints, and is more in
keeping with the spirit of open(2), where O_DIRECT instructs the kernel to
"reduce", not "eliminate" cache effects.

PR: 247276
Approved by: re (gjb)
Reported by: trapexit@spawn.link
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D26485