openbsd
23 months agoMake ucc(4) the first consumer of hidcc. No intended functional change.
anton [Fri, 11 Nov 2022 06:48:38 +0000 (06:48 +0000)]
Make ucc(4) the first consumer of hidcc. No intended functional change.

ok matthieu@

23 months agosync
anton [Fri, 11 Nov 2022 06:47:18 +0000 (06:47 +0000)]
sync

23 months agoExtract the HID specific pieces from ucc(4) into hidcc. First steps
anton [Fri, 11 Nov 2022 06:46:48 +0000 (06:46 +0000)]
Extract the HID specific pieces from ucc(4) into hidcc. First steps
toward attaching hidcc over i2c.

ok matthieu@

23 months agoreturn early from drm activate functions after fatal error
jsg [Fri, 11 Nov 2022 02:21:09 +0000 (02:21 +0000)]
return early from drm activate functions after fatal error

avoids a page fault trap trying to take an uninitialised
modeset lock on suspend

reported and tested by Ali Farzanrad on HP ProBook 4530s

radeondrm0 at pci1 dev 0 function 0 "ATI Radeon HD 6400M" rev 0x00
drm1 at radeondrm0
radeondrm0: msi
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 3000" rev 0x09
drm0 at inteldrm0
inteldrm0: msi, SANDYBRIDGE, gen 6
..
radeondrm0: CAICOS
[drm] *ERROR* Unable to locate a BIOS ROM
drm:pid0:radeondrm_attachhook *ERROR* Fatal error during GPU init
inteldrm0: 1366x768, 32bpp

23 months agozap stray space (CRITICAL!)
tb [Fri, 11 Nov 2022 01:44:26 +0000 (01:44 +0000)]
zap stray space (CRITICAL!)

23 months agodivison -> division
jsg [Thu, 10 Nov 2022 23:57:31 +0000 (23:57 +0000)]
divison -> division

23 months agopscivar.h include no longer needed
jsg [Thu, 10 Nov 2022 23:42:15 +0000 (23:42 +0000)]
pscivar.h include no longer needed
ok kettenis@

23 months agovmd(8): remove toggling interrupt line on vcpu in vcpu run loop
dv [Thu, 10 Nov 2022 23:39:51 +0000 (23:39 +0000)]
vmd(8): remove toggling interrupt line on vcpu in vcpu run loop

We toggle the interrupt "line" on the vcpu when we assert or deassert
irq on the pic in either the vcpu thread (emulating some devices)
or on the device event thread (mostly handling reading available
data). Having it in the vcpu run loop here just results in another
ioctl(2) call before the one for re-entering the guest cpu.

Removing it shows no noticeable behavioral change in existing guests.

ok mlarkin@

23 months agoSprinkle some #ifdef SUSPEND to unbreak the tree.
kettenis [Thu, 10 Nov 2022 23:21:15 +0000 (23:21 +0000)]
Sprinkle some #ifdef SUSPEND to unbreak the tree.

23 months agoHandle dynamic remote port forwarding in escape commandline's -R processing.
dtucker [Thu, 10 Nov 2022 23:03:10 +0000 (23:03 +0000)]
Handle dynamic remote port forwarding in escape commandline's -R processing.
bz#3499, ok djm@

23 months ago- sort options; from josiah frentsos
jmc [Thu, 10 Nov 2022 22:58:39 +0000 (22:58 +0000)]
- sort options; from josiah frentsos
ok nicm

- add -N to SYNOPSIS

- sort usage()

23 months agofix SEE ALSO and new sentence, new line;
jmc [Thu, 10 Nov 2022 19:10:50 +0000 (19:10 +0000)]
fix SEE ALSO and new sentence, new line;
similar patch floated by josian frentsos on tech

23 months agotweak the "once" text; ok sashan
jmc [Thu, 10 Nov 2022 19:07:21 +0000 (19:07 +0000)]
tweak the "once" text; ok sashan

23 months agoInitialize data before passing it to get_input_data. Strictly
mbuhl [Thu, 10 Nov 2022 18:58:02 +0000 (18:58 +0000)]
Initialize data before passing it to get_input_data.  Strictly
speaking this is not necessary as all used bits of the uint32_t are
zeroed.
ok mlarkin

23 months agoBump LibreSSL version to 3.7
tb [Thu, 10 Nov 2022 18:15:36 +0000 (18:15 +0000)]
Bump LibreSSL version to 3.7

23 months agoUse tls_buffer for alert and handshake fragments in the legacy stack.
jsing [Thu, 10 Nov 2022 18:06:37 +0000 (18:06 +0000)]
Use tls_buffer for alert and handshake fragments in the legacy stack.

This avoids a bunch of pointer munging and a handrolled memmove.

ok tb@

23 months agoFinish migrating to one source file per line.
joshua [Thu, 10 Nov 2022 17:53:45 +0000 (17:53 +0000)]
Finish migrating to one source file per line.

ok jsing@ tb@

23 months agoIn asn1.h rev. 1.65, beck@ provided ASN1_TIME_set_string_X509(3),
schwarze [Thu, 10 Nov 2022 17:44:05 +0000 (17:44 +0000)]
In asn1.h rev. 1.65, beck@ provided ASN1_TIME_set_string_X509(3),
ASN1_TIME_normalize(3), ASN1_TIME_to_tm(3), ASN1_TIME_cmp_time_t(3),
and ASN1_TIME_compare(3).
Merge documentation from the OpenSSL 1.1.1 branch, which is still
under a free license, with tweaks by me in several respects to match
our implementation, and also using some feedback from beck@.
OK beck@.

23 months agobring back r1.673: replace SRP with SMR in the if_idxmap.
dlg [Thu, 10 Nov 2022 17:17:47 +0000 (17:17 +0000)]
bring back r1.673: replace SRP with SMR in the if_idxmap.

when i first wrote if_idxmap i didn't realise (and no one thought
to tell me) that index 0 was special and means "no interface", so
while here use the 0th slot in the interface map to store the length
of the map instead of prepending the map with a length field.
if_get() now special cases index 0 and returns NULL directly. this
also means the size of the map is now always a power of 2, which
is a nicer fit with what the kernel malloc aprovides.

the problem with r1.673 that hrvoje popovski found was that attaching
a lot of interfaces during autoconf would lock up when growing the
map called smr_barrier. the fix in this diff is to (ab)use the
usedidx bitmap to store an smr_entry and defer the freeing of the
interface pointer map with it.

tested by hrvoje popovski
tweaks and ok visa@

23 months agoAllow explicit cert trusts or distrusts for EKU any
beck [Thu, 10 Nov 2022 16:52:19 +0000 (16:52 +0000)]
Allow explicit cert trusts or distrusts for EKU any

This matches the current OpenSSL behaviour introduced
in their commit:
commit 0daccd4dc1f1ac62181738a91714f35472e50f3c
Date:   Thu Jan 28 03:01:45 2016 -0500

ok jsing@ tb@

23 months agoAdd regress coverage for Ed25519 and X25519 EVP interfaces.
jsing [Thu, 10 Nov 2022 16:38:57 +0000 (16:38 +0000)]
Add regress coverage for Ed25519 and X25519 EVP interfaces.

23 months agoImplement EVP interfaces for Ed25519 and X25519.
jsing [Thu, 10 Nov 2022 16:37:51 +0000 (16:37 +0000)]
Implement EVP interfaces for Ed25519 and X25519.

ok beck@ tb@

23 months agoRemove obsolete function, struct, and macro names
schwarze [Thu, 10 Nov 2022 16:34:23 +0000 (16:34 +0000)]
Remove obsolete function, struct, and macro names
that tb@ removed from asn1.h on January 14:

rev. 1.58: ASN1_CTX ASN1_const_CTX
rev. 1.60: ASN1_OBJECT_FLAG_CRITICAL ASN1_OBJECT_FLAG_DYNAMIC
rev. 1.60: ASN1_OBJECT_FLAG_DYNAMIC_DATA ASN1_OBJECT_FLAG_DYNAMIC_STRINGS
rev. 1.61: NETSCAPE_X509 NETSCAPE_X509_free NETSCAPE_X509_new
rev. 1.61: d2i_NETSCAPE_X509 i2d_NETSCAPE_X509

23 months agorevert pf_state mtx commit, because it breaks tree.
sashan [Thu, 10 Nov 2022 16:29:20 +0000 (16:29 +0000)]
revert pf_state mtx commit, because it breaks tree.
pfctl does not build

OK dlg@

23 months agoApparently we receive interrupts for both powerkey press and release, which
patrick [Thu, 10 Nov 2022 16:20:54 +0000 (16:20 +0000)]
Apparently we receive interrupts for both powerkey press and release, which
isn't quite helpful when it's used to come back from suspend and then the
second interrupt initiates powerdown.  Ignore press, but handle release.

ok kettenis@

23 months agoSince the introduction of automatic immutable from the kernel, the munmap()
kettenis [Thu, 10 Nov 2022 16:14:50 +0000 (16:14 +0000)]
Since the introduction of automatic immutable from the kernel, the munmap()
of ld.so boot.text region is now (silently) failing because the region is
contained within the text LOAD, which is immutable.  So create a new btext
LOAD with flags PF_X|PF_R|PF_OPENBSD_MUTABLE, and place all boot.text objects
in there.  This LOAD must also be page-aligned so it doesn't skip unmapping
some of the object region, previously it was hilariously unaligned.
ok kettenis and guenther seemed to like it also
This one is for powerpc64 and a modified version of the diff deraadt@ mailed
out to make sure the LOADs are in increasing address order.

23 months agoAdd mbr_get_fstype() and use it to translate MBR dp_typ fields
krw [Thu, 10 Nov 2022 16:12:05 +0000 (16:12 +0000)]
Add mbr_get_fstype() and use it to translate MBR dp_typ fields
into FS_* values. Similar to what gpt_get_fstype() does. Code is
clearer and better positioned for planned enhancements to
spoofing.

No intentional functional change.

23 months agoMap objects for ED25519 to Ed25519.
jsing [Thu, 10 Nov 2022 16:04:31 +0000 (16:04 +0000)]
Map objects for ED25519 to Ed25519.

OpenSSL used ED25519, even though the RFCs use Ed25519 - as such, we get to
provide both.

ok tb@

23 months agoContinue migrating to one source file per line.
joshua [Thu, 10 Nov 2022 16:00:34 +0000 (16:00 +0000)]
Continue migrating to one source file per line.

ok jsing@ tb@

23 months agoUse local variable for consistency
kn [Thu, 10 Nov 2022 16:00:17 +0000 (16:00 +0000)]
Use local variable for consistency

OK claudio

23 months agoHP-300's hd is now gone. svnd transmorgified into vnd in 2011. No
krw [Thu, 10 Nov 2022 15:26:38 +0000 (15:26 +0000)]
HP-300's hd is now gone. svnd transmorgified into vnd in 2011. No
need to keep checking for these device names.

23 months agoProvide digestsign/digestverify hooks for EVP_PKEY_METHOD.
jsing [Thu, 10 Nov 2022 15:17:30 +0000 (15:17 +0000)]
Provide digestsign/digestverify hooks for EVP_PKEY_METHOD.

These are needed for EVP implementations of Ed25519 and X25519.

ok beck@ tb@

23 months agoContinue migrating to one source file per line.
joshua [Thu, 10 Nov 2022 15:13:52 +0000 (15:13 +0000)]
Continue migrating to one source file per line.

ok jsing@ tb@

23 months agoDowngrade test to C++98 to fix build on GCC archs
kn [Thu, 10 Nov 2022 14:51:01 +0000 (14:51 +0000)]
Downgrade test to C++98 to fix build on GCC archs

Spotted on sparc64, diff from miod, tb and bluhm agree.

23 months agoPort EVP raw key API from OpenSSL.
jsing [Thu, 10 Nov 2022 14:46:44 +0000 (14:46 +0000)]
Port EVP raw key API from OpenSSL.

This will be needed to deal with Curve25519 based keys.

ok beck@ tb@

23 months agoAdd a mutex to pf_state structure. Mutex retain a consistency
sashan [Thu, 10 Nov 2022 14:22:43 +0000 (14:22 +0000)]
Add a mutex to pf_state structure. Mutex retain a consistency
of structure members without using a global state lock.
The first member which uses protection by mutex is key[] array.
more will follow.

OK dlg@

23 months agoAdd suspend/resume support to control the power domain.
kettenis [Thu, 10 Nov 2022 14:15:15 +0000 (14:15 +0000)]
Add suspend/resume support to control the power domain.

ok patrick@

23 months agoIndicate compliance with work-in-progress spec for ROA objects
job [Thu, 10 Nov 2022 13:22:55 +0000 (13:22 +0000)]
Indicate compliance with work-in-progress spec for ROA objects

23 months agoPort ASN1_buf_print() from OpenSSL 1.1.
jsing [Thu, 10 Nov 2022 13:09:34 +0000 (13:09 +0000)]
Port ASN1_buf_print() from OpenSSL 1.1.

This is needed to print byte array based keys, such as Ed25519 and X25519.

ok beck@ tb@

23 months agoqcpon(4), qcpwm(4), qcrtc(4)
patrick [Thu, 10 Nov 2022 13:08:57 +0000 (13:08 +0000)]
qcpon(4), qcpwm(4), qcrtc(4)

23 months agoupdate for consistency
patrick [Thu, 10 Nov 2022 12:59:26 +0000 (12:59 +0000)]
update for consistency

23 months agoqcpmic(4), qcpmicgpio(4), qcspmi(4)
patrick [Thu, 10 Nov 2022 12:57:08 +0000 (12:57 +0000)]
qcpmic(4), qcpmicgpio(4), qcspmi(4)

23 months agoContinue migrating to one source file per line.
joshua [Thu, 10 Nov 2022 12:55:49 +0000 (12:55 +0000)]
Continue migrating to one source file per line.

ok jsing@ tb@

23 months agotypofix; ok dlg
kn [Thu, 10 Nov 2022 12:46:19 +0000 (12:46 +0000)]
typofix; ok dlg

23 months agocope with recent route output changes
anton [Thu, 10 Nov 2022 12:40:29 +0000 (12:40 +0000)]
cope with recent route output changes

23 months agoqcpdc(4)
patrick [Thu, 10 Nov 2022 12:40:07 +0000 (12:40 +0000)]
qcpdc(4)

23 months agoUse /tmp as opposed of /var/tmp as the default directory for temporary
anton [Thu, 10 Nov 2022 12:38:57 +0000 (12:38 +0000)]
Use /tmp as opposed of /var/tmp as the default directory for temporary
files.

23 months agoFix a few more leaks in *_print() functions.
tobhe [Thu, 10 Nov 2022 12:37:00 +0000 (12:37 +0000)]
Fix a few more leaks in *_print() functions.

ok jsing@

23 months agoMove manpages for Qualcomm devices over to the MI directory. kettenis@ put
patrick [Thu, 10 Nov 2022 12:36:38 +0000 (12:36 +0000)]
Move manpages for Qualcomm devices over to the MI directory.  kettenis@ put
them into the arm64-specific one mostly because they were for ACPI and that
will definitely be arm64-specific.  I have committed most of the FDT ones
to the MI fdt directory.  dlg@ would be happier with those manpages in the
MI one.  There are more manpages to come as well.

23 months agoRemove hack that uses a timeout to fake interrupts now that qcpdc(4) allows
patrick [Thu, 10 Nov 2022 12:16:06 +0000 (12:16 +0000)]
Remove hack that uses a timeout to fake interrupts now that qcpdc(4) allows
us to properly establish interrupts.

The fixed IPL_BIO should probably be replaced by the highest IPL requested
by our children.

ok kettenis@

23 months agoWe need to turn a few more things on in the resume path. This makes it
kettenis [Thu, 10 Nov 2022 12:14:05 +0000 (12:14 +0000)]
We need to turn a few more things on in the resume path.  This makes it
possible to ifconfig down the interface suspend/resume and ifconfig up the
interface again afterwards in most cases.  Suspend/resume with the interface
up is still busted.

ok patrick@, stsp@

23 months agoEnable qcpdc(4)
patrick [Thu, 10 Nov 2022 12:13:22 +0000 (12:13 +0000)]
Enable qcpdc(4)

ok kettenis@

23 months agoAdd qcpdc(4), a driver for the Qualcomm Power Domain controller found on
patrick [Thu, 10 Nov 2022 12:12:53 +0000 (12:12 +0000)]
Add qcpdc(4), a driver for the Qualcomm Power Domain controller found on
Qualcomm SoCs.  This is mostly a shim torwards agintc(4).

ok kettenis@

23 months agoMove the code handling brightness keys into a task, since with
matthieu [Thu, 10 Nov 2022 12:10:54 +0000 (12:10 +0000)]
Move the code handling brightness keys into a task, since with
inteldrm(4) it requires a process context. ok kettenis@

23 months agovmd(8): import mmio decode and emulation, disabled for now.
dv [Thu, 10 Nov 2022 11:46:39 +0000 (11:46 +0000)]
vmd(8): import mmio decode and emulation, disabled for now.

The initial mmio support for vmd adds support for only specific MOV
and MOVZX instructions. Plan is to begin iterating in-tree on other
missing pieces. All functionality is gated behind an #if for now.

Only change to vmm(4) is reordering register #define's in vmmvar.h.

ok mlarkin@

23 months agoMake the power button function as a wakeup button during suspend.
kettenis [Thu, 10 Nov 2022 11:45:29 +0000 (11:45 +0000)]
Make the power button function as a wakeup button during suspend.

ok phessler@, patrick@, tobhe@

23 months agoiWe must be careful to only disable power domains that are no longer in
kettenis [Thu, 10 Nov 2022 11:44:06 +0000 (11:44 +0000)]
iWe must be careful to only disable power domains that are no longer in
use by a device.  So maintainer a counter and only disable the power
domain if it drops to zero.

ok deraadt@, tobhe@

23 months agoarm64 can suspend without PSCI support now
kettenis [Thu, 10 Nov 2022 11:23:21 +0000 (11:23 +0000)]
arm64 can suspend without PSCI support now

ok deraadt@, phessler@

23 months agoRegen
krw [Thu, 10 Nov 2022 11:02:26 +0000 (11:02 +0000)]
Regen

23 months agoA theoretical path exists where ext.data1 is not initialized by
mbuhl [Thu, 10 Nov 2022 10:47:30 +0000 (10:47 +0000)]
A theoretical path exists where ext.data1 is not initialized by
parseextcommunity but used afterwards.
Found by codechecker.
OK claudio

23 months agoPut CPUs in the lowest P-state just before the final suspend step. The
kettenis [Thu, 10 Nov 2022 10:37:40 +0000 (10:37 +0000)]
Put CPUs in the lowest P-state just before the final suspend step.  The
firmware probably does this for us on ACPI systems with proper S3 support,
but this doesn't happen on systems where we park CPUs in a low-power idle
state ourselves.

ok deraadt@

23 months agoMove bn_prime.h to the public domain.
tb [Thu, 10 Nov 2022 10:24:50 +0000 (10:24 +0000)]
Move bn_prime.h to the public domain.

It's entirely trivial.

ok beck

23 months agoNuke Vax (ra,rx) and HP-300 (hd) devices.
krw [Thu, 10 Nov 2022 09:50:00 +0000 (09:50 +0000)]
Nuke Vax (ra,rx) and HP-300 (hd) devices.

Noticed by kn@

ok millert@

23 months agoConvert amd64 clock and ipi event counters to per-cpu
jmatthew [Thu, 10 Nov 2022 08:26:54 +0000 (08:26 +0000)]
Convert amd64 clock and ipi event counters to per-cpu

ok kettenis@ jca@ cheloha@

23 months agochange default output to -a format; ok tb
deraadt [Thu, 10 Nov 2022 08:17:53 +0000 (08:17 +0000)]
change default output to -a format; ok tb

23 months agoConvert sparc64 clock event counter to per-cpu and increment using
jmatthew [Thu, 10 Nov 2022 07:08:01 +0000 (07:08 +0000)]
Convert sparc64 clock event counter to per-cpu and increment using
evcount_inc() rather than atomic operations.

ok kettenis@ jca@ cheloha@

23 months agoAdd support for per-cpu event counters, to be used for clock and IPI
jmatthew [Thu, 10 Nov 2022 07:05:41 +0000 (07:05 +0000)]
Add support for per-cpu event counters, to be used for clock and IPI
counters where the event being counted occurs across all CPUs in the
system.  Counter instances can be made per-cpu by calling evcount_percpu()
after the counter is attached, and this can occur before or after all system
CPUs are attached.  Per-cpu counter instances should be incremented using
evcount_inc().

ok kettenis@ jca@ cheloha@

23 months agoReturn error number instead of call panic().
asou [Thu, 10 Nov 2022 02:47:52 +0000 (02:47 +0000)]
Return error number instead of call panic().

ok mpi@

23 months agoIn case RSA_meth_new fails, errstr would be passed to fatalx without
mbuhl [Thu, 10 Nov 2022 00:44:12 +0000 (00:44 +0000)]
In case RSA_meth_new fails, errstr would be passed to fatalx without
initialization.
OK tb

23 months agofix build after 1.298
jsg [Thu, 10 Nov 2022 00:14:11 +0000 (00:14 +0000)]
fix build after 1.298

23 months agoalways call va_end.
mbuhl [Thu, 10 Nov 2022 00:00:11 +0000 (00:00 +0000)]
always call va_end.
ok tb

23 months agoStart migrating to one source file per line.
joshua [Wed, 9 Nov 2022 23:33:08 +0000 (23:33 +0000)]
Start migrating to one source file per line.

ok jsing@ tb@

23 months agoRemove prime_t remnant and link bn_primes test statically
tb [Wed, 9 Nov 2022 23:28:08 +0000 (23:28 +0000)]
Remove prime_t remnant and link bn_primes test statically

23 months agoSync CBS_strdup() documentation update from libcrypto.
jsing [Wed, 9 Nov 2022 23:14:51 +0000 (23:14 +0000)]
Sync CBS_strdup() documentation update from libcrypto.

23 months agosimplify expiration of 'once' rules.
sashan [Wed, 9 Nov 2022 23:00:00 +0000 (23:00 +0000)]
simplify expiration of 'once' rules.
let packet to mark 'once' rule as expired. The rule
will be removed by pfctl(8) when rules are updated.

OK kn@

23 months agoHook up gpiobl(4) to the screen burner instead of wsdisplay(4) brightness
tobhe [Wed, 9 Nov 2022 22:56:44 +0000 (22:56 +0000)]
Hook up gpiobl(4) to the screen burner instead of wsdisplay(4) brightness
control. This enables automatic screen blanking with X and wscons(4) once
wsfb(4) is fixed.

"this is fine for now" kettenis@

23 months agoMove table in bn_primes.h to a .c file and get rid of prime_t
tb [Wed, 9 Nov 2022 22:52:51 +0000 (22:52 +0000)]
Move table in bn_primes.h to a .c file and get rid of prime_t

This way we deduplicate two inclusions of the same big table and eliminate
lots of stupid casts.

input and ok many

23 months agoRemove kernel lock here since msleep() with PCATCH no longer requires it.
claudio [Wed, 9 Nov 2022 22:25:36 +0000 (22:25 +0000)]
Remove kernel lock here since msleep() with PCATCH no longer requires it.
OK mpi@

23 months agoNo more xd/xy devs.
krw [Wed, 9 Nov 2022 22:25:27 +0000 (22:25 +0000)]
No more xd/xy devs.

23 months agoSome limited setsockopt/getsockopt are allowed in pledge "stdio".
deraadt [Wed, 9 Nov 2022 22:25:08 +0000 (22:25 +0000)]
Some limited setsockopt/getsockopt are allowed in pledge "stdio".
Also allow IPPROTO_TCP:TCP_NODELAY
It is very small kernel code, and will allow some software to drop "inet"
requested by djm

23 months agoRegen
krw [Wed, 9 Nov 2022 22:18:53 +0000 (22:18 +0000)]
Regen

23 months agorevert r1.673: replace SRP with SMR in the if_idxmap.
dlg [Wed, 9 Nov 2022 22:15:50 +0000 (22:15 +0000)]
revert r1.673: replace SRP with SMR in the if_idxmap.

if the map has to be reallocated during boot, there's an smr_barrier
waiting for the old map to become unused. that barrier ends up
waiting for cpus that aren't running yet because we haven't finished
booting yet, so boot gets stuck.

found by hrvoje popovski

23 months agoConstify simplefb_formats[]; OK patrick
kn [Wed, 9 Nov 2022 22:12:40 +0000 (22:12 +0000)]
Constify simplefb_formats[]; OK patrick

23 months agoEnable qcpwm(4)
patrick [Wed, 9 Nov 2022 20:00:05 +0000 (20:00 +0000)]
Enable qcpwm(4)

ok kettenis@ mlarkin@

23 months agoAdd qcpwm(4), a driver for the PWM found on Qualcomm PMICs. This is used
patrick [Wed, 9 Nov 2022 19:59:38 +0000 (19:59 +0000)]
Add qcpwm(4), a driver for the PWM found on Qualcomm PMICs.  This is used
on the Lenovo x13s to control the display backlight brightness.

ok kettenis@ mlarkin@

23 months agoNow that dlopen() sets object->nodelete for RTLD_NODELETE, _dl_load_dep_libs()
deraadt [Wed, 9 Nov 2022 19:50:25 +0000 (19:50 +0000)]
Now that dlopen() sets object->nodelete for RTLD_NODELETE, _dl_load_dep_libs()
can consider this same as the "booting" case, and instruct lower layers to
do immutability. With this change in place, the not-yet-commited
library-immutable diff leaves 1 page of libc (malloc related) and 6
non-RTLD_NODELETE libraries mutable in chrome.
Everything else is immutable, except for the program's transient memory
allocations & file mappings.  This is an unexpected result.

23 months agoRemove xy/xd. SMD left with sparc.
krw [Wed, 9 Nov 2022 19:35:23 +0000 (19:35 +0000)]
Remove xy/xd. SMD left with sparc.

ok kn@ deraadt@

23 months agoMove input/output configuration into the correct function.
patrick [Wed, 9 Nov 2022 19:25:50 +0000 (19:25 +0000)]
Move input/output configuration into the correct function.

23 months agoImplement wakeup interrupt support. For now this is only implemented for
kettenis [Wed, 9 Nov 2022 19:18:11 +0000 (19:18 +0000)]
Implement wakeup interrupt support.  For now this is only implemented for
aplintc(4); other arm64 interrupt controllers will follow.

ok patrick@

23 months agoFix up indentation for EVP_PKEY_* defines.
jsing [Wed, 9 Nov 2022 19:18:08 +0000 (19:18 +0000)]
Fix up indentation for EVP_PKEY_* defines.

23 months agonreq could leak a http get request in case a redirect without
mbuhl [Wed, 9 Nov 2022 19:11:14 +0000 (19:11 +0000)]
nreq could leak a http get request in case a redirect without
location header was received.
OK deraadt

23 months agoRevise CBS_strdup() documentation.
jsing [Wed, 9 Nov 2022 19:05:42 +0000 (19:05 +0000)]
Revise CBS_strdup() documentation.

CBS_strdup() now internally checks if the data contains NUL, failing if it
does.

Prompted by beck@

23 months agoIn do_zzz a garbage stack value could be accessed in case a read
mbuhl [Wed, 9 Nov 2022 18:48:11 +0000 (18:48 +0000)]
In do_zzz a garbage stack value could be accessed in case a read
or write in send_command failed.
Found by codechecker.
OK deraadt

23 months agoRemove xy/xd. SMD left with sparc.
krw [Wed, 9 Nov 2022 18:46:04 +0000 (18:46 +0000)]
Remove xy/xd. SMD left with sparc.

ok kn@ deraadt@

23 months agodlopen() with RTLD_NODELETE should also set the object nodelete flag,
deraadt [Wed, 9 Nov 2022 18:44:11 +0000 (18:44 +0000)]
dlopen() with RTLD_NODELETE should also set the object nodelete flag,
so the mapping layer will know it can use mimmutable()

23 months agoSince the introduction of automatic immutable from the kernel, the munmap()
deraadt [Wed, 9 Nov 2022 18:39:35 +0000 (18:39 +0000)]
Since the introduction of automatic immutable from the kernel, the munmap()
of ld.so boot.text region is now (silently) failing because the region is
contained within the text LOAD, which is immutable.  So create a new btext
LOAD with flags PF_X|PF_R|PF_OPENBSD_MUTABLE, and place all boot.text objects
in there.  This LOAD must also be page-aligned so it doesn't skip unmapping
some of the object region, previously it was hilariously unaligned.
ok kettenis and guenther seemed to like it also
This one is for 32-bit arm, tested by phessler

23 months agoClean up EVP_PKEY_METHOD related tables and code.
jsing [Wed, 9 Nov 2022 18:25:36 +0000 (18:25 +0000)]
Clean up EVP_PKEY_METHOD related tables and code.

This is effectively the same as done for EVP_PKEY_ASN1_METHOD, although
this table only has nine entries.

ok tb@

23 months agoError out if a ROA payload contains too many ipAddrBlocks
job [Wed, 9 Nov 2022 18:17:23 +0000 (18:17 +0000)]
Error out if a ROA payload contains too many ipAddrBlocks

The ASN.1 profile in draft-ietf-sidrops-rfc6482bis section 4 specifies
that there must not be more than 2 ipAddrBlocks (one for IPv4, and one
for IPv6). Compatible with all published ROAs.

OK tb@

23 months agoClean up EVP_PKEY_ASN1_METHOD related tables and code.
jsing [Wed, 9 Nov 2022 18:17:16 +0000 (18:17 +0000)]
Clean up EVP_PKEY_ASN1_METHOD related tables and code.

Rather than messing around with an OBJ_bsearch() for a table that contains
16 entries (and a stack find for any application added methods), simply do
a reverse linear scan. This maintains the application method first
behaviour, while removing a chunk of code.

While here rename some variables and do some style clean up.

ok tb@

23 months agoAdd suspend/resume support to aplns(4).
kettenis [Wed, 9 Nov 2022 18:17:00 +0000 (18:17 +0000)]
Add suspend/resume support to aplns(4).

ok dlg@, patrick@