dlg [Fri, 12 Jan 2018 00:36:13 +0000 (00:36 +0000)]
restrict carp to configuring ethernet interfaces as carpdevs.
previously the driver only cared that a carp interface wasnt configured
as a carpdev. because the code only really works on ethernet, it makes
sense to restrict it.
ok visa@ mpi@
bru [Thu, 11 Jan 2018 23:50:49 +0000 (23:50 +0000)]
Improve the handling of coordinate inputs and filters.
Single-touch and multi-touch coordinate inputs are treated more uniformly,
and the hysteresis filters have a more consistent implementation. If
possible, pointer control will be assigned to touches with coordinate
updates that pass the default hysteresis filter (the function has been
moved to wsmouse.c). The "strong" variant of hysteresis has been
improved, the new version won't double the threshold when a movement
changes the orientation on an axis.
There is an additional change in wstpad_configure, which ensures that a
zero size disables an edge area even if the coordinate limits are
misconfigured.
dlg [Thu, 11 Jan 2018 23:13:37 +0000 (23:13 +0000)]
cast the result of the ternary operators in __swapXX to the right type
ok kettenis@
let's try it deraadt@
rpe [Thu, 11 Jan 2018 22:44:44 +0000 (22:44 +0000)]
Comments
patrick [Thu, 11 Jan 2018 22:31:09 +0000 (22:31 +0000)]
Update the Intel microcode once the root filesystem has been mounted.
This depends on the intel-firmware package that contains newer Intel
microcode which will be installed automatically by fw_update(1).
The update should happen much earlier since updating the microcode can
add or remove not only feature flags but also whole features. For now
only update feature flags that are relevant to Spectre.
Initial diff from sf@
Tested by bluhm@
ok deraadt@
patrick [Thu, 11 Jan 2018 22:07:23 +0000 (22:07 +0000)]
Install the intel firmware package which contains microcode updates
if we match Intel CPUs in dmesg(8).
"do it do it" deraadt@
patrick [Thu, 11 Jan 2018 22:04:39 +0000 (22:04 +0000)]
Create a second hash that maps all possible drivers to a default regex
to match in dmesg(8). This is helpful if we want to install firmware
depending on dmesg(8) output that does not follow the typical driver
scheme.
From espie@
"do it do it" deraadt@
rpe [Thu, 11 Jan 2018 21:09:26 +0000 (21:09 +0000)]
- change [] tests to [[]]
- change -a, -o to &&, || inside [[]]
- remove unecessary quoting inside [[]]
- remove X"" constructs inside [[]]
- remove \ (line continuation) in case of &&, || and pipes
- replace backticks with $()
discussed with and OK aja@
OK tb
rpe [Thu, 11 Jan 2018 19:52:12 +0000 (19:52 +0000)]
Change the shebang line from /bin/sh to /bin/ksh in all base rc.d
daemon scripts.
discussed with and OK aja@
OK tb
patrick [Thu, 11 Jan 2018 19:33:34 +0000 (19:33 +0000)]
Extract the control channel number from the chanspec information and
apply the channel to the node, like iwm(4) does, when supplying the
scan response to the net80211 stack. Our stack uses this information
for node selection so it's elementary for it to be correct.
Tested by jcs@
gilles [Thu, 11 Jan 2018 19:20:41 +0000 (19:20 +0000)]
fix parsing of long TXT records, this prevents 'smtpctl spf walk' from
producing bogus entries with some SPF records.
ok ajacoutot@
patrick [Thu, 11 Jan 2018 18:58:17 +0000 (18:58 +0000)]
Postpone secondary CPUs until after mounthook activities. This is
useful for loading CPU microcode from the disk before the CPUs are
let go.
Tested by visa@ on sgi, loongson and octeon
"don't see immediate issues" kettenis@
ok deraadt@
patrick [Thu, 11 Jan 2018 16:09:19 +0000 (16:09 +0000)]
The PCI bwfm(4) chips have no TX rings in the traditional sense, as on
the actual rings we only share messages. Sending a TX packet means
putting a message on the ring which contains a pktid (which for us maps
to an mbuf) and the physical address of the mbuf. On jcs@'s macbook he
seems to run out of TX pktids pretty quickly during a speedtest. This
would mean that there are 2048 TX packets in flight that we either want
to send out or that have not been "acked" by the firmware yet. Either
way, recover from that situation when we hit that arbitrary limit by
restarting the queue after we free'd a packet from the TX pktid list.
Tested by jcs@
bluhm [Thu, 11 Jan 2018 16:02:31 +0000 (16:02 +0000)]
Advance data pointer after exporting SA type to userland. Otherwise
ipsecctl(8) may display bundled SA incorrectly.
from markus@
visa [Thu, 11 Jan 2018 15:49:34 +0000 (15:49 +0000)]
Add size for free.
OK mpi@
tb [Thu, 11 Jan 2018 14:53:42 +0000 (14:53 +0000)]
Remove arbitary length limits for -s, -b and -w. Based on a diff from kshe.
schwarze suggested using asprintf, which led to a substantial cleanup.
ok schwarze, help & ok millert
kevlo [Thu, 11 Jan 2018 09:27:20 +0000 (09:27 +0000)]
sync
kevlo [Thu, 11 Jan 2018 09:26:36 +0000 (09:26 +0000)]
Add support for Huawei E3372.
ok phessler@
bluhm [Thu, 11 Jan 2018 03:23:16 +0000 (03:23 +0000)]
Add tests for incoming route-to and outgoing reply-to rules. Disable
the cases that currently fail.
dlg [Thu, 11 Jan 2018 00:14:15 +0000 (00:14 +0000)]
carp_ourether gets passed the parent interface, not the carp interface.
dlg [Wed, 10 Jan 2018 23:50:39 +0000 (23:50 +0000)]
get rid of struct carp_if by moving the srpl into struct ifnet if_carp.
currently carp uses a struct carp_if to hold an srp list head, which
is accessed by both if_carp in struct ifnet, and via the if input
handlers list.
this gets rid of some indirection by making if_carp itself the list
head, rather than a pointer to the list head via a struct carp_if.
it also makes accessing the list consistent by only using if_carp
to get to it.
ok mpi@
kettenis [Wed, 10 Jan 2018 23:27:18 +0000 (23:27 +0000)]
Implement FUCKWIT for arm64; unmap the kernel almost entirely while userland
is running. This provides protection against meltown on cores that are
vilnerable (just Cortex-A75 so far) but also seems to be an essential to
protect against spectre-like attacks against the kernel.
This implementation only exposes a single treampoline page that does not
contain any kernel virtual addresses and also hides the real virtual address
of the exception vectors, which helps on cores vulnerable to "variant 3a"
(Cortex-A57, Cortex-A72). The implementation is inspired by the work done
by Will Deacon for Linux, but there are no knobs to turn it off. The
overhead is fairly limited: around 3-4% slowdown on Cortex-A57.
ok patrick@, deraadt@
bluhm [Wed, 10 Jan 2018 18:14:34 +0000 (18:14 +0000)]
Mark sosplice task mp safe, do not grab kernel lock for tcp output.
OK mpi@
jcs [Wed, 10 Jan 2018 17:54:26 +0000 (17:54 +0000)]
Attach bwfm to the Broadcom 4350 found in the 2017 MacBook.
Easily handles >150Mbps transfers through a 5Ghz AP.
ok patrick
(Committed via bwfm0, of course)
jcs [Wed, 10 Jan 2018 15:52:36 +0000 (15:52 +0000)]
regen
jcs [Wed, 10 Jan 2018 15:52:23 +0000 (15:52 +0000)]
add broadcom bcm4350
jcs [Wed, 10 Jan 2018 15:45:46 +0000 (15:45 +0000)]
Attach nvme to additional Apple NVMe device, limit targets to 1
ok dlg
jcs [Wed, 10 Jan 2018 15:44:56 +0000 (15:44 +0000)]
regen
jcs [Wed, 10 Jan 2018 15:44:41 +0000 (15:44 +0000)]
add another Apple NVMe
sthen [Wed, 10 Jan 2018 14:59:59 +0000 (14:59 +0000)]
Don't require "disk" or "kernel", also allow just "cdrom" instead, a VM can
still be useful with only cdrom storage. ok ccardenas@
jmc [Wed, 10 Jan 2018 14:30:07 +0000 (14:30 +0000)]
add bwfm; ok patrick
bluhm [Wed, 10 Jan 2018 13:57:17 +0000 (13:57 +0000)]
Use pf_send_icmp() consistently in pf_route(). It sets the routing
domain and other mbuf flags. In pf_route6() the bad packet counter
and dup-to check were missing.
OK visa@
dlg [Wed, 10 Jan 2018 10:25:52 +0000 (10:25 +0000)]
simplify the input interface type check in carp_proto_input_if.
carp6_proto_input_if only handles packets "received" on real carp
interfaces, which the ethernet stack goes to a lot of trouble to
provide. since carp assumes ethernet, carp_proto_input_if can assume
the packets will come in right too.
ok mpi@
ratchov [Wed, 10 Jan 2018 09:05:48 +0000 (09:05 +0000)]
Simplify bounds checking of client numbers of channels and rate. From
Michael W. Bombardieri, thanks.
ratchov [Wed, 10 Jan 2018 09:03:26 +0000 (09:03 +0000)]
Remove assignement of sc->round to itself that makes no sense. From
Michael W. Bombardieri, thanks.
ratchov [Wed, 10 Jan 2018 09:00:40 +0000 (09:00 +0000)]
Make azalia_free_dmamem() void, as its return value is not used. From
Michael W. Bombardieri, thanks.
patrick [Wed, 10 Jan 2018 02:15:22 +0000 (02:15 +0000)]
Add firmware names for the two revisions of the Broadcom 4350 as seen
on a MacBook 12-inch (2017).
Tested by and with jcs@
patrick [Wed, 10 Jan 2018 02:07:11 +0000 (02:07 +0000)]
Don't reset the internal memory core on chips other than the Broadcom
43602, as it's only necessary on that specific chip.
Found the hard way by jcs@ on a MacBook 12-inch (2017)
patrick [Wed, 10 Jan 2018 02:02:55 +0000 (02:02 +0000)]
Update manpage to reflect changes to bwfm(4) which allow Host AP mode
and the PCI attachment driver.
patrick [Wed, 10 Jan 2018 01:43:01 +0000 (01:43 +0000)]
Move line for readability.
dlg [Wed, 10 Jan 2018 00:14:38 +0000 (00:14 +0000)]
shuffle how the protocol family input is done in ether_input.
the main change is to defer chopping the ethernet header off until the
ether_type is looked at. the main advantage of this is pppoe doesn't have
to reattach the ether header anymore, which simplifies the code a lot.
ok mpi@ visa@ bluhm@
dlg [Wed, 10 Jan 2018 00:05:06 +0000 (00:05 +0000)]
fix some poop that snuck into the last commit.
noticed by bijanebrahimi at riseup dot net and confirmed by anton@
cheloha [Tue, 9 Jan 2018 17:59:29 +0000 (17:59 +0000)]
Extract compile_mode command status with WEXITSTATUS.
Also tell the user if the parent shell spawned by popen(3)
was killed by a signal.
Discussed with jca@.
ok millert@ jca@ deraadt@
mpi [Tue, 9 Jan 2018 17:50:57 +0000 (17:50 +0000)]
Stop grabing the KERNEL_LOCK() for running protocol input routines.
The NET_LOCK() is already held in this thread and is now enough.
People interested in ARP/bridge(4)/switch(4)/pipex(4)/pppoe(4)
performances can now push the KERNEL_LOCK() without depending on
other subsystems/drivers.
Tested by Hrvoje Popovski.
ok bluhm@, visa@
bluhm [Tue, 9 Jan 2018 15:24:24 +0000 (15:24 +0000)]
Creating a cloned interface could return ENOMEM due to temporary
memory shortage. As it is invoked from a system call, it should
not fail and wait instead.
OK visa@ mpi@
mpi [Tue, 9 Jan 2018 15:14:23 +0000 (15:14 +0000)]
Change `so_state' and `so_error' to unsigned int such that they can
be atomically read from any context.
ok bluhm@, visa@
jsg [Tue, 9 Jan 2018 14:23:03 +0000 (14:23 +0000)]
lock->ctx != NULL => lock->ctx
requested by kettenis@
jsg [Tue, 9 Jan 2018 13:48:36 +0000 (13:48 +0000)]
Work around a problem with ww_mutexes in the drm modeset lock.
Screen blanks often result in a NULL dereference in __ww_mutex_lock with
lock->acquired being non zero and lock->ctx NULL. mpi@ also reported
it occuring when switching from Xorg to a virtual terminal.
ok mpi@
mpi [Tue, 9 Jan 2018 10:19:25 +0000 (10:19 +0000)]
Do not truncate 64bit integers when pretty-printing types.
mpi [Tue, 9 Jan 2018 10:08:01 +0000 (10:08 +0000)]
Use ip{,6}_send() instead of ip{,6}_output() to prevent a recursion.
if_start() is a boundary between the network stack and drivers. The
states it modifies must be protected by the driver, so we should not
require the NET_LOCK() there.
ok bluhm@, visa@
mpi [Tue, 9 Jan 2018 10:02:02 +0000 (10:02 +0000)]
Stop printing <not displayed> for wireless keys we know the kernel no
longer export them to userland.
ok stsp@, deraadt@, jca@
mpi [Tue, 9 Jan 2018 10:00:12 +0000 (10:00 +0000)]
Do not silently truncate the firmware channel number.
Fix build with gcc, ok stsp@
dlg [Tue, 9 Jan 2018 06:24:14 +0000 (06:24 +0000)]
make mpls_input take a struct ifnet *ifp argument.
this makes it like all our other protocol family input functions.
mpls_input always looks up the interface the mbuf was received on,
but it's always called by code that already has a reference to that
interface anyway. the result of this is a few less if_get/if_put
calls.
ok mpi@ bluhm@ visa@ claudio@
deraadt [Tue, 9 Jan 2018 04:05:49 +0000 (04:05 +0000)]
sync
bluhm [Tue, 9 Jan 2018 00:43:10 +0000 (00:43 +0000)]
Rename test file =.err to eq.err for simpler make file scripts.
patrick [Mon, 8 Jan 2018 23:30:36 +0000 (23:30 +0000)]
Fix indentation.
patrick [Mon, 8 Jan 2018 23:30:11 +0000 (23:30 +0000)]
Initial support for HOSTAP mode. With this bwfm(4) can spawn an access
point including WPA2 support. We now have a different event mask per
mode, so that events that are only useful for STA mode don't interfere
with HOSTAP mode. Power savings is disabled when we act as AP. The
connection events generate 802.11 frames for handling auth/assoc and
deauth/deassoc so that our stack takes note of the connecting nodes.
bluhm [Mon, 8 Jan 2018 23:05:21 +0000 (23:05 +0000)]
Convert IF_CLONE_INITIALIZER() into C99 initializer.
OK mpi@
mpi [Mon, 8 Jan 2018 22:33:13 +0000 (22:33 +0000)]
Do not pass a userland pointer to ktrabstimespec().
Prevents an infinite pagefault/pmap_enter() loop when ktracing apps
doing a lot of futex(2) calls like firefox & chrome.
benno [Mon, 8 Jan 2018 22:22:28 +0000 (22:22 +0000)]
update comments that were left behind in the recent unifdef JOB commit
from Klemens Nanni, thanks.
anton [Mon, 8 Jan 2018 18:21:22 +0000 (18:21 +0000)]
Fix typo in comment; ok mpi@
patrick [Mon, 8 Jan 2018 17:57:48 +0000 (17:57 +0000)]
In AP mode multicast packets share the flowrings with broadcast
packets.
patrick [Mon, 8 Jan 2018 17:53:07 +0000 (17:53 +0000)]
The bwfm(4) TX ring expects the ethernet header as part of the TX info
struct. The data length is the length of the frame without the header.
In the previous version m_adj(9) is used, but since that was changed we
need to decrease the length ourselves.
patrick [Mon, 8 Jan 2018 17:29:21 +0000 (17:29 +0000)]
Guard the debug printf function behind BWFM_DEBUG as well. Also only
print the firmware's dmesg(8) if we're running with a higher debug
mode.
Prompted by Michael W. Bombardieri
visa [Mon, 8 Jan 2018 16:44:32 +0000 (16:44 +0000)]
Move SC_* defines into <machine/setjmp.h>, and rename them,
so that <machine/signal.h> is not needed in setjmp.S.
Suggested by kettenis@ long ago, OK deraadt@
millert [Mon, 8 Jan 2018 16:16:16 +0000 (16:16 +0000)]
Pass correct size to uvm_vnp_setsize() for large files.
millert [Mon, 8 Jan 2018 16:15:34 +0000 (16:15 +0000)]
Add kqueue support for ext2fs based on ffs. OK deraadt@
markus [Mon, 8 Jan 2018 15:37:21 +0000 (15:37 +0000)]
group shared source files (e.g. SRCS_KEX) and allow compilation w/o OPENSSL
ok djm@
markus [Mon, 8 Jan 2018 15:21:49 +0000 (15:21 +0000)]
move subprocess() so scp/sftp do not need uidswap.o; ok djm@
markus [Mon, 8 Jan 2018 15:18:46 +0000 (15:18 +0000)]
switch ssh-pkcs11-helper to new API; ok djm@
markus [Mon, 8 Jan 2018 15:15:17 +0000 (15:15 +0000)]
only ssh-keygen needs uuencode.o; only scp/sftp use progressmeter.o
markus [Mon, 8 Jan 2018 15:14:44 +0000 (15:14 +0000)]
uuencode.h is not used
markus [Mon, 8 Jan 2018 15:15:36 +0000 (15:15 +0000)]
split client/server kex; only ssh-keygen needs uuencode.o;
only scp/sftp use progressmeter.o; ok djm@
visa [Mon, 8 Jan 2018 13:44:43 +0000 (13:44 +0000)]
Override membar_producer() for octeon.
OK dlg@
jca [Mon, 8 Jan 2018 13:39:06 +0000 (13:39 +0000)]
Drop two outdated entries
Namely POSIX character classes and tilde expansion within parameter
substitution. While here, kill a useless line and fix a typo.
From Klemens Nanni
millert [Mon, 8 Jan 2018 13:01:31 +0000 (13:01 +0000)]
Remove unused "args" param from kb_add(), it is always NULL.
OK anton@ jca@
otto [Mon, 8 Jan 2018 12:20:23 +0000 (12:20 +0000)]
optimization and some cleanup; mostly from kshe (except the unmap() part)
jca [Mon, 8 Jan 2018 12:08:17 +0000 (12:08 +0000)]
Kill entries that are obviously outdated/out of scope
Pointed out by Klemens Nanni who had ~ the same diff
mpi [Mon, 8 Jan 2018 12:02:42 +0000 (12:02 +0000)]
TIOCUCNTL is now allowed by promise "tty".
Reminded by jmc@
mpi [Mon, 8 Jan 2018 11:58:27 +0000 (11:58 +0000)]
Enable TIOCUCNTL to be able to set ns8250's break detected condition.
It is now possible to send BREAK commands to vmd(8) independently of
the serial terminal emulator.
Happy virtual ddb(4) hacking!
No objection from mlarkin@, ok nicm@, ccardenas@, deraadt@
mpi [Mon, 8 Jan 2018 11:54:28 +0000 (11:54 +0000)]
Allow TIOCUCNTL issued on a pty(4) master in promise "tty".
This will be soon be used to emulate BREAK commands in vmd(8).
ok nicm@, ccardenas@, deraadt@
mpi [Mon, 8 Jan 2018 11:52:14 +0000 (11:52 +0000)]
Translate the TIOCSBRK & TIOCCBRK ioctl(2)s issued on a pty(4) slave to
corresponding user mode ioctls.
If the master part of the pseudo terminal previously enabled TIOCUCNTL,
it will now receive the TIOCUCNTL_{S,C}BRK commands. This allows to
send BREAKS commands over a pty(4) independently of the serial terminal
emulator used.
Guidance and ok nicm@, ok ccardenas@, looks ok to deraadt@
mlarkin [Mon, 8 Jan 2018 08:14:00 +0000 (08:14 +0000)]
Attach dwiic_pci on Dell Precision 7520. Also restrict ihidev reports
to those of 3 bytes or more (as per the hid-over-i2c spec).
discussed with jcs, kettenis
bentley [Mon, 8 Jan 2018 05:42:48 +0000 (05:42 +0000)]
Mark up command strings with Cm, and variables with Va.
ok jmc@
patrick [Mon, 8 Jan 2018 00:46:15 +0000 (00:46 +0000)]
Delete flowrings when we take the interface down or change its
settings.
ccardenas [Sun, 7 Jan 2018 22:59:57 +0000 (22:59 +0000)]
Add regression tests for cdrom keyword
ok mlarkin@
patrick [Sun, 7 Jan 2018 22:08:04 +0000 (22:08 +0000)]
Create multiple transmit flowrings in station mode, four in total, based
on TOS values. In AP mode create multiple flowrings per connected node.
mlarkin [Sun, 7 Jan 2018 21:43:25 +0000 (21:43 +0000)]
delete a wrong comment
mlarkin [Sun, 7 Jan 2018 19:56:19 +0000 (19:56 +0000)]
remove all PG_G global page mappings from the kernel when running on
Intel CPUs. Part of an ongoing set of commits to mitigate the Intel
"meltdown" CVE. This diff does not confer any immunity to that
vulnerability - subsequent commits are still needed and are being
worked on presently.
ok guenther, deraadt
millert [Sun, 7 Jan 2018 19:18:56 +0000 (19:18 +0000)]
Add proper bounds checking to kb_add(). OK anton@
guenther [Sun, 7 Jan 2018 18:54:44 +0000 (18:54 +0000)]
amd64_{get,set}_fsbase() are superfluous and unused; delete them.
Delete unused/never-implemented sysarch defines and structs while here.
ports check and ok naddy@
ok deraadt@ mlarkin@
kettenis [Sun, 7 Jan 2018 15:17:42 +0000 (15:17 +0000)]
Use __inline instead of inline as this header file might be included in a
"strict ansi" environment (even though it shouldn't be). Found out the hard
way by phessler@ with a port that uses gcc -ansi.
ok millert@, phessler@
jmc [Sun, 7 Jan 2018 13:56:30 +0000 (13:56 +0000)]
add arch to Dt;
kettenis [Sun, 7 Jan 2018 12:35:52 +0000 (12:35 +0000)]
On OpenBSD/armv7 we deliberately trap unaligned access. Unfortunately
the assembly code in libcrypto assumes unaligned access is allowed for
ARMv7. Make these paths conditional on __STRICT_ALIGNMENT not being
defined and define __STRICT_ALIGNMENT in arm_arch.h for OpenBSD.
ok tom@
inoguchi [Sun, 7 Jan 2018 08:43:26 +0000 (08:43 +0000)]
Remove unused extern variable in openssl(1) s_time
This extern variable appears not to be used.
And it is overridden by local variable in doConnection().
This causes MSVC warning C4459 "declaration of 'verify_error'
hides global declaration".
OK millert@
guenther [Sun, 7 Jan 2018 05:36:47 +0000 (05:36 +0000)]
Delete obsolete/untrue comments
mlarkin [Sun, 7 Jan 2018 05:35:10 +0000 (05:35 +0000)]
remove a ridiculous comment and move another comment to the line it was
really intended to describe. no functional change
visa [Sun, 7 Jan 2018 05:30:03 +0000 (05:30 +0000)]
Assume that direct-mapped addresses come from the xkphys segment.
visa [Sun, 7 Jan 2018 05:19:41 +0000 (05:19 +0000)]
Add references to errata.
mlarkin [Sun, 7 Jan 2018 01:08:20 +0000 (01:08 +0000)]
Add identcpu.c and specialreg.h definitions for the new Intel/AMD MSRs
that should help mitigate spectre. This is just the detection piece, these
features are not yet used.
Part of a larger ongoing effort to mitigate meltdown/spectre. i386 will
come later; it needs some machdep.c cleanup first.
ok kettenis@