emulators/wine-devel: Update 11.14 => 11.15
Changelog:
- More KDF algorithms in BCrypt.
- Support for ARM64EC build in Mingw mode.
- More format conversions in WindowsCodecs.
- Support for local NTLM authentication.
- Various bug fixes.
https://gitlab.winehq.org/wine/wine/-/releases/wine-11.15
PR: 297398
Sponsored by: UNIS Labs
textproc/presenterm: Add new port
Presenterm lets you create presentations in markdown format and run them from
your terminal, with support for image and animated gifs, highly customizable
themes, code highlighting, exporting presentations into PDF format, and plenty
of other features.
https://mfontanini.github.io/presenterm/
usb: use SYSINIT(9) order instead of using non-existing subsystem
Found with: clang -Werror=assign-enum
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D58710
tests/netinet/socket_afinet: multibind second socket can be different
Allows to add tests to the table where the second socket doesn't take
address from the first. No functional change yet, all tests test the same
conditions.
Differential Revision: https://reviews.freebsd.org/D58087
tests/netinet/socket_afinet: unroll multibind test into a table
The test has 6 dimensions: address family, socket type, socket option on
the first socket, socket option on the second socket, is first socket
bound to specific address or wildcard and is the second socket priveleged
or not. Before the change 3 dimensions are implemented as 3 nested for()
loops, 2 dimensions are implemented as repetitions in the test body and
one dimension as two actions in the innermost loop.
I'm about to add one more dimension: whether the second socket is bound to
a specific address or wildcard instead of using first socket's
getsockopt(2) result. Also, there is a change under discussion that would
make SOCK_STREAM sockets behave different to SOCK_DGRAM. That would break
result consistency in the dimensions of socket type.
We expect that consistency in the dimension of address families shall
never break, thus this one remains a for() loop. The priveleged & non-
privileged bind(2) attempts also remain as two actions, but expected
results are in the table. The rest of dimensions are unrolled into a
[7 lines not shown]
inpcb: take a pcbinfo database out from single lock
Initialize all three hashes (exact, wild, load balance group) with a per-
bucket lock. Nothing changes for the packet lookup KPI - it still uses
SMR section for thread safety. But connect(2) and bind(2) operations gain
parallelism now.
The main concept is that as we lookup inpcb database for editing, we are
accumulating bucket locks necessary to accomplish the operation. Once all
lookups are complete and we are good to go, the inpcb is inserted (or
moved) and accumulated lock context is released.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D58131
tests/netinet/socket_afinet: add more tests to multibind
Add tests where first socket and second socket are bound to different
addresses, e.g. first specific and second wildcard and vice versa.
Mark success with SO_REUSEPORT on the second socket as a bug suspect.
Mark failure to bind to INADDR_ANY in presence of other UID's specific
bound socket to the same port as probably too strict.
Differential Revision: https://reviews.freebsd.org/D58088
taskqueue: Move wakeup() out of tq_mutex
taskqueue KPI require wakeup() to be called for each completed
task. With everything else there heavily optimized over the years,
even when doing nothing this wakeup()'s lock/unlock is significant.
Since no external taskqueue consumer can depend on the tq_mutex,
we can move the wakeup() out of it. It creates some complications
for internal waiters, but those should be much more rare, and can
be handled with separate locked wakeups on demand.
My tests of taskqueue-intensive ZFS RAIDZ writes on 64-core system
show performance improvement from this change ~4%, while same time
reducing CPU usage by several percent due to lower lock contention,
confirmed by CPU profiler.
ixgbe: Report the management packet drop counter
The management_pkts_drpd sysctl was wired to MNGPTC, making it an
alias of management_pkts_txd, instead of MNGPDC.
MFC after: 3 days
ixgbe: Recognize production X550 PHY IDs
According to Linux 5f1c3589b0f0, the X550 PHY classifier still matches
an alpha silicon ID, while the shared definitions contain the two
production IDs. This can leave production hardware on the generic
probing path and issue unnecessary PHY queries.
MFC after: 2 weeks
riscv/atomic: Provide some additional aliases
These are already available and having them defined helps keep the KASAN
atomic(9) interceptors uniform.
Reviewed by: mhorne
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58680
unix: allow listening on an unbound socket, and binding after listen
`uipc_listen()` refused a socket that had not been bound, with
`EDESTADDRREQ`. That made sense while a pathname was the only way to
name a peer: an unbound listener could never be reached, so allowing it
would only have created sockets nothing could connect to. Now that
`connectat(2)` can name a peer socket by descriptor, an unbound listener
*is* reachable, and the restriction only stands in the way. It also left
stream sockets oddly stricter than datagram ones, which could already
reach an unbound peer.
Dropping the check additionally permits `bind(2)` after `listen(2)`:
`uipc_bindat()` already allows this, as it only rejects re-binding a
socket that has a name. That ordering closes a window listeners
otherwise have to leave open. Today the socket file must exist before
the socket may listen, so a client connecting in between is refused;
binding afterwards publishes the name only once the socket is ready to
accept.
[9 lines not shown]
unix: allow connectat(2) to name the peer socket by descriptor
Accept an empty `sun_path` when `fd` is not `AT_FDCWD`: the descriptor
then names the peer unix socket directly, instead of being the starting
directory for a pathname lookup. The held file reference keeps the peer
PCB stable, playing the role `unp_vp_mtxpool` plays in the pathname
path.
The descriptor must carry `CAP_CONNECTAT` and refer to an `AF_UNIX`
socket (`EPROTOTYPE` otherwise, `ENOTSOCK` for non-sockets). As with a
pathname, a stream/seqpacket peer must be listening. No filesystem
permission or MAC vnode check applies on this path: possession of the
descriptor is the authorization, as with descriptor passing.
Note this makes it possible to connect a datagram socket to an unbound
peer, which no pathname could previously name.
`connect(2)` and the implicit-connect send path pass `AT_FDCWD` and
still reject an empty path with `EINVAL`.
[22 lines not shown]
tests: exercise unix connectat(2) with a socket peer descriptor
Cover the new fd-direct connect path: stream connect and data passing,
the peer address reported by `getpeername(2)`, datagram to an unbound
peer, the `EINVAL`/`ENOTSOCK`/`EPROTOTYPE`/`ECONNREFUSED` error matrix,
and the Capsicum token semantics — a descriptor limited to
`CAP_CONNECTAT` can be connected to but not listened on, accepted from,
or read, and one lacking `CAP_CONNECTAT` cannot be a connect target.
Stream listeners are always bound: `uipc_listen()` refuses unbound
sockets with `EDESTADDRREQ`, so an unbound fd-direct listener is not
reachable even with this feature.
Signed-off-by: John Ericson <John.Ericson at Obsidian.Systems>
Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5)
Reviewed by: markj
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D58406
unix: split unp_connectat() in two
Factor the second half — connecting to an already-resolved peer PCB —
out into a new `unp_connect_peer()`, leaving `unp_connectat()` with the
connection state machine and pathname resolution. No functional change.
The helper's contract: the caller guarantees stability of the peer PCB
(vnode lock plus `unp_vp_mtxpool` lock for peers found via
`VOP_UNP_CONNECT()`), has set `UNP_CONNECTING` on the connecting socket,
and clears it again on error; the helper clears it on success.
This prepares for connecting to a peer named by something other than a
pathname.
Signed-off-by: John Ericson <John.Ericson at Obsidian.Systems>
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58404
unix: Simplify uipc_detach()
uipc_close() handles detaching a unix socket from the vnode to which
it's bound, if any, so doing the same in uipc_detach() is redundant.
Moreover, it's conceptually wrong that uipc_detach() might need to
handle this: detach happens when there are no remaining references to
the socket, and that should include the vnode's reference, even though
it's not explicitly counted.
No functional change intended.
Reviewed by: John Ericson <inquire at JohnEricson.me>, glebius
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58675
unix: factor unp_connectat_peer() out of unp_connectat()
Move the "resolve a connectat(2) target to a referenced peer socket"
half of `unp_connectat()` -- the `namei()` lookup and `unp_vnode_peer()`
call -- into a helper, leaving `unp_connectat()` with the connection state
machine plus a single `unp_connect_peer()`.
This is where the next change grows the ways a peer can be named; keeping
it a helper up front keeps that change focused on the new resolution
logic.
No functional change intended.
Signed-off-by: John Ericson <John.Ericson at Obsidian.Systems>
Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5)
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58462
unix: pin the pathname peer by reference across the connect
In the pathname path of `unp_connectat()`, take a reference on the peer
socket under the per-vnode `unp_vp_mtxpool` lock, drop that lock, and
`vput()` the vnode *before* calling `unp_connect_peer()`, rather than
holding the vnode lock across the connect.
`unp_connect_peer()` already accepts "a reference on the peer socket" as
a stability guarantee (it is exactly what the descriptor path relies on),
so this is behaviour-preserving. The payoff is that no vnode lock is held
across the connect, which removes the delicate `MPASS(!(return_locked &&
connreq))` "vput() must not sleep while the peer is locked" invariant on
the datagram fast path.
That reference then has to be released, and for the reasons described in
the code, this can only safely happen *after* the PCB is unlocked. The
boolean flag is replaced with a nullable out pointer to return the
reference to the caller so that it can carry out this responsibility.
[8 lines not shown]
unix: factor unp_sun_path() out of bind and connect
Extract the AF_UNIX validation plus sun_path/length lookup shared by
`uipc_bindat()`, `unp_connect()`, and `unp_connectat()` into a helper that
hands back the path pointer and its length. Each caller keeps its own
empty-path policy and, where needed, its own copy of the path.
Signed-off-by: John Ericson <John.Ericson at Obsidian.Systems>
Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5)
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58459
unix: Fix some bugs in the SOCK_STREAM receive path
The main problem is with the handling of errors from unp_externalize().
It turns out that this was quite broken, and unfortunately it's easy to
trigger such errors (e.g., by setting a low per-process fd limit with
setrlimit()).
In non-peek mode, uipc_soreceive_stream_or_seqpacket() cuts a bunch of
mbufs from the head of the socket buffer, to be consumed by userspace.
When unp_externalize() returns an error, we splice the removed mbuf
chain back onto the head of the socket buffer. This is expensive, but
that's ok since such errors are rare.
The problem is that this cutting is not correctly implemented: it does
not clear the "next" pointer for the last mbuf in the chain, so it
still points to the first mbuf still resident in the socket buffer.
This means that mc_init_m() creates a chain that still includes the rest
of the socket buffer, so splicing the chain back into the socket buffer
does not work properly.
[14 lines not shown]
unix: factor unp_vnode_peer() out of unp_connectat()
Move the "resolve a locked vnode to the referenced peer socket it names"
block into a helper. Pure code motion: the caller now calls
`unp_vnode_peer()` and keeps the `vput()`/connect/`sorele()` sequence.
No functional change intended.
Note: This refactor isn't really necessary as `unp_vnode_peer()` will
only be called once throughout this entire patch series. I am just
including it out of my personal preferences for decomposing tasks into
smaller functions --- we can skip this patch if the reviewers don't like
this.
Signed-off-by: John Ericson <John.Ericson at Obsidian.Systems>
Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5)
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58461
git-arc: Use full names in reviewed-by lines
Phabricator user names are not useful identifiers outside of
phabricator, don't use them if we can avoid it.