summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-02-25clockintr: rename "struct clockintr_queue" to "struct clockqueue"Scott Soule Cheloha
The code has outgrown the original name for this struct. Both the external and internal APIs have used the "clockqueue" namespace for some time when operating on it, and that name is eyeball-consistent with "clockintr" and "clockrequest", so "clockqueue" it is.
2024-02-25sys/clockintr.h: consolidate forward declarationsScott Soule Cheloha
2024-02-25clockintr.h, kern_clockintr.c: add 2023, 2024 to copyright rangeScott Soule Cheloha
2024-02-25Let some missing missing RFC 1918 reverse zones through.Florian Obser
Problem spotted and diff from Einfach Jemand (rru.142 at gmail), thanks! OK phessler, jca
2024-02-25Fix a typoYASUOKA Masahiko
2024-02-25New accounting flag ABTCFI to indicate signal SIGILL + code ILL_BTCFITheo de Raadt
has occurred in the process. ok various people
2024-02-24Check for builtins used inside tuple to ask the kernel to copyout specific data.Martin Pieuchot
Allow to save stacktrace and process name in tuples.
2024-02-24syncTheo de Raadt
2024-02-24Add a few missing endbr64 to libcryptoTheo Buehler
gcm_{gmult,ghash}_4bit(), aesni_ccm64_decrypt_blocks(), aes_cbc_encrypt(), and aesni_xts_{en,de}crypt() were overlooked in previous passes. Found with a diff for ld.lld by kettenis ok kettenis
2024-02-24Implement 'store' for maps.Martin Pieuchot
A current limitation is the value read from a map is converted to an integer. To preserve the original type we have to make maps aware of the type of its elements.
2024-02-24Explicitly disable MSR_CET_NO_TRACK_EN in MSR_S_CET. If enabled by theTheo de Raadt
boot-process, we don't want to accidentally allow "notrack" indirect branches. Linux kernel does the same. Today it is difficult to do the same for userland, because there is 1 known piece of software using "notrack" (which needs to be fixed). ok kettenis
2024-02-24clockintr_bind.9: document clockintr, clockrequest APIsScott Soule Cheloha
This manpage only covers the frontend APIs. The backend API is still moving around and will be documented separately. Tons of input, editing, and suggestions from jmc@, schwarze@, mpi@, claudio@, mlarkin@, and probably several others I'm forgetting. ok jmc@ schwarze@ claudio@ mpi@
2024-02-24Implement 'store' for all builtins, they are either string or integer.Martin Pieuchot
2024-02-24Replace uses of endbr64 with _CET_ENDBR from cet.hTheo Buehler
cet.h is needed for other platforms to emit the relevant .gnu.properties sections that are necessary for them to enable IBT. It also avoids issues with older toolchains on macOS that explode on encountering endbr64. based on a diff by kettenis ok beck kettenis
2024-02-24qwx(4): qwx_dp_rx_tid_del_func: fix dp_reo_cache_flush_elem expiration logicScott Soule Cheloha
Tweak a few things in qwx_dp_rx_tid_del_func() to make it behave correctly on OpenBSD: - struct dp_reo_cache_flush_elem: make ts a 64-bit count of nanoseconds Linux uses jiffies to timestamp dp_reo_cache_flush_elem. Although OpenBSD has a global jiffies variable, we shouldn't use it outside of drm(4). I would rather not use our global ticks variable, either. We can use getnsecuptime(9), a low-res 64-bit nanosecond timestamp, as a substitute. - qwx_dp_rx_tid_del_func: replace gettime(9) with getnsecuptime(9) - qwx_dp_rx_tid_del_func: convert DP_REO_DESC_FREE_TIMEOUT_MS to nanoseconds - qwx_dp_rx_tid_del_func: reverse timestamp comparison operator This comparison is backwards. Linux uses the time_after() macro to test whether a given entry has expired, so our ported code needs to test whether the current uptime is greater than or equal to a given entry's expiration time. Joint effort with stsp@. Tested by stsp@. ok stsp@
2024-02-24Remove custom key length handlingTheo Buehler
No cipher in libcrypto is marked EVP_CIPH_CUSTOM_KEY_LENGTH and no control handler deals with EVP_CTRL_SET_KEY_LENGTH, which means that this code is dead as far as libcrypto is concerned. Almost nothing uses EVP_CIPHER_meth* (this was added for a single project) and nothing sets a custom ctrl. This isn't going to change anyway since EVP_CIPHER_meth* is deprecated in order to promote more provider beauty. ok beck jsing
2024-02-24Remove last calls to CRYPTO_{push,pop}_info()Theo Buehler
These don't do anything but return 0 and will be garbage collected in the upcoming bump. ok jsing
2024-02-24err.c: fix incorrect line wrappingTheo Buehler
2024-02-24clockintr: rename clockqueue_reset_intrclock to clockqueue_intrclock_reprogramScott Soule Cheloha
The function should be in the clockqueue_intrclock namespace. Also, "reprogram" is a better word for what the function actually does.
2024-02-23timecounting: start system uptime at 0.0 instead of 1.0Scott Soule Cheloha
OpenBSD starts the system uptime clock at 1.0 instead of 0.0. We inherited this behavior from FreeBSD when we imported kern_tc.c. patrick@ reports that this causes a problem in sdmmc(4) during boot: the sdmmc_delay() call in sdmmc_init() doesn't block for the full 250ms. This happens because the system hardclock() starts at 0.0 and executes about hz times, rapidly, to "catch up" to 1.0. This instantly expires the first hz timeout ticks, hence the short sleep. Starting the system uptime at 0.0 fixes the problem. Prompted by patrick@. Tested by patrick@. In snaps since Feb 19 2023. Thread: https://marc.info/?l=openbsd-tech&m=170830229732396&w=2 ok patrick@ deraadt@
2024-02-23There is a 21BY x13s model. Handle it like 21BX.Mark Kettenis
ok beck@, deraadt@
2024-02-23Start of a BTCFI test.Mark Kettenis
2024-02-23ddb(4): db_read_bytes/db_write_bytes: change dst/src parameter to void*Scott Soule Cheloha
Almost all db_read_bytes() callers cast the destination buffer argument to char*, which suggests the API's prototype is incompatible with how the API is actually used. Change db_read_bytes() and db_write_bytes() to take a void* as the destination/source buffer parameter so callers don't need to cast the argument. With input from bluhm@. Bugs caught by Clemens Gossnitzer (ASCII approximation of name). Thread: https://marc.info/?l=openbsd-tech&m=170740813021636&w=2 ok bluhm@
2024-02-23timeout: make to_kclock validation more rigorousScott Soule Cheloha
In kern_timeout.c, the to_kclock checks are not strict enough to catch all plausible programmer mistakes. Tighten them up: - timeout_set_flags: KASSERT that kclock is valid - timeout_abs_ts: KASSERT that to_kclock is KCLOCK_UPTIME We can also add to_kclock validation to softclock() and db_show_timeout(), which may help to debug memory corruption: - softclock: panic if to_kclock is not KCLOCK_NONE or KCLOCK_UPTIME - db_show_timeout: print warning if to_kclock is invalid Prompted by bluhm@ in response to a syzbot panic. Hopefully these changes help to narrow down the root cause. Link: https://syzkaller.appspot.com/bug?extid=49d3f7118413963f651a Reported-by: syzbot+49d3f7118413963f651a@syzkaller.appspotmail.com ok bluhm@
2006-10-06Preliminary bits for SuperH-based ports, based on NetBSD/sh3 codebase withMiod Vallat
minor changes.
2024-02-23Prepare to provide X509_STORE_get1_objects()Theo Buehler
The OpenSSL 1.1 API X509_STORE_get0_objects() is not thread safe. It exposes a naked internal pointer containing certificates, CRLs and cached objects added by X509_LOOKUP_hash_dir(). Thus, if the store is shared between threads, it is not possible to inspect this pointer safely since another thread could concurrently add to it. This may happen in particular during certificate verification. This API led to security issues in rust-openssl and is also problematic in current Python. Other consumers of X509_STORE_get0_objects() are haproxy, isync, openvpn. The solution is to take a snapshot of the state under a lock and return that. This is what X509_STORE_get1_objects() does. It returns a newly allocated stack that needs to be freed with sk_X509_OBJECT_pop_free(), passing X509_OBJECT_free as a second argument. Based on a diff by David Benjamin for BoringSSL. https://boringssl-review.googlesource.com/c/boringssl/+/65787 ok beck jsing PS: Variants of this have landed in Python and OpenSSL 3 as well. There the sk_*deep_copy() API is used, which in OpenSSL relies on evaluating function pointers after casts (BoringSSL fixed that). Instead of using this macro insanity and exposing that garbage in public, we can do this by implementing a pedestrian, static sk_X509_OBJECT_deep_copy() by hand.
2024-02-23Remove ASN1_time_clamp_notafter() prototypeTheo Buehler
There is now a prototype in x509_internal.h, so no need to repeat that here.
2024-02-23- Add support for reporting flow control status.Kevin Lo
- Add missing igc_check_for_link() call; from Masanobu SAITOH via NetBSD. "Fine" deraadt@ ok jan@
2024-02-22make qwx(4) ignore ESHUTDOWN while printing errors to dmesgStefan Sperling
ESHUTDOWN is an expected thread-synchronization condition which can be triggered via ifconfig commands. Don't warn about this. Reported by Marco van Hulten on misc@
2024-02-22Fix copy-paste error in commentTheo Buehler
2024-02-22Zap trailing blanksTheo Buehler
2024-02-22syncTheo de Raadt
2024-02-22wrap an overlong line to appease mandoc -TlintTheo Buehler
2024-02-22Make the route cache aware of multipath routing.Alexander Bluhm
Pass source address to route_cache() and store it in struct route. Cached multipath routes are only valid if source address matches. If sysctl multipath changes, increase route generation number. OK claudio@
2024-02-22Improve db_ctf_pprint(), implement handlers for arrays and enums.Claudio Jeker
Use db_get_value() to access addr to ensure that alignment errors don't cause exceptions. DDB on 32bit archs does normally not handle 64bit values so to print 64bit ints a bit of gymnastics is needed. OK mpi@
2024-02-22Print the size of more objects (basic types and enums) based on theirClaudio Jeker
ctt_size info. This helps to ensure that the reported sizes match. OK mpi@
2024-02-22Rewrite the it_cmp() function to use the common check bigger than, checkClaudio Jeker
smaller than logic. There was a bug in this code because of a badly placed ) which I only noticed after rewriting the function since I assumed that C integer promotion is playing tricks with us. OK mpi@
2024-02-22The ctt_size of integers and floating point numbers is in bytes not bits.Claudio Jeker
OK mpi@
2024-02-22Add regress for Signed Prefix List objectsJob Snijders
2024-02-22Add support for RPKI Signed Prefix ListsJob Snijders
Signed Prefix List are a CMS protected content type for use with the RPKI to carry the complete list of prefixes which an Autonomous System may originate to all or any of its routing peers. The validation of a Signed Prefix List confirms that the holder of the listed ASN produced the object, and that this list is a current, accurate and complete description of address prefixes that may be announced into the routing system originated by this AS. https://datatracker.ietf.org/doc/html/draft-ietf-sidrops-rpki-prefixlist with and OK claudio@ tb@
2024-02-22get rid of the qwx(4) mhi_newstate_taskStefan Sperling
We can now run MHI state transition code in the interrupt handler. There is no reason to run a separate thread just to poke at some registers and send a few of wakeups().
2024-02-22start qwx(4) MHI channels in process context rather than in a taskStefan Sperling
This removes all sleep points from the MHI state-change task, which will allow us to get rid of it. And I can now reproduce the channel startup issue kettenis@ saw on arm64 by removing the delay() call.
2024-02-22cache qwx(4) firmware images in memory across suspend/resume cyclesStefan Sperling
testing + ok phessler@
2024-02-22add suspend/resume support to qwx(4)Stefan Sperling
testing + ok phessler@ deraadt@
2024-02-22add 7.6 syspatch public keyRobert Nagy
2024-02-22if_inkstatehook -> if_linkstatehookJonathan Gray
2024-02-22Workaround for gcc3 - the use of anonymous unions now makes it complainMiod Vallat
when named initializers use fields within these anonymous unions. Hopefully a short-term bandaid until the appropriate changes are identified and backported to gcc3. ok claudio@
2024-02-22vmd(8): only add vionet tap read events after a notify event.Dave Voutila
My recent refactor introduced a bug where the vionet device will add the tap(4) read event on an unpause regardless of driver and device state, causing the cpu to peg as the read event fires indefinitely because the guest's virtqueue isn't ready to receive the data. Add in a global flag that tracks if the rx-side is enabled or not to coordinate adding the tap read event. ok mlarkin@
2024-02-21match on C740; tested by and ok deraadt@Jonathan Gray
2024-02-21recognise Neoverse V3 (Poseidon), Neoverse N3 (Hermes)Jonathan Gray