openbsd
16 months agoAdd some resets for the PCIe controllers on the RK3588.
patrick [Sat, 8 Jul 2023 08:37:39 +0000 (08:37 +0000)]
Add some resets for the PCIe controllers on the RK3588.

ok kettenis@

16 months agoHide symbols in crypto.h
beck [Sat, 8 Jul 2023 08:28:23 +0000 (08:28 +0000)]
Hide symbols in crypto.h

ok jsing@

16 months agoHide symbols in cms, comp, conf, and buffer
beck [Sat, 8 Jul 2023 08:26:26 +0000 (08:26 +0000)]
Hide symbols in cms, comp, conf, and buffer

ok jsing@

16 months agoAdd support for the Motorcomm YT8521/YT8531 PHYs. Since these PHYs may
kettenis [Sat, 8 Jul 2023 08:18:30 +0000 (08:18 +0000)]
Add support for the Motorcomm YT8521/YT8531 PHYs.  Since these PHYs may
need various board-dependent tweaks, pass the device tree node down
to the PHY driver such that we can look at various properties to make
the necessary tweaks.  Enable ytphy(4) on riscv64.

ok jsing@, patrick@

16 months agomove everyone besides UList to use v5.36
espie [Sat, 8 Jul 2023 08:15:32 +0000 (08:15 +0000)]
move everyone besides UList to use v5.36

16 months agoregen
kettenis [Sat, 8 Jul 2023 08:13:31 +0000 (08:13 +0000)]
regen

16 months agoAdd Motorcomm YT8531.
kettenis [Sat, 8 Jul 2023 08:10:27 +0000 (08:10 +0000)]
Add Motorcomm YT8531.

ok jsing@, patrick@

16 months agoMove /dev/apm related acpi code to acpi_apm.c which is only built on
tobhe [Sat, 8 Jul 2023 08:01:10 +0000 (08:01 +0000)]
Move /dev/apm related acpi code to acpi_apm.c which is only built on
amd64 and i386. This is the first step towards a machine independent
safe sleep API.

tested by yasuoka@ bluhm@
ok deraadt@ kettenis@

16 months agoRemove unused SHA-1 implementation.
jsing [Sat, 8 Jul 2023 07:58:25 +0000 (07:58 +0000)]
Remove unused SHA-1 implementation.

16 months agoRemove now unnecessary "do { } while (0)"
jsing [Sat, 8 Jul 2023 07:52:25 +0000 (07:52 +0000)]
Remove now unnecessary "do { } while (0)"

16 months agoInline HASH_MAKE_STRING macro.
jsing [Sat, 8 Jul 2023 07:49:45 +0000 (07:49 +0000)]
Inline HASH_MAKE_STRING macro.

No change to generated assembly.

16 months agoReorder functions.
jsing [Sat, 8 Jul 2023 07:43:44 +0000 (07:43 +0000)]
Reorder functions.

No functional change.

16 months agoMore style(9).
jsing [Sat, 8 Jul 2023 07:34:34 +0000 (07:34 +0000)]
More style(9).

16 months agoHit cast with the style(9) stick.
jsing [Sat, 8 Jul 2023 07:25:43 +0000 (07:25 +0000)]
Hit cast with the style(9) stick.

16 months agoHide symbols in dso and ct
beck [Sat, 8 Jul 2023 07:22:58 +0000 (07:22 +0000)]
Hide symbols in dso and ct

ok jsing@

16 months agoToggle IBT off during EFI runtime services calls.
kettenis [Sat, 8 Jul 2023 07:18:39 +0000 (07:18 +0000)]
Toggle IBT off during EFI runtime services calls.

While UEFI 2.10 has a way of indicating that runtime services use the
appropriate ENDBR64 instructions, firmware that's out int the wild doesn't
actually use that yet.  Once the landscape changes we may want to
reconsider toggling IBT off.

ok guenther@, kn@

16 months agoHit the des directory with the loving mallet of knfmt
beck [Sat, 8 Jul 2023 07:11:07 +0000 (07:11 +0000)]
Hit the des directory with the loving mallet of knfmt

ok tb@

16 months agostyle(9)
jsing [Sat, 8 Jul 2023 07:08:11 +0000 (07:08 +0000)]
style(9)

16 months agoHit ripemd with the style(9) stick.
jsing [Sat, 8 Jul 2023 06:52:56 +0000 (06:52 +0000)]
Hit ripemd with the style(9) stick.

16 months agoHit md5 with the style(9) stick.
jsing [Sat, 8 Jul 2023 06:50:38 +0000 (06:50 +0000)]
Hit md5 with the style(9) stick.

16 months agoHit md4 with the style(9) stick.
jsing [Sat, 8 Jul 2023 06:47:26 +0000 (06:47 +0000)]
Hit md4 with the style(9) stick.

16 months agoInline rmd_local.h in rmd_dgst.c.
jsing [Sat, 8 Jul 2023 06:43:39 +0000 (06:43 +0000)]
Inline rmd_local.h in rmd_dgst.c.

rmd_local.h is not really a local header, just another layer of indirection
that cannot be included by anything other than rmd_dgst.c. As such, include
it directly instead.

No change in generated assembly.

16 months agoInline md5_local.h in md5_dgst.c.
jsing [Sat, 8 Jul 2023 06:41:45 +0000 (06:41 +0000)]
Inline md5_local.h in md5_dgst.c.

md5_local.h is not really a local header, just another layer of indirection
that cannot be included by anything other than md5_dgst.c. As such, include
it directly instead.

No change in generated assembly.

16 months agoInline md4_local.h in md4_dgst.c.
jsing [Sat, 8 Jul 2023 06:39:19 +0000 (06:39 +0000)]
Inline md4_local.h in md4_dgst.c.

md4_local.h is not really a local header, just another layer of indirection
that cannot be included by anything other than md4_dgst.c. As such, include
it directly instead.

No change in generated assembly.

16 months agoInline sm3_local.h in sm3.c.
jsing [Sat, 8 Jul 2023 06:36:55 +0000 (06:36 +0000)]
Inline sm3_local.h in sm3.c.

sm3_local.h is not really a local header, just another layer of indirection
that cannot be included by anything other than sm3.c. As such, include it
directly instead.

No change in generated assembly.

16 months agoHide symbols in sm3
beck [Sat, 8 Jul 2023 06:13:08 +0000 (06:13 +0000)]
Hide symbols in sm3

ok tb@ jsing@

16 months agounbreak build when namespaced, file was here in my tree but didn't manage
beck [Sat, 8 Jul 2023 06:04:33 +0000 (06:04 +0000)]
unbreak build when namespaced, file was here in my tree but didn't manage
to cvs add

16 months agoadd ietp(4);
jmc [Sat, 8 Jul 2023 05:35:24 +0000 (05:35 +0000)]
add ietp(4);

16 months agoAdd ietp driver for Elantech I2C touchpads
jcs [Sat, 8 Jul 2023 02:43:02 +0000 (02:43 +0000)]
Add ietp driver for Elantech I2C touchpads

From Vladimir Serbinenko

16 months agoImplement route reference counting mockup poperly in rtable regress.
bluhm [Fri, 7 Jul 2023 20:38:17 +0000 (20:38 +0000)]
Implement route reference counting mockup poperly in rtable regress.
This allows to change rtable implementation in kernel without
breaking test.

16 months agoupstream portable fix for ocsp_test
bcook [Fri, 7 Jul 2023 19:54:36 +0000 (19:54 +0000)]
upstream portable fix for ocsp_test

16 months agoKeep mbuf header field ph_mss during loopback TCP with LRO/TSO.
bluhm [Fri, 7 Jul 2023 19:45:26 +0000 (19:45 +0000)]
Keep mbuf header field ph_mss during loopback TCP with LRO/TSO.

When M_TCP_TSO is preserved, also keep ph_mss.  In lo(4) this logic
was missing.  This may be relevant only for weird pf configs that
forward from loopback.

OK mvs@ jan@

16 months agoUnbreak the namespace build after a broken mk.conf and tool misfire had
beck [Fri, 7 Jul 2023 19:37:52 +0000 (19:37 +0000)]
Unbreak the namespace build after a broken mk.conf and tool misfire had
me aliasing symbols not in the headers I was procesing.

This unbreaks the namespace build so it will pass again

ok tb@

16 months agoMissing bit to make ld.bfd actually emit PT_OPENBSD_NOBTCFI.
pascal [Fri, 7 Jul 2023 17:23:03 +0000 (17:23 +0000)]
Missing bit to make ld.bfd actually emit PT_OPENBSD_NOBTCFI.

ok deraadt@

16 months agoAdd clocks for the RK3588 PWM controllers.
patrick [Fri, 7 Jul 2023 16:53:39 +0000 (16:53 +0000)]
Add clocks for the RK3588 PWM controllers.

ok kettenis@

16 months agoAdd clocks for the RK3588 I2C controllers.
patrick [Fri, 7 Jul 2023 16:52:57 +0000 (16:52 +0000)]
Add clocks for the RK3588 I2C controllers.

ok kettenis@

16 months agoAdd resets for the RK3588 USB 3.0 controllers.
patrick [Fri, 7 Jul 2023 16:52:09 +0000 (16:52 +0000)]
Add resets for the RK3588 USB 3.0 controllers.

ok kettenis@

16 months agoExpand the counters in struct mbstat from u_short to u_long. Use
bluhm [Fri, 7 Jul 2023 16:27:46 +0000 (16:27 +0000)]
Expand the counters in struct mbstat from u_short to u_long.  Use
malloc(9) memory instead of kernel stack for sysctl kern.mbstat.

from yasuoka@; chunk missed in previous commit; OK claudio@ tb@

16 months agoProvide optimised bn_mulw() for riscv64.
jsing [Fri, 7 Jul 2023 16:10:32 +0000 (16:10 +0000)]
Provide optimised bn_mulw() for riscv64.

This provides a 1.5-2x performance gain for BN multiplication, with a
similar improvement being seen for RSA operations.

16 months agoRemove symbols already declared in the public header
tb [Fri, 7 Jul 2023 16:04:57 +0000 (16:04 +0000)]
Remove symbols already declared in the public header

ok bcook beck jsing

16 months agoProvide a libcrypto Makefile.inc for riscv64.
jsing [Fri, 7 Jul 2023 15:51:03 +0000 (15:51 +0000)]
Provide a libcrypto Makefile.inc for riscv64.

This is currently no different from the existing behaviour and just pulls
in the C code that would have previously been built. However, it means that
OPENSSL_NO_ASM is no longer being defined by the main libcrypto Makefile,
which in turn will allow us to implement assembly optimisations.

16 months agoIgnore CVS directories for easier git + CVS coexistence.
tobhe [Fri, 7 Jul 2023 15:44:54 +0000 (15:44 +0000)]
Ignore CVS directories for easier git + CVS coexistence.

ok bluhm@ stsp@

16 months agoImplement SHA1_{Update,Transform,Final}() directly in sha1.c.
jsing [Fri, 7 Jul 2023 15:09:45 +0000 (15:09 +0000)]
Implement SHA1_{Update,Transform,Final}() directly in sha1.c.

Copy the update, transform and final functions from md32_common.h, manually
expanding the macros for SHA1. This will allow for further clean up to
occur.

No change in generated assembly.

16 months agoClean up alignment handling for SHA-256.
jsing [Fri, 7 Jul 2023 15:06:50 +0000 (15:06 +0000)]
Clean up alignment handling for SHA-256.

If input data is 32 bit aligned use be32toh() directly, otherwise use
crypto_load_be32toh(), cleaning up all of the HOST_c2l() usage.

ok beck@

16 months agoClean up SHA-256 input handling and round macros.
jsing [Fri, 7 Jul 2023 15:03:55 +0000 (15:03 +0000)]
Clean up SHA-256 input handling and round macros.

Avoid reach around and initialisation outside of the macro, cleaning up
the call sites to remove the initialisation.

ok beck@

16 months agoswap link-auth filter arguments
op [Fri, 7 Jul 2023 14:52:00 +0000 (14:52 +0000)]
swap link-auth filter arguments

Fields which can contain a '|' character are kept last to avoid
ambiguities so move result before username; link-auth was likely forgot
in r1.61 of lka_filter.c when the same treatment was applied to other
events.

Discovered after a report on -portable due to filter-rspamd crashing.

ok millert@

16 months agoRemove unused SHA-256 implementation.
jsing [Fri, 7 Jul 2023 14:32:41 +0000 (14:32 +0000)]
Remove unused SHA-256 implementation.

ok beck@

16 months agoExpand the counters in struct mbstat from u_short to u_long.
yasuoka [Fri, 7 Jul 2023 14:17:34 +0000 (14:17 +0000)]
Expand the counters in struct mbstat from u_short to u_long.

ok blumn mvs

16 months agoHide symbols in hkdf, evp, err, ecdsa, and ec
beck [Fri, 7 Jul 2023 13:54:45 +0000 (13:54 +0000)]
Hide symbols in hkdf, evp, err, ecdsa, and ec

(part 2 of commit)

ok jsing@

16 months agoHide symbols in hkdf, evp, err, ecdsa and ec
beck [Fri, 7 Jul 2023 13:53:52 +0000 (13:53 +0000)]
Hide symbols in hkdf, evp, err, ecdsa and ec

ok jsing@

16 months agoHide symbols in lhash, pem, and rc2
beck [Fri, 7 Jul 2023 13:40:44 +0000 (13:40 +0000)]
Hide symbols in lhash, pem, and rc2

ok jsing@

16 months agoRemove softdep from example fstab file
job [Fri, 7 Jul 2023 13:21:28 +0000 (13:21 +0000)]
Remove softdep from example fstab file

16 months agoHit idea with the loving mallet of knfmt
beck [Fri, 7 Jul 2023 12:51:58 +0000 (12:51 +0000)]
Hit idea with the loving mallet of knfmt

ok knfmt

16 months agohide symbols in sm, rand, and poly1305
beck [Fri, 7 Jul 2023 12:01:32 +0000 (12:01 +0000)]
hide symbols in sm, rand, and poly1305

ok jsing@

16 months agoThe per-VQ MSI-X interrupt handler needs to sync DMA mappings in the
patrick [Fri, 7 Jul 2023 10:23:39 +0000 (10:23 +0000)]
The per-VQ MSI-X interrupt handler needs to sync DMA mappings in the
same way that the shared interrupt handler does.  This is one of the
requirements of virtio_dequeue(), as specified in its comment above.

Without the DMA sync, it will not see a new entry on the ring and
return.  Since the interrupt is edge-triggered there won't be another
one and we'll get stuck.

ok dv@

16 months agoReplace HOST_l2c() with htob32() or crypto_store_htobe32().
jsing [Fri, 7 Jul 2023 10:22:28 +0000 (10:22 +0000)]
Replace HOST_l2c() with htob32() or crypto_store_htobe32().

ok beck@

16 months agoKeep more information about the established LPI around, so that we can use
patrick [Fri, 7 Jul 2023 10:11:39 +0000 (10:11 +0000)]
Keep more information about the established LPI around, so that we can use
targeted invalidation through INV instead of flushing the whole cache through
INVALL.  Having this information enables us to send DISCARD, which clears the
mapping from the ITT.  This seems to be necessary to make the Hetzner VM's ITS
happy when we try to disestablish and re-establish an LPI.

This also moves the LPI table completely into agintc(4), as LPIs are global to
an agintc(4) and especially with multiple agintcmsi(4) they should be unique.

Tested by claudio@
ok kettenis@

16 months agoRename RSA_eay_* to rsa_*.
jsing [Fri, 7 Jul 2023 10:11:23 +0000 (10:11 +0000)]
Rename RSA_eay_* to rsa_*.

Rename all of the RSA_eay_* functions to rsa_*, as well as changing the
method name (and naming). Reorder things slightly so that we can remove
all of the prototypes for static functions.

ok tb@

16 months agoUse "llu%" for printing the uint64_t fields in tcpcb.
yasuoka [Fri, 7 Jul 2023 09:15:13 +0000 (09:15 +0000)]
Use "llu%" for printing the uint64_t fields in tcpcb.

ok blumn

16 months agoEnable reading RSA-PSS certificates
tb [Fri, 7 Jul 2023 08:53:55 +0000 (08:53 +0000)]
Enable reading RSA-PSS certificates

ok beck jsing

16 months agoAdd a few more JH7110 clocks.
kettenis [Fri, 7 Jul 2023 08:43:47 +0000 (08:43 +0000)]
Add a few more JH7110 clocks.

ok jsing@

16 months agoHit rc2 with the loving mallet of knfmt.
beck [Fri, 7 Jul 2023 08:29:37 +0000 (08:29 +0000)]
Hit rc2 with the loving mallet of knfmt.

ok tb@

16 months agoFix path MTU discovery for TCP LRO/TSO when forwarding.
bluhm [Fri, 7 Jul 2023 08:05:02 +0000 (08:05 +0000)]
Fix path MTU discovery for TCP LRO/TSO when forwarding.

When doing LRO (Large Receive Offload), the drivers, currently ix(4)
and lo(4) only, record an upper bound of the size of the original
packets in ph_mss.  When sending, either stack or hardware must
chop the packets with TSO (TCP Segmentation Offload) to that size.
That means we have to call tcp_if_output_tso() before ifp->if_output().
Put that logic into if_output_tso() to avoid code duplication.  As
TCP packets on the wire do not get larger that way, path MTU discovery
should still work.

tested by and OK jan@

16 months agoAdd test coverage for leading zero octet dance
tb [Fri, 7 Jul 2023 07:47:25 +0000 (07:47 +0000)]
Add test coverage for leading zero octet dance

16 months agofixup for MS compilers
bcook [Fri, 7 Jul 2023 07:44:59 +0000 (07:44 +0000)]
fixup for MS compilers

16 months agoAdd support for multiple batteries to acpithinkpad setchargestart and
claudio [Fri, 7 Jul 2023 07:37:59 +0000 (07:37 +0000)]
Add support for multiple batteries to acpithinkpad setchargestart and
setchargestop. With this laptops like x270 or x240 properly set the
thresholds for both batteries.
Tested by kn@ and jmatthew@
OK kettenis@

16 months agoHide symbols in ts
beck [Fri, 7 Jul 2023 07:25:21 +0000 (07:25 +0000)]
Hide symbols in ts

ok jsing@

16 months agoUse an unsigned long long and corresponding formats
tb [Fri, 7 Jul 2023 07:04:24 +0000 (07:04 +0000)]
Use an unsigned long long and corresponding formats

Fixes build on 32 bit.

Reported by claudio

16 months agoMop up remaining uses of ASN1_bn_print()
tb [Fri, 7 Jul 2023 06:59:18 +0000 (06:59 +0000)]
Mop up remaining uses of ASN1_bn_print()

This removes lots of silly buffers and will allow us to make this API
go away.

ok jsing

16 months agoInsert leading octet if high bit of first nibble is 1
tb [Fri, 7 Jul 2023 06:41:59 +0000 (06:41 +0000)]
Insert leading octet if high bit of first nibble is 1

The reason the function this replaces is called ASN1_bn_print() is that it
actually prints a representation of the ASN.1 encoding.

ok jsing

16 months agoOne source file per line.
jsing [Fri, 7 Jul 2023 06:10:14 +0000 (06:10 +0000)]
One source file per line.

16 months agoregen
jsg [Fri, 7 Jul 2023 03:50:46 +0000 (03:50 +0000)]
regen

16 months agoadd more Intel 13G TBT PCIE ids
jsg [Fri, 7 Jul 2023 03:50:02 +0000 (03:50 +0000)]
add more Intel 13G TBT PCIE ids

from Volker Schlecht's Framework 13 dmesg and
13th Generation Intel Core Processors
Datasheet, Volume 2 of 2, Doc. No.: 764981, Rev.: 1.2

16 months agoAdjust perl unveil test to test the right thing
afresh1 [Fri, 7 Jul 2023 02:07:35 +0000 (02:07 +0000)]
Adjust perl unveil test to test the right thing

Normal users can't write to /dev/random, so the -w test would always
fail for root and succeed for everyone else no matter what unveil
did.  Testing with a temp file at least gives consistent results
no matter the user, even if I don't completely understand why the
-w and -r test results are different.

Noticed by bluhm@

16 months agotimeout_hardclock_update: enter timeout_mutex before reading uptime clock
cheloha [Thu, 6 Jul 2023 23:24:37 +0000 (23:24 +0000)]
timeout_hardclock_update: enter timeout_mutex before reading uptime clock

We have no way of knowing how long we will spin before entering
timeout_mutex.  Enter timeout_mutex first, then wait until just before
we start dumping kclock buckets to read the uptime clock.

16 months agominleft and maxsign are u_int so cast appropriately. Prompted by
dtucker [Thu, 6 Jul 2023 22:17:59 +0000 (22:17 +0000)]
minleft and maxsign are u_int so cast appropriately. Prompted by
github PR#410, ok deraadt.

16 months agoRectify -s lie
kn [Thu, 6 Jul 2023 21:08:50 +0000 (21:08 +0000)]
Rectify -s lie

-s to read passphrases from stdin can indeed be used for creation.

OK jmc

16 months agomissed refcnt_init_trace in NAME
kn [Thu, 6 Jul 2023 20:53:53 +0000 (20:53 +0000)]
missed refcnt_init_trace in NAME

16 months agoDocument dt(4)'s refcnt_init_trace
kn [Thu, 6 Jul 2023 20:51:31 +0000 (20:51 +0000)]
Document dt(4)'s refcnt_init_trace

"yes please" mvs
Input jca

16 months ago- fix voltage range defined by base2 and delta2 works correctly
uaa [Thu, 6 Jul 2023 20:02:36 +0000 (20:02 +0000)]
- fix voltage range defined by base2 and delta2 works correctly
- fix AXP209 dcdc3 vmask value
- always use vmask for voltage setting (especially for AXP209 ldo2/ldo5)
- add AXP305 support

ok kettenis@

16 months agoadding regression tests:
sashan [Thu, 6 Jul 2023 19:55:57 +0000 (19:55 +0000)]
adding regression tests:
    to verify limit on tickets progam can retrieve
    by DIOCXGETRULES. Ad

    tests which verify DIOCXEND works as expected, that program
    can release ticket obtained by earlier call to DIOCGETRULES

improvements from anton@

OK anton@, bluhm@

16 months agouse refcnt API for multicast addresses, add tracepoint:refcnt:ethmulti probe
kn [Thu, 6 Jul 2023 19:46:53 +0000 (19:46 +0000)]
use refcnt API for multicast addresses, add tracepoint:refcnt:ethmulti probe

Replace hand-rolled reference counting with refcnt_init(9) and hook it up
with a new dt(4) probe.

OK mvs
Feedback OK bluhm

16 months agooops, an extra PT_ snuck in; spotted by guenther
deraadt [Thu, 6 Jul 2023 16:45:30 +0000 (16:45 +0000)]
oops, an extra PT_ snuck in; spotted by guenther

16 months agoConvert ecpk_print_explicit_parameters() to bn_printf()
tb [Thu, 6 Jul 2023 15:18:02 +0000 (15:18 +0000)]
Convert ecpk_print_explicit_parameters() to bn_printf()

This eliminates a few stupid dances the horrible ASN1_bn_print() API
required.

ok jsing

16 months agobn_print: remove unused bio, plug leak
tb [Thu, 6 Jul 2023 15:11:21 +0000 (15:11 +0000)]
bn_print: remove unused bio, plug leak

16 months agoAdd regress coverage for bn_printf
tb [Thu, 6 Jul 2023 15:08:54 +0000 (15:08 +0000)]
Add regress coverage for bn_printf

This must be one of the ugliest tests I've ever written, but I can't think
of a better way of doing it.

16 months agoAdd bn_printf(), a replacement for ASN1_bn_print()
tb [Thu, 6 Jul 2023 14:37:39 +0000 (14:37 +0000)]
Add bn_printf(), a replacement for ASN1_bn_print()

ASN1_bn_print() will be removed in an upcoming bump. This adds an internal
API that covers the same functionality but doesn't require that the caller
pass in a sufficiently large scratch space that ASN1_bn_print() may or may
not use. In addition, this takes a format string, which allows us to ditch
some extra dances.

ok jsing

16 months agoadd support for starting at a given timestamp/ISO8601 time
espie [Thu, 6 Jul 2023 10:57:03 +0000 (10:57 +0000)]
add support for starting at a given timestamp/ISO8601 time

16 months agoif panic() is meant, use panic()
jasper [Thu, 6 Jul 2023 10:53:11 +0000 (10:53 +0000)]
if panic() is meant, use panic()

ok mpi@

16 months agonew options (boilerplate progressmeter options)
espie [Thu, 6 Jul 2023 10:43:37 +0000 (10:43 +0000)]
new options (boilerplate progressmeter options)
and also the ability to specify a timestamp as a subset of ISO8601

16 months agoUse mtx_init() to initialize stack-based mutexes
visa [Thu, 6 Jul 2023 10:17:43 +0000 (10:17 +0000)]
Use mtx_init() to initialize stack-based mutexes

mtx_init() ensures the mutex' lock_object has static storage duration.
This makes it safe to re-enable WITNESS with stack-based mutexes.

OK bluhm@ miod@

16 months agoClear knotes when finishing wseventvar
visa [Thu, 6 Jul 2023 10:16:58 +0000 (10:16 +0000)]
Clear knotes when finishing wseventvar

When finishing a wseventvar in wsevent_fini(), clear the klist.
Otherwise knotes can be left dangling, which can crash the kernel.

In general, klist_invalidate() should happen after vdevgone() in order
to avoid a race with kevent registration. However, the current wscons
drivers clear the wsevent pointer (sc->sc_base.me_evp) before calling
wsevent_fini(). This prevents the drivers from registering new kevents.

Prompted by a report by Peter J. Philipp on bugs@

OK mvs@ miod@

16 months agoDocument PS_CHROOT, and upcoming PS_NOBTCFI flags
deraadt [Thu, 6 Jul 2023 10:07:09 +0000 (10:07 +0000)]
Document PS_CHROOT, and upcoming PS_NOBTCFI flags

16 months agodocument NOBTCFI similar to WXNEEDED
deraadt [Thu, 6 Jul 2023 10:02:23 +0000 (10:02 +0000)]
document NOBTCFI similar to WXNEEDED

16 months agouse symbolic name PF_X instead of 1, pointed out by kettenis
deraadt [Thu, 6 Jul 2023 10:01:15 +0000 (10:01 +0000)]
use symbolic name PF_X instead of 1, pointed out by kettenis

16 months agoteach the BFD tools how to handle NOBTCFI, quite similar to WXNEEDED
deraadt [Thu, 6 Jul 2023 09:52:37 +0000 (09:52 +0000)]
teach the BFD tools how to handle NOBTCFI, quite similar to WXNEEDED
ok kettenis

16 months agoUse correct variable to check for successful allocation.
patrick [Thu, 6 Jul 2023 09:40:36 +0000 (09:40 +0000)]
Use correct variable to check for successful allocation.

ok kettenis@

16 months agoConvert tcp_now() time counter to 64 bit.
bluhm [Thu, 6 Jul 2023 09:15:23 +0000 (09:15 +0000)]
Convert tcp_now() time counter to 64 bit.

After changing tcp now tick to milliseconds, 32 bits will wrap
around after 49 days of uptime.  That may be a problem in some
places of our stack.  Better use a 64 bit counter.

As timestamp option is 32 bit in TCP protocol, use the lower 32 bit
there.  There are casts to 32 bits that should behave correctly.

Start with random 63 bit offset to avoid uptime leakage.  2^63
milliseconds result in 2.9*10^8 years of possible uptime.

OK yasuoka@

16 months agosync
deraadt [Thu, 6 Jul 2023 08:48:03 +0000 (08:48 +0000)]
sync

16 months agoRegister a mapping of dwge interfaces to ofw nodes/phandles.
jmatthew [Thu, 6 Jul 2023 08:32:37 +0000 (08:32 +0000)]
Register a mapping of dwge interfaces to ofw nodes/phandles.

ok kettenis@