openbsd
6 years agouse RELAY_* flags where appropriate
eric [Thu, 7 Jun 2018 11:31:51 +0000 (11:31 +0000)]
use RELAY_* flags where appropriate

ok gilles@

6 years agotweak previous;
jmc [Thu, 7 Jun 2018 11:26:14 +0000 (11:26 +0000)]
tweak previous;

6 years agoAttach bwfm(4) to the Broadcom 4356 found in the GPD Pocket.
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@

6 years agoSome PCIe-based bwfm(4) chips also require that we supply an NVRAM
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.

6 years agotweak previous;
jmc [Thu, 7 Jun 2018 09:41:46 +0000 (09:41 +0000)]
tweak previous;

6 years agoput ".Re" in the right place;
jmc [Thu, 7 Jun 2018 09:41:14 +0000 (09:41 +0000)]
put ".Re" in the right place;

6 years agosome permitlisten fixes from markus@ that I missed in my insomnia-fueled
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

6 years agoThe global zero addresses must not change, mark them constant.
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@

6 years agosimplify the codepath for backup relay setup
eric [Thu, 7 Jun 2018 07:06:06 +0000 (07:06 +0000)]
simplify the codepath for backup relay setup

ok gilles@

6 years agoMention enabling PIE by default is turned off by using "-pg".
yasuoka [Thu, 7 Jun 2018 05:40:08 +0000 (05:40 +0000)]
Mention enabling PIE by default is turned off by using "-pg".

6 years agoPass -nopie to the linker when -pg is specified to make the
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

6 years agopermitlisten/PermitListen unit test from Markus
djm [Thu, 7 Jun 2018 04:46:34 +0000 (04:46 +0000)]
permitlisten/PermitListen unit test from Markus

6 years agofix regression caused by recent permitlisten option commit:
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.

6 years agoApply the retpoline transformation to indirect jumps in the raw ASM
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@

6 years agoTreat XSAVEOPT and other XSAVE extensions like other cpu flags
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@

6 years agoRemove unused variable.
mortimer [Thu, 7 Jun 2018 01:42:36 +0000 (01:42 +0000)]
Remove unused variable.

Spotted by Nan Xiao.

6 years agoRFC 8106 obsolteted RFC 6106.
florian [Wed, 6 Jun 2018 20:15:13 +0000 (20:15 +0000)]
RFC 8106 obsolteted RFC 6106.
From brad@, OK jmc

6 years agocode cleanup
eric [Wed, 6 Jun 2018 19:12:09 +0000 (19:12 +0000)]
code cleanup

ok gilles@ semarie@

6 years agoThe function dounmount() traverses the mnt_list in forward direction
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@

6 years agoswitch config file parsing to getline(3) as this avoids static limits
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@

6 years agoregress test for PermitOpen
djm [Wed, 6 Jun 2018 18:25:33 +0000 (18:25 +0000)]
regress test for PermitOpen

6 years agoman bits for permitlisten authorized_keys option
djm [Wed, 6 Jun 2018 18:24:15 +0000 (18:24 +0000)]
man bits for permitlisten authorized_keys option

6 years agoman bits for PermitListen
djm [Wed, 6 Jun 2018 18:24:00 +0000 (18:24 +0000)]
man bits for PermitListen

6 years agopermitlisten option for authorized_keys; ok markus@
djm [Wed, 6 Jun 2018 18:23:32 +0000 (18:23 +0000)]
permitlisten option for authorized_keys; ok markus@

6 years agoAdd a PermitListen directive to control which server-side addresses
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@

6 years agosync
deraadt [Wed, 6 Jun 2018 14:42:07 +0000 (14:42 +0000)]
sync

6 years agoAfter pledge the frontend process is only accepting from
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.

6 years agoMake sure cr17 matches curcpu() on non-MULTIPROCESSOR kernels.
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.

6 years agoremove fields that are found in struct dispatcher from struct relayhost
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@

6 years agoadd non-regression tests for bad user list files
espie [Wed, 6 Jun 2018 10:33:07 +0000 (10:33 +0000)]
add non-regression tests for bad user list files

6 years agoif the parser can't find a starting line in user db, it won't look
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.

6 years agoPrefix fields of pfkey & routing PCBs, part 2, no functionnal change.
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@

6 years agoPrefix fields of pfkey & routing PCBs, no functionnal change.
mpi [Wed, 6 Jun 2018 07:10:12 +0000 (07:10 +0000)]
Prefix fields of pfkey & routing PCBs, no functionnal change.

ok visa@, tb@

6 years agoPass the socket to sounlock(), this prepare the terrain for per-socket
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@

6 years agoAsseert that a pfkey or routing socket is referenced by a `fp' instead
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@

6 years agodocument missing database filters
remi [Wed, 6 Jun 2018 05:52:59 +0000 (05:52 +0000)]
document missing database filters

ok stsp@ claudio@ jca@

6 years agoprint metric for Intra-Area-Prefix LSAs
remi [Wed, 6 Jun 2018 05:51:43 +0000 (05:51 +0000)]
print metric for Intra-Area-Prefix LSAs

ok stsp@ claudio@ jca@

6 years agopluart(4) is mi now
jsg [Wed, 6 Jun 2018 02:53:44 +0000 (02:53 +0000)]
pluart(4) is mi now

6 years agoAdd RETGUARD to clang for amd64. This security mechanism uses per-function
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@

6 years agoMove pluart(4) to dev/fdt.
kettenis [Tue, 5 Jun 2018 20:41:19 +0000 (20:41 +0000)]
Move pluart(4) to dev/fdt.

ok jsg@

6 years agoUnify arm64 and armv7 pluart(4) implementations.
kettenis [Tue, 5 Jun 2018 19:23:01 +0000 (19:23 +0000)]
Unify arm64 and armv7 pluart(4) implementations.

ok jsg@

6 years agoAdd missing csi_dh_params_dup() calls.
jsing [Tue, 5 Jun 2018 18:06:07 +0000 (18:06 +0000)]
Add missing csi_dh_params_dup() calls.

6 years agoUse proper markup for ioctl arguments instead of documenting them using
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@

6 years agoremove struct relayhost from struct envelope.
eric [Tue, 5 Jun 2018 11:34:21 +0000 (11:34 +0000)]
remove struct relayhost from struct envelope.

ok gilles@

6 years agoRecognise Cortex A76. Only adding to arm64 as it only supports aarch32
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@

6 years agoRevert introduction of fdinsert(), a sanitify check triggers when
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@.

6 years agoSwitch from lazy FPU switching to semi-eager FPU switching: track whether
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@

6 years agoTurn all instances of Fn into proper cross references. While here, remove
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@

6 years agodocument "match tag"; ok gilles
jmc [Tue, 5 Jun 2018 05:58:12 +0000 (05:58 +0000)]
document "match tag"; ok gilles

6 years agoSplit "return to userspace via iretq" from intr_fast_exit into intr_user_exit.
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@

6 years agoRemove the cpu_reset_needs_v4_MMU_disable flag; it's always true for hardware
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@

6 years agoUse process-private futexes. This avoids the overhead of calling into uvm
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@

6 years agohonor SIZE extension when advertised by peer
gilles [Mon, 4 Jun 2018 21:46:56 +0000 (21:46 +0000)]
honor SIZE extension when advertised by peer

ok millert@

6 years agofor "match", document that envelopes that do not match anything are rejected,
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

6 years agoremove "from local" (the default) from one of the match rules: the line
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

6 years agoSync VFS documentation with reality
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

6 years agoAllow specifying binary via ROUTE
kn [Mon, 4 Jun 2018 19:22:13 +0000 (19:22 +0000)]
Allow specifying binary via ROUTE

OK bluhm jca

6 years agoZap unused mifi_t.
kn [Mon, 4 Jun 2018 19:20:12 +0000 (19:20 +0000)]
Zap unused mifi_t.

OK bluhm mpi jca

6 years agoZap unused sockaddr.
kn [Mon, 4 Jun 2018 19:17:37 +0000 (19:17 +0000)]
Zap unused sockaddr.

OK bluhm deraadt jca

6 years agodrop BUMPTIME
cheloha [Mon, 4 Jun 2018 18:16:43 +0000 (18:16 +0000)]
drop BUMPTIME

unused since v1.76, ca 5.3

ok kettenis@ deraadt@

6 years agoFix file descriptor leak.
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@

6 years agotweak previous;
jmc [Mon, 4 Jun 2018 16:34:09 +0000 (16:34 +0000)]
tweak previous;

6 years agoadd support for mda wrappers allowing postmaster to define command wrappers
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@

6 years agoin non-DIAGNOSTIC kernels, rw_assert_wrlock becomes a nop which leaves the
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

6 years ago4-bit bus width is mandatory for SDIO cards that support High Speed
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@

6 years agoRemove the extra pager code when compiled without the BACKWARDS flag.
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@

6 years agoDefinitively choose the existing semantics for the scroll and null command.
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@

6 years agoThe function pf_create_state() calls pf_set_protostate() before
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@

6 years agotweak the text of the relaying example: make it clear that the example
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

6 years agoCleanup IPsec output error handling with consistent goto drop.
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@

6 years ago"match auth" matches transactions that *have been* authenticated;
jmc [Mon, 4 Jun 2018 11:52:40 +0000 (11:52 +0000)]
"match auth" matches transactions that *have been* authenticated;
ok gilles

6 years agoSwitch to SDIO High Speed mode if the host controller supports it.
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@

6 years agoimxesdhc(4) also supports High Speed mode for SD.
patrick [Mon, 4 Jun 2018 10:33:51 +0000 (10:33 +0000)]
imxesdhc(4) also supports High Speed mode for SD.

ok kettenis@

6 years agoRemove unused/commented out includes.
kettenis [Mon, 4 Jun 2018 09:25:16 +0000 (09:25 +0000)]
Remove unused/commented out includes.

6 years agoRemove unused include.
kettenis [Mon, 4 Jun 2018 09:24:49 +0000 (09:24 +0000)]
Remove unused include.

6 years agoRemove unused include.
kettenis [Mon, 4 Jun 2018 09:19:52 +0000 (09:19 +0000)]
Remove unused include.

6 years agoNuke unused variable.
kevlo [Mon, 4 Jun 2018 05:24:11 +0000 (05:24 +0000)]
Nuke unused variable.

ok deraadt@

6 years agoAdd VB_DUPOK to suppress witness(4) warning of concurrent mount locks.
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@

6 years ago...and correct the count at which warning normally occurs
guenther [Mon, 4 Jun 2018 04:52:33 +0000 (04:52 +0000)]
...and correct the count at which warning normally occurs

6 years agoXr witness 4
guenther [Mon, 4 Jun 2018 04:49:08 +0000 (04:49 +0000)]
Xr witness 4

6 years agoAdd RW_DUPOK for suppressing witness checks for specific rw_enter() calls
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@

6 years agoUse variable names for rtable and rdomain consistently in the in_pcb
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@

6 years agoAdd ret protctor options as no-ops.
mortimer [Sun, 3 Jun 2018 21:30:38 +0000 (21:30 +0000)]
Add ret protctor options as no-ops.

6 years agoRename the incpb table field inpt_hash to inpt_mask as it contains
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@

6 years agoFix previous by restoring inadvertantly deleted check for
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@.

6 years agoConsistently call the inpcb table parameter "table" in in6_pcbnotify().
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@

6 years agoRemove #ifdef __XSCALE__ bits. No binary change.
kettenis [Sun, 3 Jun 2018 18:58:11 +0000 (18:58 +0000)]
Remove #ifdef __XSCALE__ bits.  No binary change.

ok deraadt@

6 years agoSIOCSIFNETMASK takes a 'struct ifreq', so use 'ifr' for it and drop the
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

6 years agoon i386, libm does sysctl to discover is the system has SSE. Whitelist
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

6 years agoChange the set_parent() interface to pass the full parent specification
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@

6 years agoBetter version of the refactoring attempted in r1.154. Move SIOCSIFADDR
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.

6 years agoMake DMA work on Samsung Exynos. The crucial bit that makes it work is
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.

6 years agoOn amd64, arm64, armv7, i386 and sparc64 /usr/bin/{cc,c++,clang++,clang-cpp}
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

6 years agoAllocate a dedicated buffer for use when deriving a shared key during
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@

6 years agoCheck the return value from DH_size() in ssl3_send_client_kex_dhe().
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@

6 years agoImplement process-shared futexes. These are now the default implementation.
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@

6 years agosplit forkmda() in two:
gilles [Sun, 3 Jun 2018 14:04:06 +0000 (14:04 +0000)]
split forkmda() in two:
- forkmda() creates the process that will be used for the delivery and does
  the switching of privileges then calls mda_unpriv()
- mda_unpriv() runs with privileges of the recipient, it expands variables,
  sets up environment and executes the mda

ok millert@ and eric@

6 years agoWork around a bug where discarding the .ARM.exidx section in the armv7 kernel
kettenis [Sun, 3 Jun 2018 12:34:03 +0000 (12:34 +0000)]
Work around a bug where discarding the .ARM.exidx section in the armv7 kernel
linker script makes ld.lld(1) crash.  This has been fixed in a different
(proper?) way upstream but backporting their fix is a bit too invasive.

ok patrick@

6 years agoSync manual with the const changes introduced in pcap.h rev 1.20.
tb [Sun, 3 Jun 2018 10:45:15 +0000 (10:45 +0000)]
Sync manual with the const changes introduced in pcap.h rev 1.20.

6 years agoChange some libpcap functions which use pointers as arguments and
sthen [Sun, 3 Jun 2018 10:29:28 +0000 (10:29 +0000)]
Change some libpcap functions which use pointers as arguments and
returns to const pointers:

- the prefix argument to pcap_perror();
- the return value of pcap_strerror();
- the filter expression argument to pcap_compile() and pcap_compile_nopcap();
- the BPF filter program argument to bpf_image().

Matches changes made earlier in tcpdump.org's version of libpcap.
From Guy Harris, ok tb@, been through a bulk ports build.