summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-16syncTheo de Raadt
2021-12-15Fix the argument passed to garbage collector enforce thread forVitaliy Makkoveev
'unsopassgc' test. Also increase it's file descriptor limit.
2021-12-15document OBJ_new_nid(3), OBJ_add_object(3), and OBJ_create_objects(3);Ingo Schwarze
mark OBJ_create_and_add_object() as intentionally undocumented
2021-12-15Fix whitespace.Alexander Bluhm
2021-12-15Increase file descriptor limit for undgram_conclose test.Alexander Bluhm
ok mvs@
2021-12-15include unistd.h directly rather than pulling it in via zlib's zconf.hTheo Buehler
(needed for getdtablecount).
2021-12-15Fix compiler warning.Alexander Bluhm
ok mvs@
2021-12-15Move OBJ_create(3) into its own manual pageIngo Schwarze
because OBJ_nid2obj(3) is already long and more functions related to OBJ_create(3) have to be documented.
2021-12-15grep: Add missing unistd.h and limits.h includesTheo Buehler
Both binary.c and file.c currently pull in unistd.h via zlib's zconf.h. binary.c uses SEEK_SET and file.c a bunch of things like close(), isatty(), lseek(). In addition file.c needs limits.h for PATH_MAX. ok deraadt
2021-12-15more sys/signal.h before sys/proc.hAnton Lindqvist
2021-12-15Rename asn1_lib.c to asn1_old_lib.cJoel Sing
This will allow us to add a new asn1_lib.c while replacing the code that is in currently in asn1_old_lib.c. Discussed with tb@
2021-12-15Sync bytestring with libssl.Joel Sing
2021-12-15Consolidate various ASN.1 code.Joel Sing
Rather than having multiple files per type (with minimal code per file), use one file per type (a_<type>.c). No functional change. Discussed with tb@
2021-12-15Use CBS_get_last_u8() to find the content type in TLSv1.3 records.Joel Sing
ok tb@
2021-12-15unifdef -U CRYPTO_MDEBUG -m tasn_new.cJoel Sing
2021-12-15Add coverage for CBS additions.Joel Sing
2021-12-15Provide various CBS_peek_* functions.Joel Sing
These will be used in libcrypto. With input from and ok tb@
2021-12-15Provide CBS_get_u64().Joel Sing
This will be used in the libcrypto certificate transparency code. ok tb@
2021-12-15Provide CBS_get_last_u8().Joel Sing
This will be used in the TLSv1.3 record layer. From BoringSSL. ok tb@
2021-12-15structure pads can leak uninitialized memory to userland via copyout,Theo de Raadt
therefore the mandatory idiom is completely clearing structs before building them for copyout -- that means ALMOST ALL STRUCTS, because we never know when some architecture will pad a struct.. In two more cases, the clearing wasn't performed. from Reno Robert ZDI ok millert bluhm
2021-12-15spamd: convert to opaque HMAC_CTXTheo Buehler
ok jsing
2021-12-15Some more ASN.1 struct types that are postponed (because they areIngo Schwarze
related to templating macros) or intentionally undocumented. Apart from NETSCAPE, PCTX, and low-level templating stuff, all ASN.1 functions, types, and macros are now documented.
2021-12-15The PATH_MAX+1 bites. The PATH_MAX+1 bites. You die...Theo de Raadt
ok millert mlarkin
2021-12-15Syzkaller found a dereference in igmp_leavegroup() where inm->inm_rtiAlexander Bluhm
is NULL. It should be set in rti_fill(), but is not if malloc(9) fails. There is no rollback after malloc failure so the field stays uninitialized. The code is only called from ioctl, setsockopt or a task. Malloc should wait instead of failing, otherwise syscalls would be unreliable. While there also put an M_WAIT in the init code. During init malloc must not fail. OK mvs@ Reported-by: syzbot+e22326057ccf34908d78@syzkaller.appspotmail.com
2021-12-15Adjust pty and tty event filtersVisa Hankala
* Implement EVFILT_EXCEPT for ttys for HUP condition detection. This filter is used when pollfd.events has no read/write events. * Add HUP condition detection to filt_ptcwrite() and filt_ttywrite() to reflect ptcpoll() and ttpoll(). Only poll(2) and select(2) can utilize the code; kevent(2) should behave as before with EVFILT_WRITE. * Clear EV_EOF and __EV_HUP if the EOF/HUP condition ends. OK mpi@
2021-12-15Document i2c_ASN1_INTEGER(3).Ingo Schwarze
While it was probably a mistake that steve@ made some i2c_*() and c2i_*() functions public back in 2000 and while we would like to delete them from the API, it may not be possible to delete this particular function because in contrast to the others (which are already marked as intentionally undocumented), this one is used by various real-world software, so for now, explain what it does, just in case people find it in existing code. While here, use the familiar term "byte" that we generally use throughout all our manual pages, even though the ASN.1 standard uses the term "octet" instead, which is more precise only in theory.
2021-12-15Use a per-UVM object lock to serialize the lower part of the fault handler.Martin Pieuchot
Like the per-amap lock the `vmobjlock' is principally used to serialized access to objects in the fault handler to allow faults occurring on different CPUs and different objects to be processed in parallel. The fault handler now acquires the `vmobjlock' of a given UVM object as soon as it finds one. For now a write-lock is always acquired even if some operations could use a read-lock. Every pager, corresponding to a different kind of UVM object, now expect the UVM object to be locked and some operations, like *_get() return it unlocked. This is enforced by assertions checking for rw_write_held(). The KERNEL_LOCK() is now pushed to the VFS boundary in the vnode pager. To ensure the correct amap or object lock is held when modifying a page many uvm_page* operations are now asserting for the "owner" lock. However, fields of the "struct vm_page" are still being protected by the global `pageqlock'. To prevent lock ordering issues with the new `vmobjlock' and to reduce differences with NetBSD this lock is now taken and released for each page instead of around the whole loop. This commit does not remove the KERNEL_LOCK/UNLOCK() dance. Unlocking will follow if there is no fallout. Ported from NetBSD, tested by many, thanks! ok kettenis@, kn@
2021-12-15ldapd always uses O_CREAT when reopening database files, so the databaseJonathan Matthew
directory must be unveiled with "rwc" rather than just "rw". ok deraadt@ mestre@
2021-12-15restrict filesystem access with unveil(2).Ricardo Mestre
this one opens the default table file "/usr/share/misc/usb_hid_usages" through hid_start(3) from libusbhid, then `dev' (will be the fd used on the ioctls) and finally `conf' which is the file with the actions to be monitored. `conf' needs to be unveil(2)ed with read perms since usbhidaction(1) can run as daemon and this file will be re-read if a SIGHUP is catched. looks good deraadt@
2021-12-15restrict all filesystem access with unveil(2).Ricardo Mestre
hid_start(3) opens `table' through libusbhid, then usbhidctl(1) itself opens `dev', after that it's just performing ioctls on the fd left opened by the latter so all fs access can be disabled.
2021-12-15Bump pkg-config version to 1.8.1Alexandre Ratchov
2021-12-15getcwd() operates on buffers of PATH_MAX including the NUL, and the +1Theo de Raadt
is not unneccesary. Different buffer sizes are actually dangerous, though major problems are strangely rare. ok millert
2021-12-15PATH_MAX+1 rarely makes sense, and abort if this happens in the imsg.Theo de Raadt
ok jmatthew millert
2021-12-15typo in previousTheo de Raadt
2021-12-14Correct value for IPTOS_DSCP_LE since it needs to allow for the preceedingDarren Tucker
two ECN bits. From daisuke.higashi at gmail.com via OpenSSH bz#3373, ok claudio@, job@, djm@.
2021-12-14sys/param.h cleanup, mostly using MINIMUM() and <limits.h>Theo de Raadt
ok dtucker
2021-12-14syncTheo de Raadt
2021-12-14tweak for the generated sourceTheo Buehler
2021-12-14more symbols that are postponed or intentionally undocumented andIngo Schwarze
some regexp tweaks; the relevant parts of asn1.h are nearing completion
2021-12-14forgotten .Dv macros in -column listsIngo Schwarze
2021-12-14add roff(7) comments listing some M_ASN1_* aliasesIngo Schwarze
that are intentionally undocumented
2021-12-14delete incorrect comment about sys/cdefs.hTheo de Raadt
2021-12-14To cache lookups, the policy ipo is linked to its SA tdb. ThereAlexander Bluhm
is also a list of SAs that belong to a policy. To make it MP safe, protect these pointers with a mutex. tested by Hrvoje Popovski; OK mvs@
2021-12-14Consolidate ASN.1 universal tag type data.Joel Sing
There are currently three different tables in three different files that contain information about ASN.1 universal class tag types. Range checking is also implemented in three different places (with different implementations). Consolidate all of this into a single table, provide a lookup function that deals with the range checks and wrappers to deal with specific types. ok inoguchi@ tb@
2021-12-14Add regress coverage for ASN1_get_object()Joel Sing
2021-12-14Add regress for ASN1_tag2bit() and ASN1_tag2str()Joel Sing
2021-12-14Add new 'unsopassgc' test. This test tries to beak unix(4) sockets garbageVitaliy Makkoveev
collector and make it to clean `so_rcv' buffer of alive socket. Successful breakage should produce kernel panic. ok bluhm@ mpi@
2021-12-14Move 'unixsock' test from regress/sys/kern/unixsock/ toVitaliy Makkoveev
regress/sys/kern/unixsockets/. ok claudio@
2021-12-14Remember to clear __EV_HUP when the other end of the FIFO has re-opened.Visa Hankala
2021-12-14document the very quirky behaviour of the SMIME_OLDMIME flagIngo Schwarze