krw [Sat, 15 May 2021 15:59:15 +0000 (15:59 +0000)]
Add missing MBR_protective_mbr() check when writing edited GPT.
No intentional functional change.
krw [Sat, 15 May 2021 15:20:17 +0000 (15:20 +0000)]
Shuffle USER_print_disk() code into a more rational, clearer
structure.
No intentional functional change.
florian [Sat, 15 May 2021 15:08:31 +0000 (15:08 +0000)]
Remove outdated comment. We got all httpd headers from the fcgi server
at this point.
kettenis [Sat, 15 May 2021 14:20:11 +0000 (14:20 +0000)]
Remove OUTPUT_FORMAT and OUTPUT_ARCH from linker script. These are
no-ops for ld.lld.
ok deraadt@
deraadt [Sat, 15 May 2021 14:05:35 +0000 (14:05 +0000)]
pmap_fault_fixup() does not need "int user"
ok kettenis
deraadt [Sat, 15 May 2021 13:56:56 +0000 (13:56 +0000)]
improve comment regarding child_return() clearing errno-indicating flag
jan [Sat, 15 May 2021 13:37:43 +0000 (13:37 +0000)]
Add pledge for ftpd's user processes.
OK tobhe@
kettenis [Sat, 15 May 2021 11:30:27 +0000 (11:30 +0000)]
Use intr_enable()/int_disable()/intr_restore() instead of
enable_interrupts()/disable_interrupts()/restore_interrupts() and remove
the latter interfaces.
While there move a few malloc(9) and free(9) calls to run with interrupts
enabled.
ok patrick@
yasuoka [Sat, 15 May 2021 08:07:20 +0000 (08:07 +0000)]
Fix IPsec NAT-T to work with pipex(4). Introduce a new packet tag
PACKET_TAG_IPSEC_FLOWINFO to specify the IPsec flow.
ok mvs
drahn [Sat, 15 May 2021 00:04:32 +0000 (00:04 +0000)]
Load the fault handler into the correct register.
Having the onfault dance in a macro makes this almost unreadable.
Initial failure found by deraadt, cause finally found.
krw [Sat, 15 May 2021 00:01:21 +0000 (00:01 +0000)]
Shuffle GPT_read() code into a nice switch{}, eliminating
unnecesary read of primary GPT when only the secondary GPT
is requested.
No intentional functional change.
krw [Fri, 14 May 2021 21:11:15 +0000 (21:11 +0000)]
Whitespace tweaks and a couple of stray u_int* in gpt_chk_mbr().
No intentional functional change.
tb [Fri, 14 May 2021 18:03:42 +0000 (18:03 +0000)]
whitespace/KNF
cheloha [Fri, 14 May 2021 16:44:38 +0000 (16:44 +0000)]
amd64: specialreg.h: add MSR_TSC_ADJUST
Where available, the IA32_TSC_ADJUST MSR may be used to make race-free
relative adjustments to a logical CPU's TSC. The value in the
register is interpreted as a signed 64-bit offset and added to the
"real" value of the TSC whenever the TSC MSR is read. That is:
RDTSC = REAL_TSC + TSC_ADJUST
and:
RDMSR TSC = REAL_TSC + TSC_ADJUST
For example, if REAL_TSC=1 and TSC_ADJUST=1, then RDTSC would yield 2.
Or if REAL_TSC=10 and TSC_ADJUST=-5, then RDTSC would yield 5.
Writing TSC_ADJUST does not change the "real" underlying value of the
TSC. Said another way setting TSC_ADJUST to zero will always undo any
prior adjustment. This property may be useful in fixing desynchronized
TSCs. In particular, buggy firmware may erroneously desynchronize a
normally synchronized TSC. If this happens, in theory we can do:
wrmsr(MSR_TSC_ADJUST, 0);
and fix any desynchronization during boot/resume with no fuss.
ok mlarkin@
krw [Fri, 14 May 2021 15:31:01 +0000 (15:31 +0000)]
Tweak the two copies of gpt_chk_mbr() to return the index of the MBR
0xEE (DOSPTYP_EFI) partition, or -1 no usable such partition is found.
Adopt a consistent idiom to capture the index for future use.
Clean up the gpt_chk_mbr() logic to make it clearer what constraints
are being applied when looking for the DOSTYP_EFI partition.
No intentional functional change.
kn [Fri, 14 May 2021 13:10:20 +0000 (13:10 +0000)]
Properly refer to ioctl(2)
From Caspar Schutijser, thanks.
inoguchi [Fri, 14 May 2021 10:50:55 +0000 (10:50 +0000)]
Improve libcrypto obj_xref.h generator
Modify objxref.pl to output $OpenBSD$ header and
__BEGIN_HIDDEN_DECLS / __END_HIDDEN_DECLS .
ok and comment from tb@
jsg [Fri, 14 May 2021 08:10:39 +0000 (08:10 +0000)]
remove comment describing GENERIC
jsg [Fri, 14 May 2021 06:55:19 +0000 (06:55 +0000)]
add dwge(4) to RAMDISK as well
jsg [Fri, 14 May 2021 06:48:52 +0000 (06:48 +0000)]
remove uneeded includes
jsg [Fri, 14 May 2021 05:21:00 +0000 (05:21 +0000)]
move some files to match other archs
ok deraadt@ drahn@
djm [Fri, 14 May 2021 05:20:32 +0000 (05:20 +0000)]
fix previous: test saved no_shell_flag, not the one that just got
clobbered
drahn [Fri, 14 May 2021 03:49:18 +0000 (03:49 +0000)]
Riscv64 sets. Initial attempt.
djm [Fri, 14 May 2021 03:09:48 +0000 (03:09 +0000)]
Fix ssh started with ControlPersist incorrectly executing a shell
when the -N (no shell) option was specified. bz3290 reported by
Richard Schwab; patch from markus@ ok me
drahn [Fri, 14 May 2021 03:01:24 +0000 (03:01 +0000)]
Enable riscv64 native kernel builds.
remove extra targets
drahn [Fri, 14 May 2021 02:29:00 +0000 (02:29 +0000)]
On riscv64, dynamically linked clang binary fails with:
libc++abi: Pure virtual function called!
By statically linking clang (and *-tblgen) this problem is worked around
at least for now.
drahn [Fri, 14 May 2021 02:21:34 +0000 (02:21 +0000)]
Fix bootloader name and riscv64 doesn't have bsd.mp yet.
drahn [Fri, 14 May 2021 01:18:52 +0000 (01:18 +0000)]
Adjust ramdisk generation for self hosting, remove cross bits.
drahn [Fri, 14 May 2021 01:15:54 +0000 (01:15 +0000)]
Initial enablment of EMULTLS on RiscV
Uncertain if this is 100% correct, however this enables self hosting
using clang.
drahn [Fri, 14 May 2021 00:57:03 +0000 (00:57 +0000)]
Fix regression for _setjmp, fucntion does not use stack and adjusting
it causes restored stack to be incorrect.
kettenis [Thu, 13 May 2021 22:42:14 +0000 (22:42 +0000)]
Improve mereg_add() like I did on arm64.
mvs [Thu, 13 May 2021 19:43:11 +0000 (19:43 +0000)]
Do `so_rcv' cleanup with sblock() held.
solock() should be taken before sblock(). soreceive() grabs solock() and
then locks `so_rcv'. But later it releases solock() before call uimove(9).
So concurrent thread which performs soshutdown() could break sorecive()
loop. But `so_rcv' is still locked by sblock() so this soshutdown()
thread will sleep in sorflush() at sblock() call. soshutdown() thread
doesn't release solock() after sblock() call so it has no matter where to
release `so_rcv' - is will be locked until the solock() release.
That's why this strange looking code works fine. This sbunlock() movement
just after `so_rcv' cleanup affects nothing but makes the code
consistent and clean to understand.
ok mpi@
kettenis [Thu, 13 May 2021 19:26:25 +0000 (19:26 +0000)]
Use intr_enable()/int_disable()/intr_restore() instead of
enable_interrupts()/disable_interrupts()/restore_interrupts() and remove
the latter interfaces.
ok mlarkin@, drahn@
mvs [Thu, 13 May 2021 18:06:54 +0000 (18:06 +0000)]
Use NULL instead of 0 for mbuf(9) pointers.
ok millert@
mvs [Thu, 13 May 2021 17:31:59 +0000 (17:31 +0000)]
Assign NULL instead of 0 to `control' within sendit(). It's mbuf(9)
pointer.
ok deraadt@
mvs [Thu, 13 May 2021 17:02:31 +0000 (17:02 +0000)]
Move ktrfds() below fdpunlock(). This fixes lock order issue between
vn_lock(9) and fdplock().
Reported-by: syzbot+2300a1bedc425f6f851e@syzkaller.appspotmail.com
ok visa@
kettenis [Thu, 13 May 2021 16:08:16 +0000 (16:08 +0000)]
Make memreg_add() a bit smarter and have it merge adjacent regions.
This should reduce the number of physical memory segments that we pass
to uvm reducing the chance that we run out of physical memory segments
and should make physical memory allocation a bit more efficient.
ok patrick@
tobhe [Thu, 13 May 2021 15:20:48 +0000 (15:20 +0000)]
Refactor iked process shutdown and cleanup. Remember configured
addresses and routes in iked_vroute_sc to not depend on ikev2
process for cleanup.
This makes sure that all flows, routes and addresses are deleted
no matter which process is killed first.
ok patrick@
tb [Thu, 13 May 2021 14:28:03 +0000 (14:28 +0000)]
Use field independent versions of {get,set}_coordinates()
ok tobhe
tb [Thu, 13 May 2021 14:01:35 +0000 (14:01 +0000)]
Use field independent version of {get,set}_affine_coordinates.
ok tobhe
florian [Thu, 13 May 2021 11:22:15 +0000 (11:22 +0000)]
RFC 4861 4.1 allows router solicitations from the unspecified address
(::). A short survey suggests that some systems respond with a
multicast router advertisement and other don't.
Andrew Forgue pointed out a usecase for this, booting a UEFI system
over http in an IPv6 network only. ("IPv6 support for UEFI IPv6
booting" on bugs@ a long time ago)
There is also no downside in allowing this, any host on the layer 2
network can solicit a router advertisement.
OK phessler
kettenis [Thu, 13 May 2021 09:32:00 +0000 (09:32 +0000)]
Run handlers with interrupts enabled.
ok jsg@
jsg [Thu, 13 May 2021 08:44:18 +0000 (08:44 +0000)]
change sig_atomic_t from long to int matching all the other archs
ok kettenis@
tb [Thu, 13 May 2021 07:10:57 +0000 (07:10 +0000)]
acme-client: use EC_POINT_{get,set}_affine_cooordinates()
The versions with _GFp() suffix only exist for historical reasons.
Now that we have EC_POINT_{get,set}_affine_coordinates(), we should
stop using the old ones as they provide no benefit.
ok florian
kettenis [Thu, 13 May 2021 06:45:23 +0000 (06:45 +0000)]
No need to disable interrupts before returning to userland.
The AST processing code will take care of doing that for us.
ok jsg@
kettenis [Thu, 13 May 2021 06:44:11 +0000 (06:44 +0000)]
When doing AST processing:
1) block interrupts, then check for ASTs
2) if no ASTs, return with interrupts blocked, so they can be re-enabled
ATOMICALLY in the return to userspace
3) if an AST happened, then re-enable interrupts, call ast(), then goto 1
ok jsg@
tb [Thu, 13 May 2021 06:00:53 +0000 (06:00 +0000)]
Add missing .Pp in HISTORY section.
tb [Thu, 13 May 2021 05:52:28 +0000 (05:52 +0000)]
Add missing .Pp
krw [Thu, 13 May 2021 02:22:33 +0000 (02:22 +0000)]
Whitespace fix for unintentional unindenting event in r1.260.
Reported by Ashton Fagg via tech@. Thanks!
yasuoka [Wed, 12 May 2021 23:17:30 +0000 (23:17 +0000)]
Remove about PACKET_TAG_PIPEX, it was replaced by ph_cookie.
deraadt [Wed, 12 May 2021 23:08:19 +0000 (23:08 +0000)]
print a newline after each instruction
ok kettenis
dv [Wed, 12 May 2021 20:13:00 +0000 (20:13 +0000)]
vmctl(8): remove unveil from disk image creation routines
James Cook reported an issue creating images from qcow2 disks that
contained base images. Initial approach suggested was to replace the
use of realpath(3), but since this is common code used in vmd(8) the
better option is to just remove the use of unveil(1) in vmctl. (It was
added very early in vmctl's development before support for disk
conversion was added.)
This does not change existing unveil usage in vmctl for things like the
control socket or the serial console. There's no change to vmd either.
Discussed with and OK from mlarkin@
kettenis [Wed, 12 May 2021 17:43:26 +0000 (17:43 +0000)]
Build a list of memory regions and call yvm_physload(9) on those like
we do on riscv64.
ok patrick@
tb [Wed, 12 May 2021 15:12:35 +0000 (15:12 +0000)]
Merge documentation for SSL_CIPHER_find(3) from OpenSSL 1.1.1.
mpi [Wed, 12 May 2021 15:05:09 +0000 (15:05 +0000)]
regen
mpi [Wed, 12 May 2021 15:04:48 +0000 (15:04 +0000)]
Revert unlock of connect(2), bind(2), listen(2) and shutdown(2).
At least one of them cause a deadlock involving `unplock' and mbuf allocations
('mbufpl') as reported by millert@.
tb [Wed, 12 May 2021 14:19:30 +0000 (14:19 +0000)]
sync
tb [Wed, 12 May 2021 14:17:27 +0000 (14:17 +0000)]
Install SSL_SESSION_get0_cipher.3
tb [Wed, 12 May 2021 14:16:25 +0000 (14:16 +0000)]
Document SSL_SESSION_get0_cipher(3)
Based on the OpenSSL 1.1.1 manual written by Rich Salz with a healthy
dose of improvements by schwarze.
ok schwarze
dtucker [Wed, 12 May 2021 11:34:30 +0000 (11:34 +0000)]
Clarify language about moduli. While both ends of the connection do need
to use the same parameters (ie groups), the DH-GEX protocol takes care
of that and both ends do not need the same contents in the moduli file,
which is what the previous text suggested. ok djm@ jmc@
lum [Wed, 12 May 2021 11:13:23 +0000 (11:13 +0000)]
Count the number of arguments in each expression as we initially go
through the expression. To be used in checking function parameter
profiles later.
jmc [Wed, 12 May 2021 10:59:43 +0000 (10:59 +0000)]
fix broken escape; ok schwarze
inoguchi [Wed, 12 May 2021 10:39:13 +0000 (10:39 +0000)]
Modify cms test in appstest.sh to work with ec cert/key
inoguchi [Wed, 12 May 2021 10:24:39 +0000 (10:24 +0000)]
Add obj_xref for ECDH schemes in RFC 5753
Found missing sigoid_srt record in crypto/objects/obj_xref.h, and
this causes error while executing openssl cms -encrypt with EC key/cert.
Added required definitions to obj_xref.txt and obj_xref.h.
Issue reported by Theodore Wynnychenko (tmw <at> uchicago.edu) on misc.
ok tb@
stsp [Wed, 12 May 2021 10:05:57 +0000 (10:05 +0000)]
Fix several issues introduced with iwm(4) Tx aggregation support.
Keep station queues marked as enabled until the device gets reset.
The firmware becomes unhappy if it finds some queues enabled but missing
from the station's queue mask, even across removals and re-additions of the
station which occur during re-associations and while roaming between APs.
Fixes "could not add sta (error 35)" fatal firmware errors.
When stopping a BA session, properly set the bit corresponding to the
session's TID in the node's tid_disable_ampu bitmask.
During dis- and re-associations all Tx block ack sessions are torn down,
so clear the bitmask which identifies queues with active Tx BA sessions.
Don't byte-swap values written to host-side variables.
Problems reported and fixes tested by Matthias Schmidt and kettenis@.
Additional testing by phessler@, mlarkin@, and Mikolaj Kucharski.
mvs [Wed, 12 May 2021 08:09:33 +0000 (08:09 +0000)]
Use local copy of `ps_rtableid' in ip{,6}_ctloutput() and mark
`ps_rtableid' as atomic. This allows us to unlock setrtable(2).
ok claudio@ mpi@
jca [Wed, 12 May 2021 06:50:33 +0000 (06:50 +0000)]
The official service name of tcp/465 is "submissions"
Keep "smtps" as an alias.
https://datatracker.ietf.org/doc/html/rfc8314#section-7.3
ok sthen@ florian@ kmos@
jca [Wed, 12 May 2021 06:45:30 +0000 (06:45 +0000)]
Drop swat (tcp/901)
The Samba Web Administration Tool has been dropped by the samba project and
TCP port 901 is not registered at IANA. ok sthen@ florian@ kmos@
mlarkin [Wed, 12 May 2021 04:00:46 +0000 (04:00 +0000)]
KNF
jsg [Wed, 12 May 2021 02:28:25 +0000 (02:28 +0000)]
Correct defines for fenv rounding modes and change fenv_t and fexcept_t
from unsigned long long to unsigned int.
ok kettenis@
mlarkin [Wed, 12 May 2021 02:24:56 +0000 (02:24 +0000)]
vmd(8): omit a possibly uninitialized var in a log_warnx
Don't print 'base' since it might not be initialized in all code paths.
From James Cook
jsg [Wed, 12 May 2021 01:24:32 +0000 (01:24 +0000)]
add a comment describing how this was created
ok deraadt@
jsg [Wed, 12 May 2021 01:20:52 +0000 (01:20 +0000)]
add OpenBSD rcs ids
dv [Tue, 11 May 2021 22:04:10 +0000 (22:04 +0000)]
vmm(4): fix flawed physical cpu tracking logic in svm_run_vcpu
Replace the overly complicated logic used to track which CPU we are on
in svm_run_vcpu. This fixes an issue where ltr causes a #GP on exit in
certain conditions due to referencing the wrong GDT.
This was primarily witnessed with NixOS guests that performed a heavy
amount of disk io.
Reported by Josh Rickmar. Tested by Josh & abieber@. OK mlarkin@.
dv [Tue, 11 May 2021 21:45:33 +0000 (21:45 +0000)]
Cast printf args to remove compiler warnings.
From Ashton Fagg. OK tb@.
tb [Tue, 11 May 2021 19:48:56 +0000 (19:48 +0000)]
Document SSL_CTX_get_ssl_method(3)
tb [Tue, 11 May 2021 18:57:17 +0000 (18:57 +0000)]
Merge some details from OpenSSL 1.1.1.
kettenis [Tue, 11 May 2021 18:21:12 +0000 (18:21 +0000)]
A Data Segment Interrupt does not indicate whether it was the result
of a read or a write fault. Unfortunately that means we can't call
uvm_fault(), as we have to pass the right access_type. In particular,
passing PROT_READ for write access on a write-only page will fail.
Fix this issue by inserting an appropriate SLB entry when a mapping
exists at the fault address. A subsequent Data Storage Interrupt
will call uvm_fault() to insert a mapping for the page into the
page tables.
Fixes the sys/kern/fork-exit regress test.
Debugging done by bluhm@ and patrick@
ok bluhm@
anton [Tue, 11 May 2021 16:40:57 +0000 (16:40 +0000)]
Temporarily release the mutex while calling sensor_task_register() as it
might end up sleeping in malloc(). This can only happen if uhidpp is the
first one calling the aforementioned routine which causes the sensors
task queue to be allocated.
Thanks to Justin Yang <linuxjustin at gmail dot com> for the report.
tb [Tue, 11 May 2021 15:31:13 +0000 (15:31 +0000)]
missing word in previous
tb [Tue, 11 May 2021 15:26:21 +0000 (15:26 +0000)]
Merge documentation for EVP_DigestVerify() from OpenSSL 1.1.1.
deraadt [Tue, 11 May 2021 15:18:48 +0000 (15:18 +0000)]
initial attempt at install*.img
tb [Tue, 11 May 2021 15:14:56 +0000 (15:14 +0000)]
Merge documentation for EVP_DigestSign from OpenSSL 1.1.1.
deraadt [Tue, 11 May 2021 14:58:25 +0000 (14:58 +0000)]
more whitespace cleanups
deraadt [Tue, 11 May 2021 14:58:08 +0000 (14:58 +0000)]
whitespace cleanup
deraadt [Tue, 11 May 2021 13:56:28 +0000 (13:56 +0000)]
riscv has no delay slots, we don't need anything like this in the sigcode.
ok jsg drahn
cheloha [Tue, 11 May 2021 13:29:25 +0000 (13:29 +0000)]
timeout_barrier(9), timeout_del_barrier(9): remove kernel lock
In timeout_barrier(9) we take/release the kernel lock to ensure that the
given timeout has finished running (if it had been running at all).
This approach is inefficient. If we put a barrier timeout on the
queue and wait for it to run in cond_wait(9) we can block instead of
spinning for the kernel lock. We already do this for process-context
timeouts in timeout_barrier(9) anyway.
Discussed with dlg@, visa@, and mpi@.
ok dlg@
patrick [Tue, 11 May 2021 13:25:26 +0000 (13:25 +0000)]
Enable iwx(4).
claudio [Tue, 11 May 2021 12:09:19 +0000 (12:09 +0000)]
Don't leak fd on error.
jsg [Tue, 11 May 2021 12:05:13 +0000 (12:05 +0000)]
use FE_ALL_EXCEPT not _ROUND_MASK when masking fcsr exception bits
claudio [Tue, 11 May 2021 11:48:02 +0000 (11:48 +0000)]
Make sure some variables are initialised since modern gcc warns about them.
Handle rrdppid like we do for all other child processes. The two warnings
in rrdp are probably false positives.
OK tb@
claudio [Tue, 11 May 2021 11:43:21 +0000 (11:43 +0000)]
Arm the alarms in all childs so they terminate if the timeout is hit.
Also install the special signal handler around the main poll() loop.
The main process handles SIGALRM so it can log an error to the operator
before exiting.
With and OK deraadt@
claudio [Tue, 11 May 2021 11:32:51 +0000 (11:32 +0000)]
Before calling ASN1_time_parse() initialize the struct tm. While
recent libressl version initalise the struct tm properly older
versions did not and so -portable runs into problem on systems
with older libressl versions installed.
Problem found by job@
OK tb@
mvs [Tue, 11 May 2021 11:21:58 +0000 (11:21 +0000)]
regen
mvs [Tue, 11 May 2021 11:21:31 +0000 (11:21 +0000)]
Unlock shutdown(2).
ok mpi@
mvs [Tue, 11 May 2021 11:20:51 +0000 (11:20 +0000)]
regen
mvs [Tue, 11 May 2021 11:20:23 +0000 (11:20 +0000)]
Unlock listen(2).
ok mpi@
mvs [Tue, 11 May 2021 11:19:39 +0000 (11:19 +0000)]
regen
mvs [Tue, 11 May 2021 11:19:10 +0000 (11:19 +0000)]
Unlock connect(2).
ok mpi@
mvs [Tue, 11 May 2021 11:18:15 +0000 (11:18 +0000)]
regen