eric [Sat, 9 Jun 2018 10:01:17 +0000 (10:01 +0000)]
parse SIZE advertisement
jmc [Sat, 9 Jun 2018 06:36:31 +0000 (06:36 +0000)]
sort previous;
djm [Sat, 9 Jun 2018 03:18:11 +0000 (03:18 +0000)]
slightly better wording re handing of $TERM, from Jakub Jelen
via bz2386
djm [Sat, 9 Jun 2018 03:03:10 +0000 (03:03 +0000)]
add a SetEnv directive for sshd_config to allow an administrator to
explicitly specify environment variables set in sessions started by
sshd. These override the default environment and any variables set
by user configuration (PermitUserEnvironment, etc), but not the SSH_*
variables set by sshd itself.
ok markus@
djm [Sat, 9 Jun 2018 03:01:12 +0000 (03:01 +0000)]
add a SetEnv directive to ssh_config that allows setting environment
variables for the remote session (subject to the server accepting them)
refactor SendEnv to remove the arbitrary limit of variable names.
ok markus@
djm [Sat, 9 Jun 2018 02:58:02 +0000 (02:58 +0000)]
reorder child environment preparation so that variables read from
~/.ssh/environment (if enabled) do not override SSH_* variables
set by the server.
helg [Fri, 8 Jun 2018 23:43:40 +0000 (23:43 +0000)]
Minor cleanup in ifuse_ops_setattr.
ok mpi@
nicm [Fri, 8 Jun 2018 20:54:22 +0000 (20:54 +0000)]
Instead of working out which pane to resize with the mouse by walking
the panes list, look through the layout cells for the nearest border and
resize that cell. From Dan Aloni in GitHub issue 1374.
cheloha [Fri, 8 Jun 2018 19:24:46 +0000 (19:24 +0000)]
Bail out if fchmod(2) fails.
Don't quietly install ld.so.hints with mode 0600 because this adds
overhead to shlib lookup for non-root processes.
From Nan Xiao.
ok guenther@
jsing [Fri, 8 Jun 2018 17:28:36 +0000 (17:28 +0000)]
Test DH params allocation and free.
guenther [Fri, 8 Jun 2018 15:38:52 +0000 (15:38 +0000)]
Constipate all the struct lock_type's so they go into .rodata
ok visa@
guenther [Fri, 8 Jun 2018 15:38:15 +0000 (15:38 +0000)]
Constipate all the struct lock_type's so they go into .rodata
ok visa@
bluhm [Fri, 8 Jun 2018 14:09:57 +0000 (14:09 +0000)]
The udp control option processing was implemented three times.
Multicast lacked receive destination port. Better use a function
and do it all in one place. The pipex chunk does not use the
options, so it can happen before. Adding the udp header length to
the ip header length was done inconsistently. Do it explicitly
when needed.
OK mpi@ visa@
pirofti [Fri, 8 Jun 2018 13:53:01 +0000 (13:53 +0000)]
New semaphore implementation making sem_post async-safe.
POSIX dictates that sem_post() needs to be async-safe here[0] and is
thus included in the list of safe functions to call from within a signal
handler here[1].
The old semaphore implementation is using spinlocks and __thrsleep to
synchronize between threads.
Let's say there are two threads: T0 and T1 and the semaphore has V=0.
T1 calls sem_wait() and it will now sleep (spinlock) until someone else
sem_post()'s. Let's say T0 sends a signal to T1 and exits.
The signal handler calls sem_post() which is meant to unblock T1 by
incrementing V. With the old semaphore implementation we we are now in a
deadlock as sem_post spinlocks on the same lock.
The new implementation does not suffer from this defect as it
uses futexes to resolve locking and thus sem_post does not need to spin.
Besides fixing this defect and making us POSIX compliant, this should
also improve performance as there should be less context switching and
thus less time spent in the kernel.
For architectures that do not provied futexes and atomic operations,
the old implementation will be used and it is now being renamed to
rthread_sem_compat as discussed with mpi@.
[0] -- http://pubs.opengroup.org/onlinepubs/
9699919799/functions/sem_post.html
[1] -- http://pubs.opengroup.org/onlinepubs/
9699919799/functions/V2_chap02.html
OK visa@, mpi@, guenther@
nicm [Fri, 8 Jun 2018 09:43:58 +0000 (09:43 +0000)]
Tweak previous - check for a NULL client and simplify manual text.
nicm [Fri, 8 Jun 2018 09:41:34 +0000 (09:41 +0000)]
Add -x- and -y- to use client size, from Stefan Assmann in GitHub issue 1372.
jmatthew [Fri, 8 Jun 2018 07:14:02 +0000 (07:14 +0000)]
Handle AENs for logical disk creation and deletion.
SAS3 and newer controllers allow these operations at any time
through the server management interface - tested on a SAS3108
(Lenovo x3650 M5) and SAS3508 (Dell R6415).
ok dlg@
jmatthew [Fri, 8 Jun 2018 07:09:50 +0000 (07:09 +0000)]
Rework sensors and bio(4) support to use the target number from the logical
disk list, rather than assuming target numbers match the position in the
list. Now we always allocate enough sensors for the maximum number of
logical disks, so we can store sensor information indexed by target number.
While here, split up the logical disk sensor code simplify adding and
removing sensors for logical disks as they're created and destroyed.
ok dlg@
ratchov [Fri, 8 Jun 2018 06:21:56 +0000 (06:21 +0000)]
Greatly simplify the resampling routine using the fact it processes
exactly one block.
ratchov [Fri, 8 Jun 2018 06:20:49 +0000 (06:20 +0000)]
The conversion chain processes exactly one block, so no need to
calculate & count the number of processed samples. This allows to move
the calls to processing routines in dev_mix_badd() and
dev_sub_bcopy(), which is much simpler. No behaviour change.
djm [Fri, 8 Jun 2018 03:35:36 +0000 (03:35 +0000)]
fix incorrect expansion of %i in load_public_identity_files(); reported by
Roumen Petrov
djm [Fri, 8 Jun 2018 01:55:40 +0000 (01:55 +0000)]
fix some over-long lines and __func__ up some debug messages
helg [Thu, 7 Jun 2018 22:28:11 +0000 (22:28 +0000)]
Prevent ggc3 error: redefinition of `fuse_dirh_t'
OK millert@
matthieu [Thu, 7 Jun 2018 21:23:44 +0000 (21:23 +0000)]
prepare for dri3proto
eric [Thu, 7 Jun 2018 16:28:14 +0000 (16:28 +0000)]
remove unused flags and obsolete comments
ok gilles@
djm [Thu, 7 Jun 2018 14:29:43 +0000 (14:29 +0000)]
test the correct configuration option name
visa [Thu, 7 Jun 2018 13:37:27 +0000 (13:37 +0000)]
Make callers of VOP_CREATE(9) and VOP_MKNOD(9) responsible for
unlocking the directory vnode.
OK mpi@, helg@
jmc [Thu, 7 Jun 2018 11:37:21 +0000 (11:37 +0000)]
add some EXIT STATUS sections; from matthew martin
eric [Thu, 7 Jun 2018 11:31:51 +0000 (11:31 +0000)]
use RELAY_* flags where appropriate
ok gilles@
jmc [Thu, 7 Jun 2018 11:26:14 +0000 (11:26 +0000)]
tweak previous;
patrick [Thu, 7 Jun 2018 11:24:19 +0000 (11:24 +0000)]
Attach bwfm(4) to the Broadcom 4356 found in the GPD Pocket.
Tested by mlarkin@
patrick [Thu, 7 Jun 2018 11:18:25 +0000 (11:18 +0000)]
Some PCIe-based bwfm(4) chips also require that we supply an NVRAM
binary. In case we have an (optional) NVRAM binary, copy it to the
end of the chip's memory.
Tested by mlarkin@ on his GPD Pocket.
jmc [Thu, 7 Jun 2018 09:41:46 +0000 (09:41 +0000)]
tweak previous;
jmc [Thu, 7 Jun 2018 09:41:14 +0000 (09:41 +0000)]
put ".Re" in the right place;
djm [Thu, 7 Jun 2018 09:26:42 +0000 (09:26 +0000)]
some permitlisten fixes from markus@ that I missed in my insomnia-fueled
commits last night
bluhm [Thu, 7 Jun 2018 08:46:24 +0000 (08:46 +0000)]
The global zero addresses must not change, mark them constant.
OK tb@ visa@
eric [Thu, 7 Jun 2018 07:06:06 +0000 (07:06 +0000)]
simplify the codepath for backup relay setup
ok gilles@
yasuoka [Thu, 7 Jun 2018 05:40:08 +0000 (05:40 +0000)]
Mention enabling PIE by default is turned off by using "-pg".
yasuoka [Thu, 7 Jun 2018 05:31:32 +0000 (05:31 +0000)]
Pass -nopie to the linker when -pg is specified to make the
profiler(gprof) work properly.
ok mpi
djm [Thu, 7 Jun 2018 04:46:34 +0000 (04:46 +0000)]
permitlisten/PermitListen unit test from Markus
djm [Thu, 7 Jun 2018 04:31:51 +0000 (04:31 +0000)]
fix regression caused by recent permitlisten option commit:
authorized_keys lines that contained permitopen/permitlisten were
being treated as invalid.
guenther [Thu, 7 Jun 2018 04:09:35 +0000 (04:09 +0000)]
Apply the retpoline transformation to indirect jumps in the raw ASM
ok mlarkin@ mortimer@ deraadt@
guenther [Thu, 7 Jun 2018 04:07:28 +0000 (04:07 +0000)]
Treat XSAVEOPT and other XSAVE extensions like other cpu flags
oddness noted by kettenis
ok mlarkin@ deraadt@
mortimer [Thu, 7 Jun 2018 01:42:36 +0000 (01:42 +0000)]
Remove unused variable.
Spotted by Nan Xiao.
florian [Wed, 6 Jun 2018 20:15:13 +0000 (20:15 +0000)]
RFC 8106 obsolteted RFC 6106.
From brad@, OK jmc
eric [Wed, 6 Jun 2018 19:12:09 +0000 (19:12 +0000)]
code cleanup
ok gilles@ semarie@
bluhm [Wed, 6 Jun 2018 19:02:38 +0000 (19:02 +0000)]
The function dounmount() traverses the mnt_list in forward direction
to call vfs_busy() for all nested mount points. vfs_stall() called
vfs_busy() in reverser order for all mount points. Change the
direction of the latter to resolve the lock order conflict.
OK visa@
markus [Wed, 6 Jun 2018 18:29:18 +0000 (18:29 +0000)]
switch config file parsing to getline(3) as this avoids static limits
noted by gerhard@; ok dtucker@, djm@
djm [Wed, 6 Jun 2018 18:25:33 +0000 (18:25 +0000)]
regress test for PermitOpen
djm [Wed, 6 Jun 2018 18:24:15 +0000 (18:24 +0000)]
man bits for permitlisten authorized_keys option
djm [Wed, 6 Jun 2018 18:24:00 +0000 (18:24 +0000)]
man bits for PermitListen
djm [Wed, 6 Jun 2018 18:23:32 +0000 (18:23 +0000)]
permitlisten option for authorized_keys; ok markus@
djm [Wed, 6 Jun 2018 18:22:41 +0000 (18:22 +0000)]
Add a PermitListen directive to control which server-side addresses
may be listened on when the client requests remote forwarding (ssh -R).
This is the converse of the existing PermitOpen directive and this
includes some refactoring to share much of its implementation.
feedback and ok markus@
deraadt [Wed, 6 Jun 2018 14:42:07 +0000 (14:42 +0000)]
sync
florian [Wed, 6 Jun 2018 14:08:28 +0000 (14:08 +0000)]
After pledge the frontend process is only accepting from
an AF_UNIX socket (the control socket) so replace inet with
unix pledge.
aoyama [Wed, 6 Jun 2018 12:58:05 +0000 (12:58 +0000)]
Make sure cr17 matches curcpu() on non-MULTIPROCESSOR kernels.
This fixes that luna88k non-MULTIPROCESSOR kernel with option
DIAGNOSTIC (i.e. GENERIC) will hang silently at boot.
That problem had been caused after the addition of a
MUTEX_ASSERT_UNLOCKED check in kprintf() in sys/kern/subr_prf.c
1.95.
The diff is suggested from Miod Vallat, tested it on
non-MULTIPROCESSOR and MULTIPROCESSOR kernels by me.
eric [Wed, 6 Jun 2018 12:00:26 +0000 (12:00 +0000)]
remove fields that are found in struct dispatcher from struct relayhost
ok gilles@
espie [Wed, 6 Jun 2018 10:33:07 +0000 (10:33 +0000)]
add non-regression tests for bad user list files
espie [Wed, 6 Jun 2018 10:13:10 +0000 (10:13 +0000)]
if the parser can't find a starting line in user db, it won't look
at any line, so it won't error out.
Add logic to make it error out.
mpi [Wed, 6 Jun 2018 07:12:51 +0000 (07:12 +0000)]
Prefix fields of pfkey & routing PCBs, part 2, no functionnal change.
ok tb@
mpi [Wed, 6 Jun 2018 07:10:12 +0000 (07:10 +0000)]
Prefix fields of pfkey & routing PCBs, no functionnal change.
ok visa@, tb@
mpi [Wed, 6 Jun 2018 06:55:22 +0000 (06:55 +0000)]
Pass the socket to sounlock(), this prepare the terrain for per-socket
locking.
ok visa@, bluhm@
mpi [Wed, 6 Jun 2018 06:47:01 +0000 (06:47 +0000)]
Asseert that a pfkey or routing socket is referenced by a `fp' instead
of calling sofree(), when its PCB is detached.
This is different from TCP which does not always detach `inpcb's from
sockets. In the pfkey & routing case caling sofree() there is a noop
whereas for TCP it's needed to free closed connections.
Having fewer sofree() makes it easier to understand the code and move
the locks down.
ok visa@
remi [Wed, 6 Jun 2018 05:52:59 +0000 (05:52 +0000)]
document missing database filters
ok stsp@ claudio@ jca@
remi [Wed, 6 Jun 2018 05:51:43 +0000 (05:51 +0000)]
print metric for Intra-Area-Prefix LSAs
ok stsp@ claudio@ jca@
jsg [Wed, 6 Jun 2018 02:53:44 +0000 (02:53 +0000)]
pluart(4) is mi now
mortimer [Wed, 6 Jun 2018 00:14:29 +0000 (00:14 +0000)]
Add RETGUARD to clang for amd64. This security mechanism uses per-function
random cookies to protect access to function return instructions, with the
effect that the integrity of the return address is protected, and function
return instructions are harder to use in ROP gadgets.
On function entry the return address is combined with a per-function random
cookie and stored in the stack frame. The integrity of this value is verified
before function return, and if this check fails, the program aborts. In this way
RETGUARD is an improved stack protector, since the cookies are per-function. The
verification routine is constructed such that the binary space immediately
before each ret instruction is padded with int03 instructions, which makes these
return instructions difficult to use in ROP gadgets. In the kernel, this has the
effect of removing approximately 50% of total ROP gadgets, and 15% of unique
ROP gadgets compared to the 6.3 release kernel. Function epilogues are
essentially gadget free, leaving only the polymorphic gadgets that result from
jumping into the instruction stream partway through other instructions. Work to
remove these gadgets will continue through other mechanisms.
Remaining work includes adding this mechanism to assembly routines, which must
be done by hand. Many thanks to all those who helped test and provide feedback,
especially deaadt, tb, espie and naddy.
ok deraadt@
kettenis [Tue, 5 Jun 2018 20:41:19 +0000 (20:41 +0000)]
Move pluart(4) to dev/fdt.
ok jsg@
kettenis [Tue, 5 Jun 2018 19:23:01 +0000 (19:23 +0000)]
Unify arm64 and armv7 pluart(4) implementations.
ok jsg@
jsing [Tue, 5 Jun 2018 18:06:07 +0000 (18:06 +0000)]
Add missing csi_dh_params_dup() calls.
anton [Tue, 5 Jun 2018 16:43:19 +0000 (16:43 +0000)]
Use proper markup for ioctl arguments instead of documenting them using
free-form text.
ok jmc@
eric [Tue, 5 Jun 2018 11:34:21 +0000 (11:34 +0000)]
remove struct relayhost from struct envelope.
ok gilles@
jsg [Tue, 5 Jun 2018 09:45:08 +0000 (09:45 +0000)]
Recognise Cortex A76. Only adding to arm64 as it only supports aarch32
for EL0/userland. MIDR value from ATF.
ok kettenis@
mpi [Tue, 5 Jun 2018 09:29:05 +0000 (09:29 +0000)]
Revert introduction of fdinsert(), a sanitify check triggers when
closing a LARVAL file.
Found the hardway by sthen@.
guenther [Tue, 5 Jun 2018 06:39:10 +0000 (06:39 +0000)]
Switch from lazy FPU switching to semi-eager FPU switching: track whether
curproc's xstate ("extended state") is loaded in the CPU or not.
- context switch, sendsig(), vmm, and doing CPU crypto in the kernel all
check the flag and, if set, save the old thread's state to the PCB,
clear the flag, and then load the _blank_ state
- when returning to userspace, if the flag is clear then set it and restore
the thread's state
This simpler tracking also fixes the restoring of FPU state after nested
signal handlers.
With this, %cr0's TS flag is never set, the FPU #DNA trap can no
longer happen, and IPIs are no longer necessary for flushing or
syncing FPU state; on the other hand, restoring xstate while returning
to userspace means we have to handle xrstor faulting if we could
be loading an altered state. If that happens, reset the state,
fake a #GP fault (SIGBUS), and recheck for ASTs.
While here, regularize fxsave/fxrstor vs xsave/xrstor handling, by
using codepatching to switch to xsave/xrstor when present in the
CPU. In addition, code patch in use of xsaveopt in most places
when the CPU supports that. Use the 64bit-wide variants of the
instructions in all cases so that x87 instruction fault IPs are
reported correctly.
This change has three motivations:
1) with modern clang, SSE registers are used even in rcrt0.o, making
lazy FPU switching a smaller benefit vs trap costs
2) the Intel SDM warns that lazy FPU switching may increase power costs
3) post-Spectre rumors suggest that the %cr0 TS flag might not block
speculation, permitting leaking of information about FPU state
(AES keys?) across protection boundaries.
tested by many in snaps; prodding from deraadt@
anton [Tue, 5 Jun 2018 06:32:26 +0000 (06:32 +0000)]
Turn all instances of Fn into proper cross references. While here, remove
redundant references to termios and favor Po/Pc for parenthesis enclosing.
ok jmc@ schwarze@
jmc [Tue, 5 Jun 2018 05:58:12 +0000 (05:58 +0000)]
document "match tag"; ok gilles
guenther [Tue, 5 Jun 2018 05:04:31 +0000 (05:04 +0000)]
Split "return to userspace via iretq" from intr_fast_exit into intr_user_exit.
Move AST handling from the bottom of alltraps and Xdoreti to the
top of the new routine.
syscall-return-via-iretq and the FPU #DNA trap jump into intr_user_exit after
the AST check (already performed for the former, skipped for the latter)
Delete a couple debugging hooks mlarkin@ and I used during Meltdown work
tested by many in snaps; thanks to brynet@ for spurious interrrupt testing
earlier reviews and comments kettenis@ mlarkin@; prodding from deraadt@
kettenis [Mon, 4 Jun 2018 22:10:58 +0000 (22:10 +0000)]
Remove the cpu_reset_needs_v4_MMU_disable flag; it's always true for hardware
that OpenBSD runs on.
ok patrick@
kettenis [Mon, 4 Jun 2018 22:08:56 +0000 (22:08 +0000)]
Use process-private futexes. This avoids the overhead of calling into uvm
to look up the mapping for the futex address.
ok visa@, mpi@
gilles [Mon, 4 Jun 2018 21:46:56 +0000 (21:46 +0000)]
honor SIZE extension when advertised by peer
ok millert@
jmc [Mon, 4 Jun 2018 21:13:34 +0000 (21:13 +0000)]
for "match", document that envelopes that do not match anything are rejected,
and that rules are evaluated sequentially, first match wins;
ok gilles
jmc [Mon, 4 Jun 2018 21:10:58 +0000 (21:10 +0000)]
remove "from local" (the default) from one of the match rules: the line
immediately above also uses this notation, it's shorter, and it keeps
two examples in the man page which claim to be the same as the default config
(but with exceptions) in sync;
ok gilles
kn [Mon, 4 Jun 2018 19:42:54 +0000 (19:42 +0000)]
Sync VFS documentation with reality
Missed during the "Namecache revamp" in 2009.
Reported by Georg Bege <georg at bege dot email>, thanks.
OK visa jmc mpi jca
kn [Mon, 4 Jun 2018 19:22:13 +0000 (19:22 +0000)]
Allow specifying binary via ROUTE
OK bluhm jca
kn [Mon, 4 Jun 2018 19:20:12 +0000 (19:20 +0000)]
Zap unused mifi_t.
OK bluhm mpi jca
kn [Mon, 4 Jun 2018 19:17:37 +0000 (19:17 +0000)]
Zap unused sockaddr.
OK bluhm deraadt jca
cheloha [Mon, 4 Jun 2018 18:16:43 +0000 (18:16 +0000)]
drop BUMPTIME
unused since v1.76, ca 5.3
ok kettenis@ deraadt@
gerhard [Mon, 4 Jun 2018 18:05:18 +0000 (18:05 +0000)]
Fix file descriptor leak.
Patch submitted by Nan Xiao, ok tb@ sthen@ millert@ deraadt@ jca@
jmc [Mon, 4 Jun 2018 16:34:09 +0000 (16:34 +0000)]
tweak previous;
gilles [Mon, 4 Jun 2018 15:57:46 +0000 (15:57 +0000)]
add support for mda wrappers allowing postmaster to define command wrappers
that will be executed (with recipient privileges) before calling the users'
mail delivery agent
ok eric@
deraadt [Mon, 4 Jun 2018 15:04:57 +0000 (15:04 +0000)]
in non-DIAGNOSTIC kernels, rw_assert_wrlock becomes a nop which leaves the
local variable dangling, so calculate the lock address by hand at invocation
ok kettenis
patrick [Mon, 4 Jun 2018 13:33:10 +0000 (13:33 +0000)]
4-bit bus width is mandatory for SDIO cards that support High Speed
mode, so switch from 1-bit to 4-bit bus width if the host controller
supports it.
ok kettenis@
martijn [Mon, 4 Jun 2018 13:29:07 +0000 (13:29 +0000)]
Remove the extra pager code when compiled without the BACKWARDS flag.
Most terminals have scrollback options, or can be achieved via tmux, so
it's not needed.
OK millert@
martijn [Mon, 4 Jun 2018 13:26:21 +0000 (13:26 +0000)]
Definitively choose the existing semantics for the scroll and null command.
POSIX states: "An empty command list shall be equivalent to the p command",
so changing the behaviour of a null-command in any other case is a
violation of POSIX.
OK millert@
bluhm [Mon, 4 Jun 2018 12:22:45 +0000 (12:22 +0000)]
The function pf_create_state() calls pf_set_protostate() before
pf_state_insert(), so the state key has not been set. When inlining,
the compiler recognized the NULL pointer dereference in
s->key[PF_SK_STACK]->proto and optimized it away. But if pf.c was
compiled with -fno-inline, the system crashed during boot. Add a
NULL check in pf_set_protostate() to handle the situation when the
function is called.
OK sashan@ henning@
jmc [Mon, 4 Jun 2018 12:15:10 +0000 (12:15 +0000)]
tweak the text of the relaying example: make it clear that the example
allows delivery as well as relaying (for authenticated users), and that
passing to an external mda is possible, but not required;
ok gilles
bluhm [Mon, 4 Jun 2018 12:13:01 +0000 (12:13 +0000)]
Cleanup IPsec output error handling with consistent goto drop.
from markus@; OK mpi@
jmc [Mon, 4 Jun 2018 11:52:40 +0000 (11:52 +0000)]
"match auth" matches transactions that *have been* authenticated;
ok gilles
patrick [Mon, 4 Jun 2018 10:37:14 +0000 (10:37 +0000)]
Switch to SDIO High Speed mode if the host controller supports it.
ok kettenis@