openbsd
16 months agoRevert unrelated change that sneaked into the pf_ioctl.c commit.
claudio [Mon, 26 Jun 2023 07:52:18 +0000 (07:52 +0000)]
Revert unrelated change that sneaked into the pf_ioctl.c commit.

16 months agoClose all pf transactions before opening a new one in DIOCGETRULES.
claudio [Mon, 26 Jun 2023 07:49:48 +0000 (07:49 +0000)]
Close all pf transactions before opening a new one in DIOCGETRULES.

Processes like snmpd or systat open pf(4) once and then issue many
DIOCGETRULES calls over their runtime. This accumulates many pf_trans
structs over their lifetime. At some point the kernel runs out of
memory because of that. By closing all transactions before creating
a new one, long living processes do no longer leak transactions.

This probably needs further refinement once more transactions types are
added but for now this solves the problem.

Problem found by florian@
OK sashan@ kn@

16 months agoAdd "us" to styles for underscore colour, GitHub issue 3589.
nicm [Mon, 26 Jun 2023 07:17:40 +0000 (07:17 +0000)]
Add "us" to styles for underscore colour, GitHub issue 3589.

16 months agofix grammar of the comment describing pat_chk(); ok millert@
op [Mon, 26 Jun 2023 07:10:17 +0000 (07:10 +0000)]
fix grammar of the comment describing pat_chk(); ok millert@

16 months agodocument handling of NULL envp as an extension;
jmc [Mon, 26 Jun 2023 06:58:18 +0000 (06:58 +0000)]
document handling of NULL envp as an extension;
from lucas de sena
ok espie

16 months agoProvide kstats based on the byte and packet counters available in some
jmatthew [Sun, 25 Jun 2023 22:36:09 +0000 (22:36 +0000)]
Provide kstats based on the byte and packet counters available in some
dwge(4) implementations.  The counters are all 32 bit, so enable reset-on-read
and accumulate them into 64 bit software counters, and enable the MMC
interrupts that indicate one or more counters is halfway to overflowing.
Tested on an RK3399, which has the counters, and an Allwinner A20, which
doesn't.

ok dlg@

16 months agoAdd missing RCS marker
tb [Sun, 25 Jun 2023 19:43:28 +0000 (19:43 +0000)]
Add missing RCS marker

16 months agoRemove unneeded bn_local.h and drop a NULL check
tb [Sun, 25 Jun 2023 19:35:56 +0000 (19:35 +0000)]
Remove unneeded bn_local.h and drop a NULL check

16 months agoMove ECDSA_size() to ecs_ossl.c to match what was done in ecdh
tb [Sun, 25 Jun 2023 19:33:39 +0000 (19:33 +0000)]
Move ECDSA_size() to ecs_ossl.c to match what was done in ecdh

16 months agoWith ech_local.h gone, we no longer need to -I ecdh
tb [Sun, 25 Jun 2023 19:29:30 +0000 (19:29 +0000)]
With ech_local.h gone, we no longer need to -I ecdh

16 months agoRemove ech_local.h
tb [Sun, 25 Jun 2023 19:28:47 +0000 (19:28 +0000)]
Remove ech_local.h

16 months agoStop including ech_local.h
tb [Sun, 25 Jun 2023 19:26:04 +0000 (19:26 +0000)]
Stop including ech_local.h

16 months agoRemove prototypes for EC_KEY_{get,insert}_key_method_data()
tb [Sun, 25 Jun 2023 19:22:21 +0000 (19:22 +0000)]
Remove prototypes for EC_KEY_{get,insert}_key_method_data()

These were accidentally left behind in a previous commit.

16 months agoMove ecdh_KDF_X9_63() to ec_local.h
tb [Sun, 25 Jun 2023 19:20:57 +0000 (19:20 +0000)]
Move ecdh_KDF_X9_63() to ec_local.h

In anticipation of merging ecdh/ and ecdsa/ into ec/, move the last
remaining thing in ech_local.h where it will soon belong.

16 months agoMove ECDH_size() to ech_key.c
tb [Sun, 25 Jun 2023 19:17:43 +0000 (19:17 +0000)]
Move ECDH_size() to ech_key.c

This way the public ECDH API that will remain in libcrypto is in one file
and the public ECDH API that will go is in the other one.

16 months agoMove the ecdh_method struct declaration to ech_lib.c
tb [Sun, 25 Jun 2023 19:14:14 +0000 (19:14 +0000)]
Move the ecdh_method struct declaration to ech_lib.c

No other file uses this anymore

16 months agoMove ECDH_OpenSSL() ECDSA_OpenSSL() to *_lib.c
tb [Sun, 25 Jun 2023 19:04:35 +0000 (19:04 +0000)]
Move ECDH_OpenSSL() ECDSA_OpenSSL() to *_lib.c

Now that they no longer use static methods, they can move where they
belong. Also make the static method const, as it should have been all
along.

16 months agoRemove EC_EXTRA_DATA
tb [Sun, 25 Jun 2023 18:52:27 +0000 (18:52 +0000)]
Remove EC_EXTRA_DATA

With the ecdh_check() and ecdsa_check() abominations gone, we can finally
get rid of EC_EXTRA_DATA and EC_KEY_{get,insert}_key_method_data(). The
EC_EX_DATA_*() handlers, (which fortunately have always had "'package'
level visibility") join the ride to the great bit bucket in the sky.

Thanks to op for making this possible.

ok jsing

16 months agoRemove {ecdh,ecdsa}_check() and {ECDH,ECDSA}_DATA
tb [Sun, 25 Jun 2023 18:45:56 +0000 (18:45 +0000)]
Remove {ecdh,ecdsa}_check() and {ECDH,ECDSA}_DATA

This is now unused code. Removing it will free us up to remove some
other ugliness in the ec directory.

ok jsing

16 months agoRemove method wrappers that use {ecdh,ecdsa}_check()
tb [Sun, 25 Jun 2023 18:41:36 +0000 (18:41 +0000)]
Remove method wrappers that use {ecdh,ecdsa}_check()

Now that it is no longer possible to set a custom {ECDH,ECDSA}_METHOD,
EC_KEY_METHOD can just call the relevant method directly without the
need for this extra contortion.

ok jsing

16 months agoecdsa_do_sign(): remove useless ecdsa_check() call
tb [Sun, 25 Jun 2023 18:35:28 +0000 (18:35 +0000)]
ecdsa_do_sign(): remove useless ecdsa_check() call

ok jsing

16 months agoMake ECDH and ECDSA ex_data handlers always fail
tb [Sun, 25 Jun 2023 18:27:38 +0000 (18:27 +0000)]
Make ECDH and ECDSA ex_data handlers always fail

They will be removed in the next major bump. No port uses them. They use
code that is in the way of upcoming surgery. Only libtls and smtpd used
to use the ECDSA version.

ok jsing

16 months agoMake {ECDH,ECDSA}_set_method() always fail
tb [Sun, 25 Jun 2023 18:24:33 +0000 (18:24 +0000)]
Make {ECDH,ECDSA}_set_method() always fail

They will be removed in the next major bump. No port uses them. They use
code that is in the way of upcoming surgery. Only libtls used the ECDSA
version, but thankfully op cleaned that up.

ok jsing

16 months agox509v3.h: unwrap a line
tb [Sun, 25 Jun 2023 18:15:21 +0000 (18:15 +0000)]
x509v3.h: unwrap a line

16 months agoSGR 0 should not end hyperlink, reported by Lucas Trzesniewski.
nicm [Sun, 25 Jun 2023 15:53:07 +0000 (15:53 +0000)]
SGR 0 should not end hyperlink, reported by Lucas Trzesniewski.

16 months agoAdjust/fix X509_check_purpose(3) documentation
tb [Sun, 25 Jun 2023 13:54:58 +0000 (13:54 +0000)]
Adjust/fix X509_check_purpose(3) documentation

16 months agoCheck for duplicate X.509v3 extension OIDs
tb [Sun, 25 Jun 2023 13:52:27 +0000 (13:52 +0000)]
Check for duplicate X.509v3 extension OIDs

Per RFC 5280, 4.2: A certificate MUST NOT include more than one instance
of a particular extension.

This implements such a check in x509v3_cache_extensions() by sorting the
list of extensions and looking for duplicate neighbors. This sidesteps
complications from extensions we do not know about and keeps algorithmic
complexity reasonable. If the check fails, EXFLAG_INVALID is set on the
certificate, which means that the verifier will not validate it.

ok jsing

16 months agoProvide additional BN primitives for BN_ULLONG architectures.
jsing [Sun, 25 Jun 2023 11:42:26 +0000 (11:42 +0000)]
Provide additional BN primitives for BN_ULLONG architectures.

On BN_ULLONG architectures, the C compiler can usually do a decent job
of optimising primitives, however it struggles to see through primitive
calls due to type narrowing. As such, providing explicit versions of
compound primitives can result in the production of more optimal code.
For example, on arm the bn_mulw_addw_addw() primitive can be replaced
with a single umaal instruction, which provides significant performance
gains.

Rather than intermingling #ifdef/#else throughout the header, the
BN_ULLONG defines are pulled up above the normal functions. This also
allows complex compound primitives to be reused. The conditionals have also
been changed from BN_LLONG to BN_ULLONG, since that is what really matters.

ok tb@

16 months agoech_local.h: remove unused ECDH_FLAG_FIPS_METHOD
tb [Sun, 25 Jun 2023 08:12:23 +0000 (08:12 +0000)]
ech_local.h: remove unused ECDH_FLAG_FIPS_METHOD

16 months agoremove ssl_init()
op [Sun, 25 Jun 2023 08:08:03 +0000 (08:08 +0000)]
remove ssl_init()

it's a noop; nowadays both LibreSSL and OpenSSL libcrypto and libssl
initialize themselves automatically before doing anything.

noticed by jsing, ok tb

16 months agoremove ssl_init()
op [Sun, 25 Jun 2023 08:07:38 +0000 (08:07 +0000)]
remove ssl_init()

it's a noop; nowadays both LibreSSL and OpenSSL libcrypto and libssl
initialize themselves automatically before doing anything.

ok tb

16 months agoremove ca_sslinit()
op [Sun, 25 Jun 2023 08:07:04 +0000 (08:07 +0000)]
remove ca_sslinit()

it's a noop; nowadays both LibreSSL and OpenSSL libcrypto and libssl
initialize themselves automatically before doing anything.

spotted by tb, ok tb tobhe

16 months agoec_local.h: move ec_group_simple_order_bits down a bit
tb [Sun, 25 Jun 2023 07:50:37 +0000 (07:50 +0000)]
ec_local.h: move ec_group_simple_order_bits down a bit

16 months agoCalculate inet PCB SIP hash without table mutex.
bluhm [Sat, 24 Jun 2023 20:54:46 +0000 (20:54 +0000)]
Calculate inet PCB SIP hash without table mutex.

Goal is to run UDP input in parallel.  Btrace kstack analysis shows
that SIP hash for PCB lookup is quite expensive.  When running in
parallel, there is also lock contention on the PCB table mutex.

It results in better performance to calculate the hash value before
taking the mutex.  The hash secret has to be constant as hash
calculation must not depend on values protected by the table mutex.
Do not reseed anymore when hash table gets resized.

Analysis also shows that asserting a rw_lock while holding a mutex
is a bit expensive.  Just remove the netlock assert.

OK dlg@ mvs@

16 months agoAdd initial support for StarFive VisionFive V2 to stfclock(4).
jsing [Sat, 24 Jun 2023 18:26:59 +0000 (18:26 +0000)]
Add initial support for StarFive VisionFive V2 to stfclock(4).

This adds initial support for the syscrg and pll clocks on the StarFive
VisionFive V2 JH7110 SoC.

ok kettenis@

16 months agoRemove precompute_mult/have_precompute_mult from EC_METHOD.
jsing [Sat, 24 Jun 2023 18:21:07 +0000 (18:21 +0000)]
Remove precompute_mult/have_precompute_mult from EC_METHOD.

These are no longer in use - stub EC_GROUP_precompute_mult() and
EC_GROUP_have_precompute_mult() to match their existing behaviour.

ok tb@

16 months agoMop up EC_GROUP precomp machinery.
jsing [Sat, 24 Jun 2023 17:49:44 +0000 (17:49 +0000)]
Mop up EC_GROUP precomp machinery.

Since there are now no EC implementations that perform pre-computation at
the EC_GROUP level, remove all of the precomp machinery, including the
extra_data EC_GROUP member.

The ec_wNAF_mul() code is horrific - simply cut out the precomp code,
rather than trying to rewrite it (that's a project for another day).

ok tb@

16 months agoMop up ec_wNAF_{,have_}precompute_mult().
jsing [Sat, 24 Jun 2023 17:18:15 +0000 (17:18 +0000)]
Mop up ec_wNAF_{,have_}precompute_mult().

These were previously called by GF2m code and are no longer used.
Also remove ec_pre_comp_new(), since it is only called by
ec_wNAF_precompute_mult() and is now unused.

ok tb@

16 months agoAdd conditional around bn_mul_words() call.
jsing [Sat, 24 Jun 2023 17:06:54 +0000 (17:06 +0000)]
Add conditional around bn_mul_words() call.

At least one of our bn_mul_words() assembly implementation fails to handle
n = 0 correctly... *sigh*

16 months agoAssign and test.
jsing [Sat, 24 Jun 2023 16:19:52 +0000 (16:19 +0000)]
Assign and test.

16 months agoCheck for non-zero length rather than a zero value.
jsing [Sat, 24 Jun 2023 16:10:23 +0000 (16:10 +0000)]
Check for non-zero length rather than a zero value.

This removes a data dependent timing path from BN_sqr().

ok tb@

16 months agoRewrite and simplify bn_sqr()/bn_sqr_normal().
jsing [Sat, 24 Jun 2023 16:01:43 +0000 (16:01 +0000)]
Rewrite and simplify bn_sqr()/bn_sqr_normal().

Rework bn_sqr()/bn_sqr_normal() so that it is less convoluted and more
readable. Instead of recomputing values that the caller has already
computed, pass it as an argument. Avoid branching and remove duplication
of variables. Consistently use a_len and r_len naming for lengths.

ok tb@

16 months agoProvide optimised bn_subw() and bn_subw_subw() for arm.
jsing [Sat, 24 Jun 2023 15:51:47 +0000 (15:51 +0000)]
Provide optimised bn_subw() and bn_subw_subw() for arm.

16 months agoCall notification_done() in the regress test so that the list
claudio [Sat, 24 Jun 2023 07:07:36 +0000 (07:07 +0000)]
Call notification_done() in the regress test so that the list
of deltas is adjusted to what the test expects.

16 months agoRemove a pair of parens and make one check more consistent with the others
tb [Sat, 24 Jun 2023 04:15:14 +0000 (04:15 +0000)]
Remove a pair of parens and make one check more consistent with the others

16 months agoFix warning about empty ipAddressesOrRanges
tb [Fri, 23 Jun 2023 20:05:30 +0000 (20:05 +0000)]
Fix warning about empty ipAddressesOrRanges

Committed from an older tree.

16 months agosmtpd: allow arguments on NOOP
op [Fri, 23 Jun 2023 18:32:28 +0000 (18:32 +0000)]
smtpd: allow arguments on NOOP

per RFC3521 ยง 4.1.1.9 the NOOP command allows optionally one argument
that SHOULD be ignored.  For semplicity, relax it to allow anything after it.

Original diff by Sebastian J. Bronner, GitHub PR 1150, tweaked by me to
add smtp_check_noop().

Gilles agrees, ok millert@

16 months agoUse consistent idiom for X509_get_ext_d2i()
tb [Fri, 23 Jun 2023 15:32:15 +0000 (15:32 +0000)]
Use consistent idiom for X509_get_ext_d2i()

X509_get_ext_d2i() is special. A NULL return value can be either a
success or a failure scenario: an extension may legitimately be absent.
However, to find out whether it was absent or an error ocurred, you need
to pass in &crit, a pointer to an int. Its purpose is to indicate whether
the extension was marked critical or not.

If the return value was NULL, crit becomes an error indicator:

crit == -1 means the extension was not found. This can be an error or fine
depending on the extension. Handle this accordingly. In particular for
basic constraints, if they are missing or non-critical, this is an error.

If crit == -2 then multiple extensions with the same OID as the nid
requested are present. this means the cert is non-conformant to RFC 5280.

If crit >= 0, then something weird happened. Either memory allocation
failed or the extension could not be parsed. It is not easily possible to
tell which.

In short, if crit != -1, drop the cert on the floor like a hot potato.
Add warnings where possible. For x509_any_inherits() this needs some more
work, but that will be done in a different diff another day.

ok job

16 months agoFix a bug in ex's 's' command with the 'c' flag when 'number' is off.
millert [Fri, 23 Jun 2023 15:06:45 +0000 (15:06 +0000)]
Fix a bug in ex's 's' command with the 'c' flag when 'number' is off.
The underlining was positioned in the wrong place.  This fixes
the problem and matches historic ex behavior.  OK op@

16 months agoImprove detection of RRDP session desynchronization
claudio [Fri, 23 Jun 2023 11:36:24 +0000 (11:36 +0000)]
Improve detection of RRDP session desynchronization

According to RFC 8182, a given session_id and serial number represent an
immutable record of the state of the Repository Server at a certain
point in time.

Add a check to the RRDP notification file processing to compare whether
the delta hashes associated to previously seen serials are different in
newly fetched notification files. Fall back to a snapshot if a difference
is detected, because such a mutation is a strong desynchronization
indicator.

Idea from Ties de Kock (RIPE NCC).
Based on a diff by job@
With and OK job@ tb@

16 months agoCodify BN_asc2bn(NULL, *) behavior in regress.
tb [Fri, 23 Jun 2023 10:50:47 +0000 (10:50 +0000)]
Codify BN_asc2bn(NULL, *) behavior in regress.

16 months agoAvoid crash in BN_asc2bn()
tb [Fri, 23 Jun 2023 10:48:40 +0000 (10:48 +0000)]
Avoid crash in BN_asc2bn()

Historically (and currently in OpenSSL), BN_asc2bn() could be called with
NULL, but only for positive numbers. So BN_asc2bn(NULL, "1") would succeed
but BN_asc2bn(NULL, "-1"), would crash. The other *2bn functions return a
length, so accepting a NULL makes some sense since it allows callers to
skip over part of the string just parsed (atoi-style).

For BN_asc2bn() a NULL bn makes no sense because it returns a boolean. The
recent CBS rewrite makes BN_asc2bn(NULL, *) always crash which in turn made
Coverity throw a fit.

Another change of behavior from that rewrite pertains to accidents (or is
it madness?) like -0x-11 and 0x-11 being parsed as decimal -17 (which Ingo
of course spotted and diligently documented). This will be addressed later.

ok jsing

16 months agoFix return check for BN_hex2bn()
tb [Fri, 23 Jun 2023 10:34:16 +0000 (10:34 +0000)]
Fix return check for BN_hex2bn()

Purely cosmetic change taking into account the fact that this function
returns a length rather than a boolean. This is the last offender in the
library.

ok jsing

16 months agoFix return check of bn_hex2bn_cbs()
tb [Fri, 23 Jun 2023 10:33:12 +0000 (10:33 +0000)]
Fix return check of bn_hex2bn_cbs()

It returns a length, not a Boolean, so check for 0 explicitly. This is
purely cosmetic.

ok jsing

16 months agotypo: hexidecimal -> hexadecimal
tb [Fri, 23 Jun 2023 10:31:27 +0000 (10:31 +0000)]
typo: hexidecimal -> hexadecimal

16 months agoRemove some redundant parentheses
tb [Fri, 23 Jun 2023 08:00:28 +0000 (08:00 +0000)]
Remove some redundant parentheses

This file is already enough of an eyesore without them.

16 months agorpki-client: check for duplicate certificate extensions
tb [Fri, 23 Jun 2023 07:40:28 +0000 (07:40 +0000)]
rpki-client: check for duplicate certificate extensions

RFC 5280 disallows multiple extensions with the same OID. Since libcrypto
does not check that currently, do this by hand. This only deals with CA
certs for now, EE certs could do that similarly.

Found with BBN test corpora

ok job

16 months agorpki-client: disallow empty sets of IP Addresses or AS numbers
tb [Fri, 23 Jun 2023 07:26:21 +0000 (07:26 +0000)]
rpki-client: disallow empty sets of IP Addresses or AS numbers

RFC 3779 doesn't say anything about empty lists of IP addresses and AS
numbers. Of course the RFC 3779 code in libcrypto implements a check for
empty lists for AS numbers but fails to do so for IP addresses...

While RFC 6487 is explicit about disallowing empty lists of IP addresses,
it is not explicit about disallowing empty ipAddressesOrRanges, but that
seems to be the intent.

Found with BBN test corpora

ok job

16 months agoRevert previous, not all platforms allow compiling
otto [Fri, 23 Jun 2023 05:26:45 +0000 (05:26 +0000)]
Revert previous, not all platforms allow compiling
__builtin_return_address(a) with a != 0.

16 months agoAvoid division by 0 in m_pool_used
gnezdo [Fri, 23 Jun 2023 04:36:49 +0000 (04:36 +0000)]
Avoid division by 0 in m_pool_used

OK dlg@

Reported-by: syzbot+a377d5cd833c2343429a@syzkaller.appspotmail.com
16 months agoksmn(4): Support thermal sensors on Ryzen 9 79xx
mlarkin [Fri, 23 Jun 2023 03:47:10 +0000 (03:47 +0000)]
ksmn(4): Support thermal sensors on Ryzen 9 79xx

ok deraadt, brynet

16 months agosymbols: Tweak this test so it works with -j N
tb [Thu, 22 Jun 2023 19:23:27 +0000 (19:23 +0000)]
symbols: Tweak this test so it works with -j N

16 months agoRevert "clockintr_cpu_init: initialize starting offsets with clockintr_stagger()"
cheloha [Thu, 22 Jun 2023 16:23:50 +0000 (16:23 +0000)]
Revert "clockintr_cpu_init: initialize starting offsets with clockintr_stagger()"

octeon machines do not increment the global variable "ncpus"
(init_main.c) in the same spot as other platforms, which violates the
KASSERT in clockintr_stagger(), causing a panic.

We need to bring octeon's behavior into alignment with every other
platform before proceeding with this patch.

Reported and debugged by bluhm@.

16 months agoMention lid position support.
tobhe [Thu, 22 Jun 2023 15:29:05 +0000 (15:29 +0000)]
Mention lid position support.

From Jan Stary

16 months agoAdd machdep.lidaction example. We support this on arm64 laptops now.
tobhe [Thu, 22 Jun 2023 15:20:16 +0000 (15:20 +0000)]
Add machdep.lidaction example. We support this on arm64 laptops now.

From Jan Stary
Ok patrick@

16 months agoInstead of tsleep on lbolt do a tsleep with a 1 second timeout.
claudio [Thu, 22 Jun 2023 13:18:02 +0000 (13:18 +0000)]
Instead of tsleep on lbolt do a tsleep with a 1 second timeout.
Result is the same and gets rid of a lbolt use.
OK miod@

16 months agoAllow to ask for deeper callers for leak reports using malloc options.
otto [Thu, 22 Jun 2023 11:04:16 +0000 (11:04 +0000)]
Allow to ask for deeper callers for leak reports using malloc options.
ok deraadt@

16 months agoUse new ibu API, switch from ibuf_seek() to ibuf_set().
claudio [Thu, 22 Jun 2023 10:38:27 +0000 (10:38 +0000)]
Use new ibu API, switch from ibuf_seek() to ibuf_set().
Also use ibuf_data() and ibuf_size().
OK tb@

16 months agoKNF
claudio [Thu, 22 Jun 2023 09:08:02 +0000 (09:08 +0000)]
KNF

16 months agoKNF
claudio [Thu, 22 Jun 2023 09:07:04 +0000 (09:07 +0000)]
KNF

16 months agodrm/amdgpu: Don't set struct drm_driver.output_poll_changed
jsg [Thu, 22 Jun 2023 05:19:01 +0000 (05:19 +0000)]
drm/amdgpu: Don't set struct drm_driver.output_poll_changed

From Thomas Zimmermann
4b4cae8e4b37c7ad4d9721dbda060a62e49e3c17 in linux-6.1.y/6.1.35
0e3172bac3f43759719384403fe2d1e4c61f87e0 in mainline linux

16 months agodrm/amdgpu: add missing radeon secondary PCI ID
jsg [Thu, 22 Jun 2023 05:17:31 +0000 (05:17 +0000)]
drm/amdgpu: add missing radeon secondary PCI ID

From Alex Deucher
21863dc45aed8d68a2573cce032ecbc8fe7c5bf5 in linux-6.1.y/6.1.35
e61f67749b351c19455ce3085af2ae9af80023bc in mainline linux

16 months agodrm/amd/pm: workaround for compute workload type on some skus
jsg [Thu, 22 Jun 2023 05:16:06 +0000 (05:16 +0000)]
drm/amd/pm: workaround for compute workload type on some skus

From Kenneth Feng
6f5b5ce9397d91b0a8bc8d15dc8fd72bc0aacaa4 in linux-6.1.y/6.1.35
7ca302d488f80cf4529620acc1c545f9022d8bb8 in mainline linux

16 months agodrm/amd: Tighten permissions on VBIOS flashing attributes
jsg [Thu, 22 Jun 2023 05:14:26 +0000 (05:14 +0000)]
drm/amd: Tighten permissions on VBIOS flashing attributes

From Mario Limonciello
b69a10df900386871703a4cc3be974485f52ff7c in linux-6.1.y/6.1.35
7ab1a4913d0051cf5196ef7987b5fa42c25e13b6 in mainline linux

16 months agodrm/amd: Make sure image is written to trigger VBIOS image update flow
jsg [Thu, 22 Jun 2023 05:10:03 +0000 (05:10 +0000)]
drm/amd: Make sure image is written to trigger VBIOS image update flow

From Mario Limonciello
b2706d862b6577b8218bdef1c238e175624b906d in linux-6.1.y/6.1.35
3eb1a3a04056ba3df3205e169b8acc9da0c65a94 in mainline linux

16 months agodrm/amd/display: edp do not add non-edid timings
jsg [Thu, 22 Jun 2023 05:08:30 +0000 (05:08 +0000)]
drm/amd/display: edp do not add non-edid timings

From Hersen Wu
ee8c6580c3106b0061c7cdff1804e5a1f1e1d7fe in linux-6.1.y/6.1.35
e749dd10e5f292061ad63d2b030194bf7d7d452c in mainline linux

16 months agodrm/amdgpu: vcn_4_0 set instance 0 init sched score to 1
jsg [Thu, 22 Jun 2023 05:07:09 +0000 (05:07 +0000)]
drm/amdgpu: vcn_4_0 set instance 0 init sched score to 1

From Sonny Jiang
5d1fdfb3d185a9726478ba174235eff7c16f1101 in linux-6.1.y/6.1.35
9db5ec1ceb5303398ec4f899d691073d531257c3 in mainline linux

16 months agodrm:amd:amdgpu: Fix missing buffer object unlock in failure path
jsg [Thu, 22 Jun 2023 05:05:56 +0000 (05:05 +0000)]
drm:amd:amdgpu: Fix missing buffer object unlock in failure path

From Sukrut Bellary
8ca9880735b0a33a4ff54328d6c5eb60fe2b0a6d in linux-6.1.y/6.1.35
60ecaaf54886b0642d5c4744f7fbf1ff0d6b3e42 in mainline linux

16 months agodrm: panel-orientation-quirks: Change Air's quirk to support Air Plus
jsg [Thu, 22 Jun 2023 05:04:19 +0000 (05:04 +0000)]
drm: panel-orientation-quirks: Change Air's quirk to support Air Plus

From Maya Matuszczyk
c45aed74318e65b8da938a593c124ad2ee1a1e66 in linux-6.1.y/6.1.35
1aa7f416175619e0286fddc5fc44e968b06bf2aa in mainline linux

16 months agoRemove extra trailing whitespace
mlarkin [Wed, 21 Jun 2023 23:24:10 +0000 (23:24 +0000)]
Remove extra trailing whitespace

ok stsp

16 months agoksh: escape control chars when displaying file name completions.
millert [Wed, 21 Jun 2023 22:22:08 +0000 (22:22 +0000)]
ksh: escape control chars when displaying file name completions.
If there are multiple matches when using autocomplete, the list of
matching file names was output as-is.  However, for a single match,
control characters are escaped before the file name is displayed.
This makes the behavior more consistent by escaping control chars
in the list of matches too.  Discussed with deraadt@, OK op@

16 months agoRevert "schedcpu, uvm_meter(9): make uvm_meter() an independent timeout"
cheloha [Wed, 21 Jun 2023 21:16:21 +0000 (21:16 +0000)]
Revert "schedcpu, uvm_meter(9): make uvm_meter() an independent timeout"

Sometimes causes boot hang after mounting root partition.

Thread 1: https://marc.info/?l=openbsd-misc&m=168736497407357&w=2
Thread 2: https://marc.info/?l=openbsd-misc&m=168737429214370&w=2

16 months agoclear errno before strtoull as it may already be set to ERANGE
op [Wed, 21 Jun 2023 17:59:24 +0000 (17:59 +0000)]
clear errno before strtoull as it may already be set to ERANGE

noticed and ok millert@

16 months agoavoid truncation of filtered data lines
op [Wed, 21 Jun 2023 17:56:26 +0000 (17:56 +0000)]
avoid truncation of filtered data lines

Don't copy in a buffer the filter' output for parsing as we may truncate
filter-dataline (i.e. the mail body).  Instead, parse the string by
advancing the pointer without copying or modifications.

Issue reported by Joachim Schneider on the OpenSMTPD-portable
repository.

ok millert@

16 months agoUse recallocarray() consistently. recallocarray() was introduced to simplify
claudio [Wed, 21 Jun 2023 13:11:49 +0000 (13:11 +0000)]
Use recallocarray() consistently. recallocarray() was introduced to simplify
exactly this use case where the new memory needs to be zeroed during resize.
Since recallocarray() takes care of all this there is no need to bzero()
memory anymore.

OK tb@ millert@

16 months agoAdd a parameter 'action' to mpfree() so it can optionally discard
krw [Wed, 21 Jun 2023 12:50:09 +0000 (12:50 +0000)]
Add a parameter 'action' to mpfree() so it can optionally discard
or keep the memory pointed at by the char ** parameter.

Allows mpfree() to be used against the global mountpoints[] and
eliminates a couple of manual loops to free the current contents
of mountpoints[].

No intentional functional change.

16 months agoadd "fib reload" support to ospf6d/ospf6ctl, and trigger it
sthen [Wed, 21 Jun 2023 09:47:03 +0000 (09:47 +0000)]
add "fib reload" support to ospf6d/ospf6ctl, and trigger it
automatically on a timeout after RTM_DESYNC (i.e. route socket
overflow). ported across from ospfd. fixes/ok claudio@

(it's much harder to overflow the routing socket buffer these
days since it was bumped to 2MB, but still happens occasionally
on a busy machine).

16 months agoProvide optimised bn_clzw() for aarch64.
jsing [Wed, 21 Jun 2023 07:56:43 +0000 (07:56 +0000)]
Provide optimised bn_clzw() for aarch64.

16 months agoSimplify and clean up the code. Try to use more ibuf idioms but the
claudio [Wed, 21 Jun 2023 07:54:54 +0000 (07:54 +0000)]
Simplify and clean up the code. Try to use more ibuf idioms but the
mix of types used in these functions make this rather hard.
The expected data checks are still not great but a step in the right
direction.
OK tb@

16 months agoConvert string2binary() to use new ibuf api instead of working with an
claudio [Wed, 21 Jun 2023 07:49:24 +0000 (07:49 +0000)]
Convert string2binary() to use new ibuf api instead of working with an
extra buffer first.
OK tb@

16 months agoProvide and use bn_clzw() in place of bn_word_clz().
jsing [Wed, 21 Jun 2023 07:48:41 +0000 (07:48 +0000)]
Provide and use bn_clzw() in place of bn_word_clz().

On some architectures, we can provide an optimised (often single
instruction) count-leading-zero implementation. In order to do this
effectively, provide bn_clzw() as a static inline that can be replaced
by an architecture specific version. The default implementation defers
to the bn_word_clz() function (which may also be architecture specific).

ok tb@

16 months agoUpdate ospf6d to use new ibuf api.
claudio [Wed, 21 Jun 2023 07:45:47 +0000 (07:45 +0000)]
Update ospf6d to use new ibuf api.

This mostly moves away from memcpy(ibuf_seek(buf, off, size), data, size) to
ibuf_set(buf, off, data, size). Also ibuf_reserve() is replaced with
ibuf_add_zero().

OK tb@

16 months agoRemove extra newlines
claudio [Wed, 21 Jun 2023 07:44:08 +0000 (07:44 +0000)]
Remove extra newlines

16 months agoMake BN_num_bits() independent of bn->top.
jsing [Wed, 21 Jun 2023 07:41:55 +0000 (07:41 +0000)]
Make BN_num_bits() independent of bn->top.

Provide bn_bitsize(), which performs a constant time scan of a BN in order
to determine the bit size of the BN value. Use this for BN_num_bits() such
that it is no longer dependent on the bn->top value.

ok tb@

16 months agoAdd tests for BN_sqr() corner cases.
jsing [Wed, 21 Jun 2023 07:18:10 +0000 (07:18 +0000)]
Add tests for BN_sqr() corner cases.

Test BN_sqr() with a newly allocated BN, a BN explicitly set to zero and
small values that fit in a single BN_ULONG.

16 months agoAdd BN_cmp()/BN_ucmp() tests with zero padded inputs.
jsing [Wed, 21 Jun 2023 07:16:08 +0000 (07:16 +0000)]
Add BN_cmp()/BN_ucmp() tests with zero padded inputs.

Currently BN_hex2bn() removes the leading zeros, however this will not be
the case in the future.

16 months agoAdd a BN_num_bits() with zero padded input.
jsing [Wed, 21 Jun 2023 07:15:38 +0000 (07:15 +0000)]
Add a BN_num_bits() with zero padded input.

Currently BN_hex2bn() removes the leading zeros, however this will not be
the case in the future.

16 months agoCheck fdopen return value, from Christian Menges.
nicm [Wed, 21 Jun 2023 06:28:18 +0000 (06:28 +0000)]
Check fdopen return value, from Christian Menges.

16 months agobetter validate CASignatureAlgorithms in ssh_config and sshd_config.
djm [Wed, 21 Jun 2023 05:10:26 +0000 (05:10 +0000)]
better validate CASignatureAlgorithms in ssh_config and sshd_config.

Previously this directive would accept certificate algorithm names, but
these were unusable in practice as OpenSSH does not support CA chains.

part of bz3577; ok dtucker@

16 months agomake `ssh -Q CASignatureAlgorithms` only list signature algorithms that
djm [Wed, 21 Jun 2023 05:08:32 +0000 (05:08 +0000)]
make `ssh -Q CASignatureAlgorithms` only list signature algorithms that
are valid for CA signing. Previous behaviour was to list all signing
algorithms, including certificate algorithms (OpenSSH certificates do
not support CA chains). part of bz3577; ok dtucker@