summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
2022-12-20add a missing .Vt macro;Ingo Schwarze
from Josiah Frentsos <jfrent at tilde dot team>
2022-12-20- some small tweaks for the textJason McIntyre
- on guenther's advice, remove NOTES: the text is either not relevant or already described correctly elsewhere ok guenther
2022-12-19Add waitid(2) manpage, based on a first pass by espie@ and bitsPhilip Guenther
from FreeBSD and NetBSD. ok kettenis@ jmc@ espie@
2022-12-19Revert previous: unintentionally included in commitPhilip Guenther
2022-12-19Add pselect(2), recvmmsg(2), sendmmsg(2), and waitid(2) to the listsPhilip Guenther
of built-in cancelation points.
2022-12-19waitid(2) returns 0 on success; do post-call cancelation only ifPhilip Guenther
it either failed, or succeeded but didn't put a status into infop. ok millert@
2022-12-13consistently put the Xr in "made obsolete by" in symbolic,Jason McIntyre
as sigvec already does; remove the one inconsistent colon from creat(3) in this same text original diff from josiah frentsos
2022-12-08_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingPhilip Guenther
is ELF" world. Eliminate use of them in landisk code. ok deraadt@
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-07_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingPhilip Guenther
is ELF" world. Eliminate use of them in powerpc64 code. ok gkoehler@
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-04Fix warnings about binding changed to STB_WEAK on i386Theo Buehler
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
2022-12-03Add ENTRY_NB() and use it for brk.S and sbrk.S on riscv64Jeremie Courreges-Anglas
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@
2022-12-02Drop _C_LABEL() uses in riscv64-specific codeJeremie Courreges-Anglas
_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@
2022-11-17Restrict what getaddrinfo(3) is willing to try to resolve.Florian Obser
Programs assume that a successful call to getaddrinfo(3) validates the input as "safe", but that's not true. Characters like '$', '`', '\n' or '*' can traverse the DNS without problems, but have special meaning, for example a shell. There is a function res_hnok() already in libc, but it validates if a string is a host name, which is too strict in practice. For example foo-.example.com is not a valid host name, but is used on the Internet. Posix has this to say: "The getaddrinfo() function shall translate the name of a service location (for example, a host name)" It hints that the input should be a host name, but it does not restrict it to it. This introduces a function hnok_lenient() which restricts the input to getaddrinfo(3) to the set [A-z0-9-_.]. Additionally two consecutive dots ('.') are not allowed nor can the string start with - or '.'. glibc introduced a similar restriction years ago, so this should not cause problems. It has been known in the DNS community for years, probably decades that getaddrinfo(3) is too lenient what it accepts, but it has always been kicked down the road as "not a DNS problem". Unfortunately this information never made it out of the DNS community and no coordinated effort happened to have this addressed in operating systems. David Leadbeater recently demonstrated how ssh(1) and ftp(1) are too trusting with what getaddrinfo(3) accepts. Both have been fixed independently of this. Input deraadt, eric OK millert, deraadt
2022-11-16tolower(3) guarantees to return its argument unchanged if it's notFlorian Obser
uppercase. While here use the correct idiom of casting to unsigned char. OK millert, farewell to ultrix deraadt
2022-11-11Nuke trailing space in a comment.Kenneth R Westerback
2022-11-09use Fn; from josiah frentsosJason McIntyre
2022-11-07remove one more reference to tcp/slowhz;Jason McIntyre
while here, wrap some long lines;
2022-11-07Modify TCP receive buffer size auto scaling to use the smoothed RTTYASUOKA Masahiko
(SRTT) instead of the timestamp option. Since the timestamp option is disabled on some OSs (eg. Windows) or dropped by some firewalls/routers, in such a case the window size had been fixed at 16KB, this limits throughput at very low on high latency networks. Also replace "tcp_now" from 2HZ tick counter to binuptime in milliseconds to calculate the SRTT better. tested by krw matthieu jmatthew dlg djm stu stsp ok claudio
2022-11-07Nuke last references to d_drivedata.Kenneth R Westerback
2022-11-06remove unneccessary Pp after Sh;Jason McIntyre
2022-11-06At present, mprotect(2) may reduce permissions on immutable pages markedTheo de Raadt
PROT_READ | PROT_WRITE to the less permissive PROT_READ. This one-way operation is permitted for an introductory period to observe how software uses this mechanism. It may change to require explicit mutable region annotation with __attribute__((section(".openbsd.mutable"))) and explicit calls to mimmutable(). ^^^ Decided we'll do that for now, since we've only discovered one program trying to be clever so far (chrome is trying to do something smart, and mimmutable makes it even better) discussed with kettenis and robert
2022-11-06When a TEXTREL binary is loaded, non-writeable LOADs are not made immutableTheo de Raadt
because a loader may want to perform text relocations wrapped inside mprotect permission flips. So static TEXTREL binaries need to perform this operation themselves, at this fairly late point. ok kettenis
2022-11-05powerpc64: TimeBase: add userspace timecounting supportScott Soule Cheloha
Tested by gkoehler@. ok gkoehler@
2022-10-26Add waitid(2) syscall stub.Mark Kettenis
Minor bump to both libc and libpthread: make sure you install a new kernel! ok millert@, deraadt@
2022-10-22In __cxa_atexit(), there is no need to initialize local pointer beforeTheo de Raadt
the lock, when it is correctly initialized after the lock ok otto millert
2022-10-22missing comma; from josiah frentsosJason McIntyre
while here, wrap long line
2022-10-19Document sigaltstack restrictions on OpenBSD.Theo de Raadt
mandoc suggestions & help from jmc
2022-10-14put the malloc_readonly struct into the "openbsd.mutable" section, soTheo de Raadt
that the kernel and ld.so will know not to mark it immutable. malloc handles the read/write transitions by itself.
2022-10-13controm terminql -> controlling terminal;Jason McIntyre
2022-10-12Nuke D_BADSECT and disktab's 'sf'.Kenneth R Westerback
DEC standard 144 bad sector information is no longer a thing. As evidenced by bad144(8) moving to the attic 16 years ago. ok miod@, who points out that badsect(8) is now the nail sticking out.
2022-10-07sort SEE ALSO;Jason McIntyre
2022-10-07Add mimmutable(2) libc stub, add & adjust manual pages, and crank the minor.Theo de Raadt
ok kettenis
2022-10-04Better path handling description, also document tzname, timezone daylight.Todd C. Miller
Explicitly mention that most programs do not need to call tzset() directly. OK deraadt@ jmc@ benno@
2022-10-03Allow TZ to contain absolutes paths starting with /usr/share/zoneinfo/Todd C. Miller
Other absolutes paths are still rejected.
2022-09-28use Fn rather than Nm for swab(); from josiah frentsosJason McIntyre
2022-09-28Fix incorrect range check for size in setvbufGreg Steuck
From enh AT google.com: The existing test is wrong for LP64, where size_t has twice as many relevant bits as int, not just one. (Found by inspection by rprichard.) Looks good to deraadt@ and millert@
2022-09-24macro tweaks; from josiah frentsosJason McIntyre
ok deraadt
2022-09-23POSIX timzone specs may contain '.' so only reject names containing '../'.Todd C. Miller
Noted by pjanzen@ with input from deraadt@.
2022-09-22use the always serializing RDTSCP instruction in tsc and usertc if availableRobert Nagy
tweaks from cheloha@; ok deraadt@, sthen@, cheloha@
2022-09-21tzset: ignore TZ if it contains an absolute path or issetugid().Todd C. Miller
Reading time zone files from user-controlled paths can result in pledge(2) or unveil(2) violations. We also ignore files that contain a '.' character to avoid paths containing ".." or hidden files. Work with and OK deraadt@
2022-09-11.Li -> .Vt where appropriate;Jason McIntyre
from josiah frentsos, tweaked by schwarze ok schwarze
2022-09-10Add EABI strong aliases for __fixunssfdi and __fixunsdfdi added recently onMiod Vallat
armv7; ok mbuhl@
2022-09-09add recvmmsg to NAME;Jason McIntyre
2022-09-09Add libc wrappers for the new sendmmsg and recvmmsg system calls.Moritz Buhl
Feedback tb@, miod@, jca@ OK jca@
2022-09-03Fix the failing libm/rint regress test by adding ieee754 implementationsMoritz Buhl
for the rounding functions. Input from kettenis@, OK miod@
2022-09-02Use a shorter system call invocation template for system calls in the rangeMiod Vallat
0-127, where immediate addressing can be used to load the system call number in r0, rather than performing a memory load using pc-relative addressing. No functional change, but rm(1) runs a couple cycles faster per file now.
2022-09-01Drop support for unused attributes 'bs' (d_bbsize) and 'sb'Kenneth R Westerback
(d_sbsize). ok otto@ as part of larger diff
2022-08-29static inline, not inline staticJonathan Gray
c99 6.11.5: "The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature." ok guenther@