patrick [Wed, 7 Dec 2022 23:04:26 +0000 (23:04 +0000)]
The ACPI tables on the Lenovo x13s are incomplete and unusable. For
that reason, identify that we're running on that machine by looking at
the SMBIOS tables and load alternate device tree binaries from disk.
ok kettenis@
tb [Wed, 7 Dec 2022 22:30:15 +0000 (22:30 +0000)]
Add references to the BIO_{push,pop}(3) example
The reader may not know what digest BIOs, Base64 BIOs and file BIOs are
and the relevant function names are non-obvious, hence it's not entirely
trivial to find the manuals where they are explained. With these references
a reader should be able to turn the example into actual code.
ok schwarze
mvs [Wed, 7 Dec 2022 20:08:28 +0000 (20:08 +0000)]
Document 'uidinfo' structure locks.
Inputs and ok bluhm@
guenther [Wed, 7 Dec 2022 19:26:39 +0000 (19:26 +0000)]
Add END()s to match ENTRY()s.
ok deraadt@
guenther [Wed, 7 Dec 2022 19:26:02 +0000 (19:26 +0000)]
Prefer numeric labels over L<digit> labels, as the latter clutter
the final kernel symbol table.
Add END()s to match ENTRY()s.
ok deraadt@
guenther [Wed, 7 Dec 2022 19:21:54 +0000 (19:21 +0000)]
Prefer STRONG_ALIAS() over multiple overlapping _ENTRY/_NENTRY
uses, as the latter requires manual handling of _PROF_PROLOGUE.
Add END()s to match ENTRY()s.
ok deraadt@
guenther [Wed, 7 Dec 2022 18:25:32 +0000 (18:25 +0000)]
Apply changes from commitid FWrfGfO9Ojnsh1mq to libkern.
From original commit message: To mitigate against spectre attacks,
AMD processors without the IBRS feature need an lfence instruction
after every near ret. See software techniques for managing speculation
on AMD processors revision 9.17.20 mitigation G-5.
ok deraadt@
kn [Wed, 7 Dec 2022 17:34:20 +0000 (17:34 +0000)]
Do not store unused ICMPv6 Option PREFIX_INFORMATION
Dead since 2017 sys/netinet6/nd6_rtr.c r1.163
Remove sending of router solicitations and processing of router
advertisements from the kernel. It's handled by slaacd(8) these days.
sysctl(2) net.inet6.icmp6.nd6_debug does not warn about it like it does
for, e.g., duplicate MTU options, so don't do anything with this option.
Remove access macros for other unused options while here.
Eventually, union nd_opts should be removed completely.
All under _KERNEL.
tcpdump(8)/rad(8)/slaacd(8) keep showing/sending/receiving this option when
running this diff on both router and client.
OK claudio
tb [Wed, 7 Dec 2022 17:17:29 +0000 (17:17 +0000)]
Fix example string
If you want to Base64-encode "Hello World\n" using a BIO, you had better
pass "Hello World\n" into it, not something slightly different... While
we're touching this, we might as well write it the way K&R did...
claudio [Wed, 7 Dec 2022 14:38:29 +0000 (14:38 +0000)]
Fix comment by splitting sentance in two. From kn@
dtucker [Wed, 7 Dec 2022 11:45:43 +0000 (11:45 +0000)]
Fix comment typo.
nicm [Wed, 7 Dec 2022 09:44:44 +0000 (09:44 +0000)]
Process escape sequences in show-buffer, GitHub issue 3401.
deraadt [Wed, 7 Dec 2022 01:02:28 +0000 (01:02 +0000)]
If the called of ypconnect(2) is root, the socket should acquire a
reserved port to received secure-maps from the ypserver.
issue found by niklas, using a simpler diff i proposed
ok miod
kettenis [Tue, 6 Dec 2022 23:18:54 +0000 (23:18 +0000)]
Add support for additional RTKit endpoint advertised by NVMe firmware that
comes with newer macOS releases.
ok patrick@
tb [Tue, 6 Dec 2022 22:22:42 +0000 (22:22 +0000)]
Zap extra space
mvs [Tue, 6 Dec 2022 22:19:39 +0000 (22:19 +0000)]
Add missing kernel lock around (*if_ioctl)() call within
in{,6}_addmulti(). Since kernel lock is no more taken while following
setsockopt() path, it should be taken in this place. Corresponding
in{,6}_delmulti() already acquire kernel lock around (*if_ioctl)().
Problem reported and diff tested by weerd@
ok kn@ bluhm@
schwarze [Tue, 6 Dec 2022 21:13:01 +0000 (21:13 +0000)]
Major rewrite for accuracy and clarity, and document BIO_set_next(3).
Feedback and OK tb@.
guenther [Tue, 6 Dec 2022 18:50:59 +0000 (18:50 +0000)]
_C_LABEL() and _ASM_LABEL() are no longer useful in the "everything
is ELF" world. Eliminate use of them in m88k code.
ok aoyama@
tb [Tue, 6 Dec 2022 18:23:29 +0000 (18:23 +0000)]
Add a few missing headers and drop a few unused ones
In bn_test.c include bn_local.h instead of using copy-pasted prototypes.
schwarze [Tue, 6 Dec 2022 17:59:21 +0000 (17:59 +0000)]
Make sure BIO_push(3) always preserves all invariants of the prev_bio
and next_bio fields of all BIO objects in all affected chains, no
matter what the arguments are.
In particular, if the second argument (the one to be appended) is
not at the beginning of its chain, properly detach the beginning
of its chain before appending.
We have weak indications that this bug might affect real-world code.
For example, in FreeRDP, file libfreerdp/crypto/tls.c, function
bio_rdp_tls_ctrl(), case BIO_C_SET_SSL, BIO_push(3) is definitely
called with a second argument that is *not* at the beginning of its
chain. Admittedly, that code is hard to fathom, but it does appear
to result in a bogus prev_bio pointer without this patch.
The practical impact of this bug in this and other software remains
unknown; the consequences might possibly escalate up to use-after-free
issues if BIO_pop(3) is afterwards called on corrupted BIO objects.
OK tb@
claudio [Tue, 6 Dec 2022 17:38:41 +0000 (17:38 +0000)]
OpenMetrics is rather strict about naming metricsets.
Add a function that a) verifies that none of the special suffixes is used
and b) that the name itself is not yet used already.
Also when printing a counter _total has to be added to the metric name and
for info metrics _info is added.
With and OK tb@
patrick [Tue, 6 Dec 2022 17:33:27 +0000 (17:33 +0000)]
Install arm64-qcom-dtb upon encountering a qcgpio(4) device.
ok phessler@ sthen@ tobhe@
sthen [Tue, 6 Dec 2022 16:18:51 +0000 (16:18 +0000)]
list hatch-vcs for MODPY_PYBUILD
schwarze [Tue, 6 Dec 2022 16:10:55 +0000 (16:10 +0000)]
Improve the poorly designed BIO_set_next(3) API to always preserve all
invariants of the prev_bio and next_bio fields of all BIO objects
in all involved chains, no matter which arguments this function is
called with.
Both real-world uses of this function (in libssl and freerdp) have
been audited to make sure this makes nothing worse. We believe libssl
behaves correctly before and after the patch (mostly because the second
argument is NULL there), and we believe the code in freerdp behaves
incorrectly before and after the patch, leaving a prev_bio pointer in
place that is becoming bogus, only in a different object before and
after the patch. But after the patch, that bogus pointer is due to a
separate bug in BIO_push(3), which we are planning to fix afterwards.
Joint work with and OK tb@.
kettenis [Tue, 6 Dec 2022 16:07:14 +0000 (16:07 +0000)]
Implement support for shared interrupts.
ok patrick@
kettenis [Tue, 6 Dec 2022 16:06:32 +0000 (16:06 +0000)]
For write operations, wait until the transaction completes just like we
do after sending the command for a read operation. Fixes issues with doing
multiple operations back-to-back.
ok patrick@
claudio [Tue, 6 Dec 2022 11:27:58 +0000 (11:27 +0000)]
Implement ometric_set_timeval() and ometric_set_timeval_with_labels()
Timestamps are special since they can require more significant bits
than a double provides. Instead print them as pseudo float as suggested
by the OpenMetrics draft.
OK cheloha@
anton [Tue, 6 Dec 2022 09:37:20 +0000 (09:37 +0000)]
Correct previous, must exit 0 to signal failure.
tobhe [Tue, 6 Dec 2022 09:07:33 +0000 (09:07 +0000)]
Print size_t with %zu.
ok patrick@
jsg [Tue, 6 Dec 2022 02:12:05 +0000 (02:12 +0000)]
arithmethic -> arithmetic
cheloha [Tue, 6 Dec 2022 01:56:43 +0000 (01:56 +0000)]
i386: switch to clockintr
In lapic timer mode:
- Rip out lapic_delay(). We can't use the lapic timer to delay(9) when
it's running in one-shot mode.
- Add a randomized statclock(), stathz = hz.
- Add profiling support, profhz = stathz * 10.
- Wire up lapic_intrclock.
In i8254-mode:
- i8254's clockintr() does not have a monopoly on hardclock(9).
- mc146818's rtcintr() does not have a monopoly on statclock().
- In profiling mode, the statclock() will drift very slightly
because (profhz = 1024) does not divide into 1 billion. Need to
consider how best to fix this.
ACPI suspend/resume tested by mlarkin@ via ESXi. Tons of testing by
Scott Bennett on a Pentium 4 machine; APM suspend/resume confirmed to
work there, too.
Link: https://marc.info/?l=openbsd-tech&m=166776370803446&w=2
ok mlarkin@
cheloha [Tue, 6 Dec 2022 01:19:35 +0000 (01:19 +0000)]
sh, landisk: switch to clockintr
Patch review and testing by miod@.
Link: https://marc.info/?l=openbsd-tech&m=166776412003652&w=2
ok mlarkin@, probably ok miod@
cheloha [Tue, 6 Dec 2022 00:56:52 +0000 (00:56 +0000)]
m88k, luna88k: switch to clockintr
- Initialize tick_nsec during cpu_initclocks()
We have no control over the interrupt clock on luna88k, so this switch
is trivial.
Bringup help and testing from aoyama@ and miod@.
Link: https://marc.info/?l=openbsd-tech&m=166776371203450&w=2
ok aoyama@ mlarkin@
cheloha [Tue, 6 Dec 2022 00:40:09 +0000 (00:40 +0000)]
hppa: switch to clockintr
- Remove hppa-specific clock interrupt scheduling bits from cpu_info.
- Rename cpu_hardclock() to itmr_intr(); it doesn't exclusively run
hardclock(9) anymore.
- Wire up itmr_intrclock.
hppa now has a randomized statclock(), stathz = hz.
Patch help, testing, and review from kettenis@ (B2000) and miod@ (C3650).
MP testing from guenther@ (dual-core J6700).
ok mlarkin@ kettenis@, "Ship it?" guenther@
jca [Tue, 6 Dec 2022 00:11:23 +0000 (00:11 +0000)]
Print SBI vendor, version and implemented spec version
On my Unmatched:
SBI: OpenSBI v0.9, SBI Specification Version 0.2
ok mlarkin@
jca [Tue, 6 Dec 2022 00:08:38 +0000 (00:08 +0000)]
Drop unused WEAK_REFERENCE macro
Probably coming from FreeBSD. We already have WEAK_ALIAS a few lines
above. ok mlarkin@ guenther@
deraadt [Mon, 5 Dec 2022 23:18:37 +0000 (23:18 +0000)]
zap a pile of dangling tabs
jmc [Mon, 5 Dec 2022 23:14:03 +0000 (23:14 +0000)]
make all lists non -compact, to keep spacing consistent;
from brad
ok jca
while here knock out the resulting unnecessary Pp and wrap some
long lines
claudio [Mon, 5 Dec 2022 21:02:52 +0000 (21:02 +0000)]
Prep for rpki-client 8.2
afresh1 [Mon, 5 Dec 2022 20:12:00 +0000 (20:12 +0000)]
Add support configuring hostname.if(5) by lladdr
Original implementation by martijn@
Feedback and suggestions from kn@, sthen@, claudio@, florian@, and deraadt@.
ok deraadt
tb [Mon, 5 Dec 2022 14:43:06 +0000 (14:43 +0000)]
Unbreak rust-openssl-tests on sparc64
For the test compilation using the CC crate, base clang is good enough,
so we don't need to pull in another heavy dependency just for this test.
claudio [Mon, 5 Dec 2022 11:50:11 +0000 (11:50 +0000)]
Revert and adjust the changes in ometric_set_state() from last commit.
Calling ometric_set_int_with_labels() for a state metric fails because
there is a check in ometric_set_int comparing the type.
Use olabels_add_extras() and ometric_set_int_value() instead.
visa [Mon, 5 Dec 2022 08:59:28 +0000 (08:59 +0000)]
Use evcount_percpu() with mips64 clock and ipi interrupt counters.
OK jca@ cheloha@
visa [Mon, 5 Dec 2022 08:58:49 +0000 (08:58 +0000)]
Avoid event counter re-insert in evcount_percpu()
This fixes evcount_list corruption that happened when evcount_percpu()
was called after evcount_init_percpu().
OK jca@ cheloha@ jmatthew@
kettenis [Mon, 5 Dec 2022 07:49:07 +0000 (07:49 +0000)]
Add linker script for hppa. The crucial bit is that hppa needs an extra
segment for .plt/.got which needs to be placed correctly.
ok deraadt@
kettenis [Mon, 5 Dec 2022 07:40:21 +0000 (07:40 +0000)]
Add support for the Backlight connector property like we already have for
inteldrm(4). This makes xbacklight(1) work when using the Xorg modesetting
driver. The Xorg amdgpu driver needs a small change for this that should
land soon.
ok jsg@
kettenis [Mon, 5 Dec 2022 07:37:57 +0000 (07:37 +0000)]
Trigger a kevent when we change the backlight. This gives the Xorg
drivers a chance to notice the update of the Backlight connector property
when we change it behind its back.
ok jsg@
kettenis [Mon, 5 Dec 2022 07:30:51 +0000 (07:30 +0000)]
Calculate the bit clock based on number of channels, bytes/sample and
sample rate instead of relying on the "mclk-fs" property. This property
is no longer present in upstream device trees.
ok ratchov@
anton [Mon, 5 Dec 2022 06:30:25 +0000 (06:30 +0000)]
Treat all possible mprotect() failures as fatal.
tb [Mon, 5 Dec 2022 00:24:44 +0000 (00:24 +0000)]
bn_mod_exp.c doesn't need <string.h>
cheloha [Sun, 4 Dec 2022 23:50:45 +0000 (23:50 +0000)]
userspace: remove vestigial '?' cases from top-level getopt(3) loops
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument. We can
handle this case with the "default" failure case with no loss of
legibility. Hence, remove all the redundant "case '?':" lines.
Prompted by dlg@. With help from dlg@ and millert@.
Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2
ok naddy@ millert@ dlg@
tb [Sun, 4 Dec 2022 19:31:13 +0000 (19:31 +0000)]
zap weird spaces $EDITOR added in previous
anton [Sun, 4 Dec 2022 19:04:38 +0000 (19:04 +0000)]
Print skipped while running on anything other than i386.
cheloha [Sun, 4 Dec 2022 18:01:57 +0000 (18:01 +0000)]
systat(1): vmstat: measure elapsed time with clock_gettime(2) instead of ticks
The vmstat view in systat(1) should not use statclock() ticks to count
elapsed time. First, ticks are low resolution. Second, the statclock
is sometimes randomized, so each tick is not necessarily of equal
length. Third, we're counting ticks from every CPU on the system, so
every rate in the view is divided by the number of CPUs. For example,
on an amd64 system with 8 CPUs you currently see:
200 clock
... when the true clock interrupt rate on that system is 1600.
Instead, measure elapsed time with clock_gettime(2). Use CLOCK_UPTIME
here so we exclude time when the system is suspended. With this
change we no longer need "stathz" or "hertz". We can also get rid of
the anachronistic secondary clock failure test.
Prompted by dlg@ and jmatthew@. deraadt@ says this has been in snaps
since 2022-11-21; no complaints.
Link: https://marc.info/?l=openbsd-tech&m=166898960831136&w=2
ok dlg@ deraadt@
visa [Sun, 4 Dec 2022 15:55:26 +0000 (15:55 +0000)]
ld.so: Disable DT_MIPS_RLD_MAP_REL
The linker produces incorrect values for DT_MIPS_RLD_MAP_REL tags.
Disable the handling of the tag in the dynamic loader. The linker
will be fixed in a later commit when snapshots have the updated ld.so.
Discussed with and OK kettenis@ deraadt@
deraadt [Sun, 4 Dec 2022 15:42:07 +0000 (15:42 +0000)]
The next step for mimmutable(). ld.so figures out what regions of memory
of startup shared library mappings can be made immutable, and also does
this for dlope() RTLD_NODELETE and subsidiary libraries. Complexity in this
diff is due to the GNU_RELRO and OPENBSD_MUTABLE sections.
Tested in snaps for about 3 weeks, with some bootstrap related pain felt in ports
ok kettenis, much help from others.
tobhe [Sun, 4 Dec 2022 11:54:31 +0000 (11:54 +0000)]
Rename sun to s_un for portability.
ok patrick@
dtucker [Sun, 4 Dec 2022 11:03:11 +0000 (11:03 +0000)]
Remove duplicate includes. Patch from AtariDreams via github PR#364.
tb [Sun, 4 Dec 2022 08:22:13 +0000 (08:22 +0000)]
Fix warnings about binding changed to STB_WEAK on i386
Compiling libc on i386 results in compiler warnings for bcmp, bzero, bcopy,
brk, and sbrk. Use ENTRY_NB instead of ENTRY to avoid this.
ok jca millert
jsg [Sun, 4 Dec 2022 03:14:20 +0000 (03:14 +0000)]
regen
jsg [Sun, 4 Dec 2022 03:13:52 +0000 (03:13 +0000)]
add Intel DG1, DG2, ATS-M ids
from linux 6.1 i915_pciids.h, Mesa 22.3 iris_pci_ids.h
Intel Iris Xe MAX Graphics Open Source Programmer's Reference Manual
Volume 4: Configurations
tobhe [Sun, 4 Dec 2022 00:23:03 +0000 (00:23 +0000)]
Include endian.h for htobe32
tobhe [Sat, 3 Dec 2022 22:34:35 +0000 (22:34 +0000)]
Consistently use uintXX_t from <stdint.h> instead of u_intXX_t.
tobhe [Sat, 3 Dec 2022 21:02:27 +0000 (21:02 +0000)]
Include endian.h where needed for betohXX functions.
jca [Sat, 3 Dec 2022 15:03:49 +0000 (15:03 +0000)]
Use evcount_percpu(9) for clock interrupts
ok cheloha@
jca [Sat, 3 Dec 2022 15:02:30 +0000 (15:02 +0000)]
Add ENTRY_NB() and use it for brk.S and sbrk.S on riscv64
NB for "No Binding". This gets us rid of clang-13 warnings about
a global symbol redefined as weak. Mostly a copy of what guenther@
already implemented on other archs. ok guenther@ tb@
kettenis [Sat, 3 Dec 2022 13:42:23 +0000 (13:42 +0000)]
Rework the RTKit code such that we don't spin forever if for some reason
we don't get the expected replies from the firmware on the other side.
ok patrick@
kettenis [Sat, 3 Dec 2022 13:31:32 +0000 (13:31 +0000)]
The device tree bindings for aplcpu(4) changed once more, recycling the
"apple,cluster-cpufreq" compatible that was used for the first version.
Add support for the "new new" binding while retaining support for the
"old new" binding. Hopefully nobody is using the "old" binding anymore
now that we update the m1n1+u-boot+dtb "boot firmware" automatically on
sysupgrade.
ok patrick@, tobhe@
tb [Sat, 3 Dec 2022 11:35:34 +0000 (11:35 +0000)]
skip rust-openssl-tests on sparc64
The issue is likely that the build is trying to compile some generated
C code with the prehistoric gcc from base, so add a tentative workaround
for that. Since I don't currently have access to a sparc64 box where I
could validate this easily and check if the workaround is enough, let's
not waste lots of cycles on this.
yasuoka [Sat, 3 Dec 2022 10:57:04 +0000 (10:57 +0000)]
Modify vmt to use the buffer allocated in pvbus directly instead of
the buffer in the vmt softc when doing RPC for PVBUSIOC_KV{READ|WRITE}
ioctl.
ok asou
tb [Sat, 3 Dec 2022 09:59:19 +0000 (09:59 +0000)]
Clean up makefile
tb [Sat, 3 Dec 2022 09:55:53 +0000 (09:55 +0000)]
biotest needs bio_local.h now
Should have been part of the previous commit
tb [Sat, 3 Dec 2022 09:53:47 +0000 (09:53 +0000)]
Test BIO_{push,pop}() along a linear chain
tb [Sat, 3 Dec 2022 09:44:52 +0000 (09:44 +0000)]
More cleanup
Drop unnecessary loading of error strings, fix error path and consistently
print to stdout.
tb [Sat, 3 Dec 2022 09:37:02 +0000 (09:37 +0000)]
Refactor and fix bn_mod_exp test
The amount of copy-paste in this test led to a few bugs and it was hard to
spot them since things were done in random order. Use a different approach:
compute the result of a^b (mod m) according to BN_mod_exp_simple(), then
compare the results of all the other *_mod_exp* functions to that.
Reuse the test structure from bn_mod_exp_zero.c to loop over the list of
functions. This way we test more functions and don't forget to check some
crucial bits.
tb [Sat, 3 Dec 2022 08:21:38 +0000 (08:21 +0000)]
Add missing checks for BN_mod_exp_{non,}ct()
Someone added a few more functions to test, but forgot to check their
results, so if they would not do the expected thing that would only be
noticed if one of the already tested functions would break.
tb [Sat, 3 Dec 2022 08:05:52 +0000 (08:05 +0000)]
Fix some ancient silliness with a random byte
For nearly 25 years this test has attempted to generate random numbers of
bit length between 192 and 319 bits. Unfortunately, it used an unsigned
char so instead of generating numbers in the interval [-64..63] and add
them to 256, it used numbers in the intervals [0..63] and [192..255]...
jsg [Sat, 3 Dec 2022 03:05:13 +0000 (03:05 +0000)]
regen
jsg [Sat, 3 Dec 2022 03:04:36 +0000 (03:04 +0000)]
add AMD family 19h model 61h (Raphael) ids
initial diff from Laurence Tratt; ok mlarkin@
jsg [Sat, 3 Dec 2022 01:18:03 +0000 (01:18 +0000)]
drm/i915: fix TLB invalidation for Gen12 video and compute engines
From Andrzej Hajda
ee2d04f23bbb16208045c3de545c6127aaa1ed0e in linux 5.15.y/5.15.81
04aa64375f48a5d430b5550d9271f8428883e550 in mainline linux
tb [Fri, 2 Dec 2022 22:58:56 +0000 (22:58 +0000)]
Drop 'perhaps a little', plus grammar and spelling nits
BIO_push() and BIO_pop() are misnamed. No need to gently and politely
suggest that their 'names [...] are perhaps a little misleading'.
cheloha [Fri, 2 Dec 2022 22:36:34 +0000 (22:36 +0000)]
midicat(1): use err(3) everywhere
This is consistent with style(9) and makes the program shorter, too.
Tweaked by ratchov@.
Link: https://marc.info/?l=openbsd-tech&m=166982129428027&w=2
ok millert@ kn@ ratchov@
cheloha [Fri, 2 Dec 2022 22:29:59 +0000 (22:29 +0000)]
midicat(1): set ifile/ofile to "stdin"/"stdout" if it is an en-dash ("-")
This makes error messages a little bit more intuitive. Instead of, e.g.:
midicat: -: No space left on device
you get:
midicat: stdout: No space left on device
Link: https://marc.info/?l=openbsd-tech&m=166982129428027&w=2
ok millert@ kn@ ratchov@
cheloha [Fri, 2 Dec 2022 22:21:35 +0000 (22:21 +0000)]
midicat(1): add a usage() function
Tweaked by millert@.
Link: https://marc.info/?l=openbsd-tech&m=166982129428027&w=2
ok millert@ kn@ ratchov@
tb [Fri, 2 Dec 2022 19:44:04 +0000 (19:44 +0000)]
Revert bio_prev removal
As schwarze points out, you can pop any BIO in a chain, not just the first
one (bonus points for a great name for this API).
The internal doubly linked was used to fix up the BIO chain bio was part
of when you BIO_pop() a bio that wasn't in the first position, which is
explicitly allowed in our documentation and implied by OpenSSL's.
tb [Fri, 2 Dec 2022 18:31:40 +0000 (18:31 +0000)]
bn_mod_exp.c: printing to stdout needs no BIO
tb [Fri, 2 Dec 2022 18:24:01 +0000 (18:24 +0000)]
bn_mod_exp: we have a BN_CTX available...
Use BN_CTX_get() instead of BN_new()/BN_free().
tb [Fri, 2 Dec 2022 17:42:45 +0000 (17:42 +0000)]
Check BN_rand() and BN_mod() return values
CID 430848
CID 430849
tb [Fri, 2 Dec 2022 17:34:26 +0000 (17:34 +0000)]
Link new bn_mod_exp_zero test to build
tb [Fri, 2 Dec 2022 17:33:38 +0000 (17:33 +0000)]
Rewrite the tests that various modular exponentiation functions
compute a^0 = 0 (mod 1) for all a from scratch.
kn [Fri, 2 Dec 2022 15:35:35 +0000 (15:35 +0000)]
Remove constant basereachable and retrans members from struct nd_ifinfo
Both are initalised with compile-time constants and never written to.
They are part of the Neighbour Discovery machinery and only surface
through the single-user SIOCGIFINFO_IN6:
$ ndp -i lo0
basereachable=30s0ms, reachable=39s, retrans=1s0ms
These values are read-only since 2017
sys/netinet6/nd6.c r1.217
usr.sbin/ndp/ndp.c r1.85
Remove knob and always do neighbor unreachable detection
Inline the macros (to keep meaningful names), shrink the per-interface
allocated struct nd_ifinfo to what is actually needed and inline
nd6_dad_starttimer()'s constant `msec' argument.
Nothing else in base, incl. regress, uses SIOCGIFINFO_IN6 or `ndp -i'.
OK bluhm
kn [Fri, 2 Dec 2022 12:58:37 +0000 (12:58 +0000)]
Remove useless variable, simplify code
Using a local `duplicate' variable to defer the actual checks by a few
lines, interleaved with comments (saying the same thing but negated),
is harder to follow that neccessary.
Fold the logic and merge comments (remove the last obvious one missing
a negation) to save 20 LOC.
OK bluhm
kn [Fri, 2 Dec 2022 12:56:51 +0000 (12:56 +0000)]
Unlock in6_ioctl_get() aka. SIOCGIF{DSTADDR,NETMASK,AFLAG,ALIFETIME}_IN6
First the right address is picked from the net lock protected if_addrlist.
Then all ioctls just copy out the address, nothing requires the kernel lock.
SIOCGIFDSTADDR_IN6 checks the net lock protected if_flags,
SIOCGIFALIFETIME_IN6 computes lifetimes which only need the address.
This removes the last kernel lock from IPv6 read ioctls (multicast being
the untouched exception here).
Users of these ioctl(2)s are route6d(8), rad(8), slaacd(8), isakmpd(8) and
of course ifconfig(8).
OK mvs
sthen [Fri, 2 Dec 2022 12:51:22 +0000 (12:51 +0000)]
sync
jca [Fri, 2 Dec 2022 12:27:08 +0000 (12:27 +0000)]
Drop _C_LABEL() uses in riscv64-specific code
_C_LABEL() was useful in the a.out->ELF transition days, way before
RISC-V was a thing.
Also drop uses of _ASM_LABEL() while here, suggested by guenther@
ok guenther@
martijn [Fri, 2 Dec 2022 10:57:12 +0000 (10:57 +0000)]
When checking if we're implied we must also check if we're working on a
string or an oid, else we can generate invalid OIDs.
Found by bluhm@ on powerpc64
OK bluhm@
tb [Fri, 2 Dec 2022 08:30:54 +0000 (08:30 +0000)]
libcrypto/bn: switch back to manual regress targets
The previous change had the undesired side effect of running the super
verbose run-regress-bn_test.
jsg [Fri, 2 Dec 2022 07:30:53 +0000 (07:30 +0000)]
regen
jsg [Fri, 2 Dec 2022 07:29:30 +0000 (07:29 +0000)]
add Intel Optane SSD DC P5800X
from Andreas Bartelt
djm [Fri, 2 Dec 2022 04:40:27 +0000 (04:40 +0000)]
make struct sshbuf private and remove an unused field; ok dtucker