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@
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
jcs [Fri, 19 Jan 2018 18:20:38 +0000 (18:20 +0000)]
dwiic: cleanup function prototypes after ACPI/PCI split
kettenis [Fri, 19 Jan 2018 16:55:46 +0000 (16:55 +0000)]
sync
kettenis [Fri, 19 Jan 2018 16:54:54 +0000 (16:54 +0000)]
Build clang on sparc64.
ok deraadt@
kettenis [Fri, 19 Jan 2018 16:17:36 +0000 (16:17 +0000)]
Switch the default compiler on armv7 to clang.
ok patrick@
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@
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@
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@
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@
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
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@
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
deraadt [Thu, 18 Jan 2018 23:42:13 +0000 (23:42 +0000)]
Wow, it cannot even be in .data...
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.
deraadt [Thu, 18 Jan 2018 18:21:01 +0000 (18:21 +0000)]
Sorry, the PIC macros cannot reach to .rodata....
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
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@
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@
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.
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@
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@
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!
bentley [Thu, 18 Jan 2018 08:57:12 +0000 (08:57 +0000)]
Mark up mount(8) options with Cm.
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.
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@
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@
nicm [Thu, 18 Jan 2018 07:10:53 +0000 (07:10 +0000)]
Remove unused hooks_run function, from Thomas Adam.
deraadt [Wed, 17 Jan 2018 17:59:58 +0000 (17:59 +0000)]
sync
fcambus [Wed, 17 Jan 2018 16:54:19 +0000 (16:54 +0000)]
Add sizes for free() in wscons(4).
OK deraadt@, visa@, mpi@
deraadt [Wed, 17 Jan 2018 16:33:33 +0000 (16:33 +0000)]
Found a .data variable that can be in .rodata
ok mibek
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@
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@
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@
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@
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@
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@
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@
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@
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@
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@
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@
benno [Tue, 16 Jan 2018 19:44:34 +0000 (19:44 +0000)]
garbage collect an unused variable
ok dlg@
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
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@
nicm [Tue, 16 Jan 2018 17:03:18 +0000 (17:03 +0000)]
Fix drawing of ACS characters (they need to go character-at-a-time),
accidentally broken in last commit.
cheloha [Tue, 16 Jan 2018 15:57:51 +0000 (15:57 +0000)]
GETTY_SLEEP is 30 seconds, not 10
ok deraadt@
visa [Tue, 16 Jan 2018 15:50:28 +0000 (15:50 +0000)]
Fix bit.
visa [Tue, 16 Jan 2018 15:22:14 +0000 (15:22 +0000)]
Fix return value.
bluhm [Tue, 16 Jan 2018 14:51:19 +0000 (14:51 +0000)]
Enable traceroute test for incoming reply-to rule.
bluhm [Tue, 16 Jan 2018 14:48:38 +0000 (14:48 +0000)]
If pf route-to is used for locally generated packets, they may have
an invalid source address. As pf route-to happens after IP source
selection based on a different route, the address should be corrected
after pf has allocated the new route. Especially loopback addresses
must not appear at outgoing packets.
OK sashan@ visa@
mpi [Tue, 16 Jan 2018 10:33:55 +0000 (10:33 +0000)]
Recycle IFF_NOTRAILERS into IFF_STATICARP and document ownerhsip
of IFF* flags.
inputs from jmc@, ok bluhm@, visa@
nicm [Tue, 16 Jan 2018 09:00:38 +0000 (09:00 +0000)]
Add -I to pipe-pane to connect pane stdin as well as stdout, suggested
by Kristof Kovacs in GitHub issue 1186.
ccardenas [Tue, 16 Jan 2018 06:10:45 +0000 (06:10 +0000)]
VMD: vioscsi - add support for REPORT_LUNS opcode
ok mlarkin@
bluhm [Mon, 15 Jan 2018 23:58:43 +0000 (23:58 +0000)]
Add tests that unmount a file system while it is busy. On a vnd
device "cp -r" and "rm -rf" are working in the background while
"umount -f" or "mount -ur" are executed. Then "fsck -f" is used
to verify that the file system is clean.
Currently this triggers a bug quite reliably. After the mount point
has been changed to read-only, the file system check shows that not
everything was flushed and synced properly.
jca [Mon, 15 Jan 2018 22:30:38 +0000 (22:30 +0000)]
Don't try to open HISTFILE if the variable is unset.
str_val returns null, not NULL, if the variable isn't set. The
erroneous check means that we later tried to open("").
ok millert@ tb@ anton@ benno@
kettenis [Mon, 15 Jan 2018 22:24:17 +0000 (22:24 +0000)]
Switch the inteldrm(4) i2c code over to the Linux code base. This gives us
several quirks that wre absent in the old OpenBSD-specific reimplementation.
Fixes several issues with external connectors on several generations of
hardware.
ok deraadt@, benno@
deraadt [Mon, 15 Jan 2018 21:30:49 +0000 (21:30 +0000)]
mask out (ie. ignore) the bit which will be MAP_STACK in the future,
so diffs in snapshots can exercise the change in a less disruptive way
idea with sthen, ok kettenis tom others
bluhm [Mon, 15 Jan 2018 20:38:47 +0000 (20:38 +0000)]
We have no deprecated regress variables in our tree. Remove the
compatibility layer.
brynet [Mon, 15 Jan 2018 19:45:51 +0000 (19:45 +0000)]
Revert my changes in r1.60 back to nicm@'s latest for now.
Fixes "file *|grep" breakage reported by espie@
ok nicm, deraadt
mlarkin [Mon, 15 Jan 2018 18:57:59 +0000 (18:57 +0000)]
tabs vs spaces
nicm [Mon, 15 Jan 2018 15:30:03 +0000 (15:30 +0000)]
Another redundant check, GitHub issue 1219.
nicm [Mon, 15 Jan 2018 15:27:03 +0000 (15:27 +0000)]
Some unused code, GitHub issue 1219.
jca [Mon, 15 Jan 2018 14:58:05 +0000 (14:58 +0000)]
Stop pretending we support building ksh without EDIT/HISTORY support
ok anton@
kettenis [Mon, 15 Jan 2018 14:11:16 +0000 (14:11 +0000)]
Improve defense against branch predictor target injection (Spectre "variant 2")
attacks. OpenBSD/armv7 is already in pretty good shape as we have always
been flushing the branch predictor cache on context switches. This diff adds
additional flushes to page faults in kernel address space. The impact on
performance should be minimal as these page faults should only happen when
userland (deliberately or accidentally) tries to access kernel addres space
which would lead to a fatal signal (SIGSEGV or SIGBUS).
Loosely based on changes made by Marc Zyngier in Linux and based on
information in Arm Trusted Firmware Security Advisory TFV 6.
Note that for Cortex-A15 (and Cortex-A72) you will need firmware that sets
the ACTRL[0] bit for this diff to be effective. Also note that with this
diff Cortex-A57 is still vulnerable.
ok jsg@
bluhm [Mon, 15 Jan 2018 13:48:31 +0000 (13:48 +0000)]
There was an issue that dynamic path MTU discovery together with
ARP or ND timeout could delete local routes. Put an assert into
arptfree() and nd6_free() so this cannot happen again.
OK mpi@
bluhm [Mon, 15 Jan 2018 12:27:45 +0000 (12:27 +0000)]
Enable traceroute test for incoming route-to rule.
bluhm [Mon, 15 Jan 2018 12:25:03 +0000 (12:25 +0000)]
When pf(4) forwards incoming packets with route-to or reply-to,
decrement the time-to-live or hop-limit field to prevent routing
loops. Sending an ICMP time exceeded error makes traceroute work.
For outgoing packets ip_forward() has already done this.
OK visa@ sashan@
inoguchi [Mon, 15 Jan 2018 11:02:07 +0000 (11:02 +0000)]
Add s_server and s_client -tlsextdebug messages
ok sthen@ jsing@
mpi [Mon, 15 Jan 2018 09:54:48 +0000 (09:54 +0000)]
Spacing, no object change.
eric [Mon, 15 Jan 2018 08:48:40 +0000 (08:48 +0000)]
fix parsing of RDATA for TXT records
ok gilles@
jsg [Mon, 15 Jan 2018 07:47:46 +0000 (07:47 +0000)]
sync
mlarkin [Mon, 15 Jan 2018 06:53:02 +0000 (06:53 +0000)]
Add some AVX512 CPUID flags.
discussed with sf and kettenis
ccardenas [Mon, 15 Jan 2018 04:26:58 +0000 (04:26 +0000)]
VMD: vioscsi refactor
Each opcode is now handled in the respective function (vioscsi_handle_xxx)
which allows more functionality to be added easier.
No functional changes confirmed by guest testing.
ok mlarkin@
bluhm [Sun, 14 Jan 2018 22:04:47 +0000 (22:04 +0000)]
Link ed regress to build.
bluhm [Sun, 14 Jan 2018 22:01:48 +0000 (22:01 +0000)]
Run the tests provided in /usr/src/bin/ed/test with the regress
framework. Three ed tests are currently failing for unknown reasons.
They are marked as disabled for now.
from Sergey Bronnikov
kettenis [Sun, 14 Jan 2018 21:47:10 +0000 (21:47 +0000)]
Add two more ARM EABI aliases that I missed in the previous libc minor
bump.
"just go ahead -- crank" deraadt@
bluhm [Sun, 14 Jan 2018 20:15:37 +0000 (20:15 +0000)]
Make cpu_ucode_debug non static so it can be changed from ddb.
OK patrick@
anton [Sun, 14 Jan 2018 16:04:21 +0000 (16:04 +0000)]
unifdef BRACE_EXPAND; ok jca@
rpe [Sun, 14 Jan 2018 12:12:52 +0000 (12:12 +0000)]
Prefetched sets are stored by root, but are read by an unprivileged
user during the actual install phase. Add a check to the selection
of the prefetch area to ensure the unprivleged user can read files
from there.
Move the selection logic to its own function prefetcharea_fs_list()
which returns a unique list of candidate filesystems, or with rc=1.
While at it, remove /var/tmp from the potential list of candidates
because it's a symbolic link to /tmp since 2014.
Change install_files() to loop over the candidates and check if it
can read a test file, otherwise clean up and skip this filesystem.
Problem found by benno@ whose upgrade failed due to /usr/obj being
owned by build:wobj and permissions that prevented the unprivileged
user to read the prefetched set files from there.
discussed with and OK benno@ halex@ tb@
stsp [Sun, 14 Jan 2018 11:51:34 +0000 (11:51 +0000)]
Pass our currently configured SSID to iwm(4) scan commands.
This makes connecting to silly "hidden" networks work, which was a long
standing problem with iwm(4). My past observations where other SSIDs were
filtered from scan results while associated can no longer be reproduced.
ok robert phessler
mpi [Sun, 14 Jan 2018 09:32:09 +0000 (09:32 +0000)]
Fix after recent mutex change.
bluhm [Sun, 14 Jan 2018 00:53:11 +0000 (00:53 +0000)]
Unlocking the TCP stack resulted in smaller TCP segments sent out
early on some machines. Use the TCP_NOPUSH socket option to get
reliable regress results and syslogd(8) debug messages for grep.
bluhm [Sun, 14 Jan 2018 00:33:09 +0000 (00:33 +0000)]
Use signed values to compare absolute difference. The variables
fid and cfid are signed, so the FID_TO_VCO_FID() macro creates
signed results. Keep the sign when passing to abs() although the
implicit conversions created the same binary.
OK deraadt@
millert [Sat, 13 Jan 2018 20:40:43 +0000 (20:40 +0000)]
Add descriptions for HAVE_B64_NTOP and HAVE_B64_PTON so autoheader
will run. OK florian@
kettenis [Sat, 13 Jan 2018 18:08:20 +0000 (18:08 +0000)]
Make things work when using the official device tree bindings used by the
Linux kernel.
jmc [Sat, 13 Jan 2018 17:13:12 +0000 (17:13 +0000)]
tweak previous;
millert [Sat, 13 Jan 2018 15:57:58 +0000 (15:57 +0000)]
In ext2fs_write(), clear the buffer on uiomove() failure unless it
was cleared on alloc just like we do in ffs_write().
millert [Sat, 13 Jan 2018 15:56:02 +0000 (15:56 +0000)]
Add comment describing why we need to clear the buffer if uiomove()
fails, adapted from FreeBSD. Also avoid clearing the buffer if it
was cleared when allocated. OK deraadt@ otto@
tb [Sat, 13 Jan 2018 15:43:39 +0000 (15:43 +0000)]
Adjust comment to reflect '%F' addition.
mpi [Sat, 13 Jan 2018 15:18:11 +0000 (15:18 +0000)]
Define and use IPL_MPFLOOR in our common mutex implementation.
ok kettenis@, visa@
stsp [Sat, 13 Jan 2018 15:10:02 +0000 (15:10 +0000)]
In vldcp(8) fix a race between vldcpread() and vldcp_rx_intr() which
was overlooked by my previous fix.
Keep SPL at TTY in vldcpread() while manipulating the rx queue head.
Otherwise we could end up in a situation where:
1: vldcpread() reads rx_head
2: vldcpread() calls splx()
3: vldcp_rx_intr() fires, finds rx link is down, and sets rx_head = rx_tail
4: vlcdpread() resumes and sets rx_head to the value it read in step 1
-> same interrupt storm problem as described in my previous commit
ok kettenis@ mpi@
tb [Sat, 13 Jan 2018 15:09:49 +0000 (15:09 +0000)]
Allow printf '%F' format specifier.
ok millert
jsg [Sat, 13 Jan 2018 14:15:07 +0000 (14:15 +0000)]
Add a linux compatible request_firmware() wrapper around loadfirmware(9).
ok deraadt@ kettenis@
robert [Sat, 13 Jan 2018 13:03:42 +0000 (13:03 +0000)]
add kqueue support to drm(4) by making the drm_sysfs_hotplug_event()
available on OpenBSD well and by notifying listeners of a device
state change using EVFILT_DEVICE and NOTE_CHANGE.
drm_sysfs_hotplug_event() gets called when a state change of the device
occured, like an hdmi cable has been plugged, this in the future will
be used by the modesetting xorg driver to notify desktop environments
via randr events to update their screen configuration
ok kettenis@
robert [Sat, 13 Jan 2018 12:58:40 +0000 (12:58 +0000)]
introduce a filter called EVFILT_DEVICE that can be used to notify
listeners of device state changes.
currently only supports NOTE_CHANGE that will be used by drm(4)
ok kettenis@
bru [Sat, 13 Jan 2018 11:54:01 +0000 (11:54 +0000)]
coordinate again: polishing
kettenis [Sat, 13 Jan 2018 10:58:50 +0000 (10:58 +0000)]
Add a barrier at the end of pmap_map_early() such that the new mapping is
guaranteed to be available after pmap_map_early() returns. Fixes a hang
seen with the in-progress SMP work.
ok patrick@
schwarze [Sat, 13 Jan 2018 05:21:06 +0000 (05:21 +0000)]
catch up with how formatting of long links was changed
in both groff and mandoc
schwarze [Sat, 13 Jan 2018 05:20:10 +0000 (05:20 +0000)]
Remove the implicit display feature of .Lk because it was inconsistent
across output devices, counter-intuitive, and resulted in ugly
output for many real-world manual pages. Always format even long
links in-line. I already committed a similar change to groff.
OK jmc@, bentley@, and the original author
of the feature, Werner Lemberg <wl@gnu.org>.