Consolidate backing swap clusters & get rid of ugly error handling.
Stop using the "pager layer" for swapping: make the page daemon call
uvm_swap_put() directly.
Rename uvm_aio_aiodone_pages() into uvm_swap_dropcluster() and consolidate
it with the logic from uvm_pager_dropcluster(). Note that currently the
page daemon does not free pages at this stage.
Thanks to the use of an iterator to select which page needs to be recycled
from the inactive LRU there is no real reason to return the last one.
Make uvm_pager_dropcluster() clean all pages related to a given UVM object.
Tested in bulks by sthen@, reduce differences with NetBSD.
avoid use-after-free when a network interface is destroyed
When iterating over the protocols list, the got_one handler will free
a protocol if an interface dhcpd was listening on was destroyed.
problem reported by landry@, feedback and ok claudio@
take advantage of if_vinput not sleeping now to avoid real refcnts
the vlan tag hash was an array of smr protectect lists. previously
when we found a vlan interface in the tag hash we'd take a real ref
(refcnt_take) to that interface before pushing it through the network
stack with if_vinput. we did this because the network stack can
sleep, and you can't sleep in an smr critical section.
now that if_vinput simply queues the packet without sleeping, we
can call it from the smr critical section and skip taking and
releasing real refs with atomic ops. this is a win if the vlan
parent interfaces are multiq and doing a lot of packets across
multiple softnet threads because the cacheline the refcnt is on
doesnt have to be modified, hopefully it can be shared (or not used
at all) instead.
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)