]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agolinuxkpi: Move class_create to .c file
Warner Losh [Tue, 5 Apr 2022 05:05:43 +0000 (23:05 -0600)]
linuxkpi: Move class_create to .c file

class_create encodes the size of struct class into the generated
code. Move from .h file to .c file to move this knowledge from the
client modules that call this into the linuxkpi module.

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

(cherry picked from commit 1341ac9f9c111bba4e1ca046c479f32f2d4989c0)
(cherry picked from commit 98d2b4a158f15d6d971a88315c5c5987036f89a3)

2 years agolinuxkpi: Move device_create_groups_vargs to linux_compat.c
Warner Losh [Tue, 5 Apr 2022 05:05:36 +0000 (23:05 -0600)]
linuxkpi: Move device_create_groups_vargs to linux_compat.c

device_create_groups_vargs encodes the size of struct device. Move
definition from .h to .c to move this size into the linuxkpi module
rather than encoding it in all client driver modules.

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

(cherry picked from commit 702b6875035921252d0f2b72171c7662f28766fb)
(cherry picked from commit 417f1c81491ae26643ea7e3f3fc5c08b8e8944a9)

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

kobject_create knows the size of struct kobject. Move it to
linux_compat.c so this knowledge is confined to the loadable module and
not the clients.

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

(cherry picked from commit 36929b55849c8f553a744d6e4fbc8b1a5ff73f66)
(cherry picked from commit 2f3d11894be6fb727be77184d232de24bf5551ba)

2 years agolinuxkpi: add padding to struct pci_driver
Warner Losh [Tue, 5 Apr 2022 04:54:49 +0000 (22:54 -0600)]
linuxkpi: add padding to struct pci_driver

Add 32 or 64 bytes of padding to struct pci_driver at the end in the
_spare field like we should have done when we branched stable/13, but
neglected to do so since we didn't properly anticipate the need.

We cannot safely use these spare fields until after 13.0 EOL since
drivers compiled on 13.0 won't have that space reserved and we'll step
on something else using them. This isn't 100% KBI compatible through the
13.x release branch, but is compatible enough so that drm packages built
on the oldest supported release will work on the latest stable/13 and
any newer releases. It's not ideal, but makes the best of a bad
situation and is a pragmatic approach that belatedly builds in some
future proofing.

Direct commit to stable/13 because this is not relevant to main in this
exact form.

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

(cherry picked from commit 86d5c66106610f083deda03ce0c661a51b2dd723)

2 years agolinuxkpi: Restore the KBI for struct pci_driver
Warner Losh [Sat, 2 Apr 2022 19:52:53 +0000 (13:52 -0600)]
linuxkpi: Restore the KBI for struct pci_driver

The size of the 13.0 version of struct pci_driver was 92 or 184 bytes on
32- or 64-bit systems respectively. We recently added bsd_probe_return
at the end of this struct, breaking the KBI on the stable/13 branch.

Fix this by removing the isdrm member. We don't need it because we can
do a strcmp in the few places that need it as they aren't performance
critical. Move the newly added bsd_probe_return to that slot. It's the
same size in all our supported KBIs as bool and fits into that slot due
to padding rules.

Direct commit to stable/13 because this is not relevant to main.

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

(cherry picked from commit aa61c28b4242ce3f86f1ae7807ae95887cbe9d11)

2 years agobectl: push space-in-name check down into libbe
Kyle Evans [Sun, 3 Apr 2022 02:04:31 +0000 (21:04 -0500)]
bectl: push space-in-name check down into libbe

This check was previously in `create` only, not applying to renames.  It
should really be applied at the libbe level, so that we can avoid
writing about this restriction over and over again.

While we're here: `bectl rename` always succeeds, even when it doesn't.
Start returning the error.

Approved by: re (gjb)
Reported By: Christian McDonald <cmcdonald netgate com>

(cherry picked from commit dadb9c70938c4ae2c260f6af65752c67ac752284)
(cherry picked from commit 227e52a9c0b0be9656757fec47a2648f5619bf67)

2 years agobectl: add some discussion about boot environment layouts
Kyle Evans [Thu, 31 Mar 2022 22:41:53 +0000 (17:41 -0500)]
bectl: add some discussion about boot environment layouts

Discuss the standard type of layout, as well as the "deep" BE layout,
and some of the properties of both.  Point the various -r flags at this
new section, to help users understand which they're working with and
what the -r flag is actually doing. Note that we may just deprecate the
-r flag in future versions, but the flag will be recognized as a NOP at
that point.

Approved by: re (gjb)

(cherry picked from commit c0f846ff235296249271b1235ff6a52b7d23cefb)
(cherry picked from commit 0e90da6549d177874437dc2e7bab085873538da2)

2 years agolibbe: fix be_mounted_at() with props after bootonce
Kyle Evans [Thu, 31 Mar 2022 19:18:14 +0000 (14:18 -0500)]
libbe: fix be_mounted_at() with props after bootonce

propinfo.bootonce was filled with garbage, leading to a segfault later
during prop building.  Initialize it to NULL.

Approved by: re (gjb)

(cherry picked from commit d155d8e138563c0b39c658684e6a4fe6e2e36f8a)
(cherry picked from commit 6ce8e35cead46048d9ae3c1dabafe1ef4ed26f97)

2 years agolibbe: pull props for the correct dataset in be_mounted_at()
Kyle Evans [Thu, 31 Mar 2022 19:19:52 +0000 (14:19 -0500)]
libbe: pull props for the correct dataset in be_mounted_at()

The props feature to this API was added as a "just in case", with no
planned consumer.  It turns out that it was implemented incorrectly,
tapping out props for the BE root (BE's parent) rather than the BE
itself in all cases.

Fetch properties for the dataset that's actually mounted at the queried
path.

Approved by: re (gjb)
Reported by: Christian McDonald <cmcdonald netgate com>

(cherry picked from commit 31190aa02eef05b1b58ba89212dc8c8738770e37)
(cherry picked from commit bed9c972aee7aa5ac916f24d60d9dbd109897856)

2 years agolibarchive: merge vendor bugfixes
Martin Matuska [Sun, 3 Apr 2022 12:21:28 +0000 (14:21 +0200)]
libarchive: merge vendor bugfixes

Bugfixes:
  IS #1685 and OSS-Fuzz #38764 (security):
    (ISO reader) fix possible heap buffer overflow in read_children()
  IS #1715 and OSS-Fuzz #46279 (security):
    (RARv4 reader) fix heap-use-after-free in run_filters()

Approved by: re (gjb)

(cherry picked from commit 9f690fcfdc050f566466ac10cca29ff43bf4fe92)
(cherry picked from commit 43a449f2f1feae53a1302821db6940fd364fa171)

2 years agoBump newvers.sh for 13.1-RC1 advisories
Ed Maste [Wed, 6 Apr 2022 03:28:15 +0000 (23:28 -0400)]
Bump newvers.sh for 13.1-RC1 advisories

Approved by: so, re (implicit)

2 years agonetmap: Fix TOCTOU vulnerability in nmreq_copyin
Vincenzo Maffione [Wed, 16 Mar 2022 06:58:50 +0000 (06:58 +0000)]
netmap: Fix TOCTOU vulnerability in nmreq_copyin

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

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

(cherry picked from commit 393729916564ed13f966e09129a24e6931898d12)
(cherry picked from commit 9f600a260a738d87015b2e9722b7b4f228cbd47d)

Approved by: so, re (implicit)

2 years agonetmap: Fix integer overflow in nmreq_copyin
Vincenzo Maffione [Wed, 16 Mar 2022 06:57:54 +0000 (06:57 +0000)]
netmap: Fix integer overflow in nmreq_copyin

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

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

(cherry picked from commit 694ea59c7021c25417e6d516362d2f59b4e2c343)
(cherry picked from commit 9df8dd3ea36c8b3abe8fc182647472ca9cd83efd)

Approved by: so, re (implicit)

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

Reported by: m00nbsd working with Trend Micro Zero Day Initiative

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

Approved by: so, re (implicit)

2 years agobhyve: validate e82545 checksum offset field
Mark Johnston [Tue, 5 Apr 2022 22:51:19 +0000 (22:51 +0000)]
bhyve: validate e82545 checksum offset field

Reported by: Mehdi Talbi, Synacktiv

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

Approved by: so, re (implicit)

2 years agoLinuxKPI: 802.11: fix RSSI (and NF)
Bjoern A. Zeeb [Fri, 1 Apr 2022 22:31:23 +0000 (22:31 +0000)]
LinuxKPI: 802.11: fix RSSI (and NF)

As in 4a22cd6c4e5f4fc4a38aa7400742d4005c5ae3de nf and rss should be
signed and not unsigned.  Change the types in the header and while
here change a magic number to a define as done elsewhere (value does
not change).

When calculating c_rssi we need to make it relative so subtract nf.
And while here improve the debug output.

This will hopefully fix ifconfig wlanN list scan S:N output which
tools use to chose a BSSID and help net80211 internal calculations.

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

(cherry picked from commit 60970a328e280b25b05f1d9a9de1ef91af573c4a)
(cherry picked from commit 7b9d8e33bc4ee0b8cc22ab28a1f09a062e103bd5)

2 years agonet80211: correct types for nf and rssi
Bjoern A. Zeeb [Fri, 1 Apr 2022 22:30:02 +0000 (22:30 +0000)]
net80211: correct types for nf and rssi

NF and RSSI should be signed and not unsigned to avoid problems.
Change the type accordingly.

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

(cherry picked from commit 4a22cd6c4e5f4fc4a38aa7400742d4005c5ae3de)
(cherry picked from commit 7311128e69b8927d866f9db8c9fa7c5d54eff692)

2 years agoLinuxKPI: 802.11: fix compat code for i386
Bjoern A. Zeeb [Thu, 31 Mar 2022 17:29:53 +0000 (17:29 +0000)]
LinuxKPI: 802.11: fix compat code for i386

Compiling another driver on i386 revealed two problems:
- ieee80211_tx_info.status.status_driver_data space needs to be
  calculated.  While a pointer is 32bit vm_paddr_t is 64 bit on i386
  so we didn't fit more than one of these in but needed more space.
- the arguments to ieee80211_txq_get_depth() are expected to
  unsigned long and not uint64_t.

No user noticable changes.

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

(cherry picked from commit 86220d3cbd500b1018dcdabb0ba70644db438cfd)
(cherry picked from commit 2a8e509ba30c6546ceeec49f9447c2e3d21a1d22)

2 years agofstyp: detect Raspberry Pi Pico boot filesystem as FAT
Ed Maste [Mon, 28 Mar 2022 21:03:10 +0000 (17:03 -0400)]
fstyp: detect Raspberry Pi Pico boot filesystem as FAT

fstyp looks for a 0x55 0xAA signature at offset 510, but this is not
required by specifications and is not provided by the Raspberry Pi Pico
bootloader.

We should really remove the signature check and implement a more
comprehensive BPB validation instead, but it will require more
investigation and testing.  For now just add a special case for the
Raspberry Pi Pico bootloader, to avoid introducing regressions or new
false positives.

PR: 262896
Reviewed by: delphij
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34699

(cherry picked from commit 868c1b8431f297ade8deba5baf903f73cf5e11c6)
(cherry picked from commit 27c2f016b86744aa5d4c6031b4ef2fc16bbf6546)
(cherry picked from commit e06ce938ddc0222c6ed10a70108f71685923bd45)

Approved by: re (gjb)

2 years agopowerpc: implement __clear_cache
Piotr Kubaj [Fri, 1 Apr 2022 19:13:13 +0000 (21:13 +0200)]
powerpc: implement __clear_cache

Merge LLVM commit 81f5c6270cdfcdf80e6296df216b696a7a37c8b5.

This fixes runtime of most notably pcre libraries (currently patched in ports),
and probably also other ports since currently __clear_cache() just calls
SIGABRT on powerpc.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D34736
Approved by: re (gjb)

(cherry picked from commit 57b6ac48a96c99e684ab4dc85b8a87097797dc9f)
(cherry picked from commit 16c3f5d03e984a6039a888eec5bcc58735a7d965)

2 years agouart(4): Add a concept of "unique" serial devices
Colin Percival [Tue, 29 Mar 2022 07:41:37 +0000 (00:41 -0700)]
uart(4): Add a concept of "unique" serial devices

FreeBSD detects serial ports twice: First, very early in the boot
process, in order to obtain a usable console; and second, during
the device probe/attach process.  When a UART is discovered during
device probing, FreeBSD attempts to determine whether it is a
device which was already being used as a console; without this,
the console doesn't work in userland.

Unfortunately it's possible for a UART to be mapped to a different
location in memory when it is discovered on a bus than it has when
it is announced via the ACPI SPCR table; this breaks the matching
process, which relies on comparing bus addresses.

To address this, we introduce a concept of "unique" serial devices,
i.e. devices which are guaranteed to be present *only once* on any
system.  If we discover one of these during device probing, we can
match it to a same-PCI-vendor-and-device-numbers console which was
announced via the ACPI SPCR table, regardless of the differing bus
addresses.

At present, the only unique serial device is the "Amazon PCI serial
device" (vendor 0x1d0f, device 0x8250) found in some EC2 instances.
This unbreaks the serial console on those systems.

Reviewed by: imp
Approved by: re (gjb)
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D34703

(cherry picked from commit ad93649d230428561db983153c546b39336fa4f1)
(cherry picked from commit 5cc5cd739ef15cc762d2f417bccb44daefc86d56)

2 years agocxgbe: fix enabling lro & rxtimestamps
Andrew Gallatin [Wed, 26 May 2021 13:54:26 +0000 (09:54 -0400)]
cxgbe: fix enabling lro & rxtimestamps

A recent change caused iq flags, like LRO, to be set before
init_iq(). However, init_iq() clears those flags, so they
became effectively impossible to set.   This change moves
the initializion of these flags to after the call to init_iq().
This fixes LRO.

Differential Revision: https://reviews.freebsd.org/D30460
Reviewed by: np, rrs
Sponsored by: Netflix
Fixes: 43bbae19483fbde0a91e61acad8a6e71e334c8b8
(cherry picked from commit df8437a93dd5268e5bfd06411c01a5cbdb38c6ac)
(cherry picked from commit 392d7f026962b273cdcd3b230403efaa05f29efe)

Approved by: re@ (gjb@)

2 years agolib/libz: remove ZLIBprivate_1.0 namespace.
Xin LI [Sun, 3 Apr 2022 18:32:47 +0000 (11:32 -0700)]
lib/libz: remove ZLIBprivate_1.0 namespace.

These symbols were hidden and no longer exposed, and were never exposed in headers.

MFC after: 3 days

(cherry picked from commit a7f127b653c939976ac492595a8283b5de08ed0d)
(cherry picked from commit c4727a47f18cb54ebbab951157e57b019db09fc0)

Approved by: re (gjb)

2 years agosys/contrib/zlib: Always define Z_U8 and Z_U4
Xin LI [Sun, 3 Apr 2022 18:45:38 +0000 (11:45 -0700)]
sys/contrib/zlib: Always define Z_U8 and Z_U4

This is a temporary hack for zlib to make sure that the library
still builds when building with Z_SOLO (used in kernel and loader),
as zlib is depending on limits.h which is only available in STDC
case.

PR: kern/262977
MFC after: 3 days

(cherry picked from commit 0a21252adf11f7e839eabeb530e75cd1f9cd5386)

Approved by: re (gjb, early MFC)

(cherry picked from commit 9587a10b420f9ef243f578b6938662ff6b558e86)

Approved by: re (gjb)

2 years agoMFV 7b495a2a7abf (zlib): Correct incorrect inputs provided to the CRC
Xin LI [Thu, 31 Mar 2022 22:35:58 +0000 (15:35 -0700)]
MFV 7b495a2a7abf (zlib): Correct incorrect inputs provided to the CRC
functions.

MFC after: 3 days

(cherry picked from commit c61bc1110c90cb67a60cb08c4f3bc24f75d0b385)
(cherry picked from commit 6b0e0c9e9534149d932fc8b71d1d21a09fe31ffc)

Approved by: re (gjb)

2 years agoMFV c144cc54795d: zlib 1.2.12.
Xin LI [Thu, 31 Mar 2022 14:25:53 +0000 (07:25 -0700)]
MFV c144cc54795d: zlib 1.2.12.

MFC after: 3 days
Relnotes: yes

(cherry picked from commit cd8822075a38d0734e74b1735e4b5dbef9789170)
(cherry picked from commit 6349675deca1fbe704086287bdd941940410799c)

Approved by: re (gjb)

2 years agompr/mps/mpt: verify cfg page ioctl lengths
Ed Maste [Mon, 28 Mar 2022 13:33:54 +0000 (09:33 -0400)]
mpr/mps/mpt: verify cfg page ioctl lengths

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

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

This change includes suggestions from scottl, markj and mav.

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

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

(cherry picked from commit 8276c4149b5fc7c755d6b244fbbf6dae1939f087)
(cherry picked from commit 0b29e1b9f9df3bde6402cccc49cb850c0dcc35fb)

Approved by: re (gjb)

2 years agopf: Initialize the table entry zone limit at initialization time
Mark Johnston [Wed, 30 Mar 2022 19:41:44 +0000 (15:41 -0400)]
pf: Initialize the table entry zone limit at initialization time

The limit may later be updated by the "set limit" directive in pf.conf.
UMA does not permit a limit to be set on a zone after any items have
been allocated from a zone.

Other UMA zones used by pf do not appear to be susceptible to this
problem: they either set a limit at zone creation time or never set one
at all.

Approved by: re (gjb)
PR: 260406
Reviewed by: kp
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 7d1ab866911a2b29e041d64bc83a93638533f957)
(cherry picked from commit 1487f84223ce1341ebdfc87e50fbcddedc6d1de8)

2 years agoTreat cache write as a read in arm64 data faults
Andrew Turner [Sat, 26 Mar 2022 15:59:34 +0000 (15:59 +0000)]
Treat cache write as a read in arm64 data faults

On arm64 we can ask the hardware to perform cache operations from
userspace. These require read permission however when the memory is
unmapped the kernel will receive a write exception. Add a check to
see if the cause of the exception is from the cache and pass a memory
read fault type to the vm subsystem.

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

(cherry picked from commit 029c1c4828aab451ba262cd4e2e1d9362cf18b76)
(cherry picked from commit 004da2d51f8427745c0d1287781d5ba546b19000)

2 years agoMFS 26e8bb3: MFC cc68614, ac69e5d, 7ed8e14: Update contrib/expat to 2.4.7.
Xin LI [Mon, 28 Mar 2022 05:22:07 +0000 (22:22 -0700)]
MFS 26e8bb3: MFC cc68614ac69e5d7ed8e14: Update contrib/expat to 2.4.7.

(cherry picked from commit cc68614da8232d8baaca0ae0d0dd8f890f06623e)
(cherry picked from commit ac69e5d471014c95070cd6294db315089a62725b)
(cherry picked from commit 7ed8e142a00d4b711dd2021b37b84a6e7f86516e)
(cherry picked from commit 26e8bb3a4e104a24d07743c1670513abaa5c6cbd)
Approved by: re (gjb)

2 years agobsd-family-tree: macOS 11 and macOS 12
Warner Losh [Fri, 1 Apr 2022 04:24:16 +0000 (22:24 -0600)]
bsd-family-tree: macOS 11 and macOS 12

Sponsored by: Netflix
Approved by: re@ (delphij@)

(cherry picked from commit 4fc5a607fdf47ce5148e01d62ea474a4b6b0b238)
(cherry picked from commit 6292dace827a1ef0b9a0b4b58336c128cc159015)

2 years agobsd-family-tree: Dragonfly 6.2.1 release
Warner Losh [Fri, 1 Apr 2022 04:14:56 +0000 (22:14 -0600)]
bsd-family-tree: Dragonfly 6.2.1 release

Sponsored by: Netflix
Approved by: re@ (delphij@)

(cherry picked from commit d2cc7bff4d8874937a97f8b74024cce6aaa9a750)
(cherry picked from commit 137ef89271baa49c4cc3040440569afb110e49e7)

2 years agobsd-family-tree: Add OpenBSD 7.0
Warner Losh [Fri, 1 Apr 2022 04:09:56 +0000 (22:09 -0600)]
bsd-family-tree: Add OpenBSD 7.0

Sponsored by: Netflix
Approved by: re@ (delphij@)

(cherry picked from commit 754cf44d99f624d9e7888f6e074ae39e2eb26d8f)
(cherry picked from commit b54988faf9c6facc5ca04b56c553ea797984c4e8)

2 years agobsd-family-tree: Add FreeBSD 12.3
Warner Losh [Fri, 1 Apr 2022 03:11:20 +0000 (21:11 -0600)]
bsd-family-tree: Add FreeBSD 12.3

FreeBSD 12.3 wasn't added when it was released. Add it now.

Sponsored by: Netflix
Approved by: re@ (delphij@)

(cherry picked from commit 58e6bbc5acb2d8c623cfbec37bfdda8b03d15a1f)
(cherry picked from commit af0b54d42aab4085966ce17259650105ca075979)

2 years agobsd-family-tree: Add 2.8BSD relationship to Research 7th edition
Warner Losh [Fri, 25 Jun 2021 17:03:17 +0000 (11:03 -0600)]
bsd-family-tree: Add 2.8BSD relationship to Research 7th edition

In the 2BSD line, the 2.8BSD tapes were the first ones to include a
kernel, both source and a bootable tape. This was an AT&T V7 kernel,
with a number of bug fixes; new features in use at Berkeley; performance
enhancements that were circulating to V7 in the licensee community; and
build system changes. Based on the TUHS archives, it contains none of
the V32 changes, however.

In addition to the source code analysis, Mike Karels relates the story
of how his group lost a customizes to V6 on a PDP-11/40 due to a disk
crash. Since V7 just came out and Bill Jolitz had just brought that up
elsewhere, they replaced their customized V6 with a V7 system, and that
base would eventually become 2.8BSD. (Quarter Century of Unix)

Given both lines of evidence, add a direct line from V7 Unix to 2.8BSD.

Also confirmed that the V6 line to 1BSD and 2BSD was appropriate. 1BSD
and 2BSD included ashell(1) and ex(1). ashell(1) was derived from v6
hell. ex(1) was an enhanced v6 ed.  2.8BSD included process control and
user-land utilities from 4.1BSD

Discussed with: Clem Cole, Diomidis Spinellis (dds)
Differential Revision: https://reviews.freebsd.org/D30883
Approved by: re@ (delphij@)

(cherry picked from commit 520a2401a65f94a2a6766d3a253baa2a1af0e54b)
(cherry picked from commit b811e00246df3dc22035d2d12c2bc440588140a0)

Sponsored by: Netflix

2 years agobsd-family-tree: add DragonFly 6.0.0
Warner Losh [Thu, 24 Jun 2021 16:42:36 +0000 (10:42 -0600)]
bsd-family-tree: add DragonFly 6.0.0

Tagged on May 8, 2021.

Sponsored by: Netflix
Approved by: re@ (delphij@)

(cherry picked from commit 779b70a2264fa187beb232dad2f018d41c31e34a)
(cherry picked from commit 79afe5598283eaf34cd3dcac5e78e64738d5f592)

2 years agobsd-family-tree: Add NetBSD 9.2
Warner Losh [Wed, 19 May 2021 21:29:11 +0000 (15:29 -0600)]
bsd-family-tree: Add NetBSD 9.2

NetBSD 9.2 was released on May 12, 2021

Submitted by: Martin Husemann
Sponsored by: Netflix
Approved by: re@ (delphij@)

(cherry picked from commit 71a071be1c5ae971421a830d76ee30186ffdd199)
(cherry picked from commit 127f5e8969b12e8f96921d26f08b0f060cf9a254)

2 years agoReleases history update
Maxim Konovalov [Fri, 7 May 2021 19:50:10 +0000 (19:50 +0000)]
Releases history update

Add DragonFly 5.8.1, OpenBSD 6.7, FreeBSD 11.4, DragonFly 5.8.2,
DragonFly 5.8.3, OpenBSD 6.8, NetBSD 9.1, FreeBSD 13.0, OpenBSD 6.9.

Approved by: re@ (delphij@)

(cherry picked from commit f0c914baacc7f0eefe9ff47ed04aeb500b7bdcd5)
(cherry picked from commit 04324346c979f187ef0ecd7c70c0f7cc65b30e2d)

2 years agolibc: Restore fp state upon flush error in fputc
Mark Johnston [Fri, 25 Mar 2022 14:46:24 +0000 (10:46 -0400)]
libc: Restore fp state upon flush error in fputc

This is akin to commit bafaa70b6f9098d83d074968c8e6747ecec1e118.

Approved by: re (gjb)
Reported by: Guy Yur <guyyur@gmail.com>
Fixes: 86a16ada1ea6
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6e13794fbe6e82c21365d0fd66769bf8b19c0197)
(cherry picked from commit 7be0c792c46c5a1faf46b611058953aa85b192d6)

2 years ago13.1: update to RC1
Glen Barber [Thu, 31 Mar 2022 00:17:39 +0000 (20:17 -0400)]
13.1: update to RC1

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

2 years agoarm64: Add explicit barrier after address translation instruction
D Scott Phillips [Fri, 25 Mar 2022 16:04:47 +0000 (09:04 -0700)]
arm64: Add explicit barrier after address translation instruction

Following ARMARM sec D5.2.11, which says:

> Where an instruction results in an update to a System register,
> as is the case with the AT * address translation instructions,
> explicit synchronization must be performed before the result is
> guaranteed to be visible to subsequent direct reads of the
> PAR_EL1.

Approved by: re (gjb)
Reviewed By: andrew
MFC after: 3 weeks
Sponsored by: Ampere Computing
Differential Revision: https://reviews.freebsd.org/D34665

(cherry picked from commit 7be7bd67758520ea2f9784a81ad244e99a7632f0)
(cherry picked from commit 0e19a22dd145c3e508978500a3b78592c84db5d0)

2 years agoarm64: pmap: Mask VA operand in TLBI instructions
D Scott Phillips [Fri, 25 Mar 2022 16:04:11 +0000 (09:04 -0700)]
arm64: pmap: Mask VA operand in TLBI instructions

Bits 43:0 of the TLBI operand are bits 55:12 of the VA.  Leaving
bits 63:55 of the VA in bits 51:44 of the operand might wind up
setting the TTL field (47:44) and accidentally restricting which
translation levels are flushed in the TLB.

Approved by: re (gjb)
Reviewed By: andrew
MFC after: 3 days
Sponsored by: Ampere Computing
Differential Revision: https://reviews.freebsd.org/D34664

(cherry picked from commit a693a30038278b1ccd3e67b98d76e259ca1b405d)
(cherry picked from commit 2c013d142b146ed42d0fe6458ee8a394161ad370)

2 years agoFix arm64 TLB invalidation with non-4k pages
Andrew Turner [Thu, 10 Mar 2022 14:39:03 +0000 (14:39 +0000)]
Fix arm64 TLB invalidation with non-4k pages

When using 16k or 64k pages atop will shift the address by more than
the needed amount for a tlbi instruction. Replace this with a new macro
to shift the address by 12 and use PAGE_SIZE in the for loop to let the
code work with any page size.

Approved by: re (gjb)
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34516

(cherry picked from commit 813738fabaaea43503724b8371faf5bab73a3047)
(cherry picked from commit 89166c063a9a136ba3780bb069e03e6049c53fd5)

2 years agoFix kernel build without INET or INET6
Ed Maste [Thu, 30 Dec 2021 21:49:35 +0000 (16:49 -0500)]
Fix kernel build without INET or INET6

Reported by: Gary Jennejohn
Fixes: ff3a85d32411 ("[lltable] Add per-family lltable ...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 818952c638a72bd677345fd8ddd05c31b34a2aee)
(cherry picked from commit 85f3c0a1c3762f32dd133deea5951de205e2450b)

Reviewed by: brooks, melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33718

(cherry picked from commit a6668e31aa3cc855bfb37d6edc05122514592a47)
(cherry picked from commit 1c487a5d3daccb8489c710d8cfabaa83fde1ca58)

Approved by: re (gjb)

2 years agoLinuxKPI: 802.11: various updates for iwlwifi stability and upcoming rtw
Bjoern A. Zeeb [Tue, 22 Mar 2022 15:02:45 +0000 (15:02 +0000)]
LinuxKPI: 802.11: various updates for iwlwifi stability and upcoming rtw

Various updates to the internals of the LinuxKPI 802.11 implementation.
Most notably improving state machine handling for de-assoc/de-auth and
always creating a new station as net80211 does and mac80211 seems to
do.  This avoids firmware crashes for iwlwifi and often panics and
lead to more stability.
Some other secondary changes are in order to support upcoming drivers
so that we could possibly provide them out-of-tree for 13.1.

- implement ieee80211_beacon_loss()

Sponsored by: The FreeBSD Foundation

(cherry picked from commit bb81db90f7e00f56df9ea14132a54ee983e7177f)
(cherry picked from commit 24c2117bafdba3c6998ddd407d643e142c5deda5)

- factor out lkpi_lsta_alloc() from lkpi_ic_node_alloc()

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 4f61ef8b78b25761b1b859ce39213f92fcbb24ce)
(cherry picked from commit 34f8e38ea7a5fccdf7f5de2cdcfabbdf68825480)

- factor out dtim/tsf updates

Sponsored by: The FreeBSD Foundation

(cherry picked from commit fa8f007de913623c066bf8f09213f92ee8cbca3a)
(cherry picked from commit bc472e0a3ef06cb8eb309b00e7fbdae64a21626a)

- rework sta state machine compatibility

Sponsored by: The FreeBSD Foundation

(cherry picked from commit d9f59799fc3e7940c47aa674c25994e640eae45e)
(cherry picked from commit 67674c1cb11512f09873c6d8e463af31548ef87f)
(cherry picked from commit 471a438a007eff18df3d0bd9dd8849faa9f2d6ff)

- improve lkpi_80211_mo_sta_state() for non (*sta_state)

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 878fb1e5754cc5bfbec57bc24859b07936f82a41)
(cherry picked from commit eb580265974013be43fa17d37e22124174a7ef86)

- use cfg80211_chandef_create()

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 4a07abdeb8ce5271996d85f648832e3d7bc741a7)
(cherry picked from commit 4836b8ac0ed3a3b155a7fb5f2322221f48c81687)

- make lkpi_ic_set_channel() unconditional

Sponsored by: The FreeBSD Foundation

(cherry picked from commit b2cf3c2125bf6f34cb01296e7eda93f73bc4b715)
(cherry picked from commit beaed0d4b5d0f901f78fc196f4b86d426a589792)

- check IEEE80211_FEXT_SCAN_OFFLOAD on vap

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 768dd32a164b35fb2f66fc8a0250cee84c79471e)
(cherry picked from commit 39bc4b2949e2ac32ad211aa6f1859559e21c7eb2)

- remove special handling for (*ic_scan_curchan)

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 321735f451d1eaa710a768d9e35ff87acb089d35)
(cherry picked from commit 5f88604cf7d9df1edbc662c4278e01476534f3ef)

- improve hw_scan fallback to sw_scan

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 196cfd0b2eb640a63d007a7e9c3a74e4256255f3)
(cherry picked from commit a1272e7d9621f95ca53f1bdef5ed78be12cac277)

- 802.11: cleanup debugging

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 9d9ba2b79b3196935431879efd9094eb9bfedd95)
(cherry picked from commit e269958566ff0df8d479996507636ed14ff6078a)

Approved by: re (gjb)

2 years agoLinuxKPI: skbuff: fix skb_queue_splice_init()
Bjoern A. Zeeb [Wed, 23 Mar 2022 17:05:43 +0000 (17:05 +0000)]
LinuxKPI: skbuff: fix skb_queue_splice_init()

In skb_queue_splice_init() we set a next value and then used that new
value to further update the remaining linking rather than the original
value.  Introduce another temporary variable 'n' to hold the original
value and use that.
While here rename q and h to from and to as otherwise it was too
confusing to read.

Also initialize skb->prev and skb->next to point to skb itself if
for nothing else at least to aid debugging.

Approved by: re (gjb)
Reported by: phk (panic in iwl_txq_reclaim)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6a8973c3324c0c6c270ae4ad371e50c0ec5761da)
(cherry picked from commit 32d1d7fee61328e65ae944836d1027335ccb979c)

2 years agoLinuxKPI: allow bsddriver name to be set for PCI
Bjoern A. Zeeb [Thu, 24 Mar 2022 01:45:36 +0000 (01:45 +0000)]
LinuxKPI: allow bsddriver name to be set for PCI

Allow a driver to overwrite the bsddriver name (we use for pci and
for wlan parent devices).  This allows us to to set
.bsddriver.name in struct pci_driver passed to module_pci_driver()
and with that set the BSD driver name while retaining the Linux .name
one.

This is helpful for divers which have different parts depending on
chipset and with that would change driver names which is highly
confusing especially for configuration.   One example is an upcoming
rtw88 driver which would be rtw_8822be or rtw_8822ce depending on
chipset.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste, hselasky
Differential Revision: https://reviews.freebsd.org/D34653

(cherry picked from commit 81d058df6d255b7f551564f6d29a03692b51fe5a)
(cherry picked from commit 00450eeab2465d6dc800680158b2cc67c1a7d9fc)

2 years agoLinuxKPI: pci: implement pci_upstream_bridge()
Bjoern A. Zeeb [Wed, 16 Feb 2022 18:04:08 +0000 (18:04 +0000)]
LinuxKPI: pci: implement pci_upstream_bridge()

Allow drivers to query the "upstream PCI bridge".
Currently we point back to ourselves on pdev->bus->self rather than
to the parent PCI bridge.
We keep this as status-quo with an extra comment and only on-demand
allocate a pci_dev for the parent bridge if we are asked for in
pci_upstream_bridge().
When releasing the pci_dev we check if pdev->bus->self has changed
and call pci_dev_put() to release the reference count on the parent
bridge as well.

This code moves pci_is_root_bus() higher up in pci.h but no functional
change there.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky, (jhb some earlier)
Thanks to: wulf for handling drm-kmod
Differential Revision: https://reviews.freebsd.org/D34305

(cherry picked from commit b3b836251f9fefa817d158784189f6d336917f7a)
(cherry picked from commit 50136233846e59eeb53c95498fdd4f3e1acf0a16)

2 years agoiwlwifi: update man pages
Bjoern A. Zeeb [Fri, 4 Mar 2022 00:27:00 +0000 (00:27 +0000)]
iwlwifi: update man pages

Update man pages given auto-loading is now enabled by default and
no user configuration is needed to load the driver.
Also note that the iwlwifi driver will appear the first time in 13.1-R.

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

(cherry picked from commit abf6e1a49e944f9fb635a6aed55f01af832da06c)
(cherry picked from commit 8ed3b807ca45da1e3dfbe38f92e60a5ddf2c571c)

2 years agoLinuxKPI: pci.h MODULE_DEVICE_TABLE to MODULE_PNP_INFO
Bjoern A. Zeeb [Fri, 4 Mar 2022 00:06:34 +0000 (00:06 +0000)]
LinuxKPI: pci.h MODULE_DEVICE_TABLE to MODULE_PNP_INFO

Implement MODULE_PNP_INFO() support in LinuxKPI for the Linux
MODULE_DEVICE_TABLE.

This will allow us to auto-load LinuxKPI PCI drivers (drm-kmod do
not currently as they attach to vgapci0 which in turn grabs the PCI
to my understanding) and make any loading from loader or kld_list in
rc.conf unnecessary; see devmatch(8) for more information.

We need to ensure there is a DRIVER_MODULE() (or probably just
a DECLARE_MODULE but that makes not much difference) before the
MODULE_PNP_INFO (which we otherwise would not need).

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Reviewed by: imp, hselasky, manu
Differential Revision: https://reviews.freebsd.org/D26651

(cherry picked from commit 5493c6277a264e91ea4bdc7e2d4ee69fe4210918)
(cherry picked from commit a94b233d5d718258e2e57e114aab00714441a79f)

2 years agoiwlwifi: adjust the LinuxKPI pci return for now
Bjoern A. Zeeb [Thu, 3 Mar 2022 22:24:13 +0000 (22:24 +0000)]
iwlwifi: adjust the LinuxKPI pci return for now

Rather than having LinuxKPI return BUS_PROBE_DEFAULT, return
"one less" so that on conflict of IDs others would be preferred.

This means that iwm(4) will attach instead of iwlwifi(4) for the
chipsets iwm(4) supports and iwlwifi(4) only for the other--in iwm(4)
unsupported--chipsets.  This is done so that we can enable auto-loading
of drivers but for the upcoming 13.1-Release people with working iwm(4)
will not yet be affected by iwlwifi(4).

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

(cherry picked from commit 3d248a914d923b444f72fb27ba621c0ab2ef464e)
(cherry picked from commit fd2c8fe44cfae7ced0ae3d142038dc71e537dbd4)

2 years agoLinuxKPI: allow a driver to override the default pci probe result
Bjoern A. Zeeb [Fri, 18 Feb 2022 21:58:01 +0000 (21:58 +0000)]
LinuxKPI: allow a driver to override the default pci probe result

Add bsd_probe_return which a driver can set in their 'struct pci_driver'
definition to set a driver-sepcific LinuxKPI pci return value.
This is helpful in case of multiple drivers with overlapping IDs,
such as iwlwifi(4) and iwm(4).

Contrary to an earlier version we now assume 0 is not BUS_PROBE_SPECIFIC
(which no driver should really return these days) but the bss initialized
value (bsd_probe_return unset) and we will return BUS_PROBE_DEFAULT.

Approved by: re (gjb)
Suggested by: jhb
Reviewed by: jhb
Reviewed by: hselasky, imp (earlier versions)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33915

(cherry picked from commit b91dd79ba32122e6adb28073c534224bc78a7b58)
(cherry picked from commit 3166cea632449ce6c6dad699a812b9813a9531ef)

2 years agoLinuxKPI: remove duplicate include
Bjoern A. Zeeb [Fri, 4 Mar 2022 00:04:19 +0000 (00:04 +0000)]
LinuxKPI: remove duplicate include

Remove a duplicate bus.h include from pci.h.

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

(cherry picked from commit fbedd9d708d06e3cc064d9e6f053649c0cf30c9c)
(cherry picked from commit a8c3d6b71645b6b16715b3a07013779b296e7ca7)

2 years agonet80211: introduce (*iv_update_bss)()
Bjoern A. Zeeb [Tue, 22 Mar 2022 14:46:51 +0000 (14:46 +0000)]
net80211: introduce (*iv_update_bss)()

Introduce (*iv_update_bss)() with a default implementation to allow
drivers to overload/intercept the time when we swap iv_bss.

This helps firmware based drivers to synchronize state with firmware.
Otherwise, for some state changes, we begin with one ni (and in
LinuxKPI lsta) and try to finish with another ni (and a new lsta
in different state) and may no longer have access to the previous state.
This also saves us from constantly checking for ni changes complicating
code.

No functional changes intended.

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

(cherry picked from commit 91b4225aa1d81155668db6deed22084abf2ce23c)
(cherry picked from commit dd39ea27f356f660736d5eb45b0a5aece63698bb)

2 years agonet80211: improve one debug logging
Bjoern A. Zeeb [Tue, 22 Mar 2022 14:40:12 +0000 (14:40 +0000)]
net80211: improve one debug logging

When forcing DEUATH in ieee80211_sta_join1() log the current state
we are coming from as well.  Note this isn't always the state we
are expecting as iv_state was updated already, so contrary to the
comment we usually do not see RUN there.
Leave a comment earlier with regards to this as well.

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

(cherry picked from commit 453d1a90f8f46637404adc0278d6f3f068542733)
(cherry picked from commit f39c5ab3503cb963cc9f22b2bf82b5bc87a70e21)

2 years agobhyve: Do not remove guest physical addresses from IOMMU host domain
Bjoern A. Zeeb [Fri, 18 Mar 2022 20:39:06 +0000 (20:39 +0000)]
bhyve: Do not remove guest physical addresses from IOMMU host domain

This permits I/O devices on the host to directly access wired memory
dedicated to guests using passthru devices.  Note that wired memory
belonging to guests that do not use passthru devices has always been
accessible by I/O devices on the host.

bhyve maps guest physical addresses into the user address space of
the bhyve process by mmap'ing /dev/vmm/<vmname>.  Device models pass
pointers derived from this mapping directly to system calls such as
preadv() to minimize copies when emulating DMA.  If the backing store
for a device model is a raw host device (e.g. when exporting a raw disk
device such as /dev/ada<n> as a drive in the guest), the host device
driver (e.g. ahci for /dev/ada<n>) can itself use DMA on the host
directly to the guest's memory.  However, if the guest's memory is
not present in the host IOMMU domain, these DMA requests by the host
device will fail without raising an error visible to the host device
driver or to the guest resulting in non-working I/O in the guest.

It is unclear why guest addresses were removed from the IOMMU host domain
initially, especially only for VM's with a passthru device as the
host IOMMU domain does not affect the permissions of passthru devices,
only devices on the host.

A considered alternative was using bounce buffers instead (D34535
is a proof of concept), but that adds additional overhead for unclear
benefit.

This solves a long-standing problem when using passthru devices and
physical disks in the same VM.

Approved by: re (gjb)
Thanks to: grehan (patience and help)
Thanks to: jhb (for improving the commit message)
PR: 260178, 215740
Reviewed by: grehan, jhb
Differential Revision: https://reviews.freebsd.org/D34607

(cherry picked from commit 246c398145674e4a9337fd933a6e6da7f160118e)
(cherry picked from commit dd113f67dfb5bdaf5d8b3a87bb19924ad447494c)

2 years agoClear non-x86 compat stat syscall kernel stack memory disclosure
Ed Maste [Tue, 29 Mar 2022 17:55:21 +0000 (13:55 -0400)]
Clear non-x86 compat stat syscall kernel stack memory disclosure

32-bit architectures other than i386 have 64-bit time_t which results
in a struct timespec with 12 bytes for tv_sec and tv_nsec, and 4 bytes
of padding.  Zero the padding holes in struct stat32 and struct
freebsd11_stat32.

i386 has 32-bit time_t; struct timespec is 8 bytes and has no padding.

Found by inspection, prompted by a report by Reno Robert of Trend Micro
Zero Day Initiative.  The originally reported issue (ZDI-CAN-14538) is
already fixed in all supported FreeBSD versions (it was addressed
incidentally as part of the 64-bit inode project).

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34709

(cherry picked from commit f90cd1ae30b5f49e9f6ea58a0628ce1c8d8822bc)
(cherry picked from commit ccd701d27a747ea7266f434170169072e8686f30)

Approved by: re (gjb)

2 years agodevd: Add rtw to wireless list
Warner Losh [Mon, 28 Mar 2022 14:16:14 +0000 (08:16 -0600)]
devd: Add rtw to wireless list

rtw88 and rtw89 are coming soon, so add them here now

Approved by: re@ (gjb)
Sponsored by: Netflix
MFC After: 1 day

(cherry picked from commit dea368bc5e7905e7456b052c545dcfd935341083)
(cherry picked from commit cba6eb5d31e825cbf6e8694b5a934db75d380fc4)

2 years agodevd: correct wifi regexp
Warner Losh [Sun, 9 Jan 2022 17:16:31 +0000 (10:16 -0700)]
devd: correct wifi regexp

Correct the wifi regexp to include iwlwifi and remove wi driver that was
has been retired.

Approved by: re@ (gjb)
Sponsored by: Netflix

(cherry picked from commit e0ab0ff104cb0e817d47a1a2a235f915ec1a31f4)
(cherry picked from commit eeec49e0b30a3faf2985e27f163a4c2f7b511e7c)

2 years agodevd: remove the scsi regexp
Warner Losh [Sun, 9 Jan 2022 17:13:58 +0000 (10:13 -0700)]
devd: remove the scsi regexp

We don't really use the scsi regexp for anything. The rescan was a
workaround that was fixed a long time ago and has been disabled for
ages. And the regexp was incomplete.

Approved by: re@ (gjb)
Sponsored by: Netflix

(cherry picked from commit 926e825ef823f49e371f61780634475a1f19c812)
(cherry picked from commit cb95daaa91895a74a2f6d2db0d0773517a34ab99)

2 years agolibarchive: merge vendor bugfixes
Martin Matuska [Sat, 26 Mar 2022 10:04:36 +0000 (11:04 +0100)]
libarchive: merge vendor bugfixes

Bugfixes:
  IS #1672 and OSS-Fuzz #38766:
    (zip reader) fix possible out-of-bounds read in zipx_lzma_alone_init()
  PR #1676: (mtree reader) remove the unused variable "detected_bytes"
  PR #1674: (doc) fix use of At mdoc(7) macro in cpio.5

Approved by: re (gjb)

(cherry picked from commit 0c9c2eb394b4a5694bc5ea11b326f334c735c813)
(cherry picked from commit 60338b80693000ed0f9812b90ca54d35fd077cd0)

2 years agozfs: merge openzfs/zfs@52bad4f23 (zfs-2.1-release) into stable/13
Martin Matuska [Tue, 29 Mar 2022 10:41:53 +0000 (12:41 +0200)]
zfs: merge openzfs/zfs@52bad4f23 (zfs-2.1-release) into stable/13

OpenZFS release 2.1.4

Notable upstream pull request merges:
  #13219 FreeBSD: add missing replay check to an assert in zfs_xvattr_set
  #13220 module: freebsd: avoid a taking a destroyed lock in zfs_zevent bits
  #13221 Fix ACL checks for NFS kernel server

Obtained from: OpenZFS
OpenZFS tag: zfs-2.1.4
OpenZFS commit: 52bad4f23daaa5f827f802c8d05785a27b80275d
Relnotes: yes
Approved by: re (gjb)

(cherry picked from commit c088e4d539e4cc947896a3b156646b831d932539)

2 years agoamd64: bring back asm bcmp, shared with memcmp
Mateusz Guzik [Fri, 25 Mar 2022 15:04:04 +0000 (15:04 +0000)]
amd64: bring back asm bcmp, shared with memcmp

Turns out clang converts "memcmp(foo, bar, len) == 0" and similar to
bcmp calls.

Reviewed by: emaste (previous version), jhb (previous version)
Differential Revision: https://reviews.freebsd.org/D34673
Approved by: re (gjb)

(cherry picked from commit fbc002cb72d2d9bb435cce99630d5d7da9f59390)
(cherry picked from commit c5890784f6d315c501586b39cf8c0c80b609be5b)

2 years agoriscv: actually enable sanitizers
Piotr Kubaj [Sun, 13 Mar 2022 03:31:35 +0000 (04:31 +0100)]
riscv: actually enable sanitizers

1. Backport https://github.com/llvm/llvm-project/commit/b475ce39e8b1de3a70ea242473f136a567be46e3.
2. Enable libclang_rt for riscv.

Previous commit missed it.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D34543
Approved by: re (gjb)

(cherry picked from commit 3781e77995e9b81afcbf7b3dc84b33b864c48794)
(cherry picked from commit e58a146c5d24172b53f18b953b3d29ee25bdb90c)

2 years agoriscv: fix riscv64sf build
Piotr Kubaj [Thu, 24 Mar 2022 14:24:21 +0000 (15:24 +0100)]
riscv: fix riscv64sf build

The library needs to have sf suffix cut off.

Differential revision: https://reviews.freebsd.org/D34561
Reviewed by: dim
Approved by: re (gjb)

(cherry picked from commit 18f71c9b2779999a9492b42c325524651a1b6909)
(cherry picked from commit 78e68a3d10216db2b3a6ddb0d4591358987c033e)

2 years agou3g: Add support Quectel EM12-G modem.
Alexander V. Chernikov [Sat, 29 Jan 2022 09:53:38 +0000 (09:53 +0000)]
u3g: Add support Quectel EM12-G modem.

Submitted by: <tda.77793 at gmail.com>
PR: 260218
Approved by:    re(gjb)
MFC after: 2 weeks

(cherry picked from commit 217481a3332783d03366c4512b0b164764aa6c6e)
(cherry picked from commit 453b4f81939b5853b8ab493c0eeb4af7b1bbb3fc)

2 years agoifconfig: remove debug printf introduced in 779fd0534466
Alexander V. Chernikov [Sat, 29 Jan 2022 11:18:13 +0000 (11:18 +0000)]
ifconfig: remove debug printf introduced in 779fd0534466

Reported by: jhb
Approved by:    re(gjb)

(cherry picked from commit 656f5031c39108d2418454f12b52931c32514741)
(cherry picked from commit b5b97a95aa5ded84de9ce707ed5c6d0d5f73fe57)

2 years agoifconfig: improve vlan options parsing
Alexander V. Chernikov [Mon, 17 Jan 2022 09:30:26 +0000 (09:30 +0000)]
ifconfig: improve vlan options parsing

PR: 261136
Reported by: Daniel O'Connor
Approved by:    re(gjb)
MFC after: 2 weeks

(cherry picked from commit 779fd05344662aeec79c29470258bf657318eab3)
(cherry picked from commit 157bf2c9964a54124e05bb7c354d8e5ad784802a)

2 years agolinux: add sysctl to pass untranslated interface names
Alexander V. Chernikov [Sat, 8 Jan 2022 15:41:53 +0000 (15:41 +0000)]
linux: add sysctl to pass untranslated interface names

Reviewed by: kib
Approved by:    re(gjb)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33792

(cherry picked from commit 1f70a85b4cbc3ad19cec4a390e8754e54815be85)
(cherry picked from commit c7655e1f3671a9ce7d963cb577b4548173469053)

2 years agolinux: fix linux_recvmsg() MSG_PEEK flag handling
Alexander V. Chernikov [Sat, 8 Jan 2022 13:44:17 +0000 (13:44 +0000)]
linux: fix linux_recvmsg() MSG_PEEK flag handling

Reviewed by: kib
Approved by:    re(gjb)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33790

(cherry picked from commit 96c524d8b2c9abe3927abf948fbbd73a7cb42c4a)
(cherry picked from commit 0b6161db7eff92a37bc6d410ff9c9d5c3ac6f443)

2 years agorouting: Add unified level-based logging support for the routing subsystem.
Alexander V. Chernikov [Sun, 26 Dec 2021 18:42:12 +0000 (18:42 +0000)]
routing: Add unified level-based logging support for the routing subsystem.

Summary: MFC after: 2 weeks
Approved by:    re(gjb)
Differential Revision: https://reviews.freebsd.org/D33664

(cherry picked from commit 63f7f3921bdc468a9b564a530f63480cc82ebd7c)
(cherry picked from commit eb22b73358784341115c83b81eba5303789484b0)

2 years agonhops: split nh_family into nh_upper_family and nh_neigh_family.
Alexander V. Chernikov [Sun, 26 Dec 2021 18:07:37 +0000 (18:07 +0000)]
nhops: split nh_family into nh_upper_family and nh_neigh_family.

With IPv4 over IPv6 nexthops and IP->MPLS support, there is a need
 to distingush "upper" e.g. traffic family and "neighbor" e.g. LLE/gateway
 address family. Store them explicitly in the private part of the nexthop data.

While here, store nhop fibnum in nhop_prip datastructure to make it self-contained.

Approved by:    re(gjb)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33663

(cherry picked from commit 823a08d7403c475fea0ecbbfff021fa8db274879)
(cherry picked from commit 519bdbb448ddc176c856db14fa90d6c4ba720c8d)

2 years ago[lltable] Add per-family lltable getters.
Alexander V. Chernikov [Sun, 26 Dec 2021 12:39:26 +0000 (12:39 +0000)]
[lltable] Add per-family lltable getters.

Introduce a new function, lltable_get(), to retrieve lltable pointer
 for the specified interface and family.
Use it to avoid all-iftable list traversal when adding or deleting
 ARP/ND records.

Differential Revision: https://reviews.freebsd.org/D33660
Approved by:    re(gjb)
MFC after: 2 weeks

(cherry picked from commit ff3a85d32411cdd7894f932b1d3d7ce01ec7a648)
(cherry picked from commit ffcca53561ed0b3d4755dbd2ce1d9942ea4a468e)

2 years agonetstat: fix nhop prepend printing.
Alexander V. Chernikov [Sun, 26 Dec 2021 15:02:06 +0000 (15:02 +0000)]
netstat: fix nhop prepend printing.

If present, print nexthop L2 prepend data in hex.

Approved by:    re(gjb)
MFC after: 1 week

(cherry picked from commit 731bfa9f180388e4081b64afb94c357643600238)
(cherry picked from commit bea3efc01cb716e8e77d61af085795eb2d0c013c)

2 years agotcp: virtualise net.inet.tcp.msl sysctl.
Alexander V. Chernikov [Sat, 4 Dec 2021 22:02:44 +0000 (22:02 +0000)]
tcp: virtualise net.inet.tcp.msl sysctl.

VNET teardown waits 2*MSL (60 seconds by default) before expiring
 tcp PCBs. These PCBs holds references to nexthops, which, in turn,
 reference ifnets. This chain results in VNET interfaces being destroyed
 and moved to default VNET only after 60 seconds.
Allow tcp_msl to be set in jail by virtualising net.inet.tcp.msl sysctl,
 permitting more predictable VNET tests outcomes.

MFC after: 1 week
Reviewed by: glebius
Approved by: re(gjb)
Differential Revision: https://reviews.freebsd.org/D33270

(cherry picked from commit c2c8e360d8c0b8712158d334686d88f052aef819)
(cherry picked from commit 057793e63771816315cb54869c067b1c2b2bb4dc)

2 years agoMerge LLVM commit c03fdd340356 to fix lang/rust on powerpc
Piotr Kubaj [Thu, 24 Mar 2022 00:30:44 +0000 (01:30 +0100)]
Merge LLVM commit c03fdd340356 to fix lang/rust on powerpc

Without it building rust fails with:
ld: error: CallSiteSplitting.cpp:(function llvm::SmallVectorImpl<std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<std::__1::pair<llvm::ICmpInst*, unsigned int>, 2u> > >::operator=(llvm::SmallVectorImpl<std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<std::__1::pair<llvm::ICmpInst*, unsigned int>, 2u> > >&&): .text._ZN4llvm15SmallVectorImplINSt3__14pairIPNS_10BasicBlockENS_11SmallVectorINS2_IPNS_8ICmpInstEjEELj2EEEEEEaSEOSB_+0xB0): relocation R_PPC_PLTREL24 out of range: -33582208 is not in [-3355443233554431]

Reviewed by: dim
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D34652
MFC after: 3 days

(cherry picked from commit 9b597132aea7d75810ca90258022f81d07971444)
(cherry picked from commit 56a4f560d429188625de4075983ec380bf8f7057)

2 years agovfs: add missing bits to vdropl_impl
Mateusz Guzik [Sun, 27 Mar 2022 14:00:09 +0000 (14:00 +0000)]
vfs: add missing bits to vdropl_impl

This completes the patch which was originally meant to go in.

Spotted by: mhorne
Fixes: c35ec1efdcb2978b ("vfs: [1/2] fix stalls in vnode reclaim by not
requeieing from vnlru")
Approved by: re (implicit)

(cherry picked from commit 2533b5dc82701ac5e31d0f98dd15362397b2478e)

2 years agovfs: [2/2] fix stalls in vnode reclaim by only counting attempts
Mateusz Guzik [Mon, 7 Mar 2022 10:38:17 +0000 (11:38 +0100)]
vfs: [2/2] fix stalls in vnode reclaim by only counting attempts

... and ignoring if they succeded, which matches historical behavior.

Reported by: pho
Approved by:    re (gjb)

(cherry picked from commit 3a4c5dab9266fac93a5cb22c7cee3938466aedea)

2 years agovfs: [1/2] fix stalls in vnode reclaim by not requeieing from vnlru
Mateusz Guzik [Mon, 7 Mar 2022 10:33:59 +0000 (11:33 +0100)]
vfs: [1/2] fix stalls in vnode reclaim by not requeieing from vnlru

Reported by: pho
Approved by: re (gjb)

(cherry picked from commit c35ec1efdcb2978bc3b6a0098c2b412be8d33e39)

2 years agortsx: Call rtsx_init() on resume.
hlh-restart [Sat, 19 Mar 2022 16:37:24 +0000 (12:37 -0400)]
rtsx: Call rtsx_init() on resume.

Approved by: re (gjb)

(cherry picked from commit 1b1bab0078a7bbeb575942c4706a2abcd71d6022)
(cherry picked from commit 205fa5f0a5cba5f9dc2ce9ef6c18a867bcd20e71)

2 years agoAllow kern.ipc.maxsockets to be set to current value without error
Allan Jude [Thu, 4 Nov 2021 12:55:33 +0000 (12:55 +0000)]
Allow kern.ipc.maxsockets to be set to current value without error

Normally setting kern.ipc.maxsockets returns EINVAL if the new value
is not greater than the previous value. This can cause spurious
error messages when sysctl.conf is processed multiple times, or when
automation systems try to ensure the sysctl is set to the correct
value. If the value is unchanged, then just do nothing.

Approved by: re (gjb)
PR: 243532
Reviewed by: markj
Sponsored by: Modirum MDPay
Sponsored by: Klara Inc.

(cherry picked from commit c441592a0e1591591665cd037a8a5e9b54675f99)
(cherry picked from commit 4f69c575996e069bfee62af9db2faa3ffa65db71)

2 years agohdac: Handle interrupts racing with device suspend
Mark Johnston [Wed, 16 Mar 2022 16:09:17 +0000 (12:09 -0400)]
hdac: Handle interrupts racing with device suspend

- Avoid looping forever if a concurrent reset causes a read of the
  interrupt status register to return all ones.
- Lock the softc before reading the interrupt status, so as to avoid a
  similar infinite loop in hdac_one_intr().

This fixes suspend-to-S3 on some laptops.

Approved by: re (gjb)
PR: 261207
Reviewed by: mav, imp
Tested by: uqs
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 077564cfdb7285ff7d256424715e563cbac36f8b)
(cherry picked from commit 18a3bada308d89928f170f4098c85cd3f11db864)

2 years ago13.1: update to BETA3
Glen Barber [Thu, 24 Mar 2022 00:01:49 +0000 (20:01 -0400)]
13.1: update to BETA3

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

2 years agozfskeys: Support autoloading of keys stored on ZFS
Mateusz Piotrowski [Fri, 18 Mar 2022 12:35:16 +0000 (13:35 +0100)]
zfskeys: Support autoloading of keys stored on ZFS

The zfskeys service script starts before the zfs service script, so that
dataset decryption keys are available when `zfs mount -a` is run. One of
the potential edge cases of this design is that if a key is stored on
ZFS it won't be loaded until `zfs mount -a` is issued.

In order to address that let's try to load the additional keys and mount
related ZFS datasets after the zfs script finishes its standard mounting
procedure.

PR: 262468
Reported by: Graham Perrin <grahamperrin@gmail.com>
Reviewed by: allanjude
Approved by: re (delphij)
Approved by: allanjude (src)
Fixes: 33ff39796ffe Add zfskeys rc.d script for auto-loading encryption keys
Sponsored by: Modirum
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34601

(cherry picked from commit 97aeda2243568b386d792514996a06daec55eece)
(cherry picked from commit 2411090f69401998569f24144b08ffc050e3cebc)

2 years agoMake the arm64 get_pcpu a function again
Andrew Turner [Tue, 8 Mar 2022 11:38:51 +0000 (11:38 +0000)]
Make the arm64 get_pcpu a function again

We assume the pointer returned from get_pcpu will be consistent even
if the thread is moved to a new CPU. Fix this by partially reverting
63c858a04d565 to make get_pcpu a function again.

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

(cherry picked from commit ed306634266002a05c88c3a4cd036c99d4cd139a)
(cherry picked from commit 1169099f8fd981f2e085f451f0b4a62e18bfe507)

2 years agovt/vga: ignore ACPI_FADT_NO_VGA unless running virtualized
Roger Pau Monné [Thu, 24 Feb 2022 15:53:30 +0000 (16:53 +0100)]
vt/vga: ignore ACPI_FADT_NO_VGA unless running virtualized

There's too many broken hardware out there that wrongly has the
ACPI_FADT_NO_VGA bit set. Ignore it unless running as a virtualized
guest, as then the expectation would be that the hypervisor does
provide correct ACPI tables.

Reviewed by: emaste, 0mp, eugen
Sponsored by: Citrix Systems R&D
PR: 230172
Approved by: re (gjb)

(cherry picked from commit 0518832011caba1e9dcee054d7884797ed8a74c2)

2 years agoBump version.
Gordon Tetlow [Tue, 22 Mar 2022 16:26:07 +0000 (09:26 -0700)]
Bump version.

Approved by: re (implicit), so

2 years agocontrib/tzdata: import tzdata 2022a
Philip Paeps [Tue, 22 Mar 2022 15:54:06 +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: re (gjb)

(cherry picked from commit 8ea5af2b77f2b43c250cacb257f42c0a54d644c4)
(cherry picked from commit 5dbd160076c09b0a3c7b175b506a57bd8b71f22a)

2 years agoUpdate leap-seconds to leap-seconds.3676924800
Xin LI [Mon, 14 Mar 2022 06:37:56 +0000 (23:37 -0700)]
Update leap-seconds to leap-seconds.3676924800

Obtained from: ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
Approved by: re (gjb)
(cherry picked from commit 1d333074349abb736ffdca9e6baf6c71aef4553b)
(cherry picked from commit 08038f3cbf197cc90b0ba89bb0e4d0e9cc287366)

2 years ago13.1: Enable REPRODUCIBLE_BUILD by default
Glen Barber [Mon, 21 Mar 2022 13:50:10 +0000 (09:50 -0400)]
13.1: Enable REPRODUCIBLE_BUILD by default

This was missed when branching releng/13.1.

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

2 years agoif_epair: build fix
Kristof Provost [Thu, 17 Mar 2022 02:35:13 +0000 (03:35 +0100)]
if_epair: build fix

66acf7685b failed to build on riscv (and mips). This is because the
atomic_testandset_int() (and friends) functions do not exist there.
Happily those platforms do have the long variant, so switch to that.

PR: 262571
MFC after: 3 days
Approved by:    re (gjb)

(cherry picked from commit 0bf7acd6b7047537a38e2de391a461e4e8956630)

2 years agovirtio_random(8): MFC: avoid deadlock at shutdown time (regression fix)
Eugene Grosbein [Wed, 16 Mar 2022 04:41:51 +0000 (11:41 +0700)]
virtio_random(8): MFC: avoid deadlock at shutdown time (regression fix)

FreeBSD 13+ running as virtual guest may load virtio_random(8) driver
by means of devd(8) unless the driver is blacklisted or disabled
via device.hints(5). Currently, the driver may prevent
the system from rebooting or shutting down correctly.

This change deactivates virtio_random at very late stage
during system shutdown sequence to avoid deadlock
that results in kernel hang.

PR: 253175
Tested by: tom
Relnotes: yes
Approved by: re (gjb)

(cherry picked from commit adbf7727b3a2aad3c2faa6e543ee7fa7a6c9a3d5)
(cherry picked from commit 4a11315a2c3fc55333772f48aaef32ae1eb11ceb)

2 years agoWITHOUT_BOOT build option appears to include stand, failing on libsa
Toomas Soome [Thu, 17 Mar 2022 17:42:05 +0000 (19:42 +0200)]
WITHOUT_BOOT build option appears to include stand, failing on libsa

building libsa needs to use -I${LDRSRC} for some files.

PR: 260083
Submitted by: Ivan Rozhuk
Approved by: re (gjb, early MFC)

(cherry picked from commit 9633c3d87476f72375f13942b55a4c9a7a00c7d8)

2 years agoOpenSSL: Merge OpenSSL 1.1.1n
Jung-uk Kim [Tue, 15 Mar 2022 23:35:22 +0000 (19:35 -0400)]
OpenSSL: Merge OpenSSL 1.1.1n

Approved by: re (delphij)

(cherry picked from commit 5ac766ab8ec23e780f108b7903d46e553d5e39d1)
(cherry picked from commit 97fe61d5bfdee2adc4d6ffb9b65a0cfb5bc5d317)

2 years agoBuild compiler-rt against libunwind, not libcxxrt
Dimitry Andric [Wed, 9 Mar 2022 21:23:35 +0000 (22:23 +0100)]
Build compiler-rt against libunwind, not libcxxrt

Parts of compiler-rt are also built for libgcc_eh and libgcc_s, and
these were already pointing to the libunwind unwind.h. For the sake of
consistency, also build compiler-rt itself against the libunwind
unwind.h, not the libcxxrt one.

Approved by: re (gjb)
MFC after: 3 days

(cherry picked from commit 7ecd99fa424df001028c5cddc52d25b29232f1af)
(cherry picked from commit 4c622a8f051d8dd9fab0719b00a6eccdbd13ac62)

2 years agoRemove compat hacks from libcxxrt's _Unwind_Exception
Dimitry Andric [Tue, 8 Mar 2022 21:53:16 +0000 (22:53 +0100)]
Remove compat hacks from libcxxrt's _Unwind_Exception

This reverts 9097e3cbcac4, which was in itself a revert of upstream
libcxxrt commits 88bdf6b290da ("Specify double-word alignment for ARM
unwind") and b96169641f79 ("Updated Itanium unwind"), and a
reapplication of our commit 3c4fd2463bb2 ("libcxxrt: add padding in
__cxa_allocate_* to fix alignment").

The editors/libreoffice port will be patched to be able to cope with the
standards-compliant alignment of _Unwind_Exception and consequently,
that of __cxa_exception. The layouts and sizes of these structures
should then be completely the same for libcxxrt, libunwind and
libc++abi.

PR: 262008
Reviewed by: emaste, jhb, theraven
Approved by: re (gjb)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34488

(cherry picked from commit 72df847a94bccee245a3316e4f848482b9ac2ac2)
(cherry picked from commit 93779214f1c64c0713f7c900021e35d4e4e49697)

2 years agoLinuxKPI: Add comment describing proper use of the on_each_cpu() function.
Hans Petter Selasky [Wed, 16 Mar 2022 14:40:09 +0000 (15:40 +0100)]
LinuxKPI: Add comment describing proper use of the on_each_cpu() function.

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit c6cf874c7de3bcc092a58a932c732221b2933043)
(cherry picked from commit d17c5a4f62157c665ecc187e676d52c07e841923)

2 years agolindebugfs: Make single_release() NULL safe.
Hans Petter Selasky [Fri, 11 Mar 2022 16:39:44 +0000 (17:39 +0100)]
lindebugfs: Make single_release() NULL safe.

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit a23e475c48da7a3751ffdc689be01d514ea2857c)
(cherry picked from commit d67b2c96153fcef344648d907893b50e30817a38)

2 years agolindebugfs: The Linux file operations use negative return values in the kernel.
Hans Petter Selasky [Fri, 11 Mar 2022 16:37:46 +0000 (17:37 +0100)]
lindebugfs: The Linux file operations use negative return values in the kernel.

Fix sign.

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit 68ec2949ad3411aa8a684dfca2cae90cbe202675)
(cherry picked from commit a16772a8111095a0358be9c046d321988f2696c2)

2 years agolindebugfs: Zero the linux_file structure before use.
Hans Petter Selasky [Fri, 11 Mar 2022 16:29:54 +0000 (17:29 +0100)]
lindebugfs: Zero the linux_file structure before use.

This avoids clients using garbage values on the stack and makes
debugging easier.

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit 88a29d89ebab1ed60607c3dab73143c3b59a0f83)
(cherry picked from commit b5cc52c21d7d34eae93c996cee09e7d2896afa6e)