1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 16:42:56 -08:00
Commit Graph

227813 Commits

Author SHA1 Message Date
tb
28a03e116d Merge ECDH code that will stay into ecdh.c 2023-07-05 12:31:14 +00:00
tb
c0ee283e97 Move ECDSA_size() to a more sensible place in this file 2023-07-05 12:27:36 +00:00
tb
b4a65d296e Merge ECDSA code that will stay into ecdsa.c
discussed with jsing
2023-07-05 12:18:21 +00:00
sashan
8946e15f44 Document DIOCXEND in pf(4) manpage.
With many improvements from jmc@ and kn@

OK jmc@, kn@ deraadt@
2023-07-05 12:00:01 +00:00
tb
9243ef137c Rename ecs_local.h into ecdsa_local.h 2023-07-05 11:37:45 +00:00
tb
913b5a72ac Make variables in prototypes match function declarations 2023-07-05 11:28:50 +00:00
kettenis
a268c146e7 Implement support for the GPIOs on the JH7110. Makes it possible to reboot
the VisionFive 2 from OpenBSD.

ok jsing@
2023-07-05 11:07:36 +00:00
jsg
4533a37301 drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl
From Min Li
1af1cd7be370b08694d8752c97325fe51fdab6aa in linux-6.1.y/6.1.36
982b173a6c6d9472730c3116051977e05d17c8c5 in mainline linux
2023-07-05 10:41:57 +00:00
jsg
0bf92aec6b drm/amd/display: fix the system hang while disable PSR
From Tom Chung
9bcac453890bf2c0ab5a7cefb407c0a9d6cbc4cb in linux-6.1.y/6.1.36
ea2062dd1f0384ae1b136d333ee4ced15bedae38 in mainline linux
2023-07-05 10:40:14 +00:00
jsg
9a29afdac4 drm/amd/display: Add wrapper to call planes and stream update
From Rodrigo Siqueira
e538342002cbe468224f71b7ae116586e55c1134 in linux-6.1.y/6.1.36
81f743a08f3b214638aa389e252ae5e6c3592e7c in mainline linux
2023-07-05 10:38:11 +00:00
jsg
37f4f9ec12 drm/amd/display: Use dc_update_planes_and_stream
From Rodrigo Siqueira
8d855bc67630fa2b17855d85de61b9cd4300e3ad in linux-6.1.y/6.1.36
f7511289821ffccc07579406d6ab520aa11049f5 in mainline linux
2023-07-05 10:36:28 +00:00
kettenis
7f81f56ad4 They may have fixed the cache coherency problems in the JH7110, but it is
still criplled as the SD/MMC controllers only do 32-bit DMA.

ok jsing@
2023-07-05 09:25:55 +00:00
tb
293ffc3e5c Drop useless ossl_ prefixes
discussed with jsing
2023-07-05 08:39:40 +00:00
tobhe
c9b6f93dc1 Suspend from suspend_taskq in apmioctl.
ok kettenis@
2023-07-05 08:26:56 +00:00
jsg
46e85305e4 remove unused armv7 max_processes global
ok miod@
2023-07-05 08:15:34 +00:00
krw
5057ec594f Simplify and clarify the description of auto allocation.
Tweaks and ok jmc@
2023-07-05 08:05:04 +00:00
krw
3c75042939 Restore (R)esize functionality to sparc64 disklabel(8).
Empty or FS_UNUSED partitions don't intrude into the OpenBSD area
of a disk and therefore should not disable partition resizing.

Encountered by claudio@
2023-07-05 07:28:10 +00:00
jsg
a56012defa fw_update is in section 8 not 1 2023-07-05 01:21:51 +00:00
mvs
9f40d4ac91 Introduce SBL_WAIT and SBL_NOINTR sbwait() flags.
This refactoring is another step to make standalone socket buffers
locking. sblock() uses M_WAITOK and M_NOWAIT flags passed as the third
argument together with the SB_NOINTR flag on the `sb_flags' to control
sleep behaviour. To perform uninterruptible acquisition, SB_NOINTR flag
should be set before sblock() call. `sb_flags' modification requires to
hold solock() around sblock()/sbunlock() that makes standalone call
impossible.

Also `sb_flags' modifications outside sblock()/sbunlock() makes
uninterruptible acquisition code huge enough. This time only sorflush()
does this (and forgets to restore SB_NOINTR flag, so shutdown(SHUT_RDWR)
call permanently modifies socket locking behaviour) and this looks not
the big problem. But with the standalone socket buffer locking it will
be many such places, so this huge construction is unwanted.

Introduce new SBL_NOINTR flag passed as third sblock() argument. The
sblock() acquisition will be uninterruptible when existing SB_NOINTR
flag is set on `sb_flags' or SBL_NOINTR was passed.

The M_WAITOK and M_NOWAIT flags belongs to malloc(9). It has no M_NOINTR
flag and there is no reason to introduce it. So for consistency reasons
introduce new SBL_WAIT and use it together with SBL_NOINTR instead of
M_WAITOK and M_NOINTR respectively.

ok bluhm
2023-07-04 22:28:24 +00:00
anton
c10b169721 favor hw.ncpuonline; ok bluhm@ 2023-07-04 19:01:46 +00:00
cheloha
a8972bbdcc amd64: cpu_info: rearrange members, keep ci_mds_tmp 32-byte aligned
ci_mds_tmp needs to be 32-byte aligned, otherwise we trip a CTASSERT
in amd64/cpu.c and break kernel compilation.  However, ci_mds_tmp's
32-byte alignment is at risk: the size of schedstate_percpu is about
to change.

Move ci_curproc and ci_schedstate up just after ci_mds_buf.  This puts
ci_mds_tmp at page offset 64 with no structs ahead of it in cpu_info.
With this arrangement it should remain 32-byte aligned without much
effort.

With input from guenther@.

ok guenther@
2023-07-04 17:29:32 +00:00
tb
5dfb914b63 Avoid outputting invalid signatures
The caller can provide an r which will be added to the ECDSA_SIG unchecked.
This can happen via ECDSA_{,do_}sign_ex() or ECDSA_sign_setup() or else via
a custom sign_sig() handler. Therefore add a check that it is in the bounds
required.

Since k was long thrown away, there's no way to check kinv, so it needs to
be trusted. Misdesigned APIs that will output garbage everywhere...

ok jsing
2023-07-04 15:09:31 +00:00
tb
c3b977fdac Clean up ECDSA verification
Use variable names that correspond more closely to the standard. Use an
additional variable for s^-1 for readability. Annotate the code with
the corresponding steps from FIPS 186-5.

ok jsing
2023-07-04 14:59:32 +00:00
tb
df8dea899c ECDSA signing: annotate code with steps corresponding to FIPS 185-6.
ok jsing
2023-07-04 14:57:05 +00:00
espie
e3e7f107c1 use local assignment to $ENV{TZ} like we do for signal handlers 2023-07-04 14:41:26 +00:00
patrick
d467fd9ece Instead of waiting for the inbound item to show up in the interrupt
handler, allocate it ourselves.  The firmware doesn't seem to mind
that it's us doing the allocation.  This fixes a splassert, because
the code that retrieves the item reaches through the shared memory
driver, which acquires the hardware mutex, which in turn mallocs.

ok kettenis@
2023-07-04 14:32:21 +00:00
sashan
95c411ffdb This diff limits the number of transactions/tickets
pf_open_trans() can issue for each clone of /dev/pf
to 512. The pf_open_trans() is currently being used
by DIOCGETRULES ioctl(2). The limit avoids processes
to consume all kernel memory by asking DIOCGETRULES
for more tickets. If DIOCGETRULES hits the limit, then
the application will see EBUSY error.

This diff was fine tuned with feedback from cluadio@,
deraadt@ and kn@.

OK kn@
2023-07-04 14:23:38 +00:00
espie
7d40840168 stop saying the format is "simple" there are so many annotations.
"straightforward" is a better description at this point.
2023-07-04 14:08:30 +00:00
espie
a1268d5afe add some more fluff to documentation 2023-07-04 14:03:16 +00:00
espie
37f14c44da explain why NO_TS_IN_PLIST exists 2023-07-04 14:00:18 +00:00
espie
cbecba2f25 fix some very minor syntactic nits 2023-07-04 13:58:01 +00:00
jan
82f8b7b2de Check for interface type ethernet before call ether_brport_isset()
Pointed out by bluhm.

ok bluhm@
2023-07-04 13:37:47 +00:00
kettenis
3efac0e76e enable dwqe(4) 2023-07-04 13:04:08 +00:00
kettenis
25a9e96de7 Add StarFive JH7110 support.
Based on an initial diff from jsing@

ok jsing@, patrick@
2023-07-04 12:58:42 +00:00
kettenis
b58ef082af Handle rx error.
ok jsing@, patrick@
2023-07-04 12:48:42 +00:00
jasper
02e5e13b78 consistenly name instruction defines 2023-07-04 12:27:44 +00:00
jasper
08b2451188 Unbreak kprobes. Since LLVM emits endbr64 instructions for IBT, dt could no
longer identify function boundaries and as such no kprobes were found anymore.
Adjust the parser accordingly.

ok mpi@
2023-07-04 12:20:10 +00:00
sashan
d2364f6007 The recent change to DIOCGETRULE allows applications which
periodically read rules from pf(4) to consume all kernel
memory. The bug has been discovered and root caused by florian@.
In this particular case it was snmpd(8) what ate all kernel
memory.

This commit introduces DIOCXEND to pf(4) so applications such
as snmpd(8) and systat(1) to close ticket/transaction when
they are done with fetching the rules. This change also
updates snmpd(8) and systat(1) to use newly introduced
DIOCXEND ioctl(2).

OK claudio@, deraadt@, kn@
2023-07-04 11:34:19 +00:00
bluhm
c82a04dd18 Run Perl tests from our regress tree. It needs a Perl obj directory
with Makefile.  To create the test environment, use the
Makefile.bsd-wrapper in /usr/src/gnu/usr.bin/perl and build Perl
there if it does not exist.  This allows to test Perl easily and
in a consistent manner.  Do not link tests to regress tree due to
this reach around and the combination of build and test.
2023-07-04 11:27:13 +00:00
jsg
5d90c77abd remove prototypes for removed functions 2023-07-04 11:14:00 +00:00
tb
6cf2737f71 Extract private key and group order in s computation
This pushes a few variables no longer needed in ossl_ecdsa_sign_sig() into
ecdsa_compute_s() separating API logic and pure computation a bit more.

ok beck
2023-07-04 10:53:42 +00:00
bluhm
e790ea0ec6 Remove redundant code when calculating checksum.
OK jmatthew@
2023-07-04 10:48:19 +00:00
kettenis
c332ccb186 Add a bunch of clocks for GMAC0 and GMAC1 on the JH7110 SoC.
Based on an initial diff from jsing@

ok jsing@
2023-07-04 10:34:03 +00:00
tb
232be09cb7 Use key for the EC_KEY everywhere 2023-07-04 10:31:57 +00:00
tb
92afdf502d Some more consistency in variable names 2023-07-04 10:26:47 +00:00
tb
7146486b09 Normalize ECDSA_SIG to be sig everywhere 2023-07-04 10:23:34 +00:00
jmatthew
bea8274bae Make the hardware counters available on BCM5705 and newer available as
kstats.  Some of the hardware counters are already used in
bge_stats_update_regs() to update interface counters and work around
hardware bugs, and all counters reset on read, so to keep things simple
the work is split between that function and bge_kstat_read(), which
reads the rest of the counters.

tested by bluhm@ on BCM5720 (with counters) and BCM5704 (without), and
by me on BCM5720 A0 (with counters and hardware bugs)
ok bluhm@ dlg@
2023-07-04 10:22:39 +00:00
tb
e9a4531f73 Normalize on digest and digest_len rather than dgst dlen dgstlen, etc. 2023-07-04 10:14:37 +00:00
tb
5844430125 Rework ecdsa_prepare_digest()
Make it take an EC_KEY instead of a group order in preparation for further
cleanup. Rename m into e to match the standard better. Also buy some vowels
for jsing.

ok beck jsing
2023-07-04 10:06:36 +00:00
jsg
aba40e07e2 Remove mbuf low watermark vars. Unused since uipc_mbuf.c rev 1.244.
ok kn@ bluhm@
2023-07-04 09:47:51 +00:00