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).
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.
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@
jmc [Thu, 14 Jul 2016 17:34:06 +0000 (17:34 +0000)]
kern.usermount is currently a no-op;
ok deraadt
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@
deraadt [Thu, 14 Jul 2016 15:47:33 +0000 (15:47 +0000)]
sync
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
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@
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@
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@
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
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.
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@
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.
guenther [Thu, 14 Jul 2016 06:03:46 +0000 (06:03 +0000)]
Add PT_GNU_RELRO, for ld.so work
ok millert@ kettenis@
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@
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@
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
dtucker [Thu, 14 Jul 2016 01:24:21 +0000 (01:24 +0000)]
Correct equal in test.
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
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
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@
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;
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@
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@
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.
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@
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@
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@
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@
deraadt [Wed, 13 Jul 2016 15:41:51 +0000 (15:41 +0000)]
remove <0 check for an unsigned variable
from tom
deraadt [Wed, 13 Jul 2016 15:40:26 +0000 (15:40 +0000)]
remove unused function ether_cmp()
from tom
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@
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@
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.
guenther [Wed, 13 Jul 2016 06:17:11 +0000 (06:17 +0000)]
Fix usage() output and getopt sorting
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@
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@
bru [Tue, 12 Jul 2016 22:02:53 +0000 (22:02 +0000)]
Reset the mt state completely in wsmouse_mt_init.
ok kettenis@
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@
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.
kettenis [Tue, 12 Jul 2016 19:04:53 +0000 (19:04 +0000)]
Change over to imxehci(4) here as well.
bluhm [Tue, 12 Jul 2016 15:54:55 +0000 (15:54 +0000)]
Link path MTU discovery regress test into build.
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.
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@
tedu [Tue, 12 Jul 2016 14:28:02 +0000 (14:28 +0000)]
in the great unp_gc rewrite, a null check was lost. we have spent some
time investigating and arguing about whether a NULL fp is a bug or not,
but what has become clear is that NULL fps get passed to unp_discard
and have been for quite some time.
restore old accomodating behavior by checking for null in unp_gc.
ok deraadt kettenis
deraadt [Tue, 12 Jul 2016 13:19:14 +0000 (13:19 +0000)]
The check for pledge "recvfd" was mistakenly only being performed
for chroot'd processes.
ok stefan semarie
semarie [Tue, 12 Jul 2016 12:10:42 +0000 (12:10 +0000)]
add "recvfd" to doas(1) for use with skey.
ok tb@ deraadt@
bluhm [Tue, 12 Jul 2016 09:57:20 +0000 (09:57 +0000)]
Add regression tests for syslogd TLS client certificates.
bluhm [Tue, 12 Jul 2016 09:47:25 +0000 (09:47 +0000)]
Add support for TLS client certificates in syslogd. This allows a
remote server to verify that the log messages from our syslogd are
authentic.
From Kapetanakis Giannis; man page input jmc@; OK jung@ deraadt@
mpi [Tue, 12 Jul 2016 09:33:13 +0000 (09:33 +0000)]
Directly drop packets filtered by bpf(4) instead of going through the
input handlers.
ok dlg@
deraadt [Tue, 12 Jul 2016 06:06:34 +0000 (06:06 +0000)]
remove more noisy messages in "sendfd" and "recvfd"
schwarze [Mon, 11 Jul 2016 22:46:57 +0000 (22:46 +0000)]
Make all components of the URI individually optional,
independent of each other, as in:
http://man.openbsd.org[/manpath][/mansec][/arch]/name[.sec]
The restrictions in the past kept confusing people.
Triggered by a question from RafaelNeves at gmail dot com.
bluhm [Mon, 11 Jul 2016 22:43:28 +0000 (22:43 +0000)]
Revert previous adaption of the test. The behavior change in libtls
has been backed out.
tedu [Mon, 11 Jul 2016 22:36:25 +0000 (22:36 +0000)]
don't allow mounting with noval owner. panics later.
reported by Tim Newsham at NCC.
ok millert natano
tb [Mon, 11 Jul 2016 21:38:13 +0000 (21:38 +0000)]
Add missing "recvfd" pledge promise: Raf Czlonka reported ssh coredumps
when Control* keywords were set in ssh_config. This patch also fixes
similar problems with scp and sftp.
ok deraadt, looks good to millert
deraadt [Mon, 11 Jul 2016 19:11:34 +0000 (19:11 +0000)]
be less noisy on console in case of "recvfd" refusal
ok semarie
deraadt [Mon, 11 Jul 2016 18:32:29 +0000 (18:32 +0000)]
sync
tb [Mon, 11 Jul 2016 18:30:21 +0000 (18:30 +0000)]
Instead of using the floating point square root, use an integer version
of the Newton method from ping.c. Fixes a rounding issue that caused
failure to factor numbers close to 2^64, e.g.
18446744030759878681.
While there, fix an off by one error that caused
4295360521 to be
reported as a prime. Issues reported by Paul Stoeber and Michael Bozon.
ok tedu, deraadt
kettenis [Mon, 11 Jul 2016 14:56:18 +0000 (14:56 +0000)]
Use gpio framework to implement hardware reset of the PHY instead of
hardcoding particular gpios based on board IDs.
ok visa@, jsg@
kettenis [Mon, 11 Jul 2016 14:54:18 +0000 (14:54 +0000)]
Use gpio framework to implement card detect instead of hardcoding particular
gpios based on board IDs.
ok visa@, jsg@
kettenis [Mon, 11 Jul 2016 14:51:31 +0000 (14:51 +0000)]
Hook up imxgpio(4) to the FDT gpio framework.
ok visa@, jsg@
kettenis [Mon, 11 Jul 2016 14:49:41 +0000 (14:49 +0000)]
Add a simple framework for handling gpio controllers and pins on FDT-enabled
platforms.
ok visa@, jsg@
visa [Mon, 11 Jul 2016 13:23:14 +0000 (13:23 +0000)]
Add CN61xx.
bluhm [Mon, 11 Jul 2016 13:15:20 +0000 (13:15 +0000)]
Add regression tests for the path MTU discovery implementation in
the kernel. Generate TCP and TCP6 and UDP6 packets with Scapy,
check the kernel's reaction to ICMP fragmentation needed and ICMP6
packet too big.
OK mpi@
visa [Mon, 11 Jul 2016 13:08:59 +0000 (13:08 +0000)]
sync
bluhm [Mon, 11 Jul 2016 13:06:31 +0000 (13:06 +0000)]
Path MTU discovery was slightly broken. I took two ICMP packets
to create and change the dynamic route. This behavior was introduced
in net/route.c rev 1.269 when the gateway route allocation was moved
from rt_setgateway() to _rtalloc(). So rtrequest(RTM_ADD) could
return a route without a valid gateway route. To fix this, call
rt_setgwroute() from _rtalloc() and rt_setgateway().
OK mpi@
mpi [Mon, 11 Jul 2016 10:35:43 +0000 (10:35 +0000)]
Do not increase the size of the socket buffer under memory pressure.
From Simon Mages, ok beck@, claudio@, bluhm@
kettenis [Mon, 11 Jul 2016 09:50:02 +0000 (09:50 +0000)]
Initialize oui and model fields in the softc.
ok deraadt@, mpi@
mpi [Mon, 11 Jul 2016 09:23:06 +0000 (09:23 +0000)]
Revert the introduction of ``rt_addr''.
Being able to add route entries without configured addresses is a nice
feature but this is not my fight. So I'd rather no add another pointer
to ``struct rtentry'' if I'm not removing another one.
stefan [Mon, 11 Jul 2016 08:38:49 +0000 (08:38 +0000)]
Make sure variables are used initialized in amap_wiperange
Uninitialized variables used in an if/else could cause a slower
codepath to be taken, but the end effect of both paths is the same.
Found by jsg@
tedu [Mon, 11 Jul 2016 03:19:44 +0000 (03:19 +0000)]
obsolete note about fascistloggin is obsolete. ok djm dtucker
rzalamena [Mon, 11 Jul 2016 00:27:50 +0000 (00:27 +0000)]
Teach tcpdump to recognize MPLS pseudowire with control words. Added
support to print encapsulated ethernet packets as well.
"Looks good" deraadt@
tedu [Sun, 10 Jul 2016 23:07:34 +0000 (23:07 +0000)]
zero the read buffer after copying data to user so it doesn't linger.
ok beck
tedu [Sun, 10 Jul 2016 23:06:48 +0000 (23:06 +0000)]
use offsetof to create an offset instead of illegal unaligned pointers
ok guenther
patrick [Sun, 10 Jul 2016 20:53:04 +0000 (20:53 +0000)]
Not all i.MX6 devices have a pinctrl property in their device nodes.
In that case, soft fail and return instead of allocating buffer with
a bogus size.
ok kettenis@
kettenis [Sun, 10 Jul 2016 20:41:19 +0000 (20:41 +0000)]
Pay attention to Processor Local X2APIC structures. ACPI 6.0 allows these
even for APIC ID values less than 255. Makes secondary CPUs attach on the
HP DL360 gen 9.
tested by jung@
ok guenther@
kettenis [Sun, 10 Jul 2016 20:36:41 +0000 (20:36 +0000)]
Rename apic_proc_uid field to acpi_proc_uid in the acpi_madt_x2apic struct.
It is the ACPI processor UID that is stored here.
ok guenther@
kettenis [Sun, 10 Jul 2016 20:18:56 +0000 (20:18 +0000)]
regen
kettenis [Sun, 10 Jul 2016 20:18:15 +0000 (20:18 +0000)]
Add MICREL KSZ9021 and KSZ9031.
kettenis [Sun, 10 Jul 2016 17:17:22 +0000 (17:17 +0000)]
Fix typo. Pointed out by patrick@
visa [Sun, 10 Jul 2016 15:16:15 +0000 (15:16 +0000)]
Build firmware for USB devices on octeon.
ok deraadt@
semarie [Sun, 10 Jul 2016 14:21:24 +0000 (14:21 +0000)]
pledge: use uint64_t instead of int for temporary storing a 64bit integer
affects only 32 bits platform (like i386).
problem spotted and diff from pelikan@
ok deraadt@ jca@
kettenis [Sun, 10 Jul 2016 14:01:10 +0000 (14:01 +0000)]
Dynamically attach imxgpio(4) using the FDT.
schwarze [Sun, 10 Jul 2016 13:52:27 +0000 (13:52 +0000)]
consistent spelling of "Moscow"; Ilya dot Kaliman at gmail dot com
schwarze [Sun, 10 Jul 2016 13:33:50 +0000 (13:33 +0000)]
Fix a nasty typo that prevented .so links to gziped manuals
from working in the absence of a mandoc.db(5) database.
Found the hard way by Svyatoslav Mishyn on Crux Linux.
kettenis [Sun, 10 Jul 2016 11:46:28 +0000 (11:46 +0000)]
Add support for handling pinctrl device tree bindings to imxiomuxc(4).
These are used to do board-specific setup of mux settings and pad
configuration.
ok jsg@, patrick@
visa [Sun, 10 Jul 2016 10:18:58 +0000 (10:18 +0000)]
Use the synciobdma instruction instead of the sync instruction for
flushing any pending local IOBDMA operations. The sync instruction is
overkill because it implies a full memory barrier.
ok jasper@ (long time ago)
schwarze [Sun, 10 Jul 2016 10:03:15 +0000 (10:03 +0000)]
Simplify the code and the server setup by deleting the pseudo-manpath
"mandoc" that was used for man.cgi(8) documentation and by assuming
that the apropos(1) and man.cgi(8) manuals are simply installed in
the default manpath. Even though man.cgi(8) is not installed by
default when installing OpenBSD, it is easy to copy it into the
default manpath used for man.cgi(8).
Idea found when considering a question asked by wrant dot com.
rpe [Sun, 10 Jul 2016 09:08:18 +0000 (09:08 +0000)]
Fix detection of /usr/lib on NFS.
Found by Frank Scheiner, thanks for reporting this.
OK krw, halex
'cool' deraadt
tedu [Sun, 10 Jul 2016 03:24:31 +0000 (03:24 +0000)]
rename variable for consistency
jsg [Sun, 10 Jul 2016 03:04:00 +0000 (03:04 +0000)]
Instead of attaching the omap device based on board ids follow imx
and match based on the compatible property of the root node in the fdt.
Each of am33xx, omap3, and omap4 have their own list of devices to
attach.
jsg [Sun, 10 Jul 2016 02:55:15 +0000 (02:55 +0000)]
Remove now unused definitions for drivers that have been converted to
use the fdt.
millert [Sun, 10 Jul 2016 00:48:21 +0000 (00:48 +0000)]
Document that SIGTTOU is sent if the process is in the background.
Adapted from text from tcsetattr(3).
millert [Sun, 10 Jul 2016 00:39:31 +0000 (00:39 +0000)]
POSIX specifies that if a processing calling tcsetpgrp() is in the
background it shall receive SIGTTOU. Handle TIOCSPGRP like we do
the other tty ioctls that change the terminal. OK deraadt@ guenther@
guenther [Sun, 10 Jul 2016 00:39:23 +0000 (00:39 +0000)]
Paranoia: check KTRPOINT() before calling ktrpledge() to guarantee we
can't (in the future) loop from ktrace writing hitting a pledge condition.
diff from Michal Mazurek (akfaew (at) jasminek.net)
tedu [Sun, 10 Jul 2016 00:15:39 +0000 (00:15 +0000)]
attempt to improve clarity by reducing forward references and more
directly documenting each option's effect.
schwarze [Sat, 9 Jul 2016 23:32:51 +0000 (23:32 +0000)]
spelling; from Ilya dot Kaliman at gmail dot com
tedu [Sat, 9 Jul 2016 20:39:17 +0000 (20:39 +0000)]
only print one error, not multiple misleading messages
schwarze [Sat, 9 Jul 2016 19:44:52 +0000 (19:44 +0000)]
Do not treat PATH_INFO as a complete path if it doesn't contain
a manpath. For example, this makes http://man.openbsd.org/mandoc
work as expected.
Bug reported by tb@, reminded by Svyatoslav Mishyn.