djm
468ab01728
constrain fractional part to [0-9] (less confusing to static analysis); ok ian@
6 years ago
denis
f814382efe
Add a missing header when compiling with -DDEBUG
With advice from jca@
OK jca@ millert@
6 years ago
otto
dbc5faf4ac
sys/uio.h is not used anymore
6 years ago
otto
79b103c901
fix MALLOC_STATS; spotted by and ok semarie@
6 years ago
bcook
becf8cef00
ensure SYS_getrandom and GRND_NONBLOCK are both defined before using getrandom(2)
Based on discussion here https://github.com/libressl-portable/openbsd/pull/82
Suggested fix from jsing@
6 years ago
deraadt
d6aeb76165
use _ALIGN() which is uhm a bit OpenBSD-specific, but it means we
don't need to use sys/param.h at all, guess which one i believe is
greater namespace polution
ok otto
6 years ago
deraadt
02c2718077
Use _MAX_PAGE_SHIFT, rather than #ifdef mips64
ok guenther kettenis
6 years ago
nicm
2c571a29e6
Fix function argument names, from Abel Abraham Camarillo Ojeda via jmc@.
6 years ago
otto
e06d7bccfa
use consistent style for for loop in unmap(), no functional change
6 years ago
otto
be36452872
keep in sync with ld.so malloc.c
6 years ago
jmc
b78237bf7e
word fix; from edgar pettijohn
6 years ago
otto
22e454653c
- An error in the multithreaded case could print the wrong function name
- Start with a full page of struct region_info's
- Save an mprotect in the init code: allocate 3 pages with none and
make the middle page r/w instead of a r/w allocation and two calls to make the
guard pages none
6 years ago
otto
fbdda17fd8
- do not junk pages returned by free_bytes(), all freed chunks are already
junked
- freezero(): only clear requested size
6 years ago
otto
d471572632
Zap the rotor, it was a wrong idea. Cluebat applied by kshe who
came also up with this diff. Simple, no bias and benchmarks show the extra
random calls disappear in te measurement noise.
6 years ago
otto
a1c70a667c
Move to ffs(3) for bitmask scanning. I played with this earlier,
but at that time ffs function calls were generated instead of the
compiler inlining the code. Now that ffs is marked protected in
libc this is handled better. Thanks to kshe who prompted me to
look at this again.
6 years ago
guenther
5c76f998f2
Instead of trying to handle ffs() with the normal rename-mark-hidden-and-alias
dance, mark it protected. This works better for both gcc and clang: gcc
blocks overriding of internal calls, while clang permits inlining again.
ok otto@
6 years ago
deraadt
3bfb6d03b3
Adjust references for sysctl(3) to sysctl(2)
6 years ago
otto
bb8baa37e1
optimization and some cleanup; mostly from kshe (except the unmap() part)
6 years ago
otto
58ab079478
Only init chunk_info once, plus some moving of code to group related functions.
6 years ago
otto
28aa9f8c65
step one in avoiding unneccesary init of chunk_info;
some cleanup; tested by sthen@ on a ports build
6 years ago
tedu
8b61b5765d
memcpy from the right place. at this point, the used variable is not
relevant. from Mark Karpilovskij.
ok millert
6 years ago
millert
e1517c2cb0
Fix one possible buffer overflow and one underflow. Also some minor
cleanups. From Jan Kokemueller. OK deraadt@
6 years ago
guenther
ef03f4da40
Move __cxa_thread_atexit* to its own .c file to avoid pulling the code
(w/ _dlctl reference) into static executables. It's all Mark's code so
put his preferred copyright on it.
ok kettenis@
6 years ago
kettenis
0566b09422
Make a few internal symbols static and add a Symbols.map version script
to control which symbols are exported from the shared library.
ok guenther@, deraadt@, jca@
7 years ago
zhuk
8d93985924
It's the imsg_compose(3) who accepts 'fd' argument, not imsg_create(3).
7 years ago
kettenis
29bb9a950c
Remove DEF_STRONG(__cxa_thread_atexit_impl). This produces an unwanted
_libc___cxa_thread_atexit_impl reference on gcc architectures that breaks
the build.
7 years ago
kettenis
901caa2734
Implement __cxa_thread_atexit to support C++11 thread_local scope. The
interface is also made available as __cxa_thread_atexit_impl to satisfy the
needs of GNU libstdc++.
ok guenther@, millert@
7 years ago
guenther
06875abb1a
clang doesn't propagate attributes like "asm labels" and "visibility(hidden)"
to builtins like mem{set,cpy,move} and __stack_smash_handler. So, when
building with clang, instead mark those as protected visibility to get rid
of the PLT relocations. We can't take the address of them then, but that's
ok: it's a build-time error not a run-time error.
ok kettenis@
7 years ago
tb
3bd9248dcf
GNU ld has prefixed the contents of .gnu.warning.SYMBOL sections
with "warning: " since 2003, so the messages themselves need not
contain the prefix anymore.
From Scott Cheloha
ok jca, deraadt
7 years ago
otto
d5460018ef
's' should include 'f'; from Jacqueline Jolicoeur
7 years ago
millert
97fa8ef41e
Don't let close(2) clobber errno. Some calls were already protected
but not all. From Peter J. Philipp.
7 years ago
jsing
edffe314c0
Restore a return that was inadvertently removed from freezero() in r1.234,
which results in an internal double free when internal functions are not
in use.
ok otto@
7 years ago
schwarze
7fd11d9f24
Add STANDARDS: denis@ spotted that it was missing.
OK deraadt@ jca@ jmc@
7 years ago
otto
437fad2669
do not return f() where f is a void function; loop var type fix
7 years ago
otto
09620f7263
Use dprintf instead of snprintf/write
7 years ago
otto
3b6bc929b8
Make delayed free non-optional and make F do an extensive double free check.
ok tb@ tedu@
7 years ago
otto
4a127addf3
mapalign returns MAP_FAILED for failuer; from George Koehler
7 years ago
otto
d1f95e32d7
check double free before canary for chunks; ok millert@
7 years ago
schwarze
371b65730c
New POSIX xlocale implementation written from scratch.
Complete in the sense that all POSIX *locale(3) and *_l(3) functions
are included, but in OpenBSD, we of course only really care about
LC_CTYPE and we only support ASCII and UTF-8.
With important help from kettenis@, guenther@, and jca@.
Repeated testing in ports bulk builds by naddy@.
Additional testing by jca@, sebastia@, dcoppa@, and others.
OK kettenis@ dcoppa@, and guenther@ on an earlier version.
Riding guenther@'s libc/librthread major bump.
7 years ago
schwarze
909afec908
delete pointless .Tn ASCII found by jca@ with mandoc -Tlint
7 years ago
jca
74793c8931
Mention strtok_r in STANDARDS
POSIX 2001 instead of POSIX.1c suggested by millert@ and jmc@, ok jmc@
7 years ago
otto
83cbddd78e
two MALLOC_STATS only tweaks; one from David CARLIER, the other found by clang
7 years ago
guenther
f3645329ae
Use sendsyslog() directly instead of syslog_r() for the "backwards memcpy"
messages, to avoid pulling in piles of other machinery unnecessarily
problem observed by schwarze@
ok deraadt@ millert@
7 years ago
guenther
2f8ee43fe4
Minimize #includes, particularly to avoid thread_private.h
ok tedu@
7 years ago
schwarze
932461687c
add missing and correct misspelled names, most in NAME sections;
found with regress/usr.bin/mandoc/db/dbm_dump;
OK jmc@
7 years ago
jmc
2ee2396122
zap trailing whitespace;
7 years ago
tedu
bce15ce0c1
rework the page a bit, clarify a few things, maybe better wording
7 years ago
otto
131bcbfdc1
one more instance of the previous commit; also initialize ->offset to a
definite value in the size == 0 case
7 years ago
otto
4a550fa72d
Only access offset if canaries are enabled *and* size > 0, otherwise offset
is not initialized. Problem spotted by Carlin Bingham; ok phessler@ tedu@
7 years ago
millert
c212aadd9a
The 0x (or 0X) prefix in base 16 is optional so only skip over the
prefix if the character following it is a valid hex char. The C99
standard is clear that given the string "0xy" zero should be returned
and endptr set to point to the "x". OK deraadt@ espie@
7 years ago