summaryrefslogtreecommitdiff
path: root/sys/lib
AgeCommit message (Collapse)Author
2023-11-18sync zlib with userlandTheo Buehler
2023-08-20Sync zlib 1.3 with userlandTheo Buehler
2023-08-18sync with userlandTheo Buehler
2023-08-13sync with userlandTheo Buehler
2023-08-04Sync with userland libzTheo Buehler
2023-07-30sync with userland's zlib.hTheo Buehler
2023-07-13bcmp(3) tries to return length, which is a size_t, as an int.Todd C. Miller
Instead, just return 1 if there is a difference, else 0. Fixed by ray@ in 2008 but the libkern version was not synced. OK deraadt@
2023-05-22NENTRY() doesn't provide an endbr64, so give memmove one inPhilip Guenther
case it ever gets called through a function pointer (with retpoline disabled) ok deraadt@
2023-05-02sync with userlandTheo Buehler
2023-04-25zlib: sync with srcTheo Buehler
2023-04-08Return -1 on actual failureKlemens Nanni
MI boot.c's "a-x" fchmod on bsd.upgrade is the only caller that checks the return value and that call can fail on, e.g. softraid volumes. Stop clobbering the actual fchmod return value and get that warning printed. OK deraadt
2023-03-08Delete obsolete /* ARGSUSED */ lint comments.Philip Guenther
ok miod@ millert@
2023-01-04Gordon W. Ross agreed to rescind clause 3 and 4 inJonathan Gray
NetBSD dev_net.c rev 1.15 bootparam.c rev 1.19 https://mail-index.netbsd.org/source-changes/2009/10/21/msg002212.html
2022-12-27Ansify pxe_netif_close() and {,pxe}socktodesc()Jeremie Courreges-Anglas
To appease the clang 15 warning -Wdeprecated-non-prototype (turned on by -Wall). ok millert@
2022-12-27Fix array bounds mismatch with clang 15Jeremie Courreges-Anglas
New warning -Warray-parameter is a bit overzealous. ok millert@
2022-12-14add __ctzdi2 to sparc64 kernelJonathan Gray
If __builtin_ctzl() is used on sparc64, gcc 4.2 will emit a call to __ctzdi2. For userland this is in libgcc or compiler-rt. In the kernel we put these functions in libkern. 'looks good' deraadt@ miod@
2022-12-08_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingPhilip Guenther
is ELF" world. Eliminate use of them in amd64, arm64, armv7, i386, macppc, mips64, and sparc64 code. ok deraadt@ jca@ krw@
2022-12-07Add END()s to match ENTRY()s.Philip Guenther
ok deraadt@
2022-12-07Prefer numeric labels over L<digit> labels, as the latter clutterPhilip Guenther
the final kernel symbol table. Add END()s to match ENTRY()s. ok deraadt@
2022-12-07Prefer STRONG_ALIAS() over multiple overlapping _ENTRY/_NENTRYPhilip Guenther
uses, as the latter requires manual handling of _PROF_PROLOGUE. Add END()s to match ENTRY()s. ok deraadt@
2022-12-07Apply changes from commitid FWrfGfO9Ojnsh1mq to libkern.Philip Guenther
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@
2022-12-06_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingPhilip Guenther
is ELF" world. Eliminate use of them in m88k code. ok aoyama@
2022-12-01_C_LABEL() is no longer useful in the "everything is ELF" world.Philip Guenther
Start eliminating it. ok mpi@ mlarkin@ krw@
2022-10-23Drop RCS ids in upstream zlib sourceTheo Buehler
We're not maintaining a this as a fork, it's upstream source with a handful of patches. Thus, the RCS ids aren't particularly useful or important. They are a bit of a maintenance burden and generate noise in diffs. ok kn, no objection millert, "kill" guess who
2022-10-20Sync sys libz with baseTheo Buehler
2022-09-02Add ufs2 to the list of filesystem, for the sake of boot blocks which do notMiod Vallat
provide an explicit list of files to build in libsa.
2022-09-02Remove non-_KERNEL code path for division by zero. This will allow theMiod Vallat
bootblocks to shrink a little.
2022-08-28remove unused blowfish inline definesJonathan Gray
inline use was removed in 1998
2022-08-22remove locore.s bzero and use libkern bzero on i386Jonathan Gray
libkern bzero doesn't have the 486 path but is otherwise the same ok mlarkin@ deraadt@
2022-08-15Fix a doc comment to match upstreamTheo Buehler
2022-08-15Adjust whitespace (tabs vs spaces) on one line to reduce diff with upstreamTheo Buehler
2022-08-12add support for booting from RAID 1C softraid(4) volumes on amd64Stefan Sperling
Only boot-loader changes are needed. Both installboot(8) and the kernel already do what is required to make this work. ok kn@ Tested: biosboot on vmm: kn, stsp biosboot and efiboot on server hardware: stsp
2022-08-11Revert uLong -> z_off_t change in the kernelTheo Buehler
The kernel source assumes the original zlib ABI. There is no reason to stick to this local change. Pull in a fix matching ctfdump.c -r1.26. This is hopefully the last change necessary to undo a painful hack that was committed 19 years ago without ok. Someone owes me a lot of beer... ok millert
2022-08-09Sync inflateGetHeader() fix from userlandTheo Buehler
2022-05-08Backport an upstream fix for CRC calculation. This fixes Java applicationsTheo Buehler
on some older hardware, see https://github.com/madler/zlib/issues/613 Pointed out by tj and sthen commit ec3df00224d4b396e2ac6586ab5d25f673caa4c2 Author: Mark Adler <madler@alumni.caltech.edu> Date: Wed Mar 30 11:14:53 2022 -0700 Correct incorrect inputs provided to the CRC functions. The previous releases of zlib were not sensitive to incorrect CRC inputs with bits set above the low 32. This commit restores that behavior, so that applications with such bugs will continue to operate as before.
2022-05-08Update to zlib 1.2.12Theo Buehler
Build tests by myself for amd64 and arm64, sthen and inoguchi for i386 and gkoehler for macppc and powerpc64, thanks! Detailed changelog is part of the committed diff.
2022-03-25Sync with userland libz (memory-corruption + followup).Theo Buehler
ok mbuhl millert
2022-03-25Sync zlib with userlandTheo Buehler
Backport zlib fix for the multi line CLEAR_HASH macro. There is an else branch where only half of the macro is executed conditionally. Acording to upstream comment this has only little impact. https://github.com/madler/zlib/commit/38e8ce32afbaa82f67d992b9f3056f281fe69259 ok bluhm (who had the same diff)
2022-01-29Use local symbols in libkern mips64 assembly routines.Visa Hankala
OK miod@
2022-01-11spellingJonathan Gray
2022-01-11Remove dead store to f and avoid use of unvalidated fd.Visa Hankala
Found by LLVM scan-build. OK millert@ deraadt@
2021-12-01Fix booting from an IDE block device on the Sun Blade 100. ApparentlyMark Kettenis
writing to disk using the Open Firmware interfaces is buggy and causes corruption of the disk. While it isn't entirely clear what versions of Open Firmware are affected, but it seems to only affect IDE drives. So if we detect an IDE drive, disable writing to it. This results in a small lose of bootloader functionality (bsd.upgrade loop prevention and flagging /etc/random.seed re-use) but that is better than losing the ability to run OpenBSD at all. Based on a diff by Ted Bullock (who did all the hard work of debugging this and coming up with a viable fix). ok deraadt@
2021-11-29Niels agreed to remove the advertising clause; switching theseDamien Miller
to 3-term BSD license.
2021-11-01Add CRC-16 implementation. From NetBSD.Mark Kettenis
ok krw@, deraadt@
2021-10-25Remove unused variables to silence clang.Patrick Wildt
ok kettenis@
2021-10-24#define open O_* flags in libsa/stand.h, so that bootblocks can useTheo de Raadt
O_RDONLY rather using 0 ok beck
2021-07-28Fix previous: In one spot I incorrectly used Pos (unsigned short) whereTheo Buehler
I should have used Byte (unsigned char) which led to passing twice the correct size to free. Found & tested by bluhm with the sys/netinet/ipsec tests on i386.
2021-07-22Add sizes for free() in zlibTheo Buehler
Rebased version of a diff from miod who described it as follows: This tries to keep diffability against upstream, hence a questionable choice of the size type for zcfree() - but all sizes should fit in 32 bits anyway. Since all zcfree routines used in the tree cope with NULL arguments (including the various alloc.c used by the boot blocks), I have simplified TRY_FREE to compensate for the growth. Reminded by and ok mpi
2021-07-20Remove unneeded __sync_* library functions from the kernel.Visa Hankala
These library functions were added as stopgaps because GCC 4.2.1 lacks the corresponding __sync_* builtins on mips64. However, the builtins are now provided by Clang.
2021-07-08In recent libz update, tb@ overzealously attempted codesize reduction withTheo de Raadt
option BUILDFIXED -- which is incompatible with kernel hibernate unpack since it places side-effects into BSS, rather than inside z_streamp or using the private allocator. While here DYNAMIC_CRC_TABLE could cause similar problems, so disable this also. Space savings for the media is best done with bootblock-specific libz compile options, coming in the following commit. ok tb mlarkin