Commit Graph
224801 Commits
Author SHA1 Message Date
Martin Matuska 5ed7eb0d97 libarchive: merge security fix from vendor branch
This commit fixes a couple of security vulnerabilities in the PAX writer:
1. Heap overflow in url_encode() in archive_write_set_format_pax.c
2. NULL dereference in archive_write_pax_header_xattrs()
3. Another NULL dereference in archive_write_pax_header_xattrs()
4. NULL dereference in archive_write_pax_header_xattr()

Security:	No known reference yet
Obtained from:	https://github.com/libarchive/libarchive/commit/1b4e0d0f9
MFC after:	3 days

(cherry picked from commit f10f65999f)
2023-09-11 09:05:29 +02:00
Mark Adler e59d10aff6 zlib: Fix a bug when getting a gzip header extra field with inflate().
If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided space is not
exceeded.

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

(cherry picked from commit dc3509f1aa)
(cherry picked from commit 2969066f73)
(cherry picked from commit 10cc2bf5f7)
2023-01-24 17:27:50 -05:00
Martin Matuska 9597624d82 libarchive: merge from vendor branch
Libarchive 3.6.2

Important bug fixes:
  rar5 reader: fix possible garbled output with bsdtar -O (#1745)
  mtree reader: support reading mtree files with tabs (#1783)
  various small fixes for issues found by CodeQL

(cherry picked from commit bd5e624a86)
2022-12-28 23:16:47 +01:00
Dag-Erling Smørgrav bc6e05e52d libarchive: Add missing MLINK.
Differential Revision: https://reviews.freebsd.org/D37398

(cherry picked from commit f1ad5e3931)
2022-12-28 23:16:37 +01:00
Martin Matuska 2bfc51f543 libarchive: import changes from upstream
Libarchive 3.6.1

Bug fixes:
  PR #1549: archive_digest: check return value of EVP_DigestInit()

(cherry picked from commit 7ec51a3e2b)
2022-12-28 23:16:10 +01:00
Martin Matuska c237fe8275 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()

(cherry picked from commit 9f690fcfdc)
2022-12-28 23:15:58 +01:00
Martin Matuska d9a2aa3818 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

(cherry picked from commit 0c9c2eb394)
2022-12-28 23:15:40 +01:00
Hans Petter Selasky 906f88a5d6 dhclient(8): Verify lease-, renewal- and rebinding-time option sizes.
Else out-of-bound reads and undefined behaviour may happen.
The current code only checked for the presence of the first of four bytes.
Make sure the fields in question have the minium size required.

No functional change intended.

Reviewed by:	rrs@
Sponsored by:	NVIDIA Networking

(cherry picked from commit 3492caf512)
2022-11-21 21:51:18 +01:00
Hans Petter Selasky bc92b6240d tcp: Correctly compute the retransmit length for all 64-bit platforms.
When the TCP sequence number subtracted is greater than 2**32 minus
the window size, or 2**31 minus the window size, the use of unsigned
long as an intermediate variable, may result in an incorrect retransmit
length computation on all 64-bit platforms.

While at it create a helper macro to facilitate the computation of
the difference between two TCP sequence numbers.

Differential Revision:	https://reviews.freebsd.org/D35388
Reviewed by:	rscheff
Sponsored by:	NVIDIA Networking

(cherry picked from commit 28173d49dc)
2022-06-06 22:09:38 +02:00
Stefan Eßer 9feba5ab90 fetch: MFC: make -S argument accept values > 2GB
Use strtoll() to parse the argument of the -S option.

FreeBSD has supported 64 bit file offsets for more than 25 years on
all architectures and off_t is a 64 bit integer type for that reason.

While strtol() returns a 64 bit value on 64 LP64 architectures, it
is limit to 32 bit on e.g. i386. The strtoll() function returns a 64
but result on all supported architectures and therefore supports the
possible file lengths and file offsets on 32 bit archtectures.

Reported by:	antoine

(cherry picked from commit 32066c96fa)
2022-06-07 02:10:43 +07:00
Hans Petter Selasky cacb5f3ea5 xhci(4): Always add and evaluate the slot context.
Because the maximum number of endpoint contexts is stored there.

Tested by:	ehaupt@
PR:		262882
Sponsored by:	NVIDIA Networking

(cherry picked from commit 09dd1adfa4)
2022-05-04 09:30:12 +02:00
Hans Petter Selasky a1ec8baee5 xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle.
Only drop BULK and INTERRUPT endpoints, to reset the data toggle,
because for other endpoint types this is not critical.

Tested by:	ehaupt@
PR:		262882
Sponsored by:	NVIDIA Networking

(cherry picked from commit e276d28150)
2022-05-04 09:30:07 +02:00
Hans Petter Selasky 683c36ae04 xhci(4): Ensure the so-called data toggle gets properly reset.
Use the drop and enable endpoint context commands to force a reset of
the data toggle for USB 2.0 and USB 3.0 after:
 - clear endpoint halt command (when the driver wishes).
 - set config command (when the kernel or user-space wants).
 - set alternate setting command (only affected endpoints).

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

Reported by:		Juniper and Gary Jennejohn
Sponsored by:		NVIDIA Networking

(cherry picked from commit cda31e7349)
2022-04-27 21:17:46 +02:00
Hans Petter Selasky b199e55ce6 No need to stop XHCI endpoints in disabled state.
Some AMD XHCI implementations apparently assert a permanent
internal failure if this happens.

Submitted by:	[email protected]
PR:		251503
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 1622a49852)
2022-04-27 21:17:40 +02:00
Bjoern A. Zeeb 9752bffbcf net80211: validate Mesh ID length in ieee80211_parse_beacon
Reported by:	m00nbsd working with Trend Micro Zero Day Initiative

(cherry picked from commit fb8c87b4f3)
(cherry picked from commit 72617f9246)
(cherry picked from commit e7c990ba3f)
2022-04-06 10:19:42 -04:00
Ed Maste b2bdfad93b 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 8276c4149b)
2022-04-06 10:19:28 -04:00
Mark Johnston 9b3cf23b7d bhyve: validate e82545 checksum offset field
Reported by:	Mehdi Talbi, Synacktiv

(cherry picked from commit b0aa20bec5)
(cherry picked from commit 53f7220947)
(cherry picked from commit 629df7c108)
2022-04-06 10:19:27 -04:00
Ed Maste 2a2ea0075d installworld: handle ldd including preloaded objects
The installworld target makes a temporary copy of binaries to be used
during the install.  Libraries that they depend on are also included,
found by using `ldd`.

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

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

(cherry picked from commit b3b462229f)
(cherry picked from commit 6550cae9b83aa12c2300727d9d4ec6cc816d664b)
2022-04-04 10:57:48 -04:00
Eugene Grosbein 7f4fcc62ed zlib: apply upstream fix for CVE-2018-25032
Fix memory corruption when deflating (i.e., when compressing)
if the input has many distant matches.

This is direct commit to stable/11 using unmodified upstream fix
https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531

Security:	CVE-2018-25032
2022-04-04 18:00:46 +07:00
Vincenzo Maffione 725c70d815 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 3937299165)
2022-03-30 22:08:32 +00:00
Ed Maste d3aef2d8fc Avoid kernel stack disclosure in compat32 stat
copy_stat and copy_ostat used by 32-bit compat *stat calls left spare
and padding bytes uninitialized.

This issue does not exist in stable/12 and later as it was incidentally
addressed as part of the 64-bit inode project.

Reported by:	Reno Robert of Trend Micro Zero Day Initiative
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34706
2022-03-29 16:18:07 -04:00
Eugene Grosbein 95dc524228 openssl: MFC: Fix a bug in BN_mod_sqrt() that can cause it to loop forever.
Obtained from:	OpenSSL Project
Security:	CVE-2022-0778
Security:	SA-22:03

(cherry picked from commit fdc418f15e)
2022-03-27 22:13:52 +07:00
Vincenzo Maffione 931c75bf01 netmap: add a tunable for the maximum number of VALE switches
The new dev.netmap.max_bridges sysctl tunable can be set in
loader.conf(5) to change the default maximum number of VALE
switches that can be created. Current defaults is 8.

MFC after:	2 weeks

(cherry picked from commit dd6ab49a9a)
2022-03-20 09:08:36 +00:00
Vincenzo Maffione 606f528dec 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 694ea59c70)
2022-03-20 09:01:58 +00:00
Martin Matuska 8342c11f27 libarchive: merge vendor bugfix
OSS-Fuzz #44843 (security):
RAR reader: fix null-dereference in RAR (v4) filter code

(cherry picked from commit 5ccf909af9)
2022-02-23 12:37:34 +01:00
Martin Matuska d3bf574860 libarchive: merge vendor bugfixes
Bugfixes:
OSS-Fuzz #44547: fix heap-use-after-free in RAR (v4) filter code
PR #1671: Fix 7z PPMD reading beyond boundary

(cherry picked from commit 47a2e541dc)
2022-02-23 12:37:21 +01:00
Martin Matuska 424886c189 libarchive: import changes from upstream
Libarchive 3.6.0

New features:
PR #1614: tar: new option "--no-read-sparse"
PR #1503: RAR reader: filter support
PR #1585: RAR5 reader: self-extracting archive support

New features (not used in FreeBSD base):
PR #1567: tar: threads support for zstd (#1567)
PR #1518: ZIP reader: zstd decompression support

Security Fixes:
PR #1491, #1492, #1493, CVE-2021-36976:
   fix invalid memory access and out of bounds read in RAR5 reader
PR #1566, #1618, CVE-2021-31566:
   extended fix for following symlinks when processing the fixup list

Other notable bugfixes and improvements:
PR #1620: tar: respect "--ignore-zeros" in c, r and u modes
PR #1625: reduced size of application binaries

(cherry picked from commit 833a452e9f)
2022-02-23 12:36:56 +01:00
Eugene Grosbein 2b18815e38 gpart(8): MFC: add minimal reference to glabel(8) to manual page
(cherry picked from commit ba94a95402)
2022-01-17 13:56:17 +07:00
Eugene Grosbein 9738f62cac MFC: rc.d/rctl: unbreak for distinct /usr filesystem
Both rctl and used xargs utility live in /usr/bin
so add REQUIRE: FILESYSTEMS

Reported by:    Peter <[email protected]>
2021-11-23 15:32:05 +07:00
Martin Matuska 50f03cd45e libarchive: cherry-pick bugfix from vendor
Vendor commit message (ede459d2e):
  archive_write_disk_posix: fix writing fflags broken in 8a1bd5c

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

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

Reported by:		markjdb
Libarchive commit:	ede459d2ebb879f5eedb6f7abea203be0b334230

(cherry picked from commit 201d0ebee3)
2021-11-21 00:16:35 +01:00
Hans Petter Selasky 6511b6ed28 snd_uaudio(4): Fix string index computations for iFeature.
This allows the iFeature strings to be properly read by the snd_uaudio(4) driver,
when parsing the audio feature unit descriptors.

Submitted by:	[email protected]
Sponsored by:	NVIDIA Networking

(cherry picked from commit 11f09b17fe)
2021-11-16 09:15:14 +01:00
Dimitry Andric ca7ffd26b3 Partially revert ac76bc1145 because it is no longer necessary
In ac76bc1145, I added a few volatiles to work around ctrig_test
failures with {inf,inf}. This is not necessary anymore now, since in
3b00222f15 we added -fp-exception-behavior=maytrap for clang >= 10 in
libm's Makefile. (The flag tells clang to use stricter floating point
semantics, which libm depends on.)

PR:		244732, 254911
Fixes:		ac76bc1145

(cherry picked from commit e2157cd000)
2021-11-08 22:14:41 +01:00
Philip Paeps 2517b11885 contrib/tzdata: correct DST in Palestine
Direct commit to stable/11.

Merge the corrected DST transition date from tzdata 2021e.  This
corrects future timestamps in Palestine.
2021-10-25 01:09:15 +00:00
Philip Paeps b7d19f92bf contrib/tzdata: correct DST in Fiji
Direct commit to stable/11.

Unfortunately, there is still no clear consensus on the tz mailing list
about some of the changes introduced by tzdata 2021b and later releases.
Pending consensus, only merge the recently announced DST transition date
for Fiji and corrections to commentary from tzdata 2021d.  This corrects
future timestamps in Fiji.
2021-10-21 05:38:31 +00:00
Marcin Wojtas e579f3af96 Upgrade ENA to v2.4.1
ena: Remove redundant declaration of ena_log_level.

GCC6 raises a -Wredundant-decl error due to duplicate declarations
in ena_fbsd_log.h and ena_plat.h.

Submitted by:   jhb
Sponsored by:	Chelsio Communications

(cherry picked from commit 8843787aa1)

ena: Avoid unnecessary mbuf collapses for LLQ condition

In case of Low-latency Queue, one small enough descriptor can be pushed
directly to the ENA hw, thus saving one fragment. Check for this
condition before performing collapse.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit c81f8c2611)

ena: Trigger reset on ena_com_prepare_tx failure

All ena_com_prepare_tx errors other than ENA_COM_NO_MEM are fatal and
require device reset.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 36130d2979)

ena: Prevent reset after device destruction

Check for ENA_FLAG_TRIGGER_RESET inside a locked context in order to
avoid potential race conditions with ena_destroy_device. This aligns the
reset task logic with the Linux driver.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 433ab9b698)

ena: Add extra log messages

Stay aligned with the Linux driver by adding the following logs:
* inform the user about retrying queue creation
* warn on non-empty ena_tx_buffer.mbuf prior to ena_tx_map_mbuf

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 77160654a1)

ena: Add locking assertions

ENA silently assumed that ena_up, ena_down and ena_start_xmit routines
should be called within locked context. Driver's logic heavily assumes
on concurrent access to those routines, so for safety and better
documentation about this assumption, the locking assertions were added
to the above functions.

The assertion was added only for the main steps (skipping the helper
functions) which can be called from multiple places including the kernel
and the driver itself.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit cb98c439d6)

ena: Move RSS logic into its own source files

Delegate RSS related functionality into separate .c/.h files in
preparation for the full RSS support.

While at it, reorder functions and remove prototypes for ones with
internal linkage.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 986e7b9227)

ena: Disable meta descriptor caching for netmap

If LLQ is being used, `ena_tx_ctx.meta_valid` must stay enabled. This
fixes netmap support on latest generation ENA HW and aligns it with the
core driver behavior.

As netmap doesn't support any csum offloads, the
`adapter->disable_meta_caching` value can be simply passed to the HW.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit a831466830)

ena: Share ena_global_lock between driver instances

In order to use `ena_global_lock` in sysctl context, it must be kept
outside the driver instance's software context, as sysctls can be called
before attach and after detach, leading to lock use before sx_init and
after sx_destroy otherwise.
Solve this issue by turning `ena_global_lock` into a file scope
variable, shared between all instances of the driver and associated
sysctl context, and in turn initialized/destroyed in dedicated
SYSINIT/SYSUNINIT functions.
As a side effect, this change also fixes existing race in the reset
routine, when simultaneously accessing sysctl exposed properties.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 07aff471c0)

ena: Add missing statistics

Provide the following sysctl statistics in order to stay aligned with
the Linux driver:
* rx_ring.csum_good
* tx_ring.unmask_interrupt_num

Also rename the 'bad_csum' statistic name to 'csum_bad' for alignment.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 223c8cb12e)

ena: Implement full RSS reconfiguration

Bind RX/TX queues and MSI-X vectors to matching CPUs based on the RSS
bucket entries.

Introduce sysctls for the following RSS functionality:
- rss.indir_table:      indirection table mapping
- rss.indir_table_size: indirection table size
- rss.key:              RSS hash key (if Toeplitz used)

Said sysctls are only available when compiled without `option RSS`, as
kernel-side RSS support currently doesn't offer RSS reconfiguration.

Migrate the hash algorithm from CRC32 to Toeplitz and change the initial
hash value to 0x0 in order to match the standard Toeplitz implementation.
Provide helpers for hash key inversion required for HW operations.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 6d1ef2abd3)

ena: fix building in-kernel driver

When building ENA as compiled into the kernel, the driver would fail to
build. Resolve the problem by introducing the following changes:
1. Add missing `ena_rss.c` entry in `sys/conf/files`.
2. Prevent SYSCTL_ADD_INT from throwing an assert due to an extra
CTLTYPE_INT flag.

Fixes: 986e7b9227 ("ena: Move RSS logic into its own source files")
Fixes: 6d1ef2abd3 ("ena: Implement full RSS reconfiguration")

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
MFC after: 1 week

(cherry picked from commit a3f0d18237)

ena: Update driver version to v2.4.1

Some of the changes in this release:
* Hardware RSS hash key reconfiguration and indirection table
reconfiguration support.
* Full kernel RSS support.
* Extra statistic counters.
* Netmap support for ENAv3.
* Locking assertions.
* Extra log messages.
* Reset handling fixes.

Submitted by: Michal Krawczyk <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 42c7760be3)
2021-10-12 16:47:32 +02:00
Marcin Wojtas 5b8f3948f1 Upgrade ENA to v2.4.0
teach ena driver about RSS kernel option

Networking is broken if the driver configures its (virtual) hardware to
use a hash algorithm (or a key) different from the one that the network
stack (software RSS) uses.  This can be seen with connections initiated
from the host.  The PCB will be placed into the hash table based on the
hash value calculated by the software.  The hardware-calculated hash
value in reponse packets will be different, so the PCB won't be found.

Tested with a kernel compiled with 'options RSS' on an instance with ena
driver.

Reviewed by:	mw, adrian
MFC after:	2 weeks
Sponsored by:	Panzura
Differential Revision: https://reviews.freebsd.org/D24733

(cherry picked from commit b40dd828bd)

ena: change ENA C++-style comment into C-style

According to man style(9), only C-style comments should be used.

Submitted by: Michal Krawczyk <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 438c9e3cf8)

ena: add support for the large LLQ headers in ENA

Default LLQ (Low-latency queue) maximum header size is 96 bytes and can
be too small for some types of packets - like IPv6 packets with multiple
extension. This can be fixed, by using large LLQ headers.

If the device supports larger LLQ headers, the user can activate this
feature by setting sysctl tunable 'hw.ena.force_large_llq_header' to '1'
in the /boot/loader.conf file.

In case the device isn't supporting this feature, the default value (96B)
will be used.

Submitted by: Michal Krawczyk <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit beaadec9ea)

ena: remove surplus NULL checks when freeing ENA resources

Calling free on a NULL pointer is valid, as appropriate check is already
done internally:

/* free(NULL, ...) does nothing */
if (addr == NULL)
    return;

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit ddec69e6a7)

ena: hide sysctl nodes for unused ENA queues

IO queue related attributes are registered statically at driver attach
with the rest of the ENA specific sysctl nodes. However, the number of
queues can be changed at runtime via the `ena_sysctl_io_queues_nb`
request, leading to a potential exposure of attributes for non-existing
queues.

Introduce a new `ena_sysctl_update_queue_node_nb` function, which
updates the sysctl nodes after the number of queues is altered.
This happens by either registering or unregistering node specific oids,
based on a delta between the previous and current queue count.

NOTE: All unregistered oids must be registered again before the driver
detach, e.g. by another call to this function.

Submitted by: Artur Rojek <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 0e7d31f63b)

Merge tag 'vendor/ena-com/2.4.0'

Update the driver in order not to break its compilation
and make use of the new ENA logging system

Migrate platform code to the new logging system provided by ena_com
layer.

Make ENA_INFO the new default log level.

Remove all explicit use of `device_printf`, all new logs requiring one
of the log macros to be used.

(cherry picked from commit 3fc5d816f8)

Update ENA driver man page

Bring the obsolete man page up to date:
* update diagnostic error messages
* add documentation of loader tunables
* document netmap support
* add a driver history section
* update the contact information

Submitted by: Artur Rojek <[email protected]>
Submitted by: Michal Krawczyk <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit e34856a2c4)

Update ENA version to v2.4.0

Some of the changes in this release:
* Large LLQ headers,
* Bug/stability fixes,
* Change of the README/Documentation.

Submitted by: Michal Krawczyk <[email protected]>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 93f0df457b)
2021-10-12 16:47:18 +02:00
Eugene Grosbein 37381a47e0 syslogd: undo regression after r326573
Restore ability for our syslogd to collect pre-RFC3164 formatted
messages from remote hosts that was broken with r326573.

Note that parsing of RFC5424 format not changed.

(cherry picked from commit 3b4cc56e52)
2021-10-07 10:12:51 +07:00
Cy Schubert 4f2d5aa364 ipfilter: Print the correct TCP sequence index number
TCP sequence numbers in the FTP proxy are maintained in a two dimensional
array. The debug message prints the same seq[N] for both. Fix that.

(cherry picked from commit df38343e71)
2021-10-01 09:12:51 -07:00
Cy Schubert 0b72f4c82a ipfilter: Correct a comment
Correct a comment's grammar and while at it clarify its meaining.

(cherry picked from commit aa6cfcc820)
2021-10-01 09:12:51 -07:00
Cy Schubert 370a229ea9 ipfilter: Avoid a null if-then-else blocks
When WITHOUT_INET6 is selected we generate a null if-then-else blocks
due to incorrect placment of #if statments. Move the #if statements
reducing unnecessary runtime comparisons WITHOUT_INET6.

(cherry picked from commit 73db3b64f1)
2021-10-01 09:12:51 -07:00
Philip Paeps 21e88c5373 contrib/tzdata: correct DST in Jordan and Samoa
Direct commit to stable/11.

The recent tzdata 2021b release includes several controversial changes
under active debate on the tz mailing list.  Pending consensus, and
hopefully a 2021c release reflecting it, only merge the DST changes for
Jordan and Samoa.  This corrects present and future timestamps in those
regions.
2021-09-29 12:47:24 +08:00
Xin LI 08d4089f57 Update leap-seconds to leap-seconds.3676924800.
Obtained from:	ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800.
MFC after:	3 days

(cherry picked from commit 7ba7bf48d5)
2021-09-24 22:40:45 -07:00
Ed Maste 1f9c81f259 readelf: document that -u / --unwind is not yet implemented
ELF tool chain readelf accepts -u / --unwind but just ignores the
option.  This was previously undocumented, which could be confusing for
someone encountering `readelf -u` (in a script or GNU readelf example).

Reported by:	markj (in D32003)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit deef4b8ce8)
2021-09-23 21:01:17 -04:00
Ed Maste 2173242244 readelf: include notes (-n) and unwind (-u) in --all/-a
This matches the GNU and LLVM versions of readelf.

As markj noted in the review -u is not actually implemented yet and has
no effect.  The option is accepted and just ignored.

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

(cherry picked from commit f161abf9f2)
2021-09-23 21:00:55 -04:00
Ed Maste 59a0ec5786 Update OptionalObsoleteFiles.inc with NTP docs
The list of files for MK_NTP was incomplete.

PR:		218193
Submitted by:	brnrd
MFC after:	1 week

(cherry picked from commit 4154e70ea8)
2021-09-22 19:11:09 -04:00
Joe Orton 159a0e32d5 apr: Merge r1889604, r1807975 from trunk:
* random/unix/sha2.c (apr__SHA256_Final, apr__SHA256_End): Fix parameter
  buffer lengths to match declaration, avoiding GCC 11 warning.
  (no functional change)

Bounds-check human-readable date fields (credit: Stefan Sperling)

Submitted by: jorton, niq
Reviewed by: jorton

git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1891198 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit fc1b69d031)
2021-09-13 10:51:58 -04:00
Martin Matuska 85cff46114 libarchive: import bugfix from upstream
Reworked bugfix for upstream issue #1566:
  Do not follow symlinks when processing the fixup list

(cherry picked from commit c577bdfce6)
2021-09-10 10:33:59 +02:00
Martin Matuska fd9825481d libarchive: import changes from upstream
Libarchive 3.5.2

New features:
  PR #1502: Support for PWB and v7 binary cpio formats
  PR #1509: Support of deflate algorithm in symbolic link decompression
            for ZIP archives

Important bugfixes:
  IS #1044: fix extraction of hardlinks to symlinks
  PR #1480: Fix truncation of size values during 7zip archive
            extraction on 32bit architectures
  PR #1504: fix rar header skiming
  PR #1514: ZIP excessive disk read - fix location of central directory
  PR #1520: fix double-free in CAB reader
  PR #1521: Fixed leak of rar before ending with error
  PR #1530: Handle short writes from archive_write_callback
  PR #1532: 7zip: Use compression settings from file also for file header
  IS #1566: do not follow symlinks when processing the fixup list

Relnotes:	yes

(cherry picked from commit ddce862ad8)
2021-09-10 10:33:04 +02:00
Kyle Evans c0674b7172 pxeboot: improve and simplify rx handling
This pushes the bulk of the rx servicing into a single loop that's only
slightly convoluted, and it addresses a problem with rx handling in the
process.  If we hit a tx interrupt while we're processing, we'd
previously drop the frame on the floor completely and ultimately
timeout, increasing boot time on particularly busy hosts as we keep
having to backoff and resend.

After this patch, we don't seem to hit timeouts at all on zoo anymore
though loading a 27M kernel is still relatively slow (~1m20s).

Sponsored By:	National Bureau of Economic Research
Sponsored by:	Klara, Inc.

(cherry picked from commit 3daa8e165c)
2021-09-04 02:45:19 -05:00
Kyle Evans de140815c9 caroot: cumulative cert update
This adds a note in all existing certs that they are explicitly trusted
for server auth, and also:

- Seven (7) added
- Nineteen (19) removed

(cherry picked from commit 446169e0b6)
(cherry picked from commit 3016c5c2bf)
(cherry picked from commit fac832b271)
(cherry picked from commit 76461921da)
2021-09-04 02:42:27 -05:00