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@
patrick [Mon, 4 Jun 2018 10:33:51 +0000 (10:33 +0000)]
imxesdhc(4) also supports High Speed mode for SD.
ok kettenis@
kettenis [Mon, 4 Jun 2018 09:25:16 +0000 (09:25 +0000)]
Remove unused/commented out includes.
kettenis [Mon, 4 Jun 2018 09:24:49 +0000 (09:24 +0000)]
Remove unused include.
kettenis [Mon, 4 Jun 2018 09:19:52 +0000 (09:19 +0000)]
Remove unused include.
kevlo [Mon, 4 Jun 2018 05:24:11 +0000 (05:24 +0000)]
Nuke unused variable.
ok deraadt@
guenther [Mon, 4 Jun 2018 04:57:09 +0000 (04:57 +0000)]
Add VB_DUPOK to suppress witness(4) warning of concurrent mount locks.
Use that in three places:
- vfs_stall()
- sys_mount()
- dounmount()'s MNT_FORCE-does-recursive-unmounts case
ok deraadt@ visa@
guenther [Mon, 4 Jun 2018 04:52:33 +0000 (04:52 +0000)]
...and correct the count at which warning normally occurs
guenther [Mon, 4 Jun 2018 04:49:08 +0000 (04:49 +0000)]
Xr witness 4
guenther [Mon, 4 Jun 2018 04:46:07 +0000 (04:46 +0000)]
Add RW_DUPOK for suppressing witness checks for specific rw_enter() calls
ok deraadt@ visa@
bluhm [Sun, 3 Jun 2018 21:32:32 +0000 (21:32 +0000)]
Use variable names for rtable and rdomain consistently in the in_pcb
functions.
discussed with and OK mpi@ visa@
mortimer [Sun, 3 Jun 2018 21:30:38 +0000 (21:30 +0000)]
Add ret protctor options as no-ops.
bluhm [Sun, 3 Jun 2018 21:00:15 +0000 (21:00 +0000)]
Rename the incpb table field inpt_hash to inpt_mask as it contains
the hashmask. For the resize calculations it is clearer to use the
field inpt_size.
OK visa@ mpi@
krw [Sun, 3 Jun 2018 20:51:14 +0000 (20:51 +0000)]
Fix previous by restoring inadvertantly deleted check for
get_recorded_lease() returning NULL.
Should fix segmentation fault reported by Klemens Nanni on bugs@.
bluhm [Sun, 3 Jun 2018 19:58:02 +0000 (19:58 +0000)]
Consistently call the inpcb table parameter "table" in in6_pcbnotify().
OK visa@ mpi@
kettenis [Sun, 3 Jun 2018 18:58:11 +0000 (18:58 +0000)]
Remove #ifdef __XSCALE__ bits. No binary change.
ok deraadt@
tb [Sun, 3 Jun 2018 18:35:48 +0000 (18:35 +0000)]
SIOCSIFNETMASK takes a 'struct ifreq', so use 'ifr' for it and drop the
now unused 'ifra' from in_ioctl().
Discussed with mpi and visa
deraadt [Sun, 3 Jun 2018 18:20:28 +0000 (18:20 +0000)]
on i386, libm does sysctl to discover is the system has SSE. Whitelist
that sysctl in pledge. Discovered by Stuart Cassoff
kettenis [Sun, 3 Jun 2018 18:17:27 +0000 (18:17 +0000)]
Change the set_parent() interface to pass the full parent specification
(including the phandle).
ok patrick@
tb [Sun, 3 Jun 2018 17:46:22 +0000 (17:46 +0000)]
Better version of the refactoring attempted in r1.154. Move SIOCSIFADDR
to its own function and merge the two switches in in_ioctl_change_ifaddr().
Finally: each ioctl has its own case and privilege check.
ok visa
As an aside, an audit of the ports tree has shown that we should continue
to support the legacy ioctls SIOCSIF{,BRD,DST}ADDR, SIOCSIFNETMASK despite
the fact that they have been deprecated for the better part of two decades
and FreeBSD dropped support 7 years ago. Too many ports still rely on them.
Thanks to sthen and visa for their help with that.
kettenis [Sun, 3 Jun 2018 17:26:31 +0000 (17:26 +0000)]
Make DMA work on Samsung Exynos. The crucial bit that makes it work is
setting the FIFO thresholds apropriately. The code now also makes an
attempt to recover from failed DMA transfers.
rpe [Sun, 3 Jun 2018 16:54:54 +0000 (16:54 +0000)]
On amd64, arm64, armv7, i386 and sparc64 /usr/bin/{cc,c++,clang++,clang-cpp}
and /usr/libexec/cpp are supposed to be hardlinks of /usr/bin/clang. The move
of /usr/bin/cc to the base set to allow kernel relinking resulted in it being
a copy and not a hardlink. Move the other files to the base set too to ensure
all are hardlinks.
Noticed by Anthony Coulter
OK deraadt
jsing [Sun, 3 Jun 2018 15:33:37 +0000 (15:33 +0000)]
Allocate a dedicated buffer for use when deriving a shared key during
client KEX DHE processing, rather than reusing the buffer that is used
to send/receive handshake messages.
ok beck@ inoguchi@
jsing [Sun, 3 Jun 2018 15:31:30 +0000 (15:31 +0000)]
Check the return value from DH_size() in ssl3_send_client_kex_dhe().
ok beck@ inoguchi@
kettenis [Sun, 3 Jun 2018 15:09:26 +0000 (15:09 +0000)]
Implement process-shared futexes. These are now the default implementation.
Introduce process-private futexs. These will bypass the uvm mapping lookup
and should be slightly more efficient.
ok visa@, mpi@