summaryrefslogtreecommitdiffstats
path: root/sys/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spellingjsg2021-03-123-6/+6
|
* ansijsg2021-03-061-2/+1
|
* Use daddr_t and not daddr32_t in boot media.krw2020-12-091-2/+2
| | | | | | | | | | At a minimum, amd64/i386 should now boot from 4TB GPT formatted disks. More daddr32_t terminations with extreme prejudice to follow. Tested by various, in snaps for a few days. ok deraadt@
* Add retguard to macppc kernel locore.S, ofwreal.S, setjmp.Sgkoehler2020-11-282-7/+7
| | | | | | | | | This changes RETGUARD_SETUP(ffs) to RETGUARD_SETUP(ffs, %r11, %r12) and RETGUARD_CHECK(ffs) to RETGUARD_CHECK(ffs, %r11, %r12) to show that r11 and r12 are in use between setup and check, and to pick registers other than r11 and r12 in some kernel functions. ok mortimer@ deraadt@
* Retguared asm macros for powerpc libkerngkoehler2020-10-272-7/+12
| | | | | This was in the macppc snap, but I forgot to include it in my last commit "Retguard asm macros for powerpc libc, ld.so"
* Remove an unneeded variable.visa2020-10-261-3/+3
| | | | OK kettenis@
* Use the retguard macros from asm.h to protect the function.deraadt2020-10-161-1/+3
| | | | ok mortimer kettenis
* Add __multi3 from compiler_rt-8.xjca2020-08-131-0/+54
| | | | | Needed to build a sparc64 kernel with clang 10. ok kettenis@
* Move compiler_rt type definitions to a separate headerjca2020-08-132-32/+68
| | | | | so that we can reuse them in other compiler_rt routines. ok kettenis@
* add aliases for arm eabi long long shift functionsjsg2020-08-033-0/+12
| | | | | | | clang 10 on armv7 references these when building RAMDISK (-Oz) but not GENERIC (-O2). feedback and ok guenther@
* __main() is no longer used by any of our toolchainsderaadt2020-07-201-41/+0
| | | | | this fell out of a discussion with mortimer ok kettenis
* The kernel and bootblocks never reference this file...deraadt2020-07-181-41/+0
|
* Fix a warning false positive from clang 10.millert2020-07-091-2/+2
| | | | | | | blf_enc() takes a number of 64-bit blocks to encrypt, but using sizeof(uint64_t) in the calculation triggers a warning from clang 10 because the actual data type is uint32_t. Pass BCRYPT_WORDS / 2 for the number of blocks like libc bcrypt(3) does. OK kettenis@
* Provide an optimized implementation of ffs(3) in the kernel onnaddy2020-06-103-0/+47
| | | | | | | arm64/powerpc/powerpc64, making use of the count leading zeros instruction. powerpc testing by cwen@; ok kettenis@ deraadt@
* If we pass a packet length larger than 2^16, we should panic() insteadpatrick2020-05-191-5/+3
| | | | | | | | | | of returning -1. With a return type of u_int16_t, -1 is not different to a valid checksum. For incoming packets, the header lengths don't exceed that size anyway, but for outgoing packets it's better to see if our bootloader crafts a broken one. Discussed with gerhard@ ok deraadt@ procter@
* Sync in_cksum.c to the same version ospfd has. This fixes problemspatrick2020-05-182-30/+29
| | | | | | | | | | with odd packet lengths, which can happen when using TFTP to load a file with an odd length. ospfd actually took dvmrpd's version in 2006 to fix the same issue, and both daemons implementations are the same. For the bootloader we keep the consts from the previous version and replace the fatal with a print and return. ok deraadt@
* Add __lshrti3 to libkern and use it on sparc64jca2020-04-021-0/+71
| | | | | With this it's possible to build the kernel using clang. Discussed with claudio@, ok deraadt@
* Next step in prepping for ffs2 installs: introduce a new install script varotto2020-02-291-0/+1
| | | | MDFSOPT and add a missing prototype.
* Remove non-__STDC__ assert macros from <lib/libkern/libkern.h>.visa2020-02-261-22/+1
| | | | | | | | The macros are defined in a part of the header where a C compiler is required. In addition, the macros expand to C code, so it looks unnecessary to define the asserts with traditional cpp in mind. OK cheloha@, mpi@
* Add an element to the marks array to store the virtual address of thekettenis2019-11-292-3/+5
| | | | | | entry point. ok mlarkin@, deraadt@
* Implement a hexdump command in the boot loader. This helps tobluhm2019-11-282-1/+54
| | | | | | inspect the memory layout that the firmware has created. It is especially useful for UEFI debugging. OK deraadt@ kettenis@
* Give some END()s to assembly symbols.mpi2019-11-054-4/+8
| | | | ok kettenis@, jca@
* Reduce BOOTRANDOM_MAX to 256. naddy pointed out there's no point havingderaadt2019-11-011-2/+2
| | | | | it larger than RC4STATE. A long discussion ensued. In conclusion all entropy inputs are either satisfactory enough, or just as shitty at 512.
* Use arc4 to bit-spread the 512-byte random buffer over the .openbsd.randomdataderaadt2019-10-291-9/+8
| | | | | | | | | section, which has grown a fair bit with the introduction of retguard. Mortimer discovered the repeated 512-byte sequence as retguard keys, and this resolves the issue. (Chacha does not fit on the media, so 1.5K early drop RC4 is hopefully sufficient in our KARL link universe) Version crank the bootblocks. sysupgrade -s will install new bootblocks. ok djm mortimer
* add arc4 cipher to the bootblocksderaadt2019-10-292-0/+118
| | | | ok djm mortimer
* In the bootblocks, after discovering and opening /bsd.upgrade, fchmod -xderaadt2019-08-036-6/+176
| | | | | | | | | | | | | | | | so the file cannot be re-executed upon the next boot. This provides a stronger one-shot-upgrade model than the upgrade script's rm /bsd.upgrade. Now various forms of upgrade failure will reboot into /bsd, which is probably more recoverable. Performing fchmod -x depends on (1) use of MI boot.c (not alpha/macppc/sparc64/sgi/octeon) and (2) "can write blocks" functionality in the IO layer. Most architectures have this support now. Two diagnostics "fchmod a-x %s: failed" and "/bsd.upgrade is not u+x" will remain in the tree while refinements happen for some of the laggard architectures. based upon a discussion florian tested in snapshots for more than a week without any complaints
* Fix warnings when building zlib with ZLIB_CONST definedjca2019-06-013-8/+8
| | | | | Probably not very useful (given the lack of feedback) but feels more correct. Kernel part tested with option ZLIB_CONST.
* Add ZLIB_CONSTjca2019-05-122-6/+13
| | | | Introduced in zlib-1.2.5.2, used by a few ports. ok deraadt@
* we have never built without %b supportderaadt2019-05-112-7/+2
|
* Add movstrSI12_i4 for linking -Os/-Oz kernels. Sadly however itderaadt2019-04-251-0/+19
| | | | fails and locks early in boot.
* libsa's memcpy() is actually memmove(). make a proper memmove(), and givederaadt2019-04-204-13/+63
| | | | memcpy() correct behaviour. This also brings the bcopy() macro into line.
* change marks[] array to uint64_t, so the code can track full 64-bitderaadt2019-04-103-9/+9
| | | | | details from the ELF header instead of faking it. Proposal from mlarkin, tested on most architectures already
* I am retiring my old email address; replace it with my OpenBSD one.millert2019-01-253-6/+6
|
* Make the freelist best fit code a tiny bit smarter to not use a block ifotto2018-12-161-2/+2
| | | | | half or more would be wasted. Causes more effective re-use of blocks. ok jsing@
* Retry on incorrect passphrase for softraid crypto boot.jsing2018-08-102-72/+122
| | | | | | | | | | | | | | | | | | | Historically, the softraid crypto support in the boot loaders has only given one attempt to provide the correct passphrase. There were a few reasons for this, including the fact that pkcs5_pbkdf2() allows an empty passphrase and that returning EPERM allowed for another attempt. With the event of KARL and the need for bsd.booted with hibernate resumption, this becomes much more of an issue - if you get the passphrase wrong you fail to resume. There are also other situations like using /etc/boot.conf to switch serial console, but an incorrect passphrase results in the config not being read. Also, bcrypt_pbkdf() does not permit empty passphrases. This reworks the softraid crypto support in the boot loaders so that it loops requesting a valid passphrase until one is provided, or an empty passphrase is entered (at which point it will abort). ok mortimer@ tb@
* Use _ALIGN_TRAPS instead of _ALIGN_TEXT where nops aren't needed.guenther2018-07-133-6/+6
| | | | ok deraadt@
* In asm.h ensure NENTRY uses the old-school nop-sled align, but change standardderaadt2018-07-103-5/+5
| | | | | | | 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
* Add retguard macros for libkernmortimer2018-07-0315-12/+43
| | | | ok deraadt
* Align libsa ctime output with libc ctime output.cheloha2018-05-231-3/+2
| | | | | | | Use zero-padding to get double-digit HH:MM:SS and space-padding for the DOM. ok visa@
* use size_t for the size of buffers and strings, not int.dlg2018-04-252-6/+8
| | | | | | sprinkle some bounded attributes while here. ok deraadt@
* Stop converting UDP and IP header values from network endianness to hostpatrick2018-03-311-10/+7
| | | | | | | | | | endianness for convenience reasons. Especially in code pathes like TFTP where the source port is read from the received UDP packet and used as destination port in a new UDP packet this can be very harmful. Luckily this issue has had no effect on our architectures since they never use any of the code paths that could be harmful. ok visa@
* Implement basic padding support in libsa so we can do zero-paddingpatrick2018-01-171-18/+55
| | | | | | in bootloader printfs. Feedback from and ok gerhard@
* "unknown KDF type 2" -> "keydisk not found".sunil2017-11-101-1/+4
| | | | Inputs and ok jsing@.
* Add aliases for __aeabi_idivmod and __aeabi_uidivmod calls clang emits.jsg2017-10-261-1/+3
| | | | | Remainder of the division is already stored in r1 in __divsi3/__udivsi3. ok kettenis@
* Revert: libsa lacks memmove currently; a more thorough rename/change isguenther2017-10-081-2/+2
| | | | | | needed problem noted by naddy@
* bcopy() is expected to be overlap safe, so it implement it with memmove()guenther2017-10-071-2/+2
| | | | | | not memcpy(). 'oh oh' deraadt@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-082-4/+2
|
* Fix the __sync_* functions to make them work properlyvisa2017-08-201-1/+21
| | | | as full memory barriers.
* make the AES-XTS mode a little more constant-time, though the AESdjm2017-05-311-5/+4
| | | | | | implementation that it depends on currently isn't. ok mikeb tom
* move sha224_initial_hash_value[] under !SHA2_SMALL; ok deraadt@ millert@naddy2017-05-271-13/+13
|