1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-22 07:20:00 +00:00
Commit Graph

294479 Commits

Author SHA1 Message Date
Kristof Provost
ee9f418c80 pfctl: correctly print skip steps in -vv mode
- Changed order of address and ports.

Obtained from:	OpenBSD, mcbride <mcbride@openbsd.org>, 0bcfb1e086
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46926
2024-10-10 14:10:39 +02:00
Kristof Provost
8de7f8ed5e pf: reduce IPv6 header parsing code duplication
There were two loops in pf_setup_pdesc() and pf_normalize_ip6()
walking over the IPv6 header chain.  Merge them into one loop,
adjust some length checks and fix IPv6 jumbo option handling.  Also
allow strange but legal IPv6 packets with plen=0 passing through
pf.  IPv6 jumbo packets still get dropped.
testing dhill@; ok mcbride@ henning@

Obtained from:	OpenBSD, bluhm <bluhm@openbsd.org>, d68283bbf0
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46925
2024-10-10 14:10:39 +02:00
Mateusz Piotrowski
8751fbe36f rc.d/sendmail: Fix stopping service during shutdown
The sendmail service script needs to be stopped during shutdown
to ensure a clean shutdown of active SMTP connections (and writing
any in memory queue files).

rcorder(8) requires the rcorder block to be an uninterrupted sequence of
REQUIRE, PROVIDE, BEFORE, and KEYWORD lines. Having a comment in between
REQUIRE and KEYWORD makes rcorder stop parsing the block when it reaches
the comment.

Fix that by moving the comment out from the rcorder block.

Reviewed by:	bnovkov, christos, gshapiro, markj
Approved by:	bnovkov (mentor), christos (mentor), markj (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D46924
2024-10-10 13:43:37 +02:00
Doug Moore
ff2263469a Revert "vfs_subr: optimize inval_buf_range"
@pho has reported that this change leads to a failure of the mmap28.sh
stress test, and I have confirmed it, so I withdraw it for further
study.

This reverts commit af4cd5e7b5.
2024-10-10 05:45:43 -05:00
Konstantin Belousov
2851aafe96 mlx5 ipsec_offload: ensure that driver does not dereference dead sahindex
Take the sahtree rlock and check for the DEAD SA state before validating
and filling the SA xfrm attributes.

Sponsored by:	NVidia networking
2024-10-10 12:55:45 +03:00
Doug Moore
af4cd5e7b5 vfs_subr: optimize inval_buf_range
Use a pctrie_lookup to avoid walking over low out-of-range buf list
entries, and an early break to avoid the high out-of-range
entries. Avoid writing almost identical loops for the dirty and clean
lists.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D46963
2024-10-10 04:06:52 -05:00
Michael Tuexen
e1a09d1e9d sctp: make sctp_free_ifn() static
It is not used outside of the file.
No functional change intended.

MFC after:	3 days
2024-10-10 10:43:32 +02:00
Toomas Soome
fae4b97c1a loader: reading from large dosfs fails
With 8GB disk image and FAT32, our read offset calculation wraps over
32-bit integer and we end up reading garbage. The problem appears when
disk image is filled with data and the block to bytes translations do
not fit into 32-bit integers.

illumos issue: https://www.illumos.org/issues/16666

Sponsored by:	MNX Cloud, Inc.
MFC after:	1 week
2024-10-10 11:40:25 +03:00
Michael Tuexen
2e9761eb80 sctp: cleanup sctp_delete_ifn
The address lock is always held, so no need for the second
parameter.
No functional change intended.

MFC after:	3 days
2024-10-10 10:36:00 +02:00
Baptiste Daroussin
458dc7f303 pkgbase: fix incremental generation of packages
Replace the regex trying to catch the branch name of the existing
repository which was too naive with simpler glob matching.

As a result the only case when we only use the new packages are:
moving from alpha to beta
moving from beta to rc
moving from rc to release
changing the major version number for the main git branch

PR:		281393
Differential Revision:	D46874
2024-10-10 08:48:28 +02:00
Isaac Freund
d5e9faf1f3 mk: honor TAGS for FILES in default group
Some checks are pending
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, arm64, aarch64) (push) Waiting to run
Currently the lib32 crt files (/usr/lib32/Scrt1.o etc.) are placed in
the clibs-dev package rather than the clibs-dev-lib32 package.

The /usr/lib32/dtrace/drti.o file is similarly placed in the dtrace
package rather than the dtrace-lib32 package.

Splitting shared libraries in /usr/lib32 into a -lib32 package is
handled in bsd.lib.mk by adding "lib32" to TAGS. However bsd.files.mk
ignores TAGS and only honors ${group}TAGS since 144c442.

This patch changes the behavior of bsd.files.mk to honor TAGS if the
default FILES group is used. This matches the handling of PACKAGE, which
is also ignored unless the default FILES group is used.

With this patch, both the clibs and dtrace package are split correctly.

PR:		249145
Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46991
2024-10-09 12:03:26 -04:00
Baptiste Daroussin
b22be3bbb2 release: basic-cloudinit disable rsa key 2024-10-09 15:50:25 +02:00
Isaac Freund
53bb5613a8
ldd32: place in utilities-lib32 not utilities
The ldd32 binary is currently in the utilities package but belongs in
utilities-lib32. This patch corrects the situation.

PR:		249145
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D47023
2024-10-09 10:31:52 -03:00
Dag-Erling Smørgrav
3c37828ee1 cmp: Check the status of stdout.
POSIX requires us to print an error message and exit non-zero if
writing to stdout fails.  This can only happen if sflag is unset.

MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47020
2024-10-09 14:11:43 +02:00
Dag-Erling Smørgrav
d350e8d795 cmp: Style and type issues.
MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	0mp, markj
Differential Revision:	https://reviews.freebsd.org/D47019
2024-10-09 14:11:42 +02:00
Konstantin Belousov
e578fd853a shm_alloc(): cleanup
Consistently use the shorter name 'obj' for the new object.
Set OBJ_POSIXSHM flag outside if, it is set on both pathes.

Suggested by:	alc
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D47018
2024-10-09 14:28:12 +03:00
Ed Maste
38518fda66 capsicum-test: rights are propagated on sctp_peeloff(2)
As of commit 91a9e4e01d ("capsicum: propagate rights on sctp_peeloff")
a capability is generated from sctp_peeloff(cap_fd,...).  Enable the
corresponding test code.

PR:		201052
Reviewed by:	oshogbo, tuexen
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47000
2024-10-08 20:41:45 -04:00
Ed Maste
91a9e4e01d sctp: propagate cap rights on sctp_peeloff
PR:		201052
Reviewed by:	oshogbo, tuexen
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46884
2024-10-08 20:36:50 -04:00
Ed Maste
e4550c9aa0 capsicum-test: include SCTP tests
HAVE_SCTP is #defined in syscalls.h, so move the #ifdef after the
inclusion of the header that #defines it.

Issue https://github.com/google/capsicum-test/issues/60 is open upstream
in case a slightly different version is needed for Linux.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46995
2024-10-08 20:34:50 -04:00
Ed Maste
1d83090d85 capsicum-test: skip SCTP tests if SCTP not available
Skip the test rather than failing if SCTP is not available (e.g., if
sctp.ko is not loaded).

Also submitted upstream as
https://github.com/google/capsicum-test/pull/61

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46999
2024-10-08 20:32:45 -04:00
Ka Ho Ng
50c64df2a1 Revert "libkldelf: add a private library for kernel/kld-related ELF parsing"
Some checks are pending
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, arm64, aarch64) (push) Waiting to run
This reverts commit 0a2cfd653e.
2024-10-08 19:40:20 +00:00
Ka Ho Ng
7007de7d10 Revert "libkldelf: add elf_lookup_symbol function"
This reverts commit 2c7d847956.
2024-10-08 19:40:13 +00:00
Ka Ho Ng
6df3a2d1bf Revert "libkldelf: use warnx instead of printf"
This reverts commit 550ee2d03c.
2024-10-08 19:39:36 +00:00
Graham Percival
9fd66e40ca manuals: Fix syntax of list width
Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1455
2024-10-08 16:16:26 -03:00
Graham Percival
643fc69820 manuals: Fix "missing end of block" errors
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1454
2024-10-08 16:14:49 -03:00
Graham Percival
8b92fa1ceb manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1453
2024-10-08 16:13:39 -03:00
Dag-Erling Smørgrav
c2d93a803a env: Check the status of stdout.
MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47009
2024-10-08 19:01:46 +02:00
Dag-Erling Smørgrav
6f6166e49c env: Add an option to change the directory.
This mirrors the equivalent option in GNU coreutils env, but does not
add support for long options.

MFC after:	3 days
Relnotes:	yes
Sponsored by:	Klara, Inc.
Reviewed by:	0mp, bcr
Differential Revision:	https://reviews.freebsd.org/D47008
2024-10-08 19:01:32 +02:00
Gleb Popov
e3ebc5f534 procctl(2): Clarify the ESRCH error code case
Approved by: kib
Differential Revision: https://reviews.freebsd.org/D47010
2024-10-08 19:58:17 +03:00
Mateusz Piotrowski
72f5e9833f committers-*.dot: Fix typos 2024-10-08 17:24:53 +02:00
Mateusz Piotrowski
9cf2efbaa0 committers-src: Add myself (0mp)
Approved by:	bnovkov (mentor), christos (mentor), markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D47007
2024-10-08 17:24:53 +02:00
Konstantin Belousov
ba40b2b899 vmstat -o: report objects backing posix shm segments
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:29 +03:00
Konstantin Belousov
a1258191d5 procstat vm: report posix shm segment mapping
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:23 +03:00
Konstantin Belousov
b0b18b57a5 sysctl vm.objects: report objects backing posix shm segments
Add the KVMO_FLAG_POSIXSHM flag.  Fill the path.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:15 +03:00
Konstantin Belousov
a8c641bbcb sys/user.h: report posix shm mappings
Add flag KVME_FLAG_POSIXSHM.  Fill kve_path with the path of the
segment.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:09 +03:00
Konstantin Belousov
bda73e441f posix shm: add shm_get_path(9)
to calculate the posix shm path from the vm_object backing shm segment.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:03 +03:00
Konstantin Belousov
a10870ecea posix shm: mark backing objects with SHM_POSIXSHM flag
and consistently store the pointer to shmfd into pager priv data space.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:37:57 +03:00
Konstantin Belousov
71a66883b5 kinfo_{vmobject,vmentry}: move copy of pathes into the vnode handling scope
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:37:47 +03:00
Doug Moore
d0b225d164 swap_pager: use iterators in swp_pager_meta_build
Add a method to use an iterator for pctrie insertion; this should
improve performance when the last search ended near the place where
the new item will be inserted.

Add an iterator argument to swp_pager_meta_build, so that the lookups
and insertions it does can be faster in the common case when keys are
bunched close together, or appear in sequence.

Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D46848
2024-10-08 03:31:16 -05:00
Roger Pau Monné
e7fe856437 xen/blk{front,back}: fix usage of sector sizes different than 512b
The units of the size reported in the 'sectors' xenbus node is always 512b,
regardless of the value of the 'sector-size' node.  The sector offsets in
the ring requests are also always based on 512b sectors, regardless of the
'sector-size' reported in xenbus.

Fix both blkfront and blkback to assume 512b sectors in the required fields.

The blkif.h public header has been recently updated in upstream Xen repository
to fix the regressions in the specification introduced by later modifications,
and clarify the base units of xenstore and shared ring fields.

PR: 280884
Reported by: Christian Kujau
MFC after: 1 week
Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D46756
2024-10-08 09:29:13 +02:00
Baptiste Daroussin
8bfd7d5f50 pci_vendors: update to 2024-09-20 2024-10-08 09:06:13 +02:00
Konstantin Belousov
e90b2b7d6c ptrace(PT_VM_ENTRY): report max protection
Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46971
2024-10-08 09:50:17 +03:00
Konstantin Belousov
409c2fa385 kinfo_vmentry: report max protection
Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46971
2024-10-08 09:50:17 +03:00
Baptiste Daroussin
88a198af3c powerd: use nlsysevent if possible
instead of depending on devd and its socket, try to use nlsysevent
instead. This makes powerd independant from devd.

Approved by:		des
Reviewed by:		des
Differential Revission:	https://reviews.freebsd.org/D46972
2024-10-08 08:40:58 +02:00
Ka Ho Ng
550ee2d03c libkldelf: use warnx instead of printf
Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46893
2024-10-08 04:29:10 +00:00
Ka Ho Ng
2c7d847956 libkldelf: add elf_lookup_symbol function
The elf_lookup_symbol function looks up the symbol with a given symbol
name. A pointer to the GElf_Sym of the symbol is returned if the symbol
exists in the opened ELF file.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46764
2024-10-08 04:29:10 +00:00
Ka Ho Ng
0a2cfd653e libkldelf: add a private library for kernel/kld-related ELF parsing
The libkldelf library was originally a part of kldxref(8). It exposed
ELF parsing helpers specialized in parsing KLDs and the kernel
executable. The library can be used to read metadata such as linker_set,
mod_depend, mod_version and PNP match info, and raw data from the ELF.

To promote the reuse of the facilities the ELF parsing code is separated
from kldxref(8) into a new private library.

kldxref(8) is modified to link against the libkldelf library.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46719
2024-10-08 04:24:07 +00:00
Warner Losh
6c711019f2 nvme: Don't create sysctl for io queues not created
When we can't set the number of I/O queues ont he admin queue, we
continue on. However, we don't create the I/O queue structures, so
having pointers (NULL) into them for sysctls makes no sense and leads to
a panic when accessed. When summing up different stats, also skip the
ioq stats when it's NULL.

Sponsored by:		Netflix
2024-10-07 22:22:40 -06:00
Maxim Konovalov
3ebb738a93 bsd-family-tree: FreeBSD 13.4 and OpenBSD 7.6 added 2024-10-07 21:16:19 +00:00
Dag-Erling Smørgrav
a0dfb0668b env: Improve documentation.
* The `env` utility's inability to run a command whose name contains an
  equal sign is a feature, not a bug, so move that paragraph up from the
  BUGS section to the DESCRIPTION section.

* Mention that this can be worked around by prefixing the command name
  with `command`, and add an example of this to the EXAMPLE section.

* Add a test case which verifies that `env` does not run a command with
  an equal sign in its name even if it exists, and also demonstrates the
  workaround.

MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46997
2024-10-07 23:01:09 +02:00