summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-07-12Add hw.ncpuonline to count the number of online CPUs.cheloha
The introduction of hw.smt means that logical CPUs can be disabled after boot and prior to suspend/resume. If hw.smt=0 (the default), there needs to be a way to count the number of hardware threads available on the system at any given time. So, import HW_NCPUONLINE/hw.ncpuonline from NetBSD and document it. hw.ncpu becomes equal to the number of CPUs given to sched_init_cpu() during boot, while hw.ncpuonline is equal to the number of CPUs available to the scheduler in the cpuset "sched_all_cpus". Set_SC_NPROCESSORS_ONLN equal to this new sysctl and keep _SC_NPROCESSORS_CONF equal to hw.ncpu. This is preferable to adding a new sysctl to count the number of configured CPUs and keeping hw.ncpu equal to the number of online CPUs because such a change would break software in the ecosystem that relies on HW_NCPU/hw.ncpu to measure CPU usage and the like. Such software in base includes top(1), systat(1), and snmpd(8), and perhaps others. We don't need additional locking to count the cardinality of a cpuset in this case because the only interfaces that can modify said cardinality are sysctl(2) and ioctl(2), both of which are under the KERNEL_LOCK. Software using HW_NCPU/hw.ncpu to determine optimal parallism will need to be updated to use HW_NCPUONLINE/hw.ncpuonline. Until then, such software may perform suboptimally. However, most changes will be similar to the change included here for libcxx's std::thread:hardware_concurrency(): using HW_NCPUONLINE in lieu of HW_NCPU should be sufficient for determining optimal parallelism for most software if the change to _SC_NPROCESSORS_ONLN is insufficient. Prompted by deraadt. Discussed at length with kettenis, deraadt, and sthen. Lots of patch tweaks from kettenis. ok kettenis, "proceed" deraadt
2018-07-11Sync commentkn
Makes it a tad easier to read through and compare with BN_swap_ct(). OK tb
2018-07-11Drop a const-bomb on regexec. It's probably not a good idea to remove aMartijn van Duren
const promise when processing it in the regex engine. Minor tweak and OK schwarze@
2018-07-11Document behavior change of EC_POINTs_mul(3) from EC constant time changes.Theo Buehler
ok beck on earlier version, markup help from Schwarze.
2018-07-11Turn yesterday's optimistic ! in an XXX comment into a more cautious ?Theo Buehler
2018-07-10Indent labels by a space so they don't obliterate function names in diffs.Theo Buehler
2018-07-10ECC constant time scalar multiplication support. First step in overhaulingTheo Buehler
the EC module. From Billy Brumley and his team, via https://github.com/libressl-portable/openbsd/pull/94 With tweaks from jsing and me. ok jsing
2018-07-10Provide BN_swap_ct(), a constant time function that conditionally swapsTheo Buehler
two bignums. It's saner and substantially less ugly than the existing public BN_constantime_swap() function and will be used in forthcoming work on constant time ECC code. From Billy Brumley and his team. Thanks! ok jsing
2018-07-10Factor out a bit of ugly code that truncates the digest to the order_bitsTheo Buehler
leftmost bits of a longer digest, according to FIPS 183-6, 6.4. Eliminate a microoptimization that only converts the relevant part of the digest to a bignum. ok beck, jsing
2018-07-10In asm.h ensure NENTRY uses the old-school nop-sled align, but change standardTheo de Raadt
ENTRY is a trapsled. Fix a few functions which fall-through into an ENTRY macro. amd64 binaries now are free of double+-nop sequences (except for one assember nit in aes-586.pl). Previous changes by guenther got us here. ok mortimer kettenis
2018-07-09Move a detail on tls_connect(3) to its documentation and be a bit moreTheo Buehler
explicit about the servername argument of tls_connect_servername(3). input & ok jsing, input & ok schwarze on earlier version
2018-07-09wording tweak for tls_init() from jsingTheo Buehler
ok jsing, schwarze
2018-07-09Delete the VM86 kernel option and i386_vm86(3) API: it's requiredPhilip Guenther
a custom kernel for over 20 years. testing mlarkin@ ok deraadt@ phessler@ jca@ matthieu@
2018-07-09sync with const changes in x509.h r1.68.Theo Buehler
2018-07-09sync with const changes in evp.h r1.64.Theo Buehler
2018-07-09sync with const changes in bio.h r1.44.Theo Buehler
2018-07-09sync with const changes in bio.h r1.45.Theo Buehler
2018-07-09Fix hid_usage_in_page(hid_parse_usage_in_page()) for the Buttons page.Martin Pieuchot
From David Bern.
2018-07-08import the relevant parts of a new ASN1_INTEGER_get(3) manual pageIngo Schwarze
from OpenSSL, fixing many bugs and polishing many details
2018-07-08Simplify and shorten the description of tls_init(3),Ingo Schwarze
fixing an awkward wording noticed by tb@. OK tb@
2018-07-08Add missing retguard checkmortimer
ok deraadt
2018-07-08mop up;Jason McIntyre
2018-07-08Add man page for fuse_destroy(3).helg
2018-07-08Create separate man pages for each library function.helg
2018-07-06Return EINVAL if pthread_barrier_init is called with count=0.Paul Irofti
OK kettenis@, guenther@
2018-07-05tweak previous;Jason McIntyre
2018-07-05fuse_set_signal_handlers(3) and fuse_remove_signal_handlers(3) shouldhelg
not replace any existing signal handlers. This makes it possible for FUSE file systems to install their own signal handlers. Bug reported by Bill Zissimopoulos. ok mpi@
2018-07-05Create new man page for fuse_set_signal_handlers(3) andhelg
fuse_remove_signal_handlers(3). ok mpi@
2018-07-03Remove residual debug statements.helg
2018-07-03Add retguard macros for libc.mortimer
ok deraadt
2018-07-03Add retguard macros to libm assembly.mortimer
ok deraadt
2018-06-28Do not cast (signed char) CANCELLED_BOOLEAN to (char) for comparisonTheo de Raadt
against (signed char) variable. Modern "genius" compilers simply delete the code on unsigned char architectures, amazed they feel lattitude to convert undefined local behaviour into much larger scope undefined behaviour (glad to have faster but incorrect libcurses..) ok millert
2018-06-25During open(2), release the fdp lock before calling vn_open(9).Visa Hankala
This lets other threads of the process modify the file descriptor table even if the vn_open(9) call blocks. The change has an effect on dup2(2) and dup3(2). If the new descriptor is the same as the one reserved by an unfinished open(2), the system call will fail with error EBUSY. The accept(2) system call already behaves like this. Issue pointed out by art@ via mpi@ Tested in a bulk build by ajacoutot@ OK mpi@
2018-06-22Save and restore the relevant FPU state on armv7.Mark Kettenis
ok deraadt@
2018-06-21sort SEE ALSO;Jason McIntyre
2018-06-21s/simultanious/simultaneous/Jason McIntyre
2018-06-21Document hw.smt.Mark Kettenis
2018-06-19use a full stop, as per the other items; from nan xiaoJason McIntyre
2018-06-19Changes the default mount behaviour so only the user that mounts thehelg
file system can access it unless the allow_other mount options is specified. The allow_other mount option makes the file system available to other users just like any other mounted file system. ok mpi@
2018-06-19Send the calling thread id, effective uid and gid, and umask to thehelg
FUSE file system. fuse_get_context(3) will now return the correct values. ok mpi@
2018-06-16Add add PIE support for m88k (requires gcc4 toolchain)Philip Guenther
Convert __cerror to hidden visibility. from miod@
2018-06-16Tiny tweak to the blinding comment.Theo Buehler
2018-06-15Basic cleanup. Handle the possibly NULL ctx_in in ecdsa_sign_setup() withTheo Buehler
the usual idiom. All the allocations are now handled inside conditionals as is usually done in this part of the tree. Turn a few comments into actual sentences and remove a few self-evident ones. Change outdated or cryptic comments into more helpful annotations. In ecdsa_do_verify(), start calculating only after properly truncating the message digest. More consistent variable names: prefer 'order_bits' and 'point' over 'i' and 'tmp_point'. ok jsing
2018-06-15Clean up some whitespace and polish a few comments. Reduces noise inTheo Buehler
an upcoming diff.
2018-06-14Use a blinding value when generating an ECDSA signature, in order toTheo Buehler
reduce the possibility of a side-channel attack leaking the private key. Suggested by Keegan Ryan at NCC Group. With input from and ok jsing
2018-06-14Use a blinding value when generating a DSA signature, in order to reduceJoel Sing
the possibility of a side-channel attack leaking the private key. Suggested by Keegan Ryan at NCC Group. With input from and ok tb@
2018-06-14Clarify the digest truncation comment in DSA signature generation.Joel Sing
Requested by and ok tb@
2018-06-14Pull up the code that converts the digest to a BIGNUM - this only needsJoel Sing
to occur once and not be repeated if the signature generation has to be repeated. ok tb@
2018-06-14Fix a potential leak/incorrect return value in DSA signature generation.Joel Sing
In the very unlikely case where we have to repeat the signature generation, the DSA_SIG return value has already been allocated. This will either result in a leak when we allocate again on the next iteration, or it will give a false success (with missing signature values) if any error occurs on the next iteration. ok tb@
2018-06-14Call DSA_SIG_new() instead of hand rolling the same.Joel Sing
ok beck@ tb@