Fix race in vmm(4) vm termination path.
Two callers can enter vm_terminate simultaneously and race to remove
the vm from the SLIST and teardown the vm. This adds a flag to the
vm struct and uses atomic cas operations to only have one caller
advance while the other callers receive EBUSY.
ok mlarkin@
Reported-by: syzbot+b3be6264d2f1d5c22b0b at syzkaller.appspotmail.com
Add support for applications to use synchronized output mode (DECSET
2026) to prevent screen tearing during rapid updates. When an
application sends SM ?2026, tmux buffers output until RM ?2026 is received
or a 1-second timeout expires.
From Chris Lloyd with the assistance of Claude Code, GitHub issue 4744.
avoid a shadowed variable in the pf_create_state() source limiter handling
the code that unwinds state creation when something fails needed
the pf_source variable at the function scope to be set, but this
was masked by a declaration in the scope that sets up the source
limiting. this results in a NULL deref in the unwind code when it
needs to clean up the accounting for a source limiter.
i found it funny that i left this comment for myself in the unwinding
code:
/* who needs KASSERTS when we have NULL derefs */
ok jmatthew@
peer_dump already puts all prefixes onto the pending queue.
So there is no need to call peer_blast at the end, just call
peer_blast_done() so the EOR marker is added and the peer
is unthrottled.
This removes an extra tree walk during session establishment.
OK tb@
Implement the bin_of function like omalloc.c and use it for various
dynamic array sizing.
Convert the attrs and communities code to use this (with slightly
different values).
OK tb@
Extend the prefix/pt API with functions for iterators.
- pt_first() and pt_next() can be used to implement a basic iterator
that can walk all or part of a tree.
- pt_get_next() returns the match or next bigger match than prefix/prefixlen
OK tb@
Add 'invaliduser' penalty to PerSourcePenalties, which is applied
to login attempts for usernames that do not match real accounts.
Defaults to 5s to match 'authfail' but allows administrators to
block such sources for longer if desired. with & ok djm@
static int, not int static
c99 6.11.5:
"The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature."
static const, not const static
c99 6.11.5:
"The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature."
ok krw@
Rearrange command completion so callbacks are called without holding any
locks. This makes it possible to mark the interrupt handler MPSAFE, but
we're not actually doing that yet.
Releasing the cq mutex means the completion callback can't use the cq
entry, so we have to copy any fields we use from it into the ccb. For now,
that's just the flags. This simplifies the callbacks in a few places.
ok dlg@ (some time ago)
also tested by kettenis@ with aplns(4)