Commit Graph

283401 Commits

Author SHA1 Message Date
Alexander V. Chernikov
6a09a7f1e9 netlink: always zero provided header buffers.
Reported by:	KMSAN
MFC after:	3 days
2023-05-01 14:09:47 +00:00
Hans Petter Selasky
a554ff4670 libmlx5: Add more ConnectX-6/7/8 HCA IDs to hca_table.
To allow userspace utilities to use these devices.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2023-05-01 13:48:20 +02:00
Mina Galić
d502d3fc72 opensm: Fix build with -Werror and -Wdate-time.
This fixes builds WITH_OFED_EXTRA=YES .

PR:		270776
Pull Request:	https://github.com/freebsd/freebsd-src/pull/715
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2023-05-01 13:46:24 +02:00
Peter Holm
b274854dd9 stress2: Added a temporary fix for the UFS+SU "out of inodes" issue 2023-05-01 12:52:42 +02:00
Xin LI
159d764c16 Vendor import of less v632. 2023-05-01 01:22:19 -07:00
Emmanuel Vadot
d198b8774d fwget: Introduce new utility
This script's goal is to check the system for peripherals that needs
firmware and install the needed packages for them.
For now it only support pci subsystem and only video classes for AMD
and Intel GPUs.

Reviewed by:	bapt
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39825
2023-05-01 08:32:59 +02:00
Emmanuel Vadot
ea9075959b armv7: release: Stop installing BBB u-boot
BBB code was removed from GENERIC kernel as it's not functional.
Stop installing u-boot for a platform that we don't boot on.

Reviewed by:	imp, gjb
Approved by:	re@ (gjb)
MFC after:	never
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39844
2023-05-01 08:32:21 +02:00
Emmanuel Vadot
3416e102c4 arm: Remove TI code from GENERIC
TI support is in a sad state for years.
We haven't been able to keep up with all the breaking changes that
upstream do in the DTS. This requires a lot of new drivers to handle the
new buses that they create and all the new clocks that they expose.
Keep the code for now in case somebody is interested in reviving this
platform but stop bloating GENERIC with code that don't work.

Reviewed by:	imp, mmel
MFC after:	never
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39843
2023-05-01 08:32:21 +02:00
Eugene Grosbein
4824d78872 listen(2): improve administrator control over logging
As documented in listen.2 manual page, the kernel emits a LOG_DEBUG
syslog message if a socket listen queue overflows. For some appliances,
it may be desirable to change the priority to some higher value
like LOG_INFO while keeping other debugging suppressed.

OTOH there are cases when such overflows are normal and expected.
Then it may be desirable to suppress overflow logging altogether,
so that dmesg buffer is not flooded over long run.

In addition to existing sysctl kern.ipc.sooverinterval,
introduce new sysctl kern.ipc.sooverprio that defaults to 7 (LOG_DEBUG)
to preserve current behavior. It may be changed to any value
in a range of 0..7 for corresponding priority or to -1 to suppress logging.
Document it in the listen.2 manual page.

MFC after:	1 month
2023-05-01 03:26:44 +07:00
Stefan Eßer
8c48f4c537 contrib/bc: import version 6.5.0
This release that fixes an infinite loop bug in the (non-standard)
extended math library functions root() and cbrt(), fixes a bug with
BC_LINE_LENGTH=0, and adds the fib() function to the extended math
library to calculate Fibonacci numbers.

(cherry picked from commit 438a1101dc1f687928cdbe02cd7817a88a24f42f)

MFC after:      3 days
2023-04-30 20:28:21 +02:00
Kristof Provost
6a23843a4a libifconfig: fix carp key configuration
There were two issues with the carp key configuration in the new netlink
code.

The first is that userspace failed to actually pass the CARP_NL_KEY
attribute to the kernel, so a key was never set.

The second issue is that snl_attr_get_string() returns a pointer to the
string inside the netlink message. It does not copy the string to the
target buffer. That's somewhat inconvenient to work with in libifconfig
where we have a static buffer for the key.
Introduce snl_attr_copy_string() which can copy a string to a target
buffer and uses the 'arg' parameter to pass the buffer size, so it
doesn't accidentally exceed the available space.

Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39874
2023-04-30 20:11:54 +02:00
Mateusz Guzik
a50ef47c0a newfs: fix up 32-bit compile
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-30 18:00:20 +00:00
Michael Tuexen
1f0e13449b sctp: improve handling of stale cookie error causes
* If a measure of staleness of 0 is reported, use the RTT instead.
* Ensure that we always send a cookie preservative parameter by
  rounding up during the calculation.
* If allowed, perform a round trip time measurement.
* Clear the overall error counter, since the error cause also
  acts like an ACK.

MFC after:	1 week
2023-04-30 11:39:32 +02:00
Kirk McKusick
2e7797cd9b Yet another try to fix printf format conflict.
I find it very annoying that there is no FreeBSD infrastructure to
determine failures across architectures other than to check in
changes and then have Jenkins find them.

Suggested by: Jessica Clarke
MFC after:    1 week
2023-04-30 00:00:23 -07:00
Poul-Henning Kamp
e0e5bf4d62 freebsd-update: Mention 13.2-RELEASE in usage. 2023-04-30 05:06:56 +00:00
Kirk McKusick
6995e6b323 Fix printf format conflict
MFC after:   1 week
2023-04-29 17:55:15 -07:00
Kirk McKusick
62dc21b107 Additional validity checking in newfs(8).
A check in the superblock validity code verifies that the computed
size of the filesystem cylinder groups (CGSIZE macro) does not
exceed the filesystem block size (fs_bsize).

A report was received that a filesystem had been flagged as failing
this check. We were unable to determine how the reported filesystem
could have been created. This commit adds a check at the end of the
newfs(8) command to verify that the the cylinder group size is valid.
If an oversize cylinder group is found newfs(8) prints a diagnostic
output and rebuilds the filesystem to make it compiliant.

MFC after:   1 week
2023-04-29 17:01:18 -07:00
Kirk McKusick
a2d1957bbc Updates to UFS/FFS superblock integrity checks when reading a superblock.
Check for an uninitialed (zero valued) fs_maxbsize and set it
to its minimum valid size (fs_bsize). Uninitialed fs_maxbsize
were left by older versions of makefs(8) and the superblock
integrity checks fail when they are found.

No legitimate superblocks should fail as a result of these changes.

MFC after:    1 week
Sponsored by: The FreeBSD Foundation
2023-04-29 17:01:18 -07:00
Kirk McKusick
04997e19e2 Additional output from dumpfs(8).
Provide an additional line of output for the superblock giving the
computed size of the cylinder group (CGSIZE macro) along with the
details needed to calculate it.

MFC after:   1 week
2023-04-29 17:01:18 -07:00
Kristof Provost
61b95bcb42 wg: change module name to if_wg
Other virtual interface drivers (e.g. if_gif, if_stf, if_ovpn) all start
with if_. The wireguard file is also named if_wg, but the module name
was 'wg'.

Fix this inconsistency.

Reported by:	Christian McDonald <cmcdonald@netgate.com>
Reviewed by:	zlei, kevans
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39853
2023-04-29 18:30:24 +02:00
Vladimir Druzenko
41788453b0 Reported by: vvd
Approved by: tcberner (mentor)
Differential Revision: https://reviews.freebsd.org/D39859

Add records about new ports committer (vvd).
Update Mentor and Mentee Information to follow step 5 of the Committers
Guide.
2023-04-29 15:38:54 +03:00
Ceri Davies
fef74e99fc setfacl.1: correct reference to a trailing comma, should read "colon"
PR:		271063
Reported by:	rdd@rdd.nu
2023-04-29 12:22:52 +01:00
Alex Richardson
b347c22846 cross-build: Add common compatibility headers after OS-specific ones
The current order is rather counter-intuitive and it appears to work fine
if we swap the order.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/725
Reviewed by:	imp
2023-04-28 16:10:25 -07:00
Doug Ambrisko
6763332969 mrsas(4) switch from PTRIN define to include sys/abi_compat.h
Suggested by:	dchagin
2023-04-28 13:51:20 -07:00
Doug Ambrisko
e133103ab6 mrsas(4) fix build on targets that don't define PTRIN. 2023-04-28 13:15:43 -07:00
Konrad Sewiłło-Jopek
d43bf55fc5 armv7: Fix BeagleBone Black panic on system start
There is now assertion which requires all memory allocations of positive size.
Negative and zero-sized allocations lead to panic, so plug them off.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D39846
2023-04-28 22:03:57 +02:00
Olivier Certner
2544b8e00c vfs: Rename vfs_emptydir() to vn_dir_check_empty()
No functional change.  While here, adapt comments to style(9).

Reviewed by:    kib
MFC after:      1 week
2023-04-28 22:37:35 +03:00
Olivier Certner
c21d87a88c vfs: vn_dir_next_dirent(): Adapt comments to style(9)
No functional change.

Reviewed by:    kib
MFC after:	1 week
2023-04-28 22:37:35 +03:00
Ed Maste
e3b937fa9e src.conf.5: regen after 4f6a5e1d6c, NETLINK_SUPPORT default change
Sponsored by:	The FreeBSD Foundation
2023-04-28 14:15:07 -04:00
Ravi Pokala
15d69c840d jedec_dimm(4): Refactor offset adjustment and page0 reset
Offsets greater than 255 bytes reside on page1 of the SPD device.
Accessing them requires switching to page1, and adjusting the absolute
offset to be relative to the start of page1. After the access, the page
must be set back to page0. These operations are performed in several
places, so break them out into their own functions.

Also, replace a pair of default cases, which should be impossible due to
earlier checks, with __assert_unreachable().

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D39842
2023-04-28 10:53:55 -07:00
Ravi Pokala
de57e0ef5a jedec_dimm(4): Add manufacturing year and week.
DDR3 and DDR4 encode the week and year that the DIMM was manufactured,
as a pair of two-digit binary-coded decimal values. Read the values, and
report them as (uint8_t)s.

Reviewed by:	imp, jhb
MFC after:	1 week
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D39795
2023-04-28 10:53:55 -07:00
Doug Ambrisko
e315351fc7 Add the mfi(4) ioctl support to mrsas(4)
The hardware supported by mfi(4) and mrsas(4) use the same dcmd's.
mfiutil(8) in theory could run on controlled attached to mrsas(4).
It can't since mrsas(4) doesn't have support for the FreeBSD mfi(4)
ioctl.  Porting the ioctl from mfi(4) to mrsas(4) would be the first
step in making mrsasutil(8) which is an additional name for mfiutil(8)
but opens /dev/mrsasX instead of /dev/mfiX

PR:			https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265794
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D36342
Tested by:		Dan Mahoney <freebsd@gushi.org>
2023-04-28 10:14:30 -07:00
Alexander V. Chernikov
2711d4345e netlink: fix debug message on 32-bit archs 2023-04-28 15:47:11 +00:00
Alexander V. Chernikov
bc8dc48437 netlink: add forgotten opt_netlink header 2023-04-28 15:44:01 +00:00
Christos Margiolis
b999f2458c kinst: do not use DPCPU_ID_GET if we already have the trampoline
No functional change intended.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39870
2023-04-28 11:11:10 -04:00
Mark Johnston
6eca9db1e7 busdma: Update KMSAN shadow maps later in bounce_bus_dmamap_sync()
Otherwise POSTREAD syncs may re-invalidate the shadow of the data buffer
when copying from bounce pages, resulting in false-positive KMSAN
reports.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2023-04-28 10:59:01 -04:00
Dimitry Andric
56f2446575 Apply clang fix for assertion building emulators/rpcs3
Merge commit a5e1a93ea10f from llvm-project (by Mariya Podchishchaeva):

  [clang] Fix crash when handling nested immediate invocations

  Before this patch it was expected that if there was several immediate
  invocations they all belong to the same expression evaluation context.
  During parsing of non local variable initializer a new evaluation context is
  pushed, so code like this
  ```
  namespace scope {
  struct channel {
      consteval channel(const char* name) noexcept { }
  };
  consteval const char* make_channel_name(const char* name) { return name;}

  channel rsx_log(make_channel_name("rsx_log"));
  }
  ```
  produced a nested immediate invocation whose subexpressions are attached
  to different expression evaluation contexts. The constructor call
  belongs to TU context and `make_channel_name` call to context of
  variable initializer.

  This patch removes this assumption and adds tracking of previously
  failed immediate invocations, so it is possible when handling an
  immediate invocation th check that its subexpressions from possibly another
  evaluation context contains errors and not produce duplicate
  diagnostics.

  Fixes https://github.com/llvm/llvm-project/issues/58207

  Reviewed By: aaron.ballman, shafik

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

PR:		269489
MFC after:	3 days
2023-04-28 16:09:45 +02:00
Alexander V. Chernikov
dc81813497 netlink: properly zero all fields in the ndmsg header.
MFC after:	3 days
2023-04-28 14:04:47 +00:00
Alexander V. Chernikov
30d7e724db route: show originator PID in netlink monitor
Replacing rtsock with netlink also means providing similar tracing facilities,
rtsock provides `route -n monitor` interface, where each message can be traced
to the originating PID.
This diff closes the feature gap between rtsock and netlink in that regard.

Netlink works slightly differently from rtsock, as it is a generic message
"broker". It calls some kernel KPIs and returns the result to the caller.
Other Netlink consumers gets notified on the changed kernel state using the
relevant subsystem callbacks. Typically, it is close to impossible to pass
some data through these KPIs to enhance the notification.

This diff approaches the problem by using osd(9) to assign the relevant
socket pointer (`'nlp`) to the per-socket taskqueue execution thread.
This change allows to recover the pointer in the aforementioned notification
callbacks and extract some additional data.
Using `osd(9)` (and adding additional metadata) to the notification receiver
comes with some additional cost attached, so this interface needs to be
enabled explicitly by using a newly-created `NETLINK_MSG_INFO` `SOL_NETLINK`
socket option.

The actual medatadata (which includes the originator PID) is provided via
control messages. To enable extensibility, the control message data is
encoded in the standard netlink(TLV-based) fashion. The list of the
currently-provided properties can be found in `nlmsginfo_attrs`.
snl(3) is extended to enable decoding of netlink messages with metadata
(`snl_read_message_dbg()` stores the parsed structure in the provided buffer).

Differential Revision: https://reviews.freebsd.org/D39391
2023-04-28 13:54:54 +00:00
Alexander V. Chernikov
9e79038c50 netlink: fix netlink interface operations when netlink is loaded as a module.
This change completes 089104e0e0.

MFC after:	2 weeks
2023-04-28 13:35:58 +00:00
Alexander V. Chernikov
4f6a5e1d6c netlink: enable NETLINK_SUPPORT by default on all architectures.
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D39849
2023-04-28 12:37:09 +00:00
Kristof Provost
95bc3ba7fe libifconfig: fix incorrect carp output
If one interface has a carp address configured on it ifconfig would show
this information on all interfaces.

That's because the kernel does (as one would expect) not return any carp
data for interface without carp configuration. However, this wound up
not overwriting the data passed in by the caller, and leaving the (now
stale) information in pace. As a result the caller thought carp was
configured on the interface.

Zero out the input structure before making the call to the kernel, so
that we correctly return 0 if there is no carp configuration on the
queried interface.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-28 14:27:11 +02:00
Andrew Turner
020edaea2a Split out pmap_map_delete on arm64
This will be used when supporting some extensions, e.g. Branch Target
Identification (BTI).

Sponsored by:	Arm Ltd
2023-04-28 11:54:19 +01:00
Zhenlei Huang
bbfb244724 mrsas: Fix a typo in a source code comment
- s/feild/field/

MFC after:	3 days
2023-04-28 18:01:58 +08:00
Zhenlei Huang
5bcbdb0b2e mps: Fix a typo in a source code comment
- s/feild/field/

MFC after:	3 days
2023-04-28 18:01:58 +08:00
Ian Moffett
99cb088f1a ixgbe: Fix typos in source code comments
- s/feilds/fields/

Reviewed by:	zlei
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/707
2023-04-28 18:01:58 +08:00
Dmitry Chagin
166e2e5a9e linux(4): Uniformly dev_t arguments translation
The two main uses of dev_t are in struct stat and as a parameter of the
mknod system calls.
As of version 2.6.0 of the Linux kernel, dev_t is a 32-bit quantity
with 12 bits set asaid for the major number and 20 for the minor number.
The in-kernel dev_t encoded as MMMmmmmm, where M is a hex digit of the
major number and m is a hex digit of the minor number.
The user-space dev_t encoded as mmmM MMmm, where M and m is the major
and minor numbers accordingly. This is downward compatible with legacy
systems where dev_t is 16 bits wide, encoded as MMmm.
In glibc dev_t is a 64-bit quantity, with 32-bit major and minor numbers,
encoded as MMMM Mmmm mmmM MMmm. This is downward compatible with the Linux
kernel and with legacy systems where dev_t is 16 bits wide.
In the FreeBSD dev_t is a 64-bit quantity. The major and minor numbers
are encoded as MMMmmmMm, therefore conversion of the device numbers between
Linux user-space and FreeBSD kernel required.
2023-04-28 11:55:05 +03:00
Dmitry Chagin
994ed958ae linux(4): Add a dedicated fstat() implementation
In between kern_fstat() and translate_fd_major_minor(), another process
having the same filedesc could modify or close fd.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D39763
2023-04-28 11:55:04 +03:00
Dmitry Chagin
cb858340dc linux(4): Add a dedicated statat() implementation
Get rid of calling Linux stat translation hook and specific to Linux
handling of non-vnode dirfd from kern_statat(),

Reviewed by:		kib, mjg
Differential revision:	https://reviews.freebsd.org/D35474
2023-04-28 11:55:04 +03:00
Dmitry Chagin
80d8a4a003 linux(4): Make struct stat64 to match Linux actual one 2023-04-28 11:55:04 +03:00