openbsd
8 years agoAdd 'p' trace point for KTRFAC_PLEDGE, as noted by
guenther [Mon, 18 Jul 2016 09:36:50 +0000 (09:36 +0000)]
Add 'p' trace point for KTRFAC_PLEDGE, as noted by
Michal Mazurek <akfaew@jasminek.net>

While here, fix handling of -t+ in ltrace.

8 years agoRemote regression tests should not run ssh with -t all the time.
bluhm [Mon, 18 Jul 2016 09:09:24 +0000 (09:09 +0000)]
Remote regression tests should not run ssh with -t all the time.
This will make it easier to automate them.

8 years agoPolish:
guenther [Mon, 18 Jul 2016 08:43:16 +0000 (08:43 +0000)]
Polish:
 - copy #define workaround from mips64 to avoid dangling __CERROR symbol
 - remove trap DL_SYSCALL2_NOERR() macro with comment explanation
 - make DL_SYSCALL2() self-contained
 - add END() and ENTRY() macros to make the symbol table shine

ok miod@

8 years agoAdd some unsigned overflow checks for extra_pad. None of these
djm [Mon, 18 Jul 2016 06:08:01 +0000 (06:08 +0000)]
Add some unsigned overflow checks for extra_pad. None of these
are reachable with the amount of padding that we use internally.
bz#2566, pointed out by Torben Hansen. ok markus@

8 years agoUpdated advice^Wcode from miod@ for passing &_DYNAMIC to _dl_boot_bind
guenther [Mon, 18 Jul 2016 04:35:57 +0000 (04:35 +0000)]
Updated advice^Wcode from miod@ for passing &_DYNAMIC to _dl_boot_bind

ok aoyama@

8 years agodon't mix code and decls, ok tedu@
bcook [Mon, 18 Jul 2016 01:04:52 +0000 (01:04 +0000)]
don't mix code and decls, ok tedu@

8 years agouse memset to initialize the union
bcook [Sun, 17 Jul 2016 22:01:01 +0000 (22:01 +0000)]
use memset to initialize the union

8 years agoremove unused OPENSSL_NO_OBJECT case
bcook [Sun, 17 Jul 2016 21:23:50 +0000 (21:23 +0000)]
remove unused OPENSSL_NO_OBJECT case

ok tedu@

8 years agoInitialize buffers before use, noted by Kinichiro Inoguchi.
bcook [Sun, 17 Jul 2016 21:21:40 +0000 (21:21 +0000)]
Initialize buffers before use, noted by Kinichiro Inoguchi.

ok beck@

8 years agoAttach sunxi(4) based on the compatible property of the root node of the
kettenis [Sun, 17 Jul 2016 17:45:14 +0000 (17:45 +0000)]
Attach sunxi(4) based on the compatible property of the root node of the
device tree like we do on omap.  Add preliminary support for the sun5i
variant which corresponds to the A13 and A10s SoCs.

ok patrick@

8 years agogetopt(3) can be called twice (once for bc and once for dc), so reinit getopt
otto [Sun, 17 Jul 2016 17:30:47 +0000 (17:30 +0000)]
getopt(3) can be called twice (once for bc and once for dc), so reinit getopt
ok deraadt@

8 years agostrip back asn1parse; ok beck jsing
jmc [Sun, 17 Jul 2016 16:33:17 +0000 (16:33 +0000)]
strip back asn1parse; ok beck jsing
description of -out altered on jsing's advice

8 years agoTalk about event API instead of libevent
stefan [Sun, 17 Jul 2016 11:21:07 +0000 (11:21 +0000)]
Talk about event API instead of libevent

Avoids inconsistent capitalization of libevent at start of sentence
suggested by and ok jmc@, ok bluhm@

8 years agosupport UTF-8 characters in ssh(1) banners using schwarze@'s
djm [Sun, 17 Jul 2016 04:20:16 +0000 (04:20 +0000)]
support UTF-8 characters in ssh(1) banners using schwarze@'s
safe fmprintf printer; bz#2058

feedback schwarze@ ok dtucker@

8 years agoRemove now obsolete parenthetical explanation (should have been part of
tb [Sun, 17 Jul 2016 04:15:25 +0000 (04:15 +0000)]
Remove now obsolete parenthetical explanation (should have been part of
previous commit).

8 years ago1. Update manpage in view of the change of behavior I introduced in -r1.27.
tb [Sun, 17 Jul 2016 04:04:46 +0000 (04:04 +0000)]
1. Update manpage in view of the change of behavior I introduced in -r1.27.

The bounds are taken inclusive and -w %d doesn't change the output of
integer random sequences anymore.  This is the same behavior as that
of Linux and NetBSD, but differs from FreeBSD and OS X.

Issue reported by Philippe Meunier on misc@.

2 Fix a bug from the same commit observed by Otto: if the precision is 0,
values may be printed out of bounds.  Fall back to the old behavior if at
least one bound isn't an integer.

General agreement expressed by otto@, tedu@, jmc@, sobrado@
Help with checking other operating systems by sobrado@.

Manpage ok jmc@.
Bugfix discussed with otto@ on icb

8 years agoAdapt kettenis' pinctrl changes in imx to sitaracm and
jsg [Sun, 17 Jul 2016 02:45:05 +0000 (02:45 +0000)]
Adapt kettenis' pinctrl changes in imx to sitaracm and
pinctrl-single,pins to handle mux settings and pad configuration.

The fdt data has offsets from the start of the pinmux address range so
the am335x specific pinmux offset from the scm base is added to the
offsets.  This as not a new driver as sitaracm does manual table
driven pad configuration for gpio.  If all the offsets in the
ti_padconf_devmap table were reduced by the am335x pinmux offset (0x800)
it may make sense to map only the pinmux memory region and not the
scm superset.

looks good kettenis@

8 years agouse the fdt root node instead of board ids to test for am335x
jsg [Sun, 17 Jul 2016 00:28:46 +0000 (00:28 +0000)]
use the fdt root node instead of board ids to test for am335x

8 years agoSet function pointers based on the fdt root node instead of board ids.
jsg [Sun, 17 Jul 2016 00:25:21 +0000 (00:25 +0000)]
Set function pointers based on the fdt root node instead of board ids.
ok kettenis@ on an earlier version

8 years agoSet function pointers based on the fdt root node instead of board ids.
jsg [Sun, 17 Jul 2016 00:21:13 +0000 (00:21 +0000)]
Set function pointers based on the fdt root node instead of board ids.
ok kettenis@

8 years agosync
millert [Sat, 16 Jul 2016 21:03:26 +0000 (21:03 +0000)]
sync

8 years agoRemove potential overflow when validating message's length.
renato [Sat, 16 Jul 2016 19:24:30 +0000 (19:24 +0000)]
Remove potential overflow when validating message's length.

Also, use uint16_t for msg_type on gen_msg_hdr().

8 years agoFix parsing of mal-formed optional TLVs/Sub-TLVs.
renato [Sat, 16 Jul 2016 19:20:16 +0000 (19:20 +0000)]
Fix parsing of mal-formed optional TLVs/Sub-TLVs.

We must detect if a TLV's length extends beyond the end of the containing
message. And, if so, send a fatal "Bad TLV Length" notification message.

Found with the Mu Dynamics Mu-8000 protocol fuzzer.

8 years agoFix sockopt name: ICMPV6_FILTER -> ICMP6_FILTER
jca [Sat, 16 Jul 2016 18:55:55 +0000 (18:55 +0000)]
Fix sockopt name: ICMPV6_FILTER -> ICMP6_FILTER

8 years agoremove an unused parameter that wasn't handled during a previous refactor
mlarkin [Sat, 16 Jul 2016 18:36:41 +0000 (18:36 +0000)]
remove an unused parameter that wasn't handled during a previous refactor
(reducing the number of XXXs in vmm)

8 years agoClean up OCSP_check_validity() a bit more.
beck [Sat, 16 Jul 2016 16:14:28 +0000 (16:14 +0000)]
Clean up OCSP_check_validity() a bit more.
- Return on first failure rather than continuing.
- Don't compare times by comparing strings that possibly were not parsable as a time.
ok deraadt@

8 years agoFix example: long long should be print with %lld
jca [Sat, 16 Jul 2016 16:10:44 +0000 (16:10 +0000)]
Fix example: long long should be print with %lld

8 years agoSupport MSI-X in virtio
sf [Sat, 16 Jul 2016 12:07:21 +0000 (12:07 +0000)]
Support MSI-X in virtio

This increases performance for interrupt heavy loads.

While suspend/resume support for MSI-X is missing, this is also missing for
virtio. So no new issue there.

Currently, qemu's old "82441FX" pci-bridge is still blacklisted for MSI. But
MSI-X is used if qemu is started with "-M q35".

8 years agoAdd $OpenBSD$ / replace $Id$ with $OpenBSD$.
visa [Sat, 16 Jul 2016 10:41:53 +0000 (10:41 +0000)]
Add $OpenBSD$ / replace $Id$ with $OpenBSD$.

8 years agoRemove octeon_disable_interrupt() and octeon_restore_status().
visa [Sat, 16 Jul 2016 10:19:55 +0000 (10:19 +0000)]
Remove octeon_disable_interrupt() and octeon_restore_status().
They are unused and equivalent to disableintr() and setsr().

While here, clean up a few other leftovers.

8 years agoFix typo in comment in three machdep.c files:
tom [Sat, 16 Jul 2016 08:53:37 +0000 (08:53 +0000)]
Fix typo in comment in three machdep.c files:

s/names are this level/names at this level/

from aalm@ - thanks

8 years agosince we no longer pull source directly from openssl, the time is
jmc [Sat, 16 Jul 2016 07:27:53 +0000 (07:27 +0000)]
since we no longer pull source directly from openssl, the time is
right to try and trim some of the excess from this page. begin now
by cutting some of the fluff from the start.

the section on pass phrase arguments goes to the end of the page: it;s in
the way for now.

8 years ago- add proxyjump to the options list
jmc [Sat, 16 Jul 2016 06:57:55 +0000 (06:57 +0000)]
- add proxyjump to the options list
- formatting fixes
- update usage()

ok djm

8 years agoRemove unused function process_frame() from arm_machdep.c
tom [Sat, 16 Jul 2016 06:41:20 +0000 (06:41 +0000)]
Remove unused function process_frame() from arm_machdep.c

ok jsg@

8 years agoremove unused vmm_activate function. all vmm-specific suspend/resume needs
mlarkin [Sat, 16 Jul 2016 06:32:18 +0000 (06:32 +0000)]
remove unused vmm_activate function. all vmm-specific suspend/resume needs
are handled during cpu hatch.

8 years agoFix an incorrect shift value when calculating the mask for the VMCS MSR
mlarkin [Sat, 16 Jul 2016 06:20:24 +0000 (06:20 +0000)]
Fix an incorrect shift value when calculating the mask for the VMCS MSR
list storage size. Noticed when attempting to get vmm(4) to nest under
Hyper-V.

8 years agoremove some 12 year old code that was never correct, and never compiled
mlarkin [Sat, 16 Jul 2016 06:08:52 +0000 (06:08 +0000)]
remove some 12 year old code that was never correct, and never compiled
anyway due to a missing #include.

the code was originally intended to handle i386 SMP EISA machines with an
IOAPIC. Since the code never was compiled, and nobody has noticed or
complained for 12 years, I think things are probably fine.

8 years agoremove some unused #includes
mlarkin [Sat, 16 Jul 2016 06:04:29 +0000 (06:04 +0000)]
remove some unused #includes

8 years agoLimit the support of the "backward compatible" ssl2 handshake to only be
beck [Sat, 16 Jul 2016 04:42:35 +0000 (04:42 +0000)]
Limit the support of the "backward compatible" ssl2 handshake to only be
used if TLS 1.0 is enabled. Sugessted/discussed with jsing@ and bcook@.
ok guenther@ sthen@

8 years agoRemove duplicated line in omap mmc driver, which would cause
tom [Fri, 15 Jul 2016 22:28:25 +0000 (22:28 +0000)]
Remove duplicated line in omap mmc driver, which would cause
clkbase to be set to 0 (if it wasn't all commented out anyway).

ok patrick@

8 years agoRemove duplicate line in amd64/acpi_machdep.c
tom [Fri, 15 Jul 2016 22:05:40 +0000 (22:05 +0000)]
Remove duplicate line in amd64/acpi_machdep.c

ok krw@

8 years agoTo remove the const qualifier from a pointer to an object - either
schwarze [Fri, 15 Jul 2016 19:31:53 +0000 (19:31 +0000)]
To remove the const qualifier from a pointer to an object - either
because we know it is actually mutable or because we are passing
it to a function that doesn't accept a const object but won't
actually attempt to modify it - simply casting from (const type *)
to (type *) is legal C and clearly expresses the intent.
So get rid of the obfuscating UNCONST macro.
Basic idea discussed with guenther@.

8 years agoRemove unused re_nbits from dev/rnd.c
tom [Fri, 15 Jul 2016 19:02:30 +0000 (19:02 +0000)]
Remove unused re_nbits from dev/rnd.c

"another leftover of the bean counter"

od tedu@ deraadt@

8 years agoFix previous: the mandocdb() prototype was already there, it just
schwarze [Fri, 15 Jul 2016 18:49:53 +0000 (18:49 +0000)]
Fix previous: the mandocdb() prototype was already there, it just
hid among static functions, as noticed by tedu@ (my bad).

8 years agoadd missing prototypes, no code change;
schwarze [Fri, 15 Jul 2016 18:02:32 +0000 (18:02 +0000)]
add missing prototypes, no code change;
noticed by Christos Zoulas with -Wmissing-prototypes

8 years agoImprove logging of reserved labels.
renato [Fri, 15 Jul 2016 17:09:25 +0000 (17:09 +0000)]
Improve logging of reserved labels.

Print "exp-null" and "imp-null" instead of "0" and "3", for example. Also,
remove print_label() and print_pw_type() from ldpctl.c and use the
equivalent functions from ldpd's log.c.

While here, be more paranoid and use UINT32_MAX instead of UINT_MAX
for NO_LABEL.

8 years agoExplicitly ignore the Hop Count and Path Vector TLVs.
renato [Fri, 15 Jul 2016 17:05:50 +0000 (17:05 +0000)]
Explicitly ignore the Hop Count and Path Vector TLVs.

Since these are "well known" TLVs, we have to explicitly ignore them
otherwise ldpd would send "Unknown TLV" Notification messages when it
shouldn't.

Fixes regression caused by rev1.51.

8 years agoUpdate per-neighbor GTSM options on config reload.
renato [Fri, 15 Jul 2016 17:03:10 +0000 (17:03 +0000)]
Update per-neighbor GTSM options on config reload.

8 years agodisable acpicbkbd by default until after the release when acpi ec
jcs [Fri, 15 Jul 2016 14:40:15 +0000 (14:40 +0000)]
disable acpicbkbd by default until after the release when acpi ec
issues can be worked out, otherwise this driver will cause the
kernel to spin forever on certain chromebooks

8 years agoTweak output of environment logging.
nicm [Fri, 15 Jul 2016 09:52:34 +0000 (09:52 +0000)]
Tweak output of environment logging.

8 years agoLog environment to new panes.
nicm [Fri, 15 Jul 2016 09:28:32 +0000 (09:28 +0000)]
Log environment to new panes.

8 years agoWrap some long lines and apply some static.
nicm [Fri, 15 Jul 2016 09:27:35 +0000 (09:27 +0000)]
Wrap some long lines and apply some static.

8 years agoSwitch m88k to pass &_DYNAMIC to _dl_boot_bind()
guenther [Fri, 15 Jul 2016 09:25:47 +0000 (09:25 +0000)]
Switch m88k to pass &_DYNAMIC to _dl_boot_bind()

probably works: this ASM pattern is already used for _dl_dtors

8 years agotake us out of -beta
deraadt [Fri, 15 Jul 2016 05:06:24 +0000 (05:06 +0000)]
take us out of -beta

8 years agoReduce the syslog level of some relatively common protocol events
dtucker [Fri, 15 Jul 2016 05:01:58 +0000 (05:01 +0000)]
Reduce the syslog level of some relatively common protocol events
from LOG_CRIT by replacing fatal() calls with logdie().  Part of
bz#2585, ok djm@

8 years agoDon't update cells in each block of data read from a pane immediately,
nicm [Fri, 15 Jul 2016 00:49:08 +0000 (00:49 +0000)]
Don't update cells in each block of data read from a pane immediately,
instead track them as change (dirty) and update them once at the end,
saves much time if repeatedly writing the same cell. Also fix comparison
of cells being equal in a few places (memcmp is not enough).

8 years agoInstead of representing colours in several different forms with various
nicm [Fri, 15 Jul 2016 00:42:56 +0000 (00:42 +0000)]
Instead of representing colours in several different forms with various
cell flags, convert to use an int with flags marking 256 or RGB colours
in the top byte (except in cells, which we don't want to make any
bigger). From Brad Town.

8 years agoAdd a ProxyJump ssh_config(5) option and corresponding -J ssh(1)
djm [Fri, 15 Jul 2016 00:24:30 +0000 (00:24 +0000)]
Add a ProxyJump ssh_config(5) option and corresponding -J ssh(1)
command-line flag to allow simplified indirection through a
SSH bastion or "jump host".

These options construct a proxy command that connects to the
specified jump host(s) (more than one may be specified) and uses
port-forwarding to establish a connection to the next destination.

This codifies the safest way of indirecting connections through SSH
servers and makes it easy to use.

ok markus@

8 years agokern.usermount is currently a no-op;
jmc [Thu, 14 Jul 2016 17:34:06 +0000 (17:34 +0000)]
kern.usermount is currently a no-op;
ok deraadt

8 years agoMake sure that amap slot calculation does not overflow
stefan [Thu, 14 Jul 2016 16:23:49 +0000 (16:23 +0000)]
Make sure that amap slot calculation does not overflow

This prevents from too small amaps being allocated by
forcing the allocation of a large number of slots.

Based on an analysis from Jesse Hertz and Tim Newsham.

ok kettenis@

8 years agosync
deraadt [Thu, 14 Jul 2016 15:47:33 +0000 (15:47 +0000)]
sync

8 years agokern.usermount=1 is unsafe for everyone, since it allows any non-pledged
deraadt [Thu, 14 Jul 2016 15:39:40 +0000 (15:39 +0000)]
kern.usermount=1 is unsafe for everyone, since it allows any non-pledged
program to call the mount/umount system calls.  There is no way any user
can be expected to keep their system safe / reliable with this feature.
Ignore setting to =1, and after release we'll delete the sysctl entirely.
ok lots of people

8 years agoDrop received packets with an IPv4-compatible address as source or
mpi [Thu, 14 Jul 2016 14:39:12 +0000 (14:39 +0000)]
Drop received packets with an IPv4-compatible address as source or
destination as per RFC4213.

We're not in 1999 anymore, what was earlier a "stronger check than
RFC1933" is now a best practice.  This matches the behavior of the
reject (R) routes added by default by netstart(8).

ok jca@, florian@, claudio@, bluhm@

8 years agoDo board-specific delay/skew corrections for the Micrel KSZ9021 and KSZ9031
kettenis [Thu, 14 Jul 2016 14:05:51 +0000 (14:05 +0000)]
Do board-specific delay/skew corrections for the Micrel KSZ9021 and KSZ9031
PHYs based on device tree properties instead of the board ID.  Untested as
I don't have the hardware.

ok jsg@, patrick@

8 years agoPrevent a use-after-free by not updating an ARP entry that has been
mpi [Thu, 14 Jul 2016 14:01:40 +0000 (14:01 +0000)]
Prevent a use-after-free by not updating an ARP entry that has been
removed from the table.

Currently the storage for L2 addresses is freed when an entry is
removed from the table.  That means that we cannot access this
chunk of memory between RTM_DELETE and rtfree(9).

Note that this doesn't apply to MPLS because the associated storage
is currently released by the last rtfree(9).

ok mikeb@

8 years agovioblk: Properly handle poll timeout
sf [Thu, 14 Jul 2016 12:50:07 +0000 (12:50 +0000)]
vioblk: Properly handle poll timeout

The only way to ensure that the device does not do DMA for the timed out
request is a device reset.

Also increase the timeout to 15s

8 years agorename virtio_ops.intr to poll_intr
sf [Thu, 14 Jul 2016 12:44:53 +0000 (12:44 +0000)]
rename virtio_ops.intr to poll_intr

This describes more accurately what it is good for.

Also introduce a virtio_poll_intr macro.

8 years agovirtio: Move interrupt handler into transport specific code
sf [Thu, 14 Jul 2016 12:42:00 +0000 (12:42 +0000)]
virtio: Move interrupt handler into transport specific code

For MSI-X (and also possibly for other transports), the interrupt
handler must do different things.  Move it out of virtio.c and into
virtio_pci.

ARM part tested by patrick@

8 years agomake several program to use "chown" promise.
semarie [Thu, 14 Jul 2016 08:31:18 +0000 (08:31 +0000)]
make several program to use "chown" promise.

it allows chown(2) call to change the user or group on a file.

- usr.bin/compress : aka gzip
- usr.bin/mg : open a file for writing
- usr.bin/sed : inplace editing
- usr.bin/sort : if outfile equals one of the input files

ok deraadt@ tb@

(and a reminder from Remi Locherer)

warning: in order to use it, you must have a recent kernel with the new
promise.

8 years agoAdd PT_GNU_RELRO, for ld.so work
guenther [Thu, 14 Jul 2016 06:03:46 +0000 (06:03 +0000)]
Add PT_GNU_RELRO, for ld.so work

ok millert@ kettenis@

8 years agoPrevent silly states via knotes on pids > 2^32 and on nonexistent signals.
guenther [Thu, 14 Jul 2016 05:55:08 +0000 (05:55 +0000)]
Prevent silly states via knotes on pids > 2^32 and on nonexistent signals.

ok tedu@

8 years agoufs_readdir() buffer was meant to be limited to 64kB; reversed test
guenther [Thu, 14 Jul 2016 03:34:28 +0000 (03:34 +0000)]
ufs_readdir() buffer was meant to be limited to 64kB; reversed test
permitted very big mallocs to panic the kernel.

reported by Tim Newsham
ok millert@

8 years agokevent validates that ident is a valid fd by getting the file. one sad
tedu [Thu, 14 Jul 2016 02:35:17 +0000 (02:35 +0000)]
kevent validates that ident is a valid fd by getting the file. one sad
quirk: uint64 to int32 truncation can lead to false positives, and then
later in the array sizing code, very big mallocs panic the kernel.
add a check that the ident isn't larger than INT_MAX in the fd case.
reported by Tim Newsham

8 years agoCorrect equal in test.
dtucker [Thu, 14 Jul 2016 01:24:21 +0000 (01:24 +0000)]
Correct equal in test.

8 years agoA work-in-progress driver for the Hyper-V NetVSC
mikeb [Wed, 13 Jul 2016 21:59:35 +0000 (21:59 +0000)]
A work-in-progress driver for the Hyper-V NetVSC

Network VSC is an RNDIS device using NVSP protocol to communicate
with the Hyper-V VMBus via VMBus channels and/or shared memory. The
code was ported from FreeBSD with some API changes and simplifications.

While the Rx path is nearly complete, packet transmition is not
implemented yet.

ok deraadt, mlarkin

8 years agoWhen matching a day in the month, make sure that the date is still
millert [Wed, 13 Jul 2016 21:32:01 +0000 (21:32 +0000)]
When matching a day in the month, make sure that the date is still
in the month we are interested in after calling mktime(3).  This
fixes things like Sunday+5 for months where there is not a 5th
Sunday and the 31st day in months with less than 31 days.
From Andy Bradford

8 years agoThe "#address-cells" and "#size-cells" properties define the size
patrick [Wed, 13 Jul 2016 20:42:44 +0000 (20:42 +0000)]
The "#address-cells" and "#size-cells" properties define the size
of the memory address and length information.  The root node passes
this information down to the children and it can be overwritten by
other nodes inbetween.  Pass these properties as part of the fdt
attach args, so that we can grab that information quickly inside
the drivers.

ok kettenis@

8 years agoross l richardson reports that an auto reply is no longer generated
jmc [Wed, 13 Jul 2016 20:31:27 +0000 (20:31 +0000)]
ross l richardson reports that an auto reply is no longer generated
on submission, so remove that sentence (correct me if this is wrong);

while here replace some mandoc chars;

8 years agooutput the no-longer-so-new AS operators when printing the
benno [Wed, 13 Jul 2016 20:07:38 +0000 (20:07 +0000)]
output the no-longer-so-new AS operators when printing the
configuration
noticed by and diff from Denis Fondras, thanks!

ok phessler@ sthen@

8 years agoSince mappings established using __MAP_NOFAULT will be converted into anonymous
kettenis [Wed, 13 Jul 2016 17:52:37 +0000 (17:52 +0000)]
Since mappings established using __MAP_NOFAULT will be converted into anonymous
memory if the file backing the mapping is truncated, we should check resource
limits.  This prevents callers from triggering a kernel panic and a potential
integer overflow in the amap code by forcing the allocation of too many slots.

Based on an analysis from Jesse Hertz and Tim Newsham.

ok deraadt@

8 years agoRevert previous; the __MAP_NOFAULT test is inverted and the commit message is
kettenis [Wed, 13 Jul 2016 17:49:00 +0000 (17:49 +0000)]
Revert previous; the __MAP_NOFAULT test is inverted and the commit message is
wrong.

8 years agoMove ARP processing back to the KERNEL_LOCK()ed task until the race
mpi [Wed, 13 Jul 2016 16:45:19 +0000 (16:45 +0000)]
Move ARP processing back to the KERNEL_LOCK()ed task until the race
triggered by updating a cached, but removed from the table, entry is
properly fixed.

Diff from dlg@, prodding deraadt@

8 years agoAdjust existing tls_config_set_cipher() callers for TLS cipher group
jsing [Wed, 13 Jul 2016 16:35:47 +0000 (16:35 +0000)]
Adjust existing tls_config_set_cipher() callers for TLS cipher group
changes - map the previous configuration to the equivalent in the new
groups. This will be revisited post release.

Discussed with beck@

8 years agoSplit the existing TLS cipher suite groups into four:
jsing [Wed, 13 Jul 2016 16:30:48 +0000 (16:30 +0000)]
Split the existing TLS cipher suite groups into four:

"secure" (TLSv1.2+AEAD+PFS)
"compat" (HIGH:!aNULL)
"legacy" (HIGH:MEDIUM:!aNULL)
"insecure" (ALL:!aNULL:!eNULL)

This allows for flexibility and finer grained control, rather than having
two extremes (an issue raised by Marko Kreen some time ago).

ok beck@ tedu@

8 years agoSince mappings established using __MAP_NOFAIL will be converted into anonymous
kettenis [Wed, 13 Jul 2016 15:57:35 +0000 (15:57 +0000)]
Since mappings established using __MAP_NOFAIL will be converted into anonymous
memory if the file backing the mapping is truncated, we should check resource
limits.  This prevents callers from triggering a kernel panic and a potential
integer overflow in the amap code by forcing the allocation of too many slots.

Based on an analysis from Jesse Hertz and Tim Newsham.

ok deraadt@

8 years agoremove <0 check for an unsigned variable
deraadt [Wed, 13 Jul 2016 15:41:51 +0000 (15:41 +0000)]
remove <0 check for an unsigned variable
from tom

8 years agoremove unused function ether_cmp()
deraadt [Wed, 13 Jul 2016 15:40:26 +0000 (15:40 +0000)]
remove unused function ether_cmp()
from tom

8 years agoUse the device tree voltage regulator information to supply power to the USB
kettenis [Wed, 13 Jul 2016 09:12:46 +0000 (09:12 +0000)]
Use the device tree voltage regulator information to supply power to the USB
bus.  For this only supports "fixed" regulators that are controlled through a
gpio.  But this covers all the case we currently handle with board ID specific
code.  Note that the old code did explicitly remove power first on some boards,
which would reset bus-powered devices/hubs on the bus.  The new code doesn't do
this.  If that causes problems we can revisit the issue.  The boards that would
be affected are sabrelight/nitrogen6x and utilite.

The plan is to evolve this into a generic regulator framework that supports
more complex regulator types as well.

ok jsg@, patrick@

8 years agoIntroduce RTF_MULTICAST and flag corresponding IPv6 routes as such
mpi [Wed, 13 Jul 2016 08:40:46 +0000 (08:40 +0000)]
Introduce RTF_MULTICAST and flag corresponding IPv6 routes as such
instead of abusing RTF_CLONING.

Fix a leak reporeted by Aaron Riekenberg on misc@, ok sthen@

8 years agoCPUID vendor ID was already register-swapped during initial query, so no
mlarkin [Wed, 13 Jul 2016 06:57:35 +0000 (06:57 +0000)]
CPUID vendor ID was already register-swapped during initial query, so no
need to do it again.

8 years agoFix usage() output and getopt sorting
guenther [Wed, 13 Jul 2016 06:17:11 +0000 (06:17 +0000)]
Fix usage() output and getopt sorting

8 years agostore nd6 expiries in the route, not separately in the llinfo struct.
dlg [Wed, 13 Jul 2016 01:51:22 +0000 (01:51 +0000)]
store nd6 expiries in the route, not separately in the llinfo struct.

this makes it more consistent with arp, and makes expiries visible
via route(8) get as well as ndp(8).

ok mpi@ florian@

8 years agoDocument that the syslogd options -c and -k must be used together.
bluhm [Tue, 12 Jul 2016 23:04:30 +0000 (23:04 +0000)]
Document that the syslogd options -c and -k must be used together.
OK jmc@

8 years agoReset the mt state completely in wsmouse_mt_init.
bru [Tue, 12 Jul 2016 22:02:53 +0000 (22:02 +0000)]
Reset the mt state completely in wsmouse_mt_init.

ok kettenis@

8 years agoThe only valid flag for unmount(2) is MNT_FORCE, ignore any others.
millert [Tue, 12 Jul 2016 20:53:04 +0000 (20:53 +0000)]
The only valid flag for unmount(2) is MNT_FORCE, ignore any others.
Fixes a crash when MNT_DOOMED is passed in the flags to unmount(2)
found by NCC Group.  OK bluhm@

8 years agoTurn ahci(4) glue code for the i.MX6 platform into its own imxahci(4) driver
kettenis [Tue, 12 Jul 2016 19:17:49 +0000 (19:17 +0000)]
Turn ahci(4) glue code for the i.MX6 platform into its own imxahci(4) driver
such that we can don't end up with conflicting attachments of other
SoC-specific glue code.

8 years agoChange over to imxehci(4) here as well.
kettenis [Tue, 12 Jul 2016 19:04:53 +0000 (19:04 +0000)]
Change over to imxehci(4) here as well.

8 years agoLink path MTU discovery regress test into build.
bluhm [Tue, 12 Jul 2016 15:54:55 +0000 (15:54 +0000)]
Link path MTU discovery regress test into build.

8 years agoAllow to run the syslogd tests as root without SUDO also if the
bluhm [Tue, 12 Jul 2016 15:44:58 +0000 (15:44 +0000)]
Allow to run the syslogd tests as root without SUDO also if the
libevent method environment is set.

8 years agoTurn ehci(4) glue code for the i.MX6 platform into its own imxehci(4) driver
kettenis [Tue, 12 Jul 2016 15:16:00 +0000 (15:16 +0000)]
Turn ehci(4) glue code for the i.MX6 platform into its own imxehci(4) driver
such that we can don't end up with conflicting attachments of other
SoC-specific glue code.

ok jsg@, patrick@