Commit graph

288232 commits

Author SHA1 Message Date
Gleb Smirnoff d6e1ae659b carp: check CARP status in in_localip_fib(), in6_localip_fib()
Don't report a BACKUP CARP address as local.  These two functions are used
only by source address validation for input packets, controlled by sysctls
net.inet.ip.source_address_validation and
net.inet6.ip6.source_address_validation.  For this purpose we definitely
want to treat BACKUP addresses as non local.

This change is conservative and doesn't modify compat in_localip() and
in6_localip().  They are used more widely than the FIB-aware versions.
The change would modify the notion of ipfw(4) 'me' keyword.  There might
be other consequences as in_localip() is used by various tunneling
protocols.

PR:			277349
(cherry picked from commit 56f7860087)
2024-03-28 12:35:45 -07:00
Baptiste Daroussin 77205dbc13 pkgbase: install all libc test files into the tests package
(cherry picked from commit 3a9ddfa1ab)
2024-03-27 09:37:10 +01:00
Baptiste Daroussin 0e3acd5798 pkgbase: add a mechanism to be able to force a give ucl include
This is made in order to be able to find add the post-install scripts
for the kernel, where PKGNAME varies for each KERNCONF but we don't want
to dynamically duplicated the kernel.ucl file.

At the same time we don't want the *-dbg* packages to actually include
those post-install scripts

(cherry picked from commit 45d83c3926)
2024-03-27 09:34:50 +01:00
Baptiste Daroussin fa0d989348 pkgbase: fix typo preventing packaging kernels
(cherry picked from commit 2addba5caf)
2024-03-27 09:31:48 +01:00
Baptiste Daroussin 69cd13d49c pkgbase: fix kernel packing after switch ucl rework
(cherry picked from commit 7622906160)
2024-03-27 09:31:48 +01:00
Baptiste Daroussin 099bd9e6ab pkgbase: rework certctl package to only run rehash on the main package
Rework how ucl manifest are generated leveraging ucl features and flua

now the ucl generation is done via a lua script which uses libucl to
ingest the template and use variables as defined in its command line.

the template will include only if it exist a ucl file named after the
package name which will complement the template or overwrite what was
defined in the template if defined in this specific ucl file

this allows to overwrite license, but add script only to the packages
who actually needs them.

As a results the post install scripts are now only added to the right
package and not also added to the subpackages like -man or -dev

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44374

(cherry picked from commit f8e46fd61e)
2024-03-27 09:31:47 +01:00
Baptiste Daroussin 2f3069cde7 pkgbase: make sendmail config files as config
(cherry picked from commit 8c3a85eaeb)
2024-03-27 09:30:44 +01:00
Baptiste Daroussin 0c66d02e63 pkgbase: separate /etc/mail/aliases from the sendmail package
move /etc/aliases and /etc/mail/aliases into the runtime package
this file is used by both sendmail and dma.

While here mark this file as a config file so 3way merge is performed

(cherry picked from commit 8cd7841d84)
2024-03-27 09:30:44 +01:00
Baptiste Daroussin cd6e93e7a9 pkgbase: remove packages which do not exists anymore
(cherry picked from commit 5c318f5ce3)
2024-03-27 09:30:44 +01:00
John F. Carr 8e3bd18c37 Translate linux_newlstat name argument
PR:	277847

(cherry picked from commit 55e2187a09)
2024-03-27 10:27:23 +02:00
Konstantin Belousov daefc4bda7 daemon(8): handle case of waitpid() returning without exited child
PR:	277764

(cherry picked from commit 8eaa6be80d)
2024-03-27 10:27:23 +02:00
Baptiste Daroussin 3658878285 RELNOTES: document usbconfig(8) changes 2024-03-27 09:26:30 +01:00
Baptiste Daroussin 2464e5cfd2 usb_vendors: add new usb_vendors
usb_vendors is a local copy of usb.ids (similar to pci_vendors)
It is now used by usbconfig(1) when listing the devices.

(cherry picked from commit db1d086b73)
2024-03-27 09:20:19 +01:00
Baptiste Daroussin 7b9a772f9f usbconfig: allow to get usb vendors and products from the usb.ids database
Reviewed by:		emaste, manu
Differential Revision:	https://reviews.freebsd.org/D3392

(cherry picked from commit 8fe86d923f)
2024-03-27 09:19:49 +01:00
Baptiste Daroussin ad8c850830 libucl: import snapshot 2024-02-06
(cherry picked from commit ddca081d38)
2024-03-27 09:18:47 +01:00
Gordon Bergling 87aff05164 xdr(3): Fix a few typos in source code comments
- s/reoutines/routines/
- s/paraemters/parameters/

Obtained from:	NetBSD

(cherry picked from commit 577a721d05)
2024-03-26 06:55:55 +01:00
Gordon Bergling caf8d5c884 intr_event.9: Remove double word
- s/of of/of/

(cherry picked from commit 2c3466172a)
2024-03-26 06:55:38 +01:00
Gordon Bergling 13a74b477d cxgbe.4: Remove double word
- s/of of/of/

(cherry picked from commit 619e6f1f92)
2024-03-26 06:55:18 +01:00
Ed Maste 495bdd698e linuxkpi: remove invalid KASSERT from hash_add_rcu
hash_add_rcu asserted that the node's prev pointer was NULL in an
attempt to detect addition of a node already on a list, but the caller
is not required to provide a zeroed node.

Reported in https://github.com/freebsd/drm-kmod/issues/282

Reviewed by:	bz, manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43645

(cherry picked from commit 7e77089dcc)
2024-03-25 18:31:44 -04:00
Ed Maste 464fa66f63 ssh: Update to OpenSSH 9.7p1
This release contains mostly bugfixes.

It also makes support for the DSA signature algorithm a compile-time
option, with plans to disable it upstream later this year and remove
support entirely in 2025.

Full release notes at https://www.openssh.com/txt/release-9.7

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a91a246563)
2024-03-25 18:31:44 -04:00
Alfonso Gregory c9bd948da3 arm64: Save an instruction in locore.S
We can move and sub at the same time, so let's do that.

Reviewed by:	andrew, kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/794

(cherry picked from commit e1fe34707a)
2024-03-25 18:29:12 -04:00
Jose Luis Duran 3f89271794 blacklistd: Handle fds that are pointing to routing sockets
If the fd has access to make changes via the routing socket, grant full
permission to make filter changes.

Obtained from:	1b9475b2c8

(cherry picked from commit b73612a342)
2024-03-25 18:28:30 -04:00
Florian Walpen 602ea0ced1 sound: Fix OSS API requests for more than 8 channels
Audio devices with more than 8 channels need bitperfect mode to operate,
the vchan processing chain is limited to 8 channels. For these devices,
let applications properly select a certain number of channels supported
by the driver, instead of mapping the request to a vchan format.

Reviewed by:	emaste
Pull Request:	https://github.com/freebsd/freebsd-src/pull/914

(cherry picked from commit 61c8316796)
2024-03-25 18:28:30 -04:00
Ed Maste 49e126a03b ctfmerge: demote "No ctf sections found" to a warning
If there are no CTF sections then ctfmerge just has nothing to do; it
should not be an error.

Note that ctfmerge has an option to require CTF:
     -t      Make sure that all object files have a CTF section.

Before this change, this option explicitly exited without error if none
of the object files have CTF sections, with the comment:

    If we're verifying that C files have CTF, it's safe to
    assume that in this case, we're building only from assembly
    inputs.

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

(cherry picked from commit 95ca89cda1)
2024-03-25 18:27:08 -04:00
Gordon Bergling 8dd42c55ec tcp_rack.4: Update the SEE ALSO section
Correct the surname of one of authors of RFC 8985 and add RFC 5681 and
RFC 6937 (PRR: Proportional Rate Reduction for TCP).

Reviewed by:	tuexen
Differential Revision:	https://reviews.freebsd.org/D44399

(cherry picked from commit e29be07861)
2024-03-25 15:58:22 +01:00
Ed Maste adc61137fd Cirrus-CI: bump Clang versions to 16 and 17
Clang/LLVM 17 is currently the in-tree default compiler, so use it as
the default Cirrus-CI toolchain.  Clang/LLVM 18 is coming soon and needs
to be added here, but I ran into trouble with llvm18-lite package
availability so will look at that later.

Reviewed by:	dim (earlier), Jose Luis Duran
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44162

(cherry picked from commit 51c6bf0478)
2024-03-24 13:48:55 -04:00
John F. Carr c3c2233c96 gpioevents: Fix build with newer Clang
PR:		277422
(cherry picked from commit 42b117a4bd)
2024-03-24 13:48:55 -04:00
Konstantin Belousov e87a6f8860 wmemchr(3): fix prototypes for wcpcpy() and wcpncpy()
PR:	277855

(cherry picked from commit 69d5783ae8)
2024-03-24 07:12:39 +02:00
Jason A. Harmening 61d9b0cb38 uipc_bindat(): Explicitly specify exclusive locking for the new vnode
When calling VOP_CREATE(), uipc_bindat() reuses the componentname
object from the preceding lookup operation, which is likely to specify
LK_SHARED.  Furthermore, the VOP_CREATE() interface technically only
requires the newly-created vnode to be returned with a shared lock.
However, the socket layer requires the new vnode to be locked exclusive
and asserts to that effect.

In most cases, this is not a practical concern because most if not
all base-layer filesystems (certainly FFS, ZFS, and msdosfs at least)
always return the vnode locked exclusive regardless of the lock flags.
However, it is an issue for unionfs which uses cn_lkflags to determine
how the new unionfs wrapper vnode should be locked.  While it would
be easy enough to work around this issue within unionfs itself, it
seems better for the socket layer to be explicit about its locking
requirements when issuing VOP_CREATE().

Reviewed by:		kib, olce
Differential Revision:	https://reviews.freebsd.org/D44047

(cherry picked from commit d56c175ac9)
2024-03-23 21:55:38 -05:00
Jason A. Harmening 6d118b9586 unionfs: accommodate underlying FS calls that may re-lock
Since non-doomed unionfs vnodes always share their primary lock with
either the lower or upper vnode, any forwarded call to the base FS
which transiently drops that upper or lower vnode lock may result in
the unionfs vnode becoming completely unlocked during that transient
window.  The unionfs vnode may then become doomed by a concurrent
forced unmount, which can lead to either or both of the following:

--Complete loss of the unionfs lock: in the process of being
  doomed, the unionfs vnode switches back to the default vnode lock,
  so even if the base FS VOP reacquires the upper/lower vnode lock,
  that no longer translates into the unionfs vnode being relocked.
  This will then violate that caller's locking assumptions as well
  as various assertions that are enabled with DEBUG_VFS_LOCKS.

--Complete less of reference on the upper/lower vnode: the caller
  normally holds a reference on the unionfs vnode, while the unionfs
  vnode in turn holds references on the upper/lower vnodes.  But in
  the course of being doomed, the unionfs vnode will drop the latter
  set of references, which can effectively lead to the base FS VOP
  executing with no references at all on its vnode, violating the
  assumption that vnodes can't be recycled during these calls and
  (if lucky) violating various assertions in the base FS.

Fix this by adding two new functions, unionfs_forward_vop_start_pair()
and unionfs_forward_vop_finish_pair(), which are intended to bookend
any forwarded VOP which may transiently unlock the relevant vnode(s).
These functions are currently only applied to VOPs that modify file
state (and require vnode reference and lock state to be identical at
call entry and exit), as the common reason for transiently dropping
locks is to update filesystem metadata.

Reviewed by:	olce
Tested by:	pho
Differential Revision: https://reviews.freebsd.org/D44076

(cherry picked from commit 6c8ded0015)
2024-03-23 21:55:37 -05:00
Jason A. Harmening b09b120818 vn_lock_pair(): allow lkflags1/lkflags2 to be 0 if vp1/vp2 is NULL
It's a bit strange to require the caller to pass contrived lock flags
if the corresponding vnode is NULL, simply to appease the assertion
that exactly one of LK_SHARED or LK_EXCLUSIVE must be set.  On the
other hand, we still want to catch cases in which completely bogus
or corrupt flags are passed even if the corresponding vnode is NULL.
Therefore, specifically allow empty flags for lkflags1/lkflags2 iff
the respective vp1/vp2 param is NULL.

Reviewed by:		kib, olce
Differential Revision:	https://reviews.freebsd.org/D44046

(cherry picked from commit fa26f46dc2)
2024-03-23 21:55:37 -05:00
Cy Schubert 66f60770fd unbound: Vendor import 1.19.3
Release notes at
	https://www.nlnetlabs.nl/news/2024/Mar/14/unbound-1.19.3-released/

Merge commit '5a33598e88ad8fbc0affa74dee0a2d8cc4010fbc' into main

(cherry picked from commit b7c0c8c18e)
2024-03-23 19:22:03 -07:00
Dimitry Andric 35a61f4a25 Slightly reorganize libclang_rt Makefile again
Make a separate .elif section for MACHINE_ARCH==powerpc, and subdivide
the MACHINE_CPUARCH values under it. If at some point more sanitizer
libraries become available for powerpc CPU architectures, they can be
added before the "nothing for other powerpc yet" case. Similar for the
MACHINE_ARCH==arm case.

PR:		262706
Fixes:		e77a1bb275
MFC after:	3 days

(cherry picked from commit 897a485c34)
2024-03-24 01:36:26 +01:00
Dimitry Andric 880f35eb5d Fix building of several libclang_rt libraries for powerpc64 and powerp64le
I reorganized the libclang_rt Makefile in e77a1bb275 to make it more
readable and maintainable, but the check for 32-bit powerpc was wrong.
This caused almost no libclang_rt libraries to be built for powerpc64
and powerpc64le.

PR:		262706
Reported by:	tuexen
Fixes:		e77a1bb275
MFC after:	3 days

(cherry picked from commit f0620ceecc)
2024-03-24 01:36:18 +01:00
Dimitry Andric 69da6e0879 Merge commit bbb8a0df7367 from llvm-project (by Shafik Yaghmour):
[Clang] Fix ResolveConstructorOverload to not select a conversion function if we are going use copy elision

  ResolveConstructorOverload needs to check properly if we are going to use copy
  elision we can't use a conversion function.

  This fixes:

  https://github.com/llvm/llvm-project/issues/39319
  https://github.com/llvm/llvm-project/issues/60182
  https://github.com/llvm/llvm-project/issues/62157
  https://github.com/llvm/llvm-project/issues/64885
  https://github.com/llvm/llvm-project/issues/65568

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

This should fix 'Assertion failed: (isa<To>(Val) && "cast<Ty>() argument
of incompatible type!")' errors when building devel/boost-libs,
specifically libs/url/src/segments_view.cpp.

Bump __FreeBSD_version so this fix can easily be detected from
devel/boost-all/compiled.mk.

PR:		273335
(cherry picked from commit bcd401b5a3)
2024-03-23 13:01:38 +01:00
Ed Maste 8e40217819 makefs: warn that ffs sectorsize other than 512 may not work
newfs always sets sectorsize to DEV_BSIZE (512) and derives some other
values based on the number of 512-byte sectors per real sector.  Similar
logic is required in makefs.  Until that happens, emit a warning that
the image may be incorrect.

PR:		276571
(cherry picked from commit 176b9e0d72)
2024-03-22 14:42:59 -04:00
Ed Maste a323dd42bc bsdlabel: limit to 8 partitions
bsdlabel is intended to support up to 20 partitions, but the disklabel
struct has a d_partitions array with only BSD_NPARTS_MIN (8) entries.
Previously, an attempt to operate on a bsdlabel with more than eight
partitions resulted in a buffer overflow.

As a stopgap limit bsdlabel to 8 partitions until this is fixed
properly.

PR:		276517
(cherry picked from commit 3f4f82c0d7)
2024-03-22 14:42:59 -04:00
Kyle Evans 590e02d3c0 if_wg: use proper barriers around pkt->p_state
Without appropriate load-synchronization to pair with store barriers in
wg_encrypt() and wg_decrypt(), the compiler and hardware are often
allowed to reorder these loads in wg_deliver_out() and wg_deliver_in()
such that we end up with a garbage or intermediate mbuf that we try to
pass on.  The issue is particularly prevalent with the weaker
memory models of !x86 platforms.

Switch from the big-hammer wmb() to more explicit acq/rel atomics to
both make it obvious what we're syncing up with, and to avoid somewhat
hefty fences on platforms that don't necessarily need this.

With this patch, my dual-iperf3 reproducer is dramatically more stable
than it is without on aarch64.

PR:		264115
Reviewed by:	andrew, zlei

(cherry picked from commit 3705d679a6)
2024-03-22 10:21:39 -05:00
Tom Coldrick 95a7c6f18a LinuxKPI: Queue skbuffs at tail in __skb_queue_tail
Correct skb_queue_tail to queue the buffer at the tail of the skbuff.
The skbuff is a circular doubly-linked list, and we call with a pointer
to the head of the list.  Thus queueing before the head gives us a
queueing at the tail.

As a motivating factor, the current behaviour (queueing at the head) was
causing frequent kernel panics from my RTL8822BE wireless card, which
uses the rtw88 driver.  Interrupts can cause buffers to be added to the
rtwdev c2h_queue while the queue is being drained in rtw_c2h_work.
Queueing at the head would leave the nascent entry in the linked list
pointing to the old, now freed, memory for the buffer being processed.
When rtw_c2h_work is next called, we try reading this and so panic.

Reviewed by:	emaste, bz
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D44192

(cherry picked from commit d3befb534b)
2024-03-22 09:30:33 -04:00
Ed Maste 35457886cd release: remove binutils package data
GDB was the final GNU binutils component included in the base system,
but was removed in 2020.  Nothing provides a pkgbase binutils package
any longer.

Fixes: 1c0ea326aa ("Retire obsolete GDB 6.1.1")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1e4cd5ed54)
2024-03-22 09:30:32 -04:00
Ed Maste 2031b368f8 rights.4: Remove sentence implying that rights are a mask
Capability rights passed to cap_rights_* are (now) not simple bitmaks
and cannot be ORed together in general (although it will work for
certain subsets of rights).

Remove sentence that implied rights are masks.  We already have the
sentence "The complete list of capability rights is provided below" so
listing the rights without an introductory sentence seems fine.

PR:		277057
(cherry picked from commit 2c5ff9118c)
2024-03-22 09:30:32 -04:00
Ed Maste ea3910c452 path_test: fix cap_rights_init usage
Capability rights passed to cap_rights_* are not simple bitmaks and
cannot be ORed together in general (although it will work for certain
subsets of rights).

PR:		277057
Fixes:		e5e1d9c7b7 ("path_test: Add a test case for...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 8d1348f55a)
2024-03-22 09:30:32 -04:00
Ed Maste be83aa2a01 libcasper: fix cap_rights_init usage
Capability rights passed to cap_rights_* are not simple bitmaks and
cannot be ORed together in general (although it will work for certain
subsets of rights).

PR:		277057
Fixes:		faaf43b2a7 ("fileargs: add tests")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 3733d82c4d)
2024-03-22 09:30:32 -04:00
Ed Maste dbf34bbb18 cat: fix cap_rights_init usage
Capability rights passed to cap_rights_* are not simple bitmaks and
cannot be ORed together in general (although it will work for certain
subsets of rights).

PR:		277057
Reported by:	asomers, markj

(cherry picked from commit 05f530f4d2)
2024-03-22 09:30:32 -04:00
Mariusz Zaborski 5f527dbe41 cat: add CAP_SEEK capability
The copy_file_range might require that.

Reviewed by:	emaste, theraven, kib, markj
Differential Revision:	https://reviews.freebsd.org/D41967

(cherry picked from commit 64c6327738)
2024-03-22 09:30:32 -04:00
Ed Maste b5ae8f2171 ccdconfig: remove obsolete references to BSD disklabels
ccd(4) previoulsy had knowledge of BSD disklabels, and relied on their
use on the underlying disks, but this hasn't been the case since 2003
(commit 0f76d6d822).

Remove disklabel references from the man page.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43574

(cherry picked from commit a3ed434a69)
2024-03-22 09:30:31 -04:00
Ed Maste 269bc49fba style.lua.9: remove mention of $FreeBSD$
Also restore a comment line in an example which previously started with
-- $FreeBSD$ but was removed in 6ef644f588.  The example shows the of
a module require statement block following the license header.

(cherry picked from commit f1bd7311fb)
2024-03-22 09:30:31 -04:00
Christopher Davidson 144abdaa2b wlan(4) - remove an(4) reference
Fixes: 663b174b5b ("an: Remove driver")
Pull request: https://github.com/freebsd/freebsd-src/pull/1120

(cherry picked from commit bbd29c4394)
2024-03-22 09:30:31 -04:00
Ed Maste 466e0dc5ce random(9): bump removal to FreeBSD 15.0
It has not yet been removed, and still has some in-tree consumers.

PR:		277655
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f50322c1dc)
2024-03-22 09:30:31 -04:00
Ed Maste ed70dd5bf5 iwm.4: add iwlwifi cross-reference
iwlwifi(4) supports a superset of the devices supported by iwm(4).  The
latter may be retired in the future (if there is no reason to prefer it
for the set of devices supported by both).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 9dd5023e95)
2024-03-22 09:30:31 -04:00