Revert my change to ignore EIO errors when writing to log files.
Syslogd continued logging messages to a file that had an EIO error.
This could slow down the whole system. File system errors may cause
huge delays at every access. This prevented debugging the issue.
Now syslogd will log a warning and shut down logging to this file
until restart or SIGHUP.
OK deraadt@ espie@ millert@
rework transmit to get rid of ifq_deq_begin, and to improve speed.
i had a diff that did a small change to replace
ifq_deq_begin/commit/rollback with ifq_dequeue, and Eduard Nicodei
tweaked it a bit with Artturi Alm to use the fifo registers properly
and bump the ifq len.
the latter changes improve performance significantly.
"if you think that diff is correct, commit it" kettenis@
add timeout_barrier, which is like intr_barrier and taskq_barrier.
if you're trying to free something that a timeout is using, you
have to wait for that timeout to finish running before doing the
free. timeout_del can stop a timeout from running in the future,
but it doesn't know if a timeout has finished being scheduled and
is now running.
previously you could know that timeouts are not running by simply
masking softclock interrupts on the cpu running the kernel. however,
code is now running outside the kernel lock, and timeouts can run
in a thread instead of softclock.
timeout_barrier solves the first problem by taking the kernel lock
and then masking softclock interrupts. that is enough to ensure
that any further timeout processing is waiting for those resources
to run again.
the second problem is solved by having timeout_barrier insert work
into the thread. when that work runs, that means all previous work
running in that thread has completed.
fixes and ok visa@, who thinks this will be useful for his work
We want `sb_flags' to be protected by the socket lock rather than the
KERNEL_LOCK(), so change asserts accordingly.
This is now possible since sblock()/sbunlock() are always called with
the socket lock held.
ok bluhm@, visa@
It does not make sense to call pcb lookup from pf during packet
forwarding. It should never match and would cause MP locking
problems. While there remove an useless ifp parameter from
from markus@; OK visa@ sashan@
Fix some incorrectness related to Emacs editing mode in ksh:
- Keep the order of bindings in sync between the manual and implementation
- Fix wrongly documented bindings in the manual
- Break out commands without a default binding in the manual
ok jmc@ tb@
Use a simple forward search to find '%' in the format string instead of
using mbrtowc(3). Thus, we now treat the format string as a bytestring,
not as a multibyte character string.
We think that ANSI C made a small error when adding wide characters:
The committees essentially replaced "characters" with "wide characters"
in the existing printf documentation, which was written before the
concept of processing was established. Doing processing on the format
string would break some 8-bit format strings in the wild, and that
isn't something these committees gave themselves license to do.
Based on the "10x printf speedup" commit from android found by tedu:
Thanks to millert and schwarze for digging into the history and
testing *printf behavior on other platforms.
ok deraadt, millert
Do not assume if_get(9) returns a non NULL ifp when using a route
This assumption is true for the moment iff the route lookup *and* the
if_get() are done under KERNEL_LOCK(). This is not the case here.
Found the hardway by Hrvoje Popovski.
ok florian@, visa@, bluhm@
Move the addrhook disestablish from carpdetach() to carp_clone_destroy()
to make it symmetric to the addrhook establish which is being done in
carp_clone_create(). This fixes the issue that carp does not recognize
address changes on the carp after an interface has detached, which could
cause issues like carp not recovering or even panics. Unfortunately
there are more bugs lurking in carp.
The compiler is generally free to allocate general purpose registers in whatever
order it chooses. Reasons for choosing one register before another usually incl
ude compiled instruction size (avoidance of REX prefixes, etc.) or usage convent
ions, but somehow haven't included security implications in the compiled bytecod
e. Some bytecode is more useful in polymorphic ROP sequences than others, so it
seems prudent to try to avoid that bytecode when possible.
This patch moves EBX/RBX towards the end of the allocation preference for 32 and
64 bit general purpose registers. Some instructions using RBX/EBX/BX/BL as a de
stination register end up with a ModR/M byte of C3 or CB, which is often useful
in ROP gadgets. Because these gadgets often occur in the middle of functions, th
ey exhibit somewhat higher diversity than some other C3/CB terminated gadgets. T
his change removes about 3% of total gadgets from the kernel, but about 6% of un
There are other possible changes in this direction. BX/BL are obvious next targe
ts for avoidance, and MM3/XMM3 may also be useful to try to avoid if possible.
Remove #if'0ed decls
Stop pretending that we will migrate the content of this file to
if_etherip.h. Those declarations are needed by userland, and it's
easier to keep them in netinet/ip_ether.h. ok visa@
Do not fail if an interface is DOWN when calling ifpromisc().
As soon as the interface will be brough UP, its device driver will
recognize it has the IFF_PROMISC flag and will configure its filters