openbsd
6 years agodocument bpfsattach and bpfsdetach
dlg [Wed, 24 Jan 2018 00:33:45 +0000 (00:33 +0000)]
document bpfsattach and bpfsdetach

6 years agoadd support for bpf on "subsystems", not just network interfaces
dlg [Wed, 24 Jan 2018 00:25:17 +0000 (00:25 +0000)]
add support for bpf on "subsystems", not just network interfaces

bpf assumed that it was being unconditionally attached to network
interfaces, and maintained a pointer to a struct ifnet *. this was
mostly used to get at the name of the interface, which is how
userland asks to be attached to a particular interface. this diff
adds a pointer to the name and uses it instead of the interface
pointer for these lookups. this in turn allows bpf to be attached
to arbitrary subsystems in the kernel which just have to supply a
name rather than an interface pointer. for example, bpf could be
attached to pf_test so you can see what packets are about to be
filtered. mpi@ is using this to look at usb transfers.

bpf still uses the interface pointer for bpfwrite, and for enabling
and disabling promisc. however, these are nopped out for subsystems.

ok mpi@

6 years agoAdd a smarter test that opens a file, unlinks it, and remounts the
bluhm [Tue, 23 Jan 2018 22:30:34 +0000 (22:30 +0000)]
Add a smarter test that opens a file, unlinks it, and remounts the
file system read-only.  After unmounting this should result in a
dirty file system that is not marked clean.  Disable both tests
with dangling vnodes for now as they fail.

6 years agoThe IPv6 gateway address passed to rt6_flush() comes either from a
bluhm [Tue, 23 Jan 2018 22:06:42 +0000 (22:06 +0000)]
The IPv6 gateway address passed to rt6_flush() comes either from a
packet through ip6_input() or from the routing table.  In both cases
the KAME hack has added the embeded scope to the address, so it is
not necessary to fill the scope id again in rt6_flush().  Assert
that it is already there.
OK mpi@

6 years agoUpdate to tzdata2018c from ftp.iana.org
millert [Tue, 23 Jan 2018 21:54:04 +0000 (21:54 +0000)]
Update to tzdata2018c from ftp.iana.org

6 years agoThe TCP reaper timeout was still imlemented as soft timeout. So
bluhm [Tue, 23 Jan 2018 21:41:17 +0000 (21:41 +0000)]
The TCP reaper timeout was still imlemented as soft timeout.  So
it could run immediately and was not synchronized with the TCP
timeouts, although that was the intension when it was introduced
in revision 1.85.  Convert the reaper to an ordinary TCP timeout
so it is scheduled on the same timeout thread after all timeouts
have finished.  A net lock is not necessary as the process calling
tcp_close() will not access the tcpcb after arming the reaper
timeout.
OK mikeb@

6 years agoAlthough it is a dead store here, always reassign the tcpcb after
bluhm [Tue, 23 Jan 2018 21:06:47 +0000 (21:06 +0000)]
Although it is a dead store here, always reassign the tcpcb after
calling tcp_close(), tcp_drop(), and tcp_disconnect().  Then no
freed memory can be used after closing a TCP connection.
OK mikeb@ mpi@

6 years agoBring back the PRU_ATTACH constant and description. Then trpt(8)
bluhm [Tue, 23 Jan 2018 20:49:58 +0000 (20:49 +0000)]
Bring back the PRU_ATTACH constant and description.  Then trpt(8)
prints the ATTACH action for TCP debugging socketes correctly.
OK bluhm@

6 years agoFix printf(9) format strings so that a kernel with TCPDEBUG compiles.
bluhm [Tue, 23 Jan 2018 20:41:42 +0000 (20:41 +0000)]
Fix printf(9) format strings so that a kernel with TCPDEBUG compiles.
Mark the string variables with TCP debugging names as constant.
OK mpi@

6 years agoFix a logic bug in sshd_exchange_identification which prevented clients
stsp [Tue, 23 Jan 2018 20:00:58 +0000 (20:00 +0000)]
Fix a logic bug in sshd_exchange_identification which prevented clients
using major protocol version 2 from connecting to the server.
ok millert@

6 years agoAdd missing braces; fixes 'write: Socket is not connected' error in ssh.
stsp [Tue, 23 Jan 2018 18:33:49 +0000 (18:33 +0000)]
Add missing braces; fixes 'write: Socket is not connected' error in ssh.
ok deraadt@

6 years agouse END_STRONG. Yes, everything in the sh ecosystem is different..
deraadt [Tue, 23 Jan 2018 17:11:02 +0000 (17:11 +0000)]
use END_STRONG.  Yes, everything in the sh ecosystem is different..

6 years agoAlways lock the kernel lock with non-MP-safe interrupt handlers.
visa [Tue, 23 Jan 2018 14:47:21 +0000 (14:47 +0000)]
Always lock the kernel lock with non-MP-safe interrupt handlers.

Suggested by kettenis@

6 years agoRevise 'struct fpreg' such that it can actually represent the full VFPv3-D32
kettenis [Tue, 23 Jan 2018 12:38:14 +0000 (12:38 +0000)]
Revise 'struct fpreg' such that it can actually represent the full VFPv3-D32
state.

ok patrick@

6 years agoFix underline rotation on CCW (quarter counter-clockwise) rotated
fcambus [Tue, 23 Jan 2018 10:10:32 +0000 (10:10 +0000)]
Fix underline rotation on CCW (quarter counter-clockwise) rotated
screens.

The "underline" was actually drawn above text.

OK jcs@

6 years agoFix table wrt missing element and `, detailed analysis and diff from
otto [Tue, 23 Jan 2018 07:06:55 +0000 (07:06 +0000)]
Fix table wrt missing element and `, detailed analysis and diff from
David Fifield; ok tb@

6 years agoDrop compatibility hacks for some ancient SSH implementations, including
djm [Tue, 23 Jan 2018 05:27:21 +0000 (05:27 +0000)]
Drop compatibility hacks for some ancient SSH implementations, including
ssh.com <=2.* and OpenSSH <= 3.*.

These versions were all released in or before 2001 and predate the
final SSH RFCs. The hacks in question aren't necessary for RFC-
compliant SSH implementations.

ok markus@

6 years agotry harder to preserve errno during ssh_connect_direct() to make the
djm [Tue, 23 Jan 2018 05:17:04 +0000 (05:17 +0000)]
try harder to preserve errno during ssh_connect_direct() to make the
final error message possibly accurate; bz#2814, ok dtucker@

6 years agounbreak support for clients that advertise a protocol version
djm [Tue, 23 Jan 2018 05:12:12 +0000 (05:12 +0000)]
unbreak support for clients that advertise a protocol version
of "1.99" (indicating both v2 and v1 support). Busted by me during
SSHv1 purge in r1.358; bz2810, ok dtucker

6 years agodon't attempt to force hostnames that are addresses to lowercase, but
djm [Tue, 23 Jan 2018 05:06:25 +0000 (05:06 +0000)]
don't attempt to force hostnames that are addresses to lowercase, but
instead canonicalise them through getnameinfo/getaddrinfo to remove
ambiguities (e.g. ::0001 => ::1) before they are matched against
known_hosts; bz#2763, ok dtucker@

6 years agoavoid modifying pw->pw_passwd; let endpwent() clean up for us, but
djm [Tue, 23 Jan 2018 05:01:15 +0000 (05:01 +0000)]
avoid modifying pw->pw_passwd; let endpwent() clean up for us, but
keep a scrubbed copy; bz2777, ok dtucker@

6 years agoFix checks for error return from urtw_alloc_rx_data_list() and
kevlo [Tue, 23 Jan 2018 02:53:26 +0000 (02:53 +0000)]
Fix checks for error return from urtw_alloc_rx_data_list() and
urtw_alloc_tx_data_list() in 8187b init.

From James Jerkins, thanks.

6 years ago1. Add a field for configuring the size of edge areas on touchpads.
bru [Mon, 22 Jan 2018 22:14:11 +0000 (22:14 +0000)]
1. Add a field for configuring the size of edge areas on touchpads.
2. Remove code that is obsolete because all touchpad drivers configure
wsmouse for compat mode now.

6 years agoAdd support for 'a:' and 'exists:' mechanisms.
okan [Mon, 22 Jan 2018 20:56:47 +0000 (20:56 +0000)]
Add support for 'a:' and 'exists:' mechanisms.

ok gilles@

6 years agoBring back the detach messages in trpt(8) for tcp debugging. They
bluhm [Mon, 22 Jan 2018 20:27:28 +0000 (20:27 +0000)]
Bring back the detach messages in trpt(8) for tcp debugging.  They
got lost with the pr_detach conversion.  While there, remove some
dead code.
OK mpi@

6 years agoTriggered by Klemens Nanni patch, move OLD_WRKDIR_NAME into OBSOLETE VARIABLES
espie [Mon, 22 Jan 2018 13:18:37 +0000 (13:18 +0000)]
Triggered by Klemens Nanni patch, move OLD_WRKDIR_NAME into OBSOLETE VARIABLES
and deprecate WRKDIR_LINKNAME.

6 years agoUse the proper address space when using a kernel that supports
helg [Mon, 22 Jan 2018 13:16:48 +0000 (13:16 +0000)]
Use the proper address space when using a kernel that supports
Supervisor Mode Access Prevention (SMAP) compiled with FUSE_DEBUG.
While here, add some sanity check to the debug function fuse_dump_buff.

Thanks to Thomas Jeunet.

OK mpi@, helg@

6 years agoMore sizes for free() in wscons(4).
fcambus [Mon, 22 Jan 2018 12:20:54 +0000 (12:20 +0000)]
More sizes for free() in wscons(4).

OK visa@

6 years ago<machine/mutex.h> -> <sys/mutex.h>
mpi [Mon, 22 Jan 2018 10:04:46 +0000 (10:04 +0000)]
<machine/mutex.h> -> <sys/mutex.h>

6 years agoInclude <sys/mutex.h> instead of <machine/mutex.h>
mpi [Mon, 22 Jan 2018 09:40:45 +0000 (09:40 +0000)]
Include <sys/mutex.h> instead of <machine/mutex.h>

required by upcoming MI mutex change.

6 years agoInclude <sys/mutex.h> rather than <machine/mutex.h>
mpi [Mon, 22 Jan 2018 09:31:35 +0000 (09:31 +0000)]
Include <sys/mutex.h> rather than <machine/mutex.h>

Required by upcoming MI mutex change.

6 years agoAlways grab the KERNEL_LOCK() for !IPL_MPSAFE handlers.
mpi [Mon, 22 Jan 2018 09:08:43 +0000 (09:08 +0000)]
Always grab the KERNEL_LOCK() for !IPL_MPSAFE handlers.

Suggested by kettenis@, ok visa@

6 years agoUse ip_send() to not call ip_output() recursively in *start() routine.
mpi [Mon, 22 Jan 2018 09:06:22 +0000 (09:06 +0000)]
Use ip_send() to not call ip_output() recursively in *start() routine.

ok visa@

6 years agoDo not call ip_output() recursively in vxlan_start().
mpi [Mon, 22 Jan 2018 09:05:06 +0000 (09:05 +0000)]
Do not call ip_output() recursively in vxlan_start().

ip_output() currently needs the NET_LOCK() which is not held when an
interface is added to a pf(4) queue.

Fix an issue reported by Jason Tubnor, ok dlg@

6 years agoAdd SHT_SYMTAB_SHNDX
mpi [Mon, 22 Jan 2018 09:01:39 +0000 (09:01 +0000)]
Add SHT_SYMTAB_SHNDX

Required by Karel Gardas to unbreak GHC head.

6 years agoregen
jsg [Mon, 22 Jan 2018 03:14:33 +0000 (03:14 +0000)]
regen

6 years agoadd clang-local(1) to SEE ALSO
jsg [Mon, 22 Jan 2018 03:13:09 +0000 (03:13 +0000)]
add clang-local(1) to SEE ALSO
suggested by jmc@ ok patrick@

6 years agoMatch on Iris Pro Graphics 580 and other skylake GT4 ids and correct
jsg [Mon, 22 Jan 2018 02:28:09 +0000 (02:28 +0000)]
Match on Iris Pro Graphics 580 and other skylake GT4 ids and correct
the Iris Graphics P555 GT3 id.

Derived from the following linux commits:

drm/i915/skl: Add SKL GT4 PCI IDs
From Mika Kuoppala
15620206ae87ba9643ffa6f5ddb5471be7192006 in mainline linux

drm/i915: Update SKL SRV GT4 pci ids reference.
From Rodrigo Vivi
5390974f981907cd02d1cb48145b03471279877a in mainline linux

drm/i915/skl: Add missing SKL ID
From Michal Winiarski
ca7a45ba6fb9e7ceca56d10b91db29c2f3451a2e in mainline linux

Expanded version of a diff from ccardenas@.
Reported and tested by Bryan Vyhmeister.
Tested by and ok ccardenas@

6 years agoMove some code back from locore0.S to locore.S that we will need to bring up
kettenis [Sun, 21 Jan 2018 22:30:41 +0000 (22:30 +0000)]
Move some code back from locore0.S to locore.S that we will need to bring up
secondary CPUs.  This involves adjusting get_virt_delta() to account for the
fact that it may no longer live near the start of kernel code.  Heavily based
on a diff from drahn@.

ok patrick@, deraadt@

6 years agoImplement ffs(3) using the CLZ instructions which has been available ever
kettenis [Sun, 21 Jan 2018 21:56:02 +0000 (21:56 +0000)]
Implement ffs(3) using the CLZ instructions which has been available ever
since ARMv5.  Should be much faster but more importantly it removes the
data table from .text which could introduce unwanted ROP gadgets.

Based on changes in Android/Bionic by Elliott Hughes.

ok patrick@

6 years agoAdd missing OpenBSD CVS tag
patrick [Sun, 21 Jan 2018 21:37:01 +0000 (21:37 +0000)]
Add missing OpenBSD CVS tag

6 years agoImplement network boot support in efiboot(8). This changes efiboot(8)
patrick [Sun, 21 Jan 2018 21:35:34 +0000 (21:35 +0000)]
Implement network boot support in efiboot(8).  This changes efiboot(8)
to recognize if it has been booted via PXE.  The new TFTP file system
layer will then use the matching PXE base code protocol handle to load
the files.  Since this uses the PXE base code protocol for abstraction
instead of the raw Simple Network protocol this will at this point not
work on u-boot based machines.

ok kettenis@

6 years agoadd new '-c' option which runs a command instead of an interactive shell
jasper [Sun, 21 Jan 2018 20:18:20 +0000 (20:18 +0000)]
add new '-c' option which runs a command instead of an interactive shell

from Paul de Weerd
ok ian@ job@; manpage bits are ok jmc@

6 years agofix error handling while fetching sets
halex [Sun, 21 Jan 2018 19:58:37 +0000 (19:58 +0000)]
fix error handling while fetching sets

reported by naddy@ long ago
ok rpe@

6 years agoRelease interrupt source if the interrupt task is already scheduled
mikeb [Sun, 21 Jan 2018 18:54:46 +0000 (18:54 +0000)]
Release interrupt source if the interrupt task is already scheduled

Tested by Imre Oolberg, thanks!

6 years agoImprove panic message
mikeb [Sun, 21 Jan 2018 18:51:19 +0000 (18:51 +0000)]
Improve panic message

6 years agoadd arch to Dt;
jmc [Sun, 21 Jan 2018 16:00:50 +0000 (16:00 +0000)]
add arch to Dt;

6 years agoremove the ref to gcc-local. the alternative was to add clang-local,
jmc [Sun, 21 Jan 2018 10:28:37 +0000 (10:28 +0000)]
remove the ref to gcc-local. the alternative was to add clang-local,
but i think the ref to cc should suffice for this page;

6 years agouse virt instructions with clang instead of equivalent raw bytes
jsg [Sat, 20 Jan 2018 23:57:44 +0000 (23:57 +0000)]
use virt instructions with clang instead of equivalent raw bytes

6 years agoProvide a simpler example ifstated.conf.
mpf [Sat, 20 Jan 2018 23:07:58 +0000 (23:07 +0000)]
Provide a simpler example ifstated.conf.
The existing example was written over a decade ago, when carp(4) was
not supporting carpdemote and did not track it's interfaces link state itself.
OK jmc@, rob@

6 years agoImprove the config example.
mpf [Sat, 20 Jan 2018 22:57:11 +0000 (22:57 +0000)]
Improve the config example.
Suggest using carpdemote instead of tweaking the advskew setting.
Also add a check for a non-carp link state.
Prodded by jmc@. OK jmc@, rob@.

6 years agoDisable TCP and UDP transmit checksum offloading
mikeb [Sat, 20 Jan 2018 20:03:45 +0000 (20:03 +0000)]
Disable TCP and UDP transmit checksum offloading

In certain configurations, transmit checksum offloading doesn't
appear to work correctly, preventing correct TCP and UDP operation.
Some of these issues involving VLAN tagging are documented by the
Xen project.

Problem reported and fix tested by Imre Oolberg, thanks!

6 years agoFix uninitialized variable.
rob [Sat, 20 Jan 2018 18:49:12 +0000 (18:49 +0000)]
Fix uninitialized variable.

Ok jca@

6 years agoRe-enable the code that unmaps the startup code once more now that lld is
kettenis [Sat, 20 Jan 2018 18:35:41 +0000 (18:35 +0000)]
Re-enable the code that unmaps the startup code once more now that lld is
fixed.

6 years agosync
deraadt [Sat, 20 Jan 2018 18:11:31 +0000 (18:11 +0000)]
sync

6 years agoRemove code that has been disabled since 1999. From Michael W. Bombardieri who
anton [Sat, 20 Jan 2018 15:32:20 +0000 (15:32 +0000)]
Remove code that has been disabled since 1999. From Michael W. Bombardieri who
also took the time to provide an excellent explanation on why the code isn't
useful on tech@.

ok jca@

6 years agooops, no chomp, so get rid of the extra blank line by using print
espie [Sat, 20 Jan 2018 12:01:56 +0000 (12:01 +0000)]
oops, no chomp, so get rid of the extra blank line by using print

6 years agodwiic: cleanup function prototypes after ACPI/PCI split
jcs [Fri, 19 Jan 2018 18:20:38 +0000 (18:20 +0000)]
dwiic: cleanup function prototypes after ACPI/PCI split

6 years agosync
kettenis [Fri, 19 Jan 2018 16:55:46 +0000 (16:55 +0000)]
sync

6 years agoBuild clang on sparc64.
kettenis [Fri, 19 Jan 2018 16:54:54 +0000 (16:54 +0000)]
Build clang on sparc64.

ok deraadt@

6 years agoSwitch the default compiler on armv7 to clang.
kettenis [Fri, 19 Jan 2018 16:17:36 +0000 (16:17 +0000)]
Switch the default compiler on armv7 to clang.

ok patrick@

6 years agoUse static inline such that the functions are guaranteed to be present when
kettenis [Fri, 19 Jan 2018 16:16:09 +0000 (16:16 +0000)]
Use static inline such that the functions are guaranteed to be present when
compiled with clang.

ok visa@

6 years agoIn pfioctl() a pf unlock was missing in the error path.
bluhm [Fri, 19 Jan 2018 15:33:27 +0000 (15:33 +0000)]
In pfioctl() a pf unlock was missing in the error path.
OK lteo@ sashan@

6 years agoVMD: vioscsi - fix large ISO support in Linux
ccardenas [Fri, 19 Jan 2018 14:23:52 +0000 (14:23 +0000)]
VMD: vioscsi - fix large ISO support in Linux

Check if n_blocks is less than UINT32_MAX and not the image size
in various places (READ_CAPACITY_* and GET_CONFIGURATION).

ok mlarkin@ and dlg@

6 years agoUse the pf state key linking functions in two more places instead
bluhm [Fri, 19 Jan 2018 12:57:15 +0000 (12:57 +0000)]
Use the pf state key linking functions in two more places instead
of doing it manually.
OK sashan@ visa@

6 years agodisplay the actual redirect message, as that's informative.
espie [Fri, 19 Jan 2018 11:34:41 +0000 (11:34 +0000)]
display the actual redirect message, as that's informative.
won't flood the terminal, since the first redirect changes the host
discussed with sthen

6 years agoPartial revert of rev. 1.7, fixes build with clang
jca [Fri, 19 Jan 2018 11:10:43 +0000 (11:10 +0000)]
Partial revert of rev. 1.7, fixes build with clang

The error was:
--8<--
ffs.S:57:2: error: unsupported relocation on symbol
adrne r2, .L_ffs_table
^
-->8--

Minimal workaround suggested by deraadt@, ok guenther@ kettenis@

6 years ago/etc/snmpd.conf may contain passwords or other sensitive
gsoares [Fri, 19 Jan 2018 00:19:58 +0000 (00:19 +0000)]
/etc/snmpd.conf may contain passwords or other sensitive
data. diff provided by alf <a.schlichting at lemarit.com>
ok millert

6 years agoWow, it cannot even be in .data...
deraadt [Thu, 18 Jan 2018 23:42:13 +0000 (23:42 +0000)]
Wow, it cannot even be in .data...

6 years agoZap the rotor, it was a wrong idea. Cluebat applied by kshe who
otto [Thu, 18 Jan 2018 20:06:16 +0000 (20:06 +0000)]
Zap the rotor, it was a wrong idea. Cluebat applied by kshe who
came also up with this diff. Simple, no bias and benchmarks show the extra
random calls disappear in te measurement noise.

6 years agoSorry, the PIC macros cannot reach to .rodata....
deraadt [Thu, 18 Jan 2018 18:21:01 +0000 (18:21 +0000)]
Sorry, the PIC macros cannot reach to .rodata....

6 years agoRemove quirk matching all Yamaha devices, as this prevents non-MIDI
ratchov [Thu, 18 Jan 2018 18:09:38 +0000 (18:09 +0000)]
Remove quirk matching all Yamaha devices, as this prevents non-MIDI
devices from attaching (ex uaudio devices).

ok mpi

6 years agoWhile booting it does not make sense to wait for memory, there is
bluhm [Thu, 18 Jan 2018 18:08:51 +0000 (18:08 +0000)]
While booting it does not make sense to wait for memory, there is
no other process which could free it.  Better panic in malloc(9)
or pool_get(9) instead of sleeping forever.
tested by visa@ patrick@ Jan Klemkow
suggested by kettenis@;  OK deraadt@

6 years agoMake URL redirection sticky in the installer
job [Thu, 18 Jan 2018 17:23:15 +0000 (17:23 +0000)]
Make URL redirection sticky in the installer

Ensures that when URL redirection takes place, the rest of the install/upgrade
session will stick to that redirected location. This should help ensure that
the fetched set of files is coherent when a load balancer emits 301/302.

With feedback from rpe@

OK sthen@ rpe@

6 years agoDiscard all but the last line when reading from a #() command - the
nicm [Thu, 18 Jan 2018 14:28:11 +0000 (14:28 +0000)]
Discard all but the last line when reading from a #() command - the
callback is just going to be fired again straight away to go through all
the lines, it is better just to use the last one straight away.

6 years agoMake the installer use the multiprocessor kernel if there is more
visa [Thu, 18 Jan 2018 14:04:04 +0000 (14:04 +0000)]
Make the installer use the multiprocessor kernel if there is more
than one core available.

When bsd.mp is used, bsd.sp is not copied to the boot partition.
Old installations might not have enough space for all bsd.mp, bsd.sp
and bsd.rd.

OK deraadt@, krw@, pirofti@

6 years agoFix the computation of `ncpusfound' on !MULTIPROCESSOR kernels so that
visa [Thu, 18 Jan 2018 14:02:54 +0000 (14:02 +0000)]
Fix the computation of `ncpusfound' on !MULTIPROCESSOR kernels so that
the value matches with the number of cores that GENERIC.MP uses.

OK deraadt@, krw@, pirofti@

6 years agoFix an off-by-one uncovered by the recent free(9) change
mikeb [Thu, 18 Jan 2018 11:43:20 +0000 (11:43 +0000)]
Fix an off-by-one uncovered by the recent free(9) change

From canacar@, thanks!

6 years agoMark up mount(8) options with Cm.
bentley [Thu, 18 Jan 2018 08:57:12 +0000 (08:57 +0000)]
Mark up mount(8) options with Cm.

6 years agoMove to ffs(3) for bitmask scanning. I played with this earlier,
otto [Thu, 18 Jan 2018 08:37:28 +0000 (08:37 +0000)]
Move to ffs(3) for bitmask scanning. I played with this earlier,
but at that time ffs function calls were generated instead of the
compiler inlining the code.  Now that ffs is marked protected in
libc this is handled better.  Thanks to kshe who prompted me to
look at this again.

6 years agoInstead of trying to handle ffs() with the normal rename-mark-hidden-and-alias
guenther [Thu, 18 Jan 2018 08:23:44 +0000 (08:23 +0000)]
Instead of trying to handle ffs() with the normal rename-mark-hidden-and-alias
dance, mark it protected.  This works better for both gcc and clang: gcc
blocks overriding of internal calls, while clang permits inlining again.

ok otto@

6 years agoUnlike other archs, mips64 needs ld.so to know about symbol visibility and
guenther [Thu, 18 Jan 2018 08:17:39 +0000 (08:17 +0000)]
Unlike other archs, mips64 needs ld.so to know about symbol visibility and
skip symbol lookup on protected symbols.  Add visibility #defines to
<sys/exec_elf.h> to support that.

ok kettenis@ visa@

6 years agoRemove unused hooks_run function, from Thomas Adam.
nicm [Thu, 18 Jan 2018 07:10:53 +0000 (07:10 +0000)]
Remove unused hooks_run function, from Thomas Adam.

6 years agosync
deraadt [Wed, 17 Jan 2018 17:59:58 +0000 (17:59 +0000)]
sync

6 years agoAdd sizes for free() in wscons(4).
fcambus [Wed, 17 Jan 2018 16:54:19 +0000 (16:54 +0000)]
Add sizes for free() in wscons(4).

OK deraadt@, visa@, mpi@

6 years agoFound a .data variable that can be in .rodata
deraadt [Wed, 17 Jan 2018 16:33:33 +0000 (16:33 +0000)]
Found a .data variable that can be in .rodata
ok mibek

6 years agoIn cbus(4) drivers, make it easier to identify which driver is doing
stsp [Wed, 17 Jan 2018 15:52:33 +0000 (15:52 +0000)]
In cbus(4) drivers, make it easier to identify which driver is doing
debug printfs about LDC link state changes. No functional change.

ok kettenis@

6 years agoRemove erreneous and leftover slash that was part of the regex before
patrick [Wed, 17 Jan 2018 13:35:52 +0000 (13:35 +0000)]
Remove erreneous and leftover slash that was part of the regex before
we switched to compiled regexes.  Fixes fw_update(1).

Noticed by deraadt@
ok sthen@

6 years agoProcess redirection messages from http.
espie [Wed, 17 Jan 2018 13:25:36 +0000 (13:25 +0000)]
Process redirection messages from http.
This will help for round-robin sites in anchoring a pkg_add session to
a single site, thus removing shearing effects.
Initial idea from job@, reworked a lot by me,
enthusiastic okay sthen@

6 years agoDefend agains branch predictor target injection (Spectre "variant 2")
kettenis [Wed, 17 Jan 2018 10:22:25 +0000 (10:22 +0000)]
Defend agains branch predictor target injection (Spectre "variant 2")
attacks by flushing the branch predictor cache (BTB) on context switches
and page faults in kkernel address space.  Note that this relies on the
presence of firmware (such as Arm Trusted Firmware) that provides PSCI
services that flush the BTB on entry as described in Arm Trusted Firmware
Security Advisory TFV 6.

ok patrick@, visa@

6 years agoImplement support for the PSCI_VERSION call and export the function such that
kettenis [Wed, 17 Jan 2018 10:17:33 +0000 (10:17 +0000)]
Implement support for the PSCI_VERSION call and export the function such that
we can use it to defend against branch target injection attacks.

ok patrick@, visa@

6 years agoImplement basic padding support in libsa so we can do zero-padding
patrick [Wed, 17 Jan 2018 08:46:15 +0000 (08:46 +0000)]
Implement basic padding support in libsa so we can do zero-padding
in bootloader printfs.

Feedback from and ok gerhard@

6 years agoDisable ACPI burst mode on the 2015 Chromebook Pixel, where it freezes.
bentley [Wed, 17 Jan 2018 07:40:29 +0000 (07:40 +0000)]
Disable ACPI burst mode on the 2015 Chromebook Pixel, where it freezes.

Diff from jcs@, ok pirofti@

6 years agoOn armv7, remove symbols that are also present in our libc. Because of the
kettenis [Tue, 16 Jan 2018 23:04:42 +0000 (23:04 +0000)]
On armv7, remove symbols that are also present in our libc.  Because of the
EABI aliases these can lead to duplicate symbol errors, especially when
mixing code compiled with gcc and clang.  The intention is to revert this
once we convert armv7 to hardfloat.

ok patrick@, guenther@

6 years agoIntroduce internal_warningf() and mark internal_errorf() as noreturn
jca [Tue, 16 Jan 2018 22:52:32 +0000 (22:52 +0000)]
Introduce internal_warningf() and mark internal_errorf() as noreturn

This helps tools like scan-build, and follows the example of warningf()
and errorf().  ok anton@

6 years agog/c unused defines that were only used by nacl's SHA-512 implementation
naddy [Tue, 16 Jan 2018 21:42:40 +0000 (21:42 +0000)]
g/c unused defines that were only used by nacl's SHA-512 implementation
ok tedu@

6 years agoStop constructing the ulimit optstring passed to ksh_getopt() at runtime since
anton [Tue, 16 Jan 2018 20:40:43 +0000 (20:40 +0000)]
Stop constructing the ulimit optstring passed to ksh_getopt() at runtime since
it's rarely subject to change. While here, unifdef RLIMIT_VMEM.

ok jca@

6 years agogarbage collect an unused variable
benno [Tue, 16 Jan 2018 19:44:34 +0000 (19:44 +0000)]
garbage collect an unused variable
ok dlg@

6 years agoOne minor scan-build warning
jca [Tue, 16 Jan 2018 17:17:18 +0000 (17:17 +0000)]
One minor scan-build warning

emacs.c:1041:2: warning: Value stored to 'cp' is never read

6 years agoUse the monotonic clock to compute the session duration.
cheloha [Tue, 16 Jan 2018 17:07:49 +0000 (17:07 +0000)]
Use the monotonic clock to compute the session duration.

Ensures the correct duration is logged even if the system
time is changed during the session.

ok jca@