]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
19 months agoloader: fix elf lookup_symbol type filtering
Kyle Evans [Fri, 14 Oct 2022 03:06:13 +0000 (22:06 -0500)]
loader: fix elf lookup_symbol type filtering

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

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

Reported by: Christian McDonald <cmcdonald netgate com>
Reviewed by: imp, kib, tsoome

(cherry picked from commit 0701dbda94f21de8ddab3113f79262a26cc7b96c)

19 months agoRevert "Avoid using TARGET_ARCH in llvm.build.mk"
Kyle Evans [Fri, 14 Oct 2022 03:04:47 +0000 (22:04 -0500)]
Revert "Avoid using TARGET_ARCH in llvm.build.mk"

This reverts commit 8534e6be8110a8126268a38dc0557a2d15615ce9, and adds
a cautionary note that there are dragons about that should be considered
when changing it.

PR: 267026
Reviewed by: dim, imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D36981

(cherry picked from commit ed7910fbac07ee39d10528994e49ada2d0f2d754)

19 months agopci_host_generic: stop address translation in bus_alloc_resource
Kyle Evans [Mon, 26 Sep 2022 19:24:21 +0000 (14:24 -0500)]
pci_host_generic: stop address translation in bus_alloc_resource

Translating the provided range prior to rman_reserve_resource(9) is
decidedly wrong; the caller may be trying to do a wildcard allocation,
for which the implementation is expected to DTRT and clamp the range to
what's actually feasible.

We don't use the resulting translation here anyways, so just remove it
entirely -- the rman in the default implementation is derived from
sc->ranges, so the translation should trivially succeed every time as
long as the reservation succeeded.  If something has gone awry in a
derived driver, we'll detect it when we translate prior to activation,
so there's likely no diagnostic value in retaining the translation after
reservation either.

Reviewed by: andrew
Noticed by: jhb

(cherry picked from commit bd93b5f79ab489fb0ed6ab25d6be48242eb8c028)

19 months agoUse DEFINE_CLASS_0 in the arm generic timer
Andrew Turner [Tue, 20 Sep 2022 16:07:27 +0000 (17:07 +0100)]
Use DEFINE_CLASS_0 in the arm generic timer

Rather than defining the structure manually use the DEFINE_CLASS_0
macro. As we have both an ACPI and FDT attachment we need to use the
_0 variant of the macro as DEFINE_CLASS would create two structures
with the same name.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 42353d81e3a580442a70404a4fcfcbc16c36ef3f)

19 months agoCreate macros for the Arm timer IRQ indexes
Andrew Turner [Wed, 14 Sep 2022 16:29:29 +0000 (17:29 +0100)]
Create macros for the Arm timer IRQ indexes

Rather than hard coding these values use a macro to document which
interrupt is being used.

Reviewed by: emaste
Obtained from: https://github.com/FreeBSD-UPB/freebsd-src (earlier version)
Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation
Sponsored by: University Politehnica of Bucharest
Differential Revision: https://reviews.freebsd.org/D36600

(cherry picked from commit 9526031cd5606fe590ef69224d0db1af1603dcfe)

19 months agoigc: Fix up hw vlan ops
Kevin Bowling [Mon, 10 Oct 2022 23:09:21 +0000 (16:09 -0700)]
igc: Fix up hw vlan ops

Adapt 2796f7cab10785ef40efbba97ef67ab319c96e9c to igc(4)

* Don't reset the entire adapter for vlan changes, fix up the problems
* Remove the VFTA, this hardware doesn't seem to implement it

Approved by: grehan
Differential Revision: https://reviews.freebsd.org/D31979

(cherry picked from commit 2eaef8ec4af1f7576a1444180020e23d2e142107)

19 months agoigc: remove unnecessary PHY ID checks
Mah Yock Gen [Fri, 2 Sep 2022 00:18:28 +0000 (08:18 +0800)]
igc: remove unnecessary PHY ID checks

I225 devices have only one PHY vendor. There is unnecessary to check
_I_PHY_ID during the link establishment and auto-negotiation process,
the checking also caused devices like i225-IT failed. This patch is to
remove the mentioned unnecessary checking.

Cc: stable@dpdk.org
Signed-off-by: Mah Yock Gen <yock.gen.mah@intel.com>
Signed-off-by: Taripin Samuel <samuel.taripin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Approved by: grehan
Differential Revision: https://reviews.freebsd.org/D36923

(cherry picked from commit 29d7f1ff579579711dd5a3325480728b8ed45f8c)

19 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

(cherry picked from commit 5d56371c70d785c222ff086ba8a83b408111acbf)

19 months agoipfilter: Removed unused ioctl typedef
Cy Schubert [Fri, 7 Oct 2022 10:05:53 +0000 (03:05 -0700)]
ipfilter: Removed unused ioctl typedef

Defunct operating systems no longer pollute the ipfilter sources. Remove
their typedefs.

(cherry picked from commit 1fcc50004cebbe3a578f6761936e5d8cd8ee24cd)

19 months agoldd: ignore unverified files
Simon J. Gerraty [Fri, 7 Oct 2022 00:51:28 +0000 (17:51 -0700)]
ldd: ignore unverified files

When mac_veriexec is enforcing, we won't run unverified binaries,
don't let ldd examine them either.

Reviewed by: stevek emaste
MFC after: 1 week
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D36897

(cherry picked from commit f48114b653a2a3d8f817ad68186235595ce304ed)

19 months agonfs_clvnops.c: Fix access to v_mount when vnode unlocked
Rick Macklem [Sat, 1 Oct 2022 14:43:53 +0000 (07:43 -0700)]
nfs_clvnops.c: Fix access to v_mount when vnode unlocked

Commit ab17854f974b fixed access to v_mount when the
vnode is unlocked for nfs_copy_file_range().

This patch does the same for nfs_ioctl().

(cherry picked from commit bffb3d947b2ee48dc30c4876e0c7a5927375e38f)

19 months agoTrack kern.ipc.somaxconn -> kern.ipc.soacceptqueue rename
Jose Luis Duran [Tue, 11 Oct 2022 16:39:26 +0000 (12:39 -0400)]
Track kern.ipc.somaxconn -> kern.ipc.soacceptqueue rename

Fixes: 2bdf61ca29d0 ("Hide the unfortunate named sysctl...")

(cherry picked from commit 9871ae6aa91f82a6932be7fcfa1023b077be8e2e)
(cherry picked from commit f4f6bc636787e110cbea90ca5822cc5209138125)

19 months agoFix an incorrectly placed parenthesis.
Kirk McKusick [Thu, 29 Sep 2022 08:44:34 +0000 (01:44 -0700)]
Fix an incorrectly placed parenthesis.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 221da3e9212d4cc1e370721493922de232fe3918)

19 months agoWhen taking a snapshot on a UFS/FFS filesystem, it must be mounted.
Kirk McKusick [Tue, 27 Sep 2022 15:57:30 +0000 (08:57 -0700)]
When taking a snapshot on a UFS/FFS filesystem, it must be mounted.

PR:           265362
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 27d673fbbb79b1b829484ec127da59b45f623ebd)

19 months agoriscv: handle kernel PTE edge-case in pmap_enter_l2()
Mitchell Horne [Wed, 5 Oct 2022 16:14:36 +0000 (13:14 -0300)]
riscv: handle kernel PTE edge-case in pmap_enter_l2()

Page table pages are never freed from the kernel pmap, instead they are
zeroed when a range is unmapped. This allows future mappings to be
constructed more quickly. Detect this scenario in pmap_enter_l2(), so we
don't fail to create a superpage mapping when the 2MB range is actually
available.

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

(cherry picked from commit 1f9cc5ffc50523498545b6f7d50406feb18903be)

19 months agoriscv: add an assert to pmap_remove_pages()
Mitchell Horne [Thu, 25 Aug 2022 20:08:20 +0000 (17:08 -0300)]
riscv: add an assert to pmap_remove_pages()

Similar checks exist for both arm64 and amd64, but note that for amd64
it is a bare panic().

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

(cherry picked from commit 99fe523778af8cd0db3a17b253adb77a980176be)

19 months agoriscv: handle superpage in pmap_enter_quick_locked()
Mitchell Horne [Wed, 5 Oct 2022 17:11:02 +0000 (14:11 -0300)]
riscv: handle superpage in pmap_enter_quick_locked()

Previously, if pmap_enter_l2() was asked to re-map an existing superpage
(the result of madvise(MADV_WILLNEED) on a mapped range), it could
'fail' to do so, falling back to trying pmap_enter_quick_locked() for
each 4K virtual page. Because this function does not check if the l2
entry it finds is a superpage, it would proceed, sometimes resulting in
the creation of false PV entries.

If the relevant range was later munmap'ed, the system would panic during
the process' exit in pmap_remove_pages(), while attempting to clean up
the PV entries for mappings which no longer exist.

Instead, we should return early in the presence of an existing
superpage, as is done in other pmaps.

PR:             266108
Reviewed by: markj, alc
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36563

(cherry picked from commit 9d1aef84021f4e99d37f4e9149a8799c3d9e5e03)

19 months agoriscv: optimize MADV_WILLNEED on existing superpages
Mitchell Horne [Wed, 5 Oct 2022 17:10:45 +0000 (14:10 -0300)]
riscv: optimize MADV_WILLNEED on existing superpages

Specifically, avoid pointless calls to pmap_enter_quick_locked() when
madvise(MADV_WILLNEED) is applied to an existing superpage mapping.

1d5ebad06c20 made the change for amd64 and arm64.

Reviewed by: markj, alc
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36563

(cherry picked from commit 95b1c27069775dd969cd045888b4ea5aeb53cb7f)

19 months agodhclient-script: cope with /32 address leases
Kristof Provost [Wed, 5 Oct 2022 10:11:07 +0000 (12:11 +0200)]
dhclient-script: cope with /32 address leases

On certain cloud platforms (Google Cloud, Packet.net and others) the
DHCP server offers a /32 address. This makes adding the default route
fail since it is not reachable via any interface. Linux's
dhclient-script seem to usually have a special case for that and
explicitly adds an interface route to the router's address.

FreeBSD's dhclient-script already has a special case for when the router
address is the same as the leased address. Now also add one for when
it's a different address that doesn't fall in the interface's subnet.

PR: 241792
Event: Aberdeen hackathon 2022
Submitted by: sigsys@gmail.com
Reviewed by: dch, kp, bz (+1 on the idea, not reviewed), thj
MFC after: 1 week

(cherry picked from commit fd6ecc184dbc64b9b3f7866b34812fb93df62925)

19 months agoamd64: remove useless addr2 variables in page range invalidation handlers
Konstantin Belousov [Sat, 8 Oct 2022 08:33:11 +0000 (11:33 +0300)]
amd64: remove useless addr2 variables in page range invalidation handlers

(cherry picked from commit 273d0715f6b168ab7be6e79a768d97fbdea81c8d)

19 months agoamd64 pmap: add comment explaining why INVLPG is functional for PCID config
Konstantin Belousov [Mon, 10 Oct 2022 00:19:45 +0000 (03:19 +0300)]
amd64 pmap: add comment explaining why INVLPG is functional for PCID config

(cherry picked from commit e0612ed490c723174607823378d9e883a4b1c257)

19 months agoldd: use direct exec mode unconditionally
Konstantin Belousov [Wed, 21 Sep 2022 13:55:44 +0000 (16:55 +0300)]
ldd: use direct exec mode unconditionally

PR: 127276, 175339, 231926

(cherry picked from commit 9cabef3d146e9a844813b6bc8952d6cf2e9d45e5)

19 months agobhyve: Address -Wno-unused warnings in atkbd.c
Mark Johnston [Thu, 8 Sep 2022 22:48:03 +0000 (18:48 -0400)]
bhyve: Address -Wno-unused warnings in atkbd.c

(cherry picked from commit 57d96d8df99129080a3950bf3f8806d9ebf01a64)

19 months agobhyve: Make smbios tables local to smbiostbl.c
Mark Johnston [Fri, 9 Sep 2022 03:26:47 +0000 (23:26 -0400)]
bhyve: Make smbios tables local to smbiostbl.c

Also flag them as const.

(cherry picked from commit 889cec66d39d60d0a00cd249614924291759fb82)

19 months agobhyve: Address compiler warnings in audio.c
Mark Johnston [Thu, 8 Sep 2022 22:48:53 +0000 (18:48 -0400)]
bhyve: Address compiler warnings in audio.c

- Avoid arithmetic on void pointers.
- Avoid a signed/unsigned comparison in loops which write or fill audio
  data buffers.

Convert while loops to for loops while here.

(cherry picked from commit ee83710bc492c0b2e7d66dd61f45fa657a14d169)

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

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

Fixes: 8f9be1eed11c ("cam(4): Improve XPT_DEV_MATCH")
PR: 264709
Tested by: andreas.mahling@googlemail.com
Reviewed by: imp

(cherry picked from commit 0cd631ee0693dd7337c38b251044e018aad6fbaf)

19 months agoriscv: Handle invalid L2 entries in pmap_extract()
Mark Johnston [Thu, 29 Sep 2022 17:07:26 +0000 (13:07 -0400)]
riscv: Handle invalid L2 entries in pmap_extract()

While here, eliminate a single-use local variable.

PR: 266103
Reviewed by: mhorne

(cherry picked from commit ec21f85ab5f03a803884cc7bafa88621c613f4ca)

19 months agousb(4): Make the enumeration thread nice time a variable.
Hans Petter Selasky [Fri, 7 Oct 2022 11:28:38 +0000 (13:28 +0200)]
usb(4): Make the enumeration thread nice time a variable.

Depends on "options USB_DEBUG".

Suggested by: koobs@
Sponsored by: NVIDIA Networking

(cherry picked from commit 8758aabb169d98f08c20f2a1fce5184434b1ddf6)

19 months agousb(4): Make sure the enumeration thread doesn't loop too fast.
Hans Petter Selasky [Thu, 9 Jun 2022 13:15:49 +0000 (15:15 +0200)]
usb(4): Make sure the enumeration thread doesn't loop too fast.

Sponsored by: NVIDIA Networking

(cherry picked from commit 55a3bd000d9799f431c207e359466484ac63c137)

19 months agolibusb(3): Implement libusb_interrupt_event_handler() by exposing existing function.
Hans Petter Selasky [Sun, 2 Oct 2022 15:30:40 +0000 (17:30 +0200)]
libusb(3): Implement libusb_interrupt_event_handler() by exposing existing function.

Sponsored by: NVIDIA Networking

(cherry picked from commit aa87aa52326be7b726664dba65e91ec3d8160f48)

19 months agovt(4): Use define instead of numerical value.
Hans Petter Selasky [Wed, 5 Oct 2022 09:50:42 +0000 (11:50 +0200)]
vt(4): Use define instead of numerical value.

No functional change intended.

Sponsored by: NVIDIA Networking

(cherry picked from commit 18a44589fcdc9833b3756854c2db4b68e750d7d7)

19 months agovt(4): Clear paste buffer after pasting.
Ivan Quitschal [Wed, 5 Oct 2022 08:37:08 +0000 (10:37 +0200)]
vt(4): Clear paste buffer after pasting.

Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D36042

(cherry picked from commit d2d30464365ebaa9f4b04371f947fcffcc3975e1)

19 months agovt(4): When cutting a line, append a newline character.
Ivan Quitschal [Wed, 5 Oct 2022 09:20:54 +0000 (11:20 +0200)]
vt(4): When cutting a line, append a newline character.

While at it optimise "case 3" into a default.
This way there is no need to initialize the "mark" variable in the beginning,
because all cases set it.

Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D36042

(cherry picked from commit 90b89100548f7fef4cbd4a8c76dc3d83ab786d7a)

19 months agovt(4): Make sure pressing the extend button updates the current selection.
Hans Petter Selasky [Wed, 5 Oct 2022 09:40:01 +0000 (11:40 +0200)]
vt(4): Make sure pressing the extend button updates the current selection.

Sponsored by: NVIDIA Networking

(cherry picked from commit 4ea90153ac792afd0f8c3db845a09176c8d6dfa3)

19 months agoqdivrem: Predict division by zero as false.
Hans Petter Selasky [Tue, 4 Oct 2022 10:28:25 +0000 (12:28 +0200)]
qdivrem: Predict division by zero as false.

Division by zero triggers an arithmetic exception and should not be very
common. Predict this.

No functional change intended.

Sponsored by: NVIDIA Networking

(cherry picked from commit 1024bb26337bdc6679af477977247e9155d502bc)

19 months agotime(3): Increase precision of time conversion functions by using gcd.
Hans Petter Selasky [Sun, 2 Oct 2022 22:15:09 +0000 (00:15 +0200)]
time(3): Increase precision of time conversion functions by using gcd.

When converting times to and from units which have many leading zeros,
it pays off to compute the greatest common divisor first, and then do the
scaling product. This way all time unit conversion comes down to scaling a
signed or unsigned 64-bit value by a fraction represented by two signed
or unsigned 32-bit integers.

SBT_1S is defined as 2^32 . When scaling using powers of 10 above 1,
the gcd of SBT_1S and 10^N is always greater than or equal to 4,
when N is greater or equal to 2.

Scaling a sbt value to milliseconds is then done by multiplying by
(1000 / 8) and dividing by (2^32 / 8).

This trick allows for higher precision at very little additional CPU cost.

It shall also be noted that the Xtosbt() functions prior to this patch,
sometimes were off-by-one:

For example when converting 1 / 8 of a second to sbt as 125ms the old sbt
conversion function would compute 0x20000001 while the new function computes
0x20000000 which multiplied by 8 becomes SBT_1S, which is the correct value.

Reviewed by: kib@
Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D36857

(cherry picked from commit d97ecf714e791ad8ca7caa969fd9a5e9347fc96a)

19 months agocuse(3): Cosmetic change about testing boolean values.
Hans Petter Selasky [Tue, 4 Oct 2022 10:31:51 +0000 (12:31 +0200)]
cuse(3): Cosmetic change about testing boolean values.

No functional change intended.

Suggested by: jrtc27@ and avg@
Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D36633

(cherry picked from commit 2ae08612424eda47e099096f1f5719891c6d4711)

19 months agocuse(3): Use bool type for boolean value instead of int type.
Hans Petter Selasky [Mon, 3 Oct 2022 15:26:43 +0000 (17:26 +0200)]
cuse(3): Use bool type for boolean value instead of int type.

No functional change intended.

Reviewed by: imp @
Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D36633

(cherry picked from commit 8f0a3c9c35517e61f4f64ce5b252202b8ddfa313)

19 months agocuse(3): Optimise small reads and writes.
Hans Petter Selasky [Tue, 20 Sep 2022 13:58:36 +0000 (15:58 +0200)]
cuse(3): Optimise small reads and writes.

When doing small reads and writes use an intermediate buffer to store the
data to save locking the remote process to access data.

Reviewed by: imp @
Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D36633

(cherry picked from commit 5e59b2734f77da24e2bc45154c7db949b9d790c5)

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

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

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

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

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

PR: 256507
Fixes: f3f38e2580f1 ("Start implementing queue state updates using fcmpset loops.")
Reviewed by: alc, kib
Sponsored by: E-CARD Ltd.
Sponsored by: Klara, Inc.

(cherry picked from commit 2c9dc2384f85a4ccc44a79b349f4fb0253a2f254)

19 months agoRevert "e1000: Try auto-negotiation for fixed 100 or 10 configuration"
Kevin Bowling [Wed, 12 Oct 2022 12:01:12 +0000 (05:01 -0700)]
Revert "e1000: Try auto-negotiation for fixed 100 or 10 configuration"

This reverts commit 9ab4dfce8feda8cf3545be0c3c7569095b1fcd24.

OPNsense users have reported a regression with fixed configs.

The e1000 api is not ready for this change.

(cherry picked from commit 66dad2db0a484d65df331df76db0b68ef518f4db)

19 months agodf: do not report a 100% full inode usage on fs without inodes
Baptiste Daroussin [Thu, 10 Mar 2022 14:28:50 +0000 (15:28 +0100)]
df: do not report a 100% full inode usage on fs without inodes

Before:
devfs    2        2         0   100%       0          0  100%   /dev

After:
devfs    2        2         0   100%       0          0     -   /dev

The previous behaviour was confusing for end users and many monitoring tools

Note the linux df tools is also using the same syntax '-' for such filesystem

MFC After: 2 weeks
Reviewed by: manu, emaste, imp
Differential Revision: https://reviews.freebsd.org/D34515

(cherry picked from commit 2eee44bd5ebcb88bf304215be1b0c68b6802a924)

19 months agolocate: change from BSD-4-clause to BSD-3-clause
Baptiste Daroussin [Tue, 25 Jan 2022 08:17:36 +0000 (09:17 +0100)]
locate: change from BSD-4-clause to BSD-3-clause

We have the authorization from the University of California to remove
the advertising clause for a while, wosch@ who also hold a copyright
on this code also approved the relicensing

Approved by: wosch@
MFC after: 3 days

(cherry picked from commit 389844c058ec1ab69bb506601ed673fdd4e4d12b)

19 months agosh(1): fix home/del key on mobaxterm env
Baptiste Daroussin [Wed, 20 Oct 2021 11:58:18 +0000 (13:58 +0200)]
sh(1): fix home/del key on mobaxterm env

For $reason mobaxterm default on sending unusual sequence from home/del
key, which makes libedit unabel to catch them and bind them correctly.

mobaxterm seems popular on the windows environment, so add proper
keybinding to default shrc configuration so it works out of box.

Reported by: lme

(cherry picked from commit f3aad18d5e57328469be0e3be9e17d7bc48e6822)

19 months agoskel: update .shrc as well
Baptiste Daroussin [Wed, 20 Oct 2021 09:23:13 +0000 (11:23 +0200)]
skel: update .shrc as well

Somehow we end up having 2 definition of the same .shrc in the source
tree, both of them should have been updated.

A batter fix would be to only keep one copy of the same file. but that
would be for another commit

Reported by: lme

(cherry picked from commit 5fe97373486619373e3eeecb25582b5c937a26c5)

19 months agosh(1): interactive mode improvement
Baptiste Daroussin [Tue, 19 Oct 2021 06:37:47 +0000 (08:37 +0200)]
sh(1): interactive mode improvement

In the default configuration add 2 bindings which has been requested by
many during the HEADSUP discussion:
* csh like arrow history navigation
* ctrl-arrow to jump from word to words

Add an alias to make the history command exist as an alias to fc -l.

(cherry picked from commit ef0d94a3d34c880bd9f86cd842ee01b6075bc1d8)

19 months agomandoc: import version 1.14.6
Baptiste Daroussin [Mon, 15 Nov 2021 15:54:38 +0000 (16:54 +0100)]
mandoc: import version 1.14.6

MFC after: 3 weeks

(cherry picked from commit 6d38604fc532a3fc060788e3ce40464b46047eaf)

19 months ago/usr/sbin/pkg: don't sleep on fetch failure
John Hood [Thu, 21 Apr 2022 21:39:14 +0000 (17:39 -0400)]
/usr/sbin/pkg: don't sleep on fetch failure

PR: 263458
(cherry picked from commit 60b92ba9323c2dd249ba3a3349b207c2d0b9d212)

19 months agopci_vendors: udpate to 2022-05-18
Baptiste Daroussin [Fri, 10 Jun 2022 10:55:43 +0000 (12:55 +0200)]
pci_vendors: udpate to 2022-05-18

(cherry picked from commit 60408c23c9505de0366aa21ce61eb57bd528d1ad)

19 months agoupdate to 2022-03-22
Baptiste Daroussin [Thu, 14 Apr 2022 14:15:47 +0000 (16:15 +0200)]
update to 2022-03-22

(cherry picked from commit 4fea9c7cfeac7878872080406c4e1704563eef56)

19 months agopci_vendors: update to 2022.03.06
Baptiste Daroussin [Fri, 11 Mar 2022 09:48:04 +0000 (10:48 +0100)]
pci_vendors: update to 2022.03.06

(cherry picked from commit 7da4ef4ef21dfc0c56c5b07fb1c253e4d31db494)

19 months agopci_vendors: update to 2022-01-15
Baptiste Daroussin [Wed, 19 Jan 2022 08:58:13 +0000 (09:58 +0100)]
pci_vendors: update to 2022-01-15

(cherry picked from commit 6521372e95bdd9e4ab444eee2d5cbe1534004cac)

19 months agopci_vendors: update to 2021-11-24
Baptiste Daroussin [Fri, 26 Nov 2021 07:52:20 +0000 (08:52 +0100)]
pci_vendors: update to 2021-11-24

(cherry picked from commit ecff38de76ded358558aacc62c1081da4451c8fb)

19 months agolibedit: import version of 2022-04-11
Baptiste Daroussin [Thu, 14 Apr 2022 14:46:47 +0000 (16:46 +0200)]
libedit: import version of 2022-04-11

It includes improvements in the libreadline compatibility and a change
from pstef@ which fixes filename autocompletion for strings like a\)b

(cherry picked from commit 7f39937557052c004d7ebf55dd973108323756f3)

19 months agolibedit: import snapshot 2021-09-10
Baptiste Daroussin [Wed, 22 Sep 2021 08:19:43 +0000 (10:19 +0200)]
libedit: import snapshot 2021-09-10

(cherry picked from commit 91f764172e197c82efa97a66cfbc13d2c744b02b)

19 months agoident: replace sbuf(9) with open_memstream(3)
Baptiste Daroussin [Thu, 28 Oct 2021 13:39:24 +0000 (15:39 +0200)]
ident: replace sbuf(9) with open_memstream(3)

This change makes ident only dependant on libc functions

This makes our ident(1) more portable, also the fact that we only
depend on libc which is maintained with excellent backward compatibility
means that if one day ident is removed from base, someone using FreeBSD
22 will be able to fetch ident from FreeBSD 14 to run ident against
FreeBSD 1.0 binary

MFC After: 1 week

(cherry picked from commit 1a4d5f13ba19308f9909ef712c5d7eebaf1f9806)

19 months agoopenssl: install pc files
Baptiste Daroussin [Fri, 26 Aug 2022 14:02:09 +0000 (16:02 +0200)]
openssl: install pc files

most programs in ports are looking for .pc files in order to get the
necessary information on how to compile and link against openssl.

The ports now also has a way to hide or force a path for pkgconf.

Providing .pc files along with openssl in base will allow (once all
the supported version of FreeBSD has it) so improve the framework to
deal with openssl in base vs openssl in ports (and libressl)

This will also greatly reduce the number of patches necessary to
workaround the build systems which only knows how to detect where
openssl is installed via pkgconf.

PR: 266051
MFC After: 3 weeks
Reviewed by: jkim, delphij
Exp-run by: antoine
Differential Revision: https://reviews.freebsd.org/D36360

(cherry picked from commit b323fa85f15268ac44b8ff90faf90bce5d87b608)

19 months agocopy_file_range: truncate write if it would exceed RLIMIT_FSIZE
Alan Somers [Sun, 25 Sep 2022 22:53:36 +0000 (16:53 -0600)]
copy_file_range: truncate write if it would exceed RLIMIT_FSIZE

PR: 266611
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D36706

(cherry picked from commit 52360ca32ff90b605ac7481fd79e6a251e8b5116)

19 months agofusefs: truncate write if it would exceed RLIMIT_FSIZE
Alan Somers [Sun, 25 Sep 2022 18:59:33 +0000 (12:59 -0600)]
fusefs: truncate write if it would exceed RLIMIT_FSIZE

PR: 164793
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D36703

(cherry picked from commit be280f60dd8e8ef765a76966aac9c6ca7d6264d0)

19 months agofusefs: respect RLIMIT_FSIZE during truncate
Alan Somers [Sun, 25 Sep 2022 17:56:11 +0000 (11:56 -0600)]
fusefs: respect RLIMIT_FSIZE during truncate

PR: 164793
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D36703

(cherry picked from commit 0a192b3abab19deac70f762cd1ec45ba09ec47ca)

19 months agorb_tree: Use void casts for RB_AUGMENT_CHECK with unused return value.
John Baldwin [Thu, 29 Sep 2022 22:05:22 +0000 (15:05 -0700)]
rb_tree: Use void casts for RB_AUGMENT_CHECK with unused return value.

Reviewed by: dougm
Reported by: GCC -Wunused-value
Differential Revision: https://reviews.freebsd.org/D36778

(cherry picked from commit 1aef571102e2d56b062916d69d962e8eeecfd1bf)

19 months agorb_tree: add augmentation comments
Doug Moore [Mon, 26 Sep 2022 17:39:16 +0000 (12:39 -0500)]
rb_tree: add augmentation comments

Add comments to better explain why augmentation is done in several places.
Reviewed by: alc
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36646

(cherry picked from commit b5b07c71e83637af8a2507ef96c32bc7e2d226c6)

19 months agoUse 0 and 1, not false and true, in tree.h changes.
Doug Moore [Wed, 21 Sep 2022 04:36:40 +0000 (23:36 -0500)]
Use 0 and 1, not false and true, in tree.h changes.
Reported by: jenkins

(cherry picked from commit 86d00db451f7b9fcc06e5a507cced4b20aa55ade)

19 months agorb_tree: augmentation shortcut
Doug Moore [Wed, 21 Sep 2022 04:21:14 +0000 (23:21 -0500)]
rb_tree: augmentation shortcut

RB-tree augmentation maintains data in each node of the tree that
represents the product of some associative operator applied to all the
nodes of the subtree rooted at that node. If a node in the tree
changes, augmentation data for the node is updated for that node and
all nodes on the path from that node to the tree root. However,
sometimes, augmenting a node changes no data in that node,
particularly if the associated operation is something involving 'max'
or 'min'. If augmentation changes nothing in a node, then the work of
walking to the tree root from that point is pointless, because
augmentation will change nothing in those nodes either. This change
makes it possible to avoid that wasted work.

Define RB_AUGMENT_CHECK as a macro much like RB_AUGMENT, but which
returns a value 'true' when augmentation changes the augmentation data
of a node, and false otherwise. Change code that unconditionally walks
and augments to the top of tree to code that stops once an
augmentation has no effect. In the case of rebalancing the tree after
insertion or deletion, where previously a node rotated into the path
was inevitably augmented on the march to the tree root, now check to
see if it needs augmentation because the march to the tree root
stopped before reaching it.

Change the augmentation function in iommu_gas.c so that it returns
true/false to indicate whether the augmentation had any effect.

Reviewed by: alc, kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D36509

(cherry picked from commit b16f993ec2cafe48fae96ca0eb27224951b30d7e)

19 months agorb_tree: pass parent to RB_INSERT_COLOR
Doug Moore [Tue, 13 Sep 2022 06:11:47 +0000 (01:11 -0500)]
rb_tree: pass parent to RB_INSERT_COLOR

Change RB_COLOR_INSERT to take a parent parameter, to avoid looking up
a value already available. Make adjustments to a linux rbtree header,
which invokes it.

Reviewed by: alc, hselasky
Differential Revision: https://reviews.freebsd.org/D36114

(cherry picked from commit 4893472c9a18cd8ce3b68d0c54084ef6f0285d0f)

19 months agoiommu_gas: don't remove and insert boundary entry
Doug Moore [Fri, 16 Sep 2022 20:32:11 +0000 (15:32 -0500)]
iommu_gas: don't remove and insert boundary entry

Avoid removing an item in iommu_gas_free_region only to reinsert it,
by avoiding removing an entry that is either first_place or
last_place.

Reviewed by: kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D36597

(cherry picked from commit 87cd087a4ae7b272986ce3bcf27ffe4930f15e55)

19 months agoAdd mbuf_tstmp2timeval()
Konstantin Belousov [Mon, 3 Oct 2022 22:49:45 +0000 (01:49 +0300)]
Add mbuf_tstmp2timeval()

(cherry picked from commit 2220b66fe0d5c2dfdaf3c22dcec3771665874d69)

19 months agosmr: Fix synchronization in smr_enter()
Mark Johnston [Sat, 24 Sep 2022 13:18:04 +0000 (09:18 -0400)]
smr: Fix synchronization in smr_enter()

smr_enter() must publish its observed read sequence number before
issuing any subsequent memory operations.  The ordering provided by
atomic_add_acq_int() is insufficient on some platforms, at least on
arm64, because it permits reordering of subsequent loads with the store
to c_seq.

Thus, use atomic_thread_fence_seq_cst() to issue a store-load barrier
after publishing the read sequence number.

On x86, take advantage of the fact that memory operations are not
reordered with locked instructions to improve code density: we can store
the observed read sequence and provide a store-load barrier with a
single operation.

Based on a patch from Pierre Habouzit <pierre@habouzit.net>.

PR: 265974
Reviewed by: alc

(cherry picked from commit 8694fd333556addb97acfff1feca6a1e389201ce)

19 months agoriscv: Apply 8d7ee2047c5e to the riscv pmap
Mark Johnston [Tue, 4 Oct 2022 16:49:36 +0000 (12:49 -0400)]
riscv: Apply 8d7ee2047c5e to the riscv pmap

Reviewed by: alc

(cherry picked from commit d5dc278eeca341cf1b5199c7c6ba70553bbb44a0)

19 months agoriscv: better CTR messages in pmap_enter_l2()
Mitchell Horne [Thu, 25 Aug 2022 20:08:41 +0000 (17:08 -0300)]
riscv: better CTR messages in pmap_enter_l2()

Disambiguate the failure cases.

Reviewed by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D36562

(cherry picked from commit dd18b62cec6228c17aef428a575f44152ea55d53)

19 months agoriscv: move GEOM_PART_GPT option to DEFAULTS
Mitchell Horne [Tue, 14 Jun 2022 17:19:46 +0000 (14:19 -0300)]
riscv: move GEOM_PART_GPT option to DEFAULTS

This is consistent with other architectures.

(cherry picked from commit 3a91cecea412cc6c73d10f7594a3b6f472748b9d)

19 months agoamd64: Make it possible to grow the KERNBASE region of KVA
Mark Johnston [Sat, 24 Sep 2022 13:19:21 +0000 (09:19 -0400)]
amd64: Make it possible to grow the KERNBASE region of KVA

pmap_growkernel() may be called when mapping a region above KERNBASE,
typically for a kernel module.  If we have enough PTPs left over from
bootstrap, pmap_growkernel() does nothing.  However, it's possible to
run out, and in this case pmap_growkernel() will try to grow the kernel
map all the way from kernel_vm_end to somewhere past KERNBASE, which can
easily run the system out of memory.  This happens with large kernel
modules such as the nvidia GPU driver.  There is also a WIP dtrace
provider which needs to map KVA in the region above KERNBASE (to provide
trampolines which allow a copy of traced kernel instruction to be
executed), and its allocations could potentially trigger this scenario.

This change modifies pmap_growkernel() to manage the two regions
separately, allowing them to grow independently.  The end of the
KERNBASE region is tracked by modifying "nkpt".

PR: 265019
Reviewed by: alc, imp, kib

(cherry picked from commit 0b29f5efcc7ee8271ad2f6b6447898b489d618ec)

19 months agostty(1): provide details about interaction with job control
Konstantin Belousov [Mon, 26 Sep 2022 21:34:22 +0000 (00:34 +0300)]
stty(1): provide details about interaction with job control

PR: 266627

(cherry picked from commit a7eac018437e592a575f46a59151eedc7a742fa7)

19 months agonfs_clvnops.c: Fix access to v_mount when vnode unlocked
Rick Macklem [Sat, 1 Oct 2022 23:30:07 +0000 (16:30 -0700)]
nfs_clvnops.c: Fix access to v_mount when vnode unlocked

Commit ab17854f974b fixed access to v_mount when the
vnode is unlocked for nfs_copy_file_range().

This patch does the same for nfs_advlockasync().

(cherry picked from commit a82308abab86740e9bc37499bd2a13568764d7a0)

19 months agotmpfs: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 13:27:28 +0000 (16:27 +0300)]
tmpfs: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE

PR: 164793

(cherry picked from commit 8bdb2695d69710b7f2e7cc20820aab8b3f4668a6)

19 months agomsdosfs: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 11:51:33 +0000 (14:51 +0300)]
msdosfs: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE

PR: 164793

(cherry picked from commit a9c439ba104d83a2666d114dae9f26b2efb22d17)

19 months agoFFS: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 11:48:40 +0000 (14:48 +0300)]
FFS: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE

PR: 164793

(cherry picked from commit 87525ef94007c792c6745db7938251a663ca5706)

19 months agoAdd vn_rlimit_fsizex() and vn_rlimit_fsizex_res()
Konstantin Belousov [Sun, 18 Sep 2022 11:46:19 +0000 (14:46 +0300)]
Add vn_rlimit_fsizex() and vn_rlimit_fsizex_res()

PR: 164793

(cherry picked from commit 1b4b75171ee3f2213b7671878a910fd5ddb3306e)

19 months agotmpfs: disallow truncation to set file size past RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 13:28:11 +0000 (16:28 +0300)]
tmpfs: disallow truncation to set file size past RLIMIT_FSIZE

PR: 164793

(cherry picked from commit b5b16659c5aceb9caa0a9b76c7746e1d12a505ce)

19 months agomsdosfs: disallow truncation to set file size past RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 11:51:03 +0000 (14:51 +0300)]
msdosfs: disallow truncation to set file size past RLIMIT_FSIZE

PR: 164793

(cherry picked from commit 701b73858e3afa15d8ca2ea4aa480173ccc5960e)

19 months agoUFS: disallow truncation to set file size past RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 11:49:57 +0000 (14:49 +0300)]
UFS: disallow truncation to set file size past RLIMIT_FSIZE

PR: 164793

(cherry picked from commit 70385088cafaab3365c5243f22b8fc9c712c1fde)

19 months agoAdd vn_rlimit_trunc()
Konstantin Belousov [Sun, 18 Sep 2022 19:52:13 +0000 (22:52 +0300)]
Add vn_rlimit_trunc()

(cherry picked from commit 2ac083f60f8c9ce361c3daf691c60486459d87ae)

19 months agofilesystems: return error from vn_rlimit_fsize() instead of EFBIG
Konstantin Belousov [Sun, 18 Sep 2022 14:44:49 +0000 (17:44 +0300)]
filesystems: return error from vn_rlimit_fsize() instead of EFBIG

(cherry picked from commit cc65a412ae226136e6207bdc8db4722dab99982f)

19 months agotmpfs_subr.c: some style
Konstantin Belousov [Sun, 18 Sep 2022 13:20:24 +0000 (16:20 +0300)]
tmpfs_subr.c: some style

(cherry picked from commit 0f01fb01c2de3e2c9ce8719750aea379c402ece6)

19 months agolibc: Fix size range check in setvbuf
Ed Maste [Mon, 3 Oct 2022 18:24:42 +0000 (14:24 -0400)]
libc: Fix size range check in setvbuf

From enh at google.com via openbsd-tech mailing list via pfg@:

The existing test is wrong for LP64, where size_t has twice as many
relevant bits as int, not just one. (Found by inspection by
rprichard.)

(cherry picked from commit 9515313b26beb005a521aff2e6edd4d75cd010da)

19 months agovmstat: remove processor counting from getcpuinfo()
Elliott Mitchell [Thu, 29 Sep 2022 16:27:24 +0000 (09:27 -0700)]
vmstat: remove processor counting from getcpuinfo()

(cherry picked from commit 42dc8696df5e3004ea65fd315aba500d269dbcbf)

19 months agosshd: update the libwrap patch to drop connections early
Gleb Smirnoff [Mon, 3 Jan 2022 02:32:30 +0000 (18:32 -0800)]
sshd: update the libwrap patch to drop connections early

OpenSSH has dropped libwrap support in OpenSSH 6.7p in 2014
(f2719b7c in github.com/openssh/openssh-portable) and we
maintain the patch ourselves since 2016 (a0ee8cc636cd).

Over the years, the libwrap support has deteriotated and probably
that was reason for removal upstream.  Original idea of libwrap was
to drop illegitimate connection as soon as possible, but over the
years the code was pushed further down and down and ended in the
forked client connection handler.

The negative effects of late dropping is increasing attack surface
for hosts that are to be dropped anyway.  Apart from hypothetical
future vulnerabilities in connection handling, today a malicious
host listed in /etc/hosts.allow still can trigger sshd to enter
connection throttling mode, which is enabled by default (see
MaxStartups in sshd_config(5)), effectively casting DoS attack.
Note that on OpenBSD this attack isn't possible, since they enable
MaxStartups together with UseBlacklist.

A only negative effect from early drop, that I can imagine, is that
now main listener parses file in /etc, and if our root filesystems
goes bad, it would get stuck.  But unlikely you'd be able to login
in that case anyway.

Implementation details:

- For brevity we reuse the same struct request_info.  This isn't
  a documented feature of libwrap, but code review, viewing data
  in a debugger and real life testing shows that if we clear
  RQ_CLIENT_NAME and RQ_CLIENT_ADDR every time, it works as intended.
- We set SO_LINGER on the socket to force immediate connection reset.
- We log message exactly as libwrap's refuse() would do.

Differential revision: https://reviews.freebsd.org/D33044

(cherry picked from commit ca573c9a1779bdeeea6d0a6e948676555977737e)

19 months agossh-keysign: fix double free in error path
Ed Maste [Tue, 4 Oct 2022 20:34:15 +0000 (16:34 -0400)]
ssh-keysign: fix double free in error path

From OpenSSH-portable commit 141535b904b6, OpenBSD commit 3d21aa127b1f.

MFC after: 3 days

(cherry picked from commit 963c7b084b8bf2397deced4f568b976a42611910)

19 months agossh-keygen: fix double free in error path
Ed Maste [Tue, 4 Oct 2022 20:31:39 +0000 (16:31 -0400)]
ssh-keygen: fix double free in error path

From OpenSSH-portable commit 5062ad48814b, OpenBSD commit 39f35e16ba87.

MFC after: 3 days

(cherry picked from commit 666605ad2df3f5c1fb973dbd719ffbe3f3935c1d)

19 months agossh-keyscan: Strictly enforce the maximum allowed SSH2 banner size
Ed Maste [Tue, 4 Oct 2022 20:28:13 +0000 (16:28 -0400)]
ssh-keyscan: Strictly enforce the maximum allowed SSH2 banner size

From OpenSSH-portable commit ff89b1bed807, OpenBSD commit 6ae664f9f4db.

MFC after: 3 days

(cherry picked from commit 5e5ebbee81bfd1c034caffa00d58d4e06e1b26ee)

19 months agossh: drop $FreeBSD$ from crypto/openssh
Ed Maste [Fri, 22 Apr 2022 23:05:44 +0000 (19:05 -0400)]
ssh: drop $FreeBSD$ from crypto/openssh

After we moved to git $FreeBSD$ is no longer expanded and serves no
purpose.  Remove them from OpenSSH to reduce diffs against upstream.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 835ee05f3c754d905099a3500f421dc01fab028f)

19 months agossh: update to OpenSSH v9.0p1
Ed Maste [Fri, 15 Apr 2022 14:41:08 +0000 (10:41 -0400)]
ssh: update to OpenSSH v9.0p1

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

Some highlights:

 * ssh(1), sshd(8): use the hybrid Streamlined NTRU Prime + x25519 key
   exchange method by default ("sntrup761x25519-sha512@openssh.com").
   The NTRU algorithm is believed to resist attacks enabled by future
   quantum computers and is paired with the X25519 ECDH key exchange
   (the previous default) as a backstop against any weaknesses in
   NTRU Prime that may be discovered in the future. The combination
   ensures that the hybrid exchange offers at least as good security
   as the status quo.

 * sftp-server(8): support the "copy-data" extension to allow server-
   side copying of files/data, following the design in
   draft-ietf-secsh-filexfer-extensions-00. bz2948

 * sftp(1): add a "cp" command to allow the sftp client to perform
   server-side file copies.

This commit excludes the scp(1) change to use the SFTP protocol by
default; that change will immediately follow.

MFC after: 1 month
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 87c1498d1a7473ff983e5c0456f30608f3f1e601)
(cherry picked from commit 9fce8d4140370ca8bc03d6a5668fb64a040c00fc)
(cherry picked from commit e2cec5ba2c4385eec0b76d07469ec11d3ce3d6e2)

19 months agossh: update to OpenSSH v8.9p1
Ed Maste [Wed, 13 Apr 2022 20:00:56 +0000 (16:00 -0400)]
ssh: update to OpenSSH v8.9p1

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

Some highlights:

 * ssh(1), sshd(8), ssh-add(1), ssh-agent(1): add a system for
   restricting forwarding and use of keys added to ssh-agent(1)

 * ssh(1), sshd(8): add the sntrup761x25519-sha512@openssh.com hybrid
   ECDH/x25519 + Streamlined NTRU Prime post-quantum KEX to the
   default KEXAlgorithms list (after the ECDH methods but before the
   prime-group DH ones). The next release of OpenSSH is likely to
   make this key exchange the default method.

 * sshd(8), portable OpenSSH only: this release removes in-built
   support for MD5-hashed passwords. If you require these on your
   system then we recommend linking against libxcrypt or similar.

Future deprecation notice
=========================

A near-future release of OpenSSH will switch scp(1) from using the
legacy scp/rcp protocol to using SFTP by default.

Legacy scp/rcp performs wildcard expansion of remote filenames (e.g.
"scp host:* .") through the remote shell. This has the side effect of
requiring double quoting of shell meta-characters in file names
included on scp(1) command-lines, otherwise they could be interpreted
as shell commands on the remote side.

MFC after: 1 month
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 1323ec571215a77ddd21294f0871979d5ad6b992)
(cherry picked from commit 58def461e256e3a05c3ff15a87ed702fe0c3662c)

19 months agonfscl: Fix parameter order in the calls to MGET().
Zhenlei Huang [Fri, 23 Sep 2022 21:04:36 +0000 (15:04 -0600)]
nfscl: Fix parameter order in the calls to MGET().

(cherry picked from commit 8b43388c745ebb42414496f2925f47acac662c2f)

19 months agoipfilter/libipf: printpool_live() consumer ignores return code
Cy Schubert [Thu, 22 Sep 2022 18:26:23 +0000 (11:26 -0700)]
ipfilter/libipf: printpool_live() consumer ignores return code

The single consumer of printpool_live() ignores the return code.
Avoid wasting resources on this.

(cherry picked from commit 00d8a28f19b21ce2955c0cf24a040824ec506da5)

19 months agoipfilter/ippool: Return error code when listing a pool fails
Cy Schubert [Thu, 22 Sep 2022 13:00:09 +0000 (06:00 -0700)]
ipfilter/ippool: Return error code when listing a pool fails

When an internal or other error occurs during the listing of a pool,
return an error code when extiting ippool(8). Printing an error to
stderr without returning an error code is useless in shell scripts.

(cherry picked from commit 5568c8b2c58a65a07b42af0e09c3fc619f13316c)

19 months agoipfilter/ippool: Dump a copy of ippool in ippool.conf format
Cy Schubert [Wed, 21 Sep 2022 15:33:11 +0000 (08:33 -0700)]
ipfilter/ippool: Dump a copy of ippool in ippool.conf format

Add an ippool(8) option to dump a copy of the inm-memory ippool tables
in an ippool(5) format so that it can be reloaded using ippool -f.

(cherry picked from commit 7531c434a593b2f369d69c85551e7ad1ebb7499a)

19 months agopowerpc: slb_alloc_user_cache: fix missing uma_zalloc wait flag
Alfredo Dal'Ava Junior [Mon, 3 Oct 2022 23:22:14 +0000 (20:22 -0300)]
powerpc: slb_alloc_user_cache: fix missing uma_zalloc wait flag

Flags should be M_WAITOK | M_ZERO instead of just M_ZERO

Reviewed by: markj
MFC after: 2 days
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D36865

(cherry picked from commit ff80ab1cebd61d08598fd248fb6e70782ba72e4a)

19 months agopowerpc: cpuset: add local functions for copyin/copyout
Alfredo Dal'Ava Junior [Mon, 3 Oct 2022 14:51:05 +0000 (11:51 -0300)]
powerpc: cpuset: add local functions for copyin/copyout

Add local functions to workaround an instruction segment trap (panic)
when the indirect functions copyin and copyout are called by an external
loadable kernel module (i.e. pfsync, zfs and linuxulator). The crash
was triggered by change 47a57144af25a7bd768b29272d50a36fdf2874ba, but
kernel binary linked with LLD 9 works fine. LLVM bisect points that LLD
behavior chaged after dc06b0bc9ad055d06535462d91bfc2a744b2f589.

This is know to affect powerpc targets only and the final fix is still
being discussed with the LLVM community.

PR: 266730
Reviewed by: luporl, jhibbits (on IRC, previous version)
MFC after: 2 days
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D36234

(cherry picked from commit db79bf75ac9eb1b5678ccbaebb45fb88c0e0e1e3)

19 months agopowerpcspe: make GEOM_LABEL kernel built-in
Alfredo Dal'Ava Junior [Tue, 2 Aug 2022 21:11:11 +0000 (18:11 -0300)]
powerpcspe: make GEOM_LABEL kernel built-in

Make powerpspe kernel config in sync with other targets making
GEOM_LABEL built-in to allow use of labels when mounting partitions.

MFC after: 2 days
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)

(cherry picked from commit 8b57548e9a38ffbb122947043bafabb92b037fb3)