openbsd
6 months agoHide a couple of LCRYPTO_UNUSED in asn1.h
beck [Wed, 10 Apr 2024 14:55:12 +0000 (14:55 +0000)]
Hide a couple of LCRYPTO_UNUSED in asn1.h

and remove the LIBRESSL_INTERNAL guards around them

ok tb@

6 months agoAdd RC2 symbols to Symbols.namespace.
beck [Wed, 10 Apr 2024 14:54:13 +0000 (14:54 +0000)]
Add RC2 symbols to Symbols.namespace.

These got missed when they were hidden

ok tb@

6 months agoFinish hiding symbols in rand.h
beck [Wed, 10 Apr 2024 14:53:01 +0000 (14:53 +0000)]
Finish hiding symbols in rand.h

This removes the LIBRESSL_INTERNAL guards and marks
the functions within as LCRYPTO_UNUSED

6 months agoFinish Hiding symbols in crypto.h
beck [Wed, 10 Apr 2024 14:51:02 +0000 (14:51 +0000)]
Finish Hiding symbols in crypto.h

crypto.h already had the symbols not hidden behind LIBRESSL_INTERNAL
hidden - This now picks up the reset of them marking them as
LCRYPTO_UNUSED, and removes the LIBRESSL_INTERNAL guard.

These symbols will now be hidden, but if we use them inside
the library in a namespaced build we will get a deprecation
warning. use outside the library will be as with any other hidden
symbol, so fine.

ok tb@

6 months agoremove unused hton[ls] functions from libkern
naddy [Wed, 10 Apr 2024 13:59:05 +0000 (13:59 +0000)]
remove unused hton[ls] functions from libkern

These have been superseded by inlines from endian.h.

ok miod@ mpi@

6 months agovmctl: fix incorrect scaling when converting disk images.
dv [Wed, 10 Apr 2024 13:03:41 +0000 (13:03 +0000)]
vmctl: fix incorrect scaling when converting disk images.

ctl_convert still had old logic assuming disk sizes were in MiB and
not bytes, causing an attempt to create a new disk using the '-i'
argument to generate impossibly large output disk images (e.g. 1 MiB
ends up 1 TiB).

Reported by and diff from Jesper Wallin.

6 months agoRemove `head' socket re-locking in sonewconn().
mvs [Wed, 10 Apr 2024 12:04:41 +0000 (12:04 +0000)]
Remove `head' socket re-locking in sonewconn().

uipc_attach() releases solock() because it should be taken after
`unp_gc_lock' rwlock(9) which protects the `unp_link' list. For this
reason, the listening `head' socket should be unlocked too while
sonewconn() calls uipc_attach(). This could be reworked because now
`so_rcv' sockbuf relies on `sb_mtx' mutex(9).

The last one `unp_link' foreach loop within unp_gc() discards sockets
previously marked as UNP_GCDEAD. These sockets are not accessed from the
userland. The only exception is the sosend() threads of connected
sending peers, but they only sbappend*() mbuf(9) to `so_rcv'. So it's
enough to unlink mbuf(9) chain with `sb_mtx' held and discard lockless.

Please note, the existing SS_NEWCONN_WAIT logic was never used because
the listening unix(4) socket protected from concurrent unp_detach() by
vnode(9) lock, however `head' re-locked all times.

ok bluhm

6 months agoRemove obsolete headers.
mglocker [Wed, 10 Apr 2024 10:40:27 +0000 (10:40 +0000)]
Remove obsolete headers.

Spotted by jsg@

6 months agoUnlock dosigsuspend() and with that some aspects of ppoll and pselect
claudio [Wed, 10 Apr 2024 10:05:26 +0000 (10:05 +0000)]
Unlock dosigsuspend() and with that some aspects of ppoll and pselect

Change p_sigmask from atomic back to non-atomic updates. All changes to
p_sigmask are only allowed by curproc (the owner). There is no need for
atomic instructions here.

p_sigmask is mostly accessed by curproc with the exception of ptsignal().
In ptsignal() p_sigmask is now only read once unless a SSLEEP proc gets
the signal. In that case recheck the p_sigmask before wakeup to ensure
that no unnecessary wakeup happens.

Add some KASSERT(p == curproc) to ensure this precondition.
sigabort() is special since it is also called by ddb but apart from that
only works for curproc.

With and OK mvs@ OK mpi@

6 months agoRework the logic to not send double notifications in session_notification().
claudio [Wed, 10 Apr 2024 09:05:32 +0000 (09:05 +0000)]
Rework the logic to not send double notifications in session_notification().

last_sent_errcode is now cleared late (when state changes to ESTABLISHED)
and so notifications sent in the OPEN phase would be dropped after the
first incident. Using the session state to know if sending a message is
possible seems more robust and is what session_stop() uses as well.
For now log the notification which are not sent as 'dropping' to see how
often this happens.

OK tb@

6 months agoAdd an option allow-set-title to forbid applications from changing the
nicm [Wed, 10 Apr 2024 07:36:25 +0000 (07:36 +0000)]
Add an option allow-set-title to forbid applications from changing the
pane title, from someone in GitHub issue 3930.

6 months agoCorrect handling of mouse up events (don't ignore all but the last
nicm [Wed, 10 Apr 2024 07:29:15 +0000 (07:29 +0000)]
Correct handling of mouse up events (don't ignore all but the last
released button), and always process down event for double click. From
Rudy Dellomas III in GitHub issue 3919.

6 months agoDo not get muddled and crash if focusing a pane that is exiting,
nicm [Wed, 10 Apr 2024 07:15:21 +0000 (07:15 +0000)]
Do not get muddled and crash if focusing a pane that is exiting,
reported by Saul Nogueras in GitHub issue 3776.

6 months agovmm/vmd: add exception injection and refactor inject api.
dv [Tue, 9 Apr 2024 21:55:16 +0000 (21:55 +0000)]
vmm/vmd: add exception injection and refactor inject api.

In order to continue work on mmio and other instruction emulation,
vmd(8) needs the ability to inject exceptions (like page faults)
from userland.

Refactor the way events are injected from userland, cleaning up how
hardware (external) interrupts are injected in the process.

ok mlarkin@

6 months agoAdd ufshci(4) to pci(4). While there, add ahci(4) to acpi(4).
mglocker [Tue, 9 Apr 2024 20:18:37 +0000 (20:18 +0000)]
Add ufshci(4) to pci(4).  While there, add ahci(4) to acpi(4).

Suggested and ok jmc@

6 months agowhirlpool_test: avoid calling arc4random_uniform(0)
tb [Tue, 9 Apr 2024 18:12:11 +0000 (18:12 +0000)]
whirlpool_test: avoid calling arc4random_uniform(0)

This causes a SIGFPE on solaris
Fixes https://github.com/libressl/portable/issues/1042

6 months agowhirlpool_test: zap lots of trailing whitespace
tb [Tue, 9 Apr 2024 18:08:43 +0000 (18:08 +0000)]
whirlpool_test: zap lots of trailing whitespace

6 months agobn_convert: plug leak spotted by ASAN
tb [Tue, 9 Apr 2024 16:06:01 +0000 (16:06 +0000)]
bn_convert: plug leak spotted by ASAN

6 months agoSync removal of setsid(), setpgid() and a few dup2() from relayd. They are
tobhe [Tue, 9 Apr 2024 15:48:01 +0000 (15:48 +0000)]
Sync removal of setsid(), setpgid() and a few dup2() from relayd. They are
redundant since we call daemon() earlier.

ok bluhm@

6 months agomake(1): inline set_times() into Job_Touch()
cheloha [Tue, 9 Apr 2024 15:08:21 +0000 (15:08 +0000)]
make(1): inline set_times() into Job_Touch()

set_times() has one caller: Job_Touch().  set_times() is a thin
utimes(2) wrapper.  Using utimes(2) to reset a file's atime/mtime
to the current time is not cumbersome.

So, remove set_times() and just call utimes(2) directly.

Thread: https://marc.info/?l=openbsd-tech&m=171262211713835&w=2

ok kn@

6 months agoAdd a comment on abuse of EXFLAG_INVALID
tb [Tue, 9 Apr 2024 15:00:44 +0000 (15:00 +0000)]
Add a comment on abuse of EXFLAG_INVALID

We added things we probably shouldn't have, and so did BoringSSL and
OpenSSL. Terrible API is terrible.

discussed with jsing

6 months agoAdd initial regress for BN_set_bit(), BN_clear_bit() and BN_mask_bits().
jsing [Tue, 9 Apr 2024 14:59:57 +0000 (14:59 +0000)]
Add initial regress for BN_set_bit(), BN_clear_bit() and BN_mask_bits().

6 months agoAdd PCI support for ufshci(4). Tested on the Microsoft Surface Go 4.
mglocker [Tue, 9 Apr 2024 14:58:41 +0000 (14:58 +0000)]
Add PCI support for ufshci(4).  Tested on the Microsoft Surface Go 4.

CAVEATS:
The ufshci(4) openings need to be limited to 1 currently, otherwise
file system corruptions have been identified using PCI.  I hope this
can be fixed soon.

Help and ok jsg@, kettenis@

6 months agoAdd hidden conf.h, missed in an earlier commit
tb [Tue, 9 Apr 2024 14:57:28 +0000 (14:57 +0000)]
Add hidden conf.h, missed in an earlier commit

6 months agoAdd regress coverage for BN_bn2mpi()/BN_mpi2bn().
jsing [Tue, 9 Apr 2024 14:56:21 +0000 (14:56 +0000)]
Add regress coverage for BN_bn2mpi()/BN_mpi2bn().

6 months agoHide symbols in conf.h
beck [Tue, 9 Apr 2024 13:56:29 +0000 (13:56 +0000)]
Hide symbols in conf.h

This guentherizes the public symbols from conf.h

ok tb@

6 months agoPlug leaks in ASN1_TIME_set_string_internal()
tb [Tue, 9 Apr 2024 13:56:00 +0000 (13:56 +0000)]
Plug leaks in ASN1_TIME_set_string_internal()

This API can be called with s == NULL, in which case the tm_to_*()
functions helpfully allocate a new s and then leak. This is a rather
ugly fix to make portable ASAN regress happy again, the better fix
will be to rewrite the tm_to_*() functions and adjust their callers.
That is more intrusive and will be done in a later pass.

ok bcook jsing

6 months agoHide public symbols in x509.h
beck [Tue, 9 Apr 2024 13:55:02 +0000 (13:55 +0000)]
Hide public symbols in x509.h

This picks up most of the remaining public symbols in
x509.h

ok tb@

6 months agoHide public symbols in evp.h
beck [Tue, 9 Apr 2024 13:52:41 +0000 (13:52 +0000)]
Hide public symbols in evp.h

largely mechanically done by the guentherizer 9000

ok tb@

6 months agoRename EVP_aes_XXX_cfb to EVP_aes_XXX_cfb128.
beck [Tue, 9 Apr 2024 13:48:51 +0000 (13:48 +0000)]
Rename EVP_aes_XXX_cfb to EVP_aes_XXX_cfb128.

For consitency with everything else.

ok tb@

6 months agoDon't include net/art.h in net/rtable.h instead let the two users
claudio [Tue, 9 Apr 2024 12:53:08 +0000 (12:53 +0000)]
Don't include net/art.h in net/rtable.h instead let the two users
include the file themselves.
OK bluhm@ mpi@

6 months agoLimit the number of provider ASnumbers to MAX_ASPA_SPAS_COUNT (10'000)
claudio [Tue, 9 Apr 2024 12:40:01 +0000 (12:40 +0000)]
Limit the number of provider ASnumbers to MAX_ASPA_SPAS_COUNT (10'000)
in the parser as well.

OK tb@

6 months agoIncrease RTR PDU limit to 48k and limit number of SPAS to 10'000.
claudio [Tue, 9 Apr 2024 12:09:19 +0000 (12:09 +0000)]
Increase RTR PDU limit to 48k and limit number of SPAS to 10'000.

PDU larger then 48k will result in a session reset while ASPA records
with more than 10'000 entries will be implicitly withdrawn.

Also truncate RTR error PDUs to only include 256 bytes of the faulty PDU.
It makes no sense to include more to identify the issue.
OK tb@

6 months agoCheck that the ASPA tas array fits in an IMSG before sending the ASPA
claudio [Tue, 9 Apr 2024 12:05:07 +0000 (12:05 +0000)]
Check that the ASPA tas array fits in an IMSG before sending the ASPA
record over to RTR or the RDE.

The long term goal is to increase the IMSG size considerably but that
requires some additional API changes to the imsg API.
OK tb@

6 months agoreduce diff to linux
jsg [Tue, 9 Apr 2024 11:20:10 +0000 (11:20 +0000)]
reduce diff to linux

6 months agoRemove the "cubie" miniroot. There are far more popular armv7 boards
kettenis [Tue, 9 Apr 2024 11:13:51 +0000 (11:13 +0000)]
Remove the "cubie" miniroot.  There are far more popular armv7 boards
with Allwinner SoCs and the presence of this particular miniroot is making
it hard to update U-Boot.

ok jsg@

6 months agoPlug route leak in IP output.
bluhm [Tue, 9 Apr 2024 11:05:05 +0000 (11:05 +0000)]
Plug route leak in IP output.

If no struct route is passed to ip_output() or ip6_output(), it
uses its own iproute on the stack.  In that case any route entry
in the local route cache has to be freed.  After pf decides to
reroute, struct route is reset to NULL.  Then the route reference
counter has to be released.  Call rtfree() without needless NULL
check.

OK mvs@

6 months agoAdd a capability enforcement integration test.
claudio [Tue, 9 Apr 2024 09:35:57 +0000 (09:35 +0000)]
Add a capability enforcement integration test.

This should ensure that no / yes and enforce work the way we want.

6 months agoAdd capability announce enforcement test and fixup some other result files
claudio [Tue, 9 Apr 2024 09:33:46 +0000 (09:33 +0000)]
Add capability announce enforcement test and fixup some other result files
since the role capability is now shown in more cases.

6 months agoAllow operators to enforce the presence of certain capabilities on sessions.
claudio [Tue, 9 Apr 2024 09:03:18 +0000 (09:03 +0000)]
Allow operators to enforce the presence of certain capabilities on sessions.

For simple capabilities this just adds enforce to the yes/no option of the
announce statement. For multi-protocol capabilities and add-path there is
an extra keyword. On top of this for add-path the enforcement requires the
neighbor to send a matching capability, e.g
'announce add-path recv enforce' requires the other side to send any
'announce add-path send XYZ' capability.

This is mainly to enforce as-4byte and extra multi-protocol capabilities.

OK denis@ tb@

6 months agoClean up Symbols.namespace
beck [Tue, 9 Apr 2024 01:39:27 +0000 (01:39 +0000)]
Clean up Symbols.namespace

These did not get removed from here when they got removed
from Symbols.list after a major bump.

ok tb@

6 months agoregen
jsg [Tue, 9 Apr 2024 01:23:58 +0000 (01:23 +0000)]
regen

6 months agomore Intel DG2 graphics ids
jsg [Tue, 9 Apr 2024 01:22:19 +0000 (01:22 +0000)]
more Intel DG2 graphics ids

from ark.intel.com and github.com/intel/compute-runtime

6 months agodrm/i915: ATS-M device ID update
jsg [Tue, 9 Apr 2024 01:14:35 +0000 (01:14 +0000)]
drm/i915: ATS-M device ID update

From Haridhar Kalvala
5032c607e886e0c40749a05d37b835c1757d38ff in mainline linux

6 months agodrm/i915: Add new PCI IDs to DG2 platform in driver
jsg [Tue, 9 Apr 2024 00:56:48 +0000 (00:56 +0000)]
drm/i915: Add new PCI IDs to DG2 platform in driver

From Ravi Kumar Vodapalli
in drm-intel-next

6 months agodrm/i915: Add new DG2 PCI IDs
jsg [Tue, 9 Apr 2024 00:52:10 +0000 (00:52 +0000)]
drm/i915: Add new DG2 PCI IDs

From Shekhar Chauhan
d0c908d2978e0ef3c1ac1357c1c58224a153f8d4 in mainline linux

6 months agoRemove notBefore and notAfter cacheing.
beck [Mon, 8 Apr 2024 23:46:21 +0000 (23:46 +0000)]
Remove notBefore and notAfter cacheing.

This cache was added because our time conversion used timegm()
and gmtime() which aren't very cheap. These calls were noticably
expensive when profiling things like rpki-client which do many
X.509 validations.

Now that we convert times using julien seconds from the unix
epoch, BoringSSL style, instead of a julien days from a
Byzantine date, we no longer use timegm() and gmtime().

Since the julien seconds calculaitons are cheap for conversion,
we don't need to bother caching this, it doesn't have a noticable
performance impact.

While we are at this correct a bug where
x509_verify_asn1_time_to_time_t was not NULL safe.

Tested for performance regressions by tb@ and job@

ok tb@ job@

6 months agoRemove spaces before tabs
tb [Mon, 8 Apr 2024 20:47:32 +0000 (20:47 +0000)]
Remove spaces before tabs

6 months agoStop redeclaring ENTRY, the <machine/asm.h> flavour is as good as we need it.
miod [Mon, 8 Apr 2024 20:09:18 +0000 (20:09 +0000)]
Stop redeclaring ENTRY, the <machine/asm.h> flavour is as good as we need it.
While there, replace inlined NENTRY by actual use of that macro.

ok kettenis@

6 months agoFix misplaced END() macro.
miod [Mon, 8 Apr 2024 20:08:19 +0000 (20:08 +0000)]
Fix misplaced END() macro.

ok kettenis@

6 months agoRemove unused tf_fault and tf_kstack members from struct trapframe. These
miod [Mon, 8 Apr 2024 20:07:53 +0000 (20:07 +0000)]
Remove unused tf_fault and tf_kstack members from struct trapframe. These
fields were (seldom) written to but never used for anything.

ok kettenis@

6 months agoRemove demap code for MMU miss faults.
miod [Mon, 8 Apr 2024 20:07:07 +0000 (20:07 +0000)]
Remove demap code for MMU miss faults.

This code was #if 0, except for instruction misses where it had been enabled
probably by mistake... and was demapping in the data mmu anyway...
(#include <facepalm.h>)

ok kettenis@

6 months agoThere is too much #ifdef DEBUG stuff cluttering locore, really. While some of
miod [Mon, 8 Apr 2024 20:05:51 +0000 (20:05 +0000)]
There is too much #ifdef DEBUG stuff cluttering locore, really. While some of
it had sense in the early days of the sparc64 port, this code has bitrotten
and is getting in the way. Time for a visit to the Attic.

This removes:
- interrupt handling debug code (forcing hz = 1, probably broken since years).
- unused or too invasive DEBUG code which noone will ever use in this state.
- #if 0 code blocks which have been this way since locore.s revision 1.1 and
  will never get enabled.

ok kettenis@

6 months agoIntroduce more assembler macros to deduplicate code and improve readability:
miod [Mon, 8 Apr 2024 20:02:18 +0000 (20:02 +0000)]
Introduce more assembler macros to deduplicate code and improve readability:
- one macro for the inline pseg_get logic used in various MMU trap handlers.
- one macro for the TSB locking logic in various PTE update routines.
- one macro for the sun4v rwindow content saving.

ok kettenis@

6 months agoRemove dead code and data, fix typos, kill wrong comments.
miod [Mon, 8 Apr 2024 20:00:27 +0000 (20:00 +0000)]
Remove dead code and data, fix typos, kill wrong comments.

ok kettenis@

6 months agoFix cut'n'paste error in data miss handler causing wrong label to be used in
miod [Mon, 8 Apr 2024 19:59:57 +0000 (19:59 +0000)]
Fix cut'n'paste error in data miss handler causing wrong label to be used in
some failure conditions.

6 months agoFix sun4v patching of sp_tlb_flush_ctx() to pass flags in the right register.
miod [Mon, 8 Apr 2024 19:59:28 +0000 (19:59 +0000)]
Fix sun4v patching of sp_tlb_flush_ctx() to pass flags in the right register.

ok kettenis@

6 months agoMake ASN1_TIME_set_string_X509 and ASN1_TIME_set_string match the man page
beck [Mon, 8 Apr 2024 19:57:40 +0000 (19:57 +0000)]
Make ASN1_TIME_set_string_X509 and ASN1_TIME_set_string match the man page

This makes it where people can't put dumb values in certs without
trying harder, and changes the regress to test this.

GENERALIZED times outside of the RFC5280 spec are required for OCSP
but these should be constructed with the GENERALIZED time string
setters.

ok tb@

6 months agoFix capping of VAPs
tb [Mon, 8 Apr 2024 14:02:13 +0000 (14:02 +0000)]
Fix capping of VAPs

The previous approach introduced a cap, but it might not always be hit as
intended (I missed this on review). Fix this to check the cap after merging
an ASPA into an already existing VAP. Also free the list of providers since
nothing should be looking at it anymore.

Count VAPs that hit the limit with a new overflowed counter. There are
still a few aspects of the accounting that probably aren't entirely right.
This will be fixed at another point. It's just statistics after all.

with/ok claudio, ok job

6 months agoCall daemon() only in parent and before proc_exec() to avoid orphaning child
tobhe [Mon, 8 Apr 2024 13:18:54 +0000 (13:18 +0000)]
Call daemon() only in parent and before proc_exec() to avoid orphaning child
processes. Synced from relayd.

ok florian@

6 months agoMove daemon() after proc_setup() to sync with other proc.c daemons.
tobhe [Mon, 8 Apr 2024 12:50:05 +0000 (12:50 +0000)]
Move daemon() after proc_setup() to sync with other proc.c daemons.

6 months agoCall daemon() only in parent and before proc_exec() to avoid orphaning child
tobhe [Mon, 8 Apr 2024 12:48:26 +0000 (12:48 +0000)]
Call daemon() only in parent and before proc_exec() to avoid orphaning child
processes. Synced from relayd.

ok mlarkin@ dv@

6 months agoCall daemon() only in parent and before proc_exec() to avoid orphaning child
tobhe [Mon, 8 Apr 2024 12:45:18 +0000 (12:45 +0000)]
Call daemon() only in parent and before proc_exec() to avoid orphaning child
processes. Synced from relayd.

ok kn@

6 months agomore ansi function decls
jsg [Mon, 8 Apr 2024 02:51:14 +0000 (02:51 +0000)]
more ansi function decls
ok deraadt@

6 months agodrm: panel-orientation-quirks: Add quirk for GPD Win Mini
jsg [Mon, 8 Apr 2024 01:59:36 +0000 (01:59 +0000)]
drm: panel-orientation-quirks: Add quirk for GPD Win Mini

From Samuel Dionne-Riel
2f862fdc0fd802e728b6ca96bc78ec3f01bf161e in mainline linux

6 months agodrm: panel-orientation-quirks: Add quirk for Lenovo Legion Go
jsg [Mon, 8 Apr 2024 01:56:20 +0000 (01:56 +0000)]
drm: panel-orientation-quirks: Add quirk for Lenovo Legion Go

From Brenton Simpson
430143b0d3611f4a9c8434319e5e504244749e79 in mainline linux

6 months agoThe RISC-V architecture has cache-coherent DMA... until it doesn't. This
kettenis [Sun, 7 Apr 2024 21:08:59 +0000 (21:08 +0000)]
The RISC-V architecture has cache-coherent DMA... until it doesn't.  This
is indicated by a "dma-noncoherent" property on the bus or device nodes
in the device tree.  Set the BUS_DMA_COHERENT flag on the DMA tag for
mainbus(4) and modify the flags based on the presence of "dma-coherent"
and "dma-noncoherent" properties where appropriate.

ok patrick@

6 months agoRework CMS_add_simple_smimecap()
tb [Sun, 7 Apr 2024 06:34:42 +0000 (06:34 +0000)]
Rework CMS_add_simple_smimecap()

This is an API to add an OID attribute to the set of SMIMECapabilities.
While attributes are complicated in general, this only supports simple
capabilities encoded as an OID with an optional integer parameter (e.g.,
the key size of a cipher).

Make this API transactional, i.e., don't leave a new empty set behind on
failure or leak the key size if setting the parameter on the X509_ALGOR
fails.

Also convert to single exit and add a doc comment with a reference.

ok beck

7 months agomatch another two Alder Lake-N DesignWare I2C ids
jsg [Sun, 7 Apr 2024 01:04:58 +0000 (01:04 +0000)]
match another two Alder Lake-N DesignWare I2C ids

Not in the Intel datasheet but are matched by their Windows driver.
ok mglocker@ who tested on Surface Go 4.

7 months agoregen
jsg [Sun, 7 Apr 2024 00:59:23 +0000 (00:59 +0000)]
regen

7 months agoanother two Alder Lake-N DesignWare I2C ids
jsg [Sun, 7 Apr 2024 00:58:57 +0000 (00:58 +0000)]
another two Alder Lake-N DesignWare I2C ids

Not in the Intel datasheet but are matched by their Windows driver.
Seen on Surface Go 4.

ok mglocker@

7 months agoNow that we support RISC-V CPUs that have MMUs with memory cachability
kettenis [Sat, 6 Apr 2024 18:33:54 +0000 (18:33 +0000)]
Now that we support RISC-V CPUs that have MMUs with memory cachability
attributes, the "direct map" becomes problematic as it results in
mappings for the same physical memory pages with different cachability
addresses.  The RISC-V specification of the "Svpbmt" extension doesn't
outright state that this is "verboten" like on some other
architectures that we support.  But it does say that it may result in
access with the wrong attributes.  So restrict the use of the direct
map to just mapping the 64MB block that the bootloader loaded us into.
To make this possible map the device tree later like we do on arm64.
This allows us to get rid of some assembly code in locore.S as a bonus!

ok miod@, jca@

7 months agoIP multicast sysctl mrtmfc must not write outside of allocation.
bluhm [Sat, 6 Apr 2024 14:23:27 +0000 (14:23 +0000)]
IP multicast sysctl mrtmfc must not write outside of allocation.

Reading sysctl mrt_sysctl_mfc() allocates memory to be copied back
to user.  Chunks of struct mfcinfo are copied from routing table
to linear heap memory.  If the allocated memory was not a multiple
the struct size, a struct mfcinfo could be copied to a partially
unallocated destination.  Check that the end of the struct is within
the allocation.

From Alfredo Ortega;  OK claudio@

7 months agoRemove (unused) in-kernel event filtering, it's currently dead code.
mpi [Sat, 6 Apr 2024 11:18:02 +0000 (11:18 +0000)]
Remove (unused) in-kernel event filtering, it's currently dead code.

All events are currently exported to userland in order to support complex
filters.  If this becomes a bottleneck it should be possible to translate
(some) user-land filters to in-kernel fitlers.

Prodded by a diff from Christian Ludwig to also trace the tracing program.

ok claudio@

7 months agoPrevent accounting bug when an anon w/ swap slot is passed to uvm_anon_release()
mpi [Sat, 6 Apr 2024 10:59:52 +0000 (10:59 +0000)]
Prevent accounting bug when an anon w/ swap slot is passed to uvm_anon_release()

uvm_anon_release() is always called for anon that have an associated page so
decrementing `uvmexp.swpgonly' is incorrect.  This happened because the page
was cleared before calling uvm_anfree().

Reported by many including mvs@, miod@ and robert@

ok kettenis@, miod@

7 months agoregen
jsg [Sat, 6 Apr 2024 08:40:27 +0000 (08:40 +0000)]
regen

7 months agomore Alder Lake-N ids
jsg [Sat, 6 Apr 2024 08:39:51 +0000 (08:39 +0000)]
more Alder Lake-N ids

from:
Intel Processor and Intel Core i3 N-Series
Datasheet, Volume 1 of 2, Doc. No.: 759603, Rev.: 001

7 months agoANSI functions; ok tb
deraadt [Fri, 5 Apr 2024 18:01:56 +0000 (18:01 +0000)]
ANSI functions; ok tb

7 months agoDon't emit Validated ASPAs for Customer ASIDs with more than MAX_ASPA_PROVIDERS
job [Fri, 5 Apr 2024 16:05:15 +0000 (16:05 +0000)]
Don't emit Validated ASPAs for Customer ASIDs with more than MAX_ASPA_PROVIDERS

The number of providers in a single ASPA object already was limited to
MAX_ASPA_PROVIDERS, now also impose a limit on the total number of providers
across multiple ASPA objects. If the MAX_ASPA_PROVIDERS limit is hit, omit
the Customer ASID's entry from OpenBGPD and JSON output.

OK tb@

7 months agouse inline functions instead of do while(0) for dev_*
jsg [Fri, 5 Apr 2024 14:31:57 +0000 (14:31 +0000)]
use inline functions instead of do while(0) for dev_*

avoids unused variable warning on gcc archs with ttm_tt.c rev 1.21
reported by deraadt@

7 months agodelete msyscall stub
deraadt [Fri, 5 Apr 2024 14:16:05 +0000 (14:16 +0000)]
delete msyscall stub

7 months agosync
deraadt [Fri, 5 Apr 2024 14:15:37 +0000 (14:15 +0000)]
sync

7 months agomsyscall(2) goes away
deraadt [Fri, 5 Apr 2024 14:15:13 +0000 (14:15 +0000)]
msyscall(2) goes away

7 months agonoone calls msyscall() anymore.
deraadt [Fri, 5 Apr 2024 13:55:26 +0000 (13:55 +0000)]
noone calls msyscall() anymore.

7 months agold.so should stop calling msyscall(2), since it is fully neutered and
deraadt [Fri, 5 Apr 2024 13:51:47 +0000 (13:51 +0000)]
ld.so should stop calling msyscall(2), since it is fully neutered and
about to be removed.  Please be careful building through this, you need
a kernel at least March 29th or so to build through it, otherwise use
snapshots to cross over.
ok various people

7 months agoOn machines lacking xonly support hardware, we emulate xonly in the
deraadt [Fri, 5 Apr 2024 12:58:49 +0000 (12:58 +0000)]
On machines lacking xonly support hardware, we emulate xonly in the
copyin(9) layer below system calls, using a 4-entry lookup; the 4th
entry is libc.so text. We were assuming, or rather insisting, that
on all our architectures libc.so text is treated as xonly, even if
the linker was behind in it's game.
Since msyscall(2) is gone, kernel no longer has information about the
start,len of libc.so text segment.  But we can instead use the (same)
start,len range of pinsyscalls() instead for this purpose.
ld.so is passing the same text-range to the kernel in this position.
regression tests run by anton discovered that libc.so text had become
copyin-readable.
ok kettenis

7 months agoEsure the base,len range provided by ld.so is definately in the map.
deraadt [Fri, 5 Apr 2024 12:51:15 +0000 (12:51 +0000)]
Esure the base,len range provided by ld.so is definately in the map.
Being outside the map doesn't seem like it can do anything bad.
Discussed with kettenis

7 months agoPick newest session as documented, not oldest, from Magnus Gross.
nicm [Thu, 4 Apr 2024 22:44:40 +0000 (22:44 +0000)]
Pick newest session as documented, not oldest, from Magnus Gross.

7 months agoset right mode on ssh-agent at boot-time
semarie [Thu, 4 Apr 2024 16:00:51 +0000 (16:00 +0000)]
set right mode on ssh-agent at boot-time

which sthen@
ok deraadt@

7 months agoRemove incorrect function counts
tb [Thu, 4 Apr 2024 09:30:43 +0000 (09:30 +0000)]
Remove incorrect function counts

Vincent Lee spotted that I failed to update numbers that count how many
functions are documented here when removing {CRYPTO,OPENSSL}_realloc.
This isn't helpful information and nobody will remember to go look for
such numbers next time this page is adjusted, so remove the counts.

agreement from jmc

7 months agodrm/amdgpu: fix use-after-free bug
jsg [Thu, 4 Apr 2024 08:14:53 +0000 (08:14 +0000)]
drm/amdgpu: fix use-after-free bug

From Vitaly Prosyak
e87e08c94c9541b4e18c4c13f2f605935f512605 in linux-6.6.y/6.6.24
22207fd5c80177b860279653d017474b2812af5e in mainline linux

7 months agodrm/amd/display: Clear OPTC mem select on disable
jsg [Thu, 4 Apr 2024 08:13:21 +0000 (08:13 +0000)]
drm/amd/display: Clear OPTC mem select on disable

From Ilya Bakoulin
2ceddecdd0ef6fe7cdb31ec14ff2e26ed938fa4b in linux-6.6.y/6.6.24
b4e05bb1dec53fe28c3c88425aded824498666e5 in mainline linux

7 months agodrm/amd/display: Disconnect phantom pipe OPP from OPTC being disabled
jsg [Thu, 4 Apr 2024 08:11:23 +0000 (08:11 +0000)]
drm/amd/display: Disconnect phantom pipe OPP from OPTC being disabled

From George Shen
6a1cb68b9810f71644eb5d2d663e59083540bada in linux-6.6.y/6.6.24
7bdbfb4e36e34eb788e44f27666bf0a2b3b90803 in mainline linux

7 months agodrm/amd/display: Fix hang/underflow when transitioning to ODM4:1
jsg [Thu, 4 Apr 2024 08:09:03 +0000 (08:09 +0000)]
drm/amd/display: Fix hang/underflow when transitioning to ODM4:1

From Ilya Bakoulin
ae62f1dde66a6f0eee98defc4c7a346bd5acd239 in linux-6.6.y/6.6.24
e7b2b108cdeab76a7e7324459e50b0c1214c0386 in mainline linux

7 months agodrm/i915/gt: Reset queue_priority_hint on parking
jsg [Thu, 4 Apr 2024 08:07:39 +0000 (08:07 +0000)]
drm/i915/gt: Reset queue_priority_hint on parking

From Chris Wilson
3b031e4fcb2740988143c303f81f69f18ce86325 in linux-6.6.y/6.6.24
4a3859ea5240365d21f6053ee219bb240d520895 in mainline linux

7 months agodrm/i915: Do not match JSL in ehl_combo_pll_div_frac_wa_needed()
jsg [Thu, 4 Apr 2024 08:05:26 +0000 (08:05 +0000)]
drm/i915: Do not match JSL in ehl_combo_pll_div_frac_wa_needed()

From Jonathon Hall
07c011e3351da3e5d4633ec1b259457b1626faa4 in linux-6.6.y/6.6.24
e41d769f1a7a1dc533c35ef7b366be3dbf432a1c in mainline linux

7 months agodrm/i915/dsi: Go back to the previous INIT_OTP/DISPLAY_ON order, mostly
jsg [Thu, 4 Apr 2024 08:03:27 +0000 (08:03 +0000)]
drm/i915/dsi: Go back to the previous INIT_OTP/DISPLAY_ON order, mostly

From Ville Syrjala
69fa0e23a6a3b30dc14b731c7e5818375aaa4da6 in linux-6.6.y/6.6.24
18846627ef1210dcd55d65342b055ea97a46ffff in mainline linux

7 months agoRecommit a better version of the removal of the F5 workaround
tb [Thu, 4 Apr 2024 08:02:21 +0000 (08:02 +0000)]
Recommit a better version of the removal of the F5 workaround

Unlike for previous TLS versions, TLSv1.3 servers can send the supported
groups extension to inform a client of the server's preferences. The
intention is that a client can adapt for subsequent commits. We ignore
this info for now, but sthen ran into java-based servers that do this.

Thus, rejecting the extension outright was incorrect. Instead, only allow
the extension in TLSv1.3 encrypted extensions. This way the F5 workaround
is also disabled, but we continue to interoperate with TLSv1.3 servers that
do follow the last paragraph of RFC 8446, section 4.2.7.

This mostly adjusts outdated/misleading comments.

ok jsing sthen

7 months agodrm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()
jsg [Thu, 4 Apr 2024 08:00:22 +0000 (08:00 +0000)]
drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()

From Ville Syrjala
a891add409e3bc381f4f68c2ce9d953f1865cb1f in linux-6.6.y/6.6.24
32e39bab59934bfd3f37097d4dd85ac5eb0fd549 in mainline linux

7 months agodrm/i915/hwmon: Fix locking inversion in sysfs getter
jsg [Thu, 4 Apr 2024 07:58:45 +0000 (07:58 +0000)]
drm/i915/hwmon: Fix locking inversion in sysfs getter

From Janusz Krzysztofik
510c5f5e4837cab803c4f594c5f79783ff7b463d in linux-6.6.y/6.6.24
b212b79768ccde74429f872c37618c543fa11333 in mainline linux