aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-27TODO(api): cheri: fix syscall return typeSzabolcs Nagy
TODO: this affects API (syscall return type is long) so breaks portability and requires doc updates.
2022-10-27aarch64: morello: string: memcpySzabolcs Nagy
from arm optimized-routines morello branch.
2022-10-27aarch64: morello: string: memsetSzabolcs Nagy
memset from arm optimized-routines morello branch.
2022-10-27aarch64: morello: string: dummy c memcmpSzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c memchrSzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c memrchrSzabolcs Nagy
2022-10-27aarch64: morello: purecap rawmemchrCarlos Eduardo Seo
Modified rawmemchr to support Arm Morello Capabilities.
2022-10-27aarch64: morello: string: dummy c strchrnulSzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c strlenSzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c strnlenSzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c strcpy and stpcpySzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c strcmpSzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c strncmpSzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c strchrSzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c strrchrSzabolcs Nagy
2022-10-27aarch64: morello: string: dummy c strspnSzabolcs Nagy
avoids out of bound access of the generic implementation.
2022-10-27aarch64: morello: string: dummy c strcspnSzabolcs Nagy
avoids out of bounds access of the generic implementation.
2022-10-27aarch64: morello: update sysdep.h for purecap ABICarlos Eduardo Seo
Add macro definitions for purecap ABI in sysdep.h.
2022-10-27TODO(gcc): cheri: work around a gcc bug in _dl_setup_stack_chk_guardSzabolcs Nagy
morello purecap gcc in some cases inlines 16byte memcpy as a capability load, which is wrong if the source or dest may be unaligned. stack guard only needs random for the address portion since only that part is compared, so 8 byte is enough with 64 bit addresses, but the current code is only right on little endian systems. TODO: drop when gcc is fixed
2022-10-27cheri: __LP64__ is not defined for purecap ABICarlos Eduardo Seo
There is no ideal ABI macro, so we assume __CHERI_PURE_CAPABILITY__ implies 64 bit long, 64 bit address and 128 bit pointer.
2022-10-27cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERISzabolcs Nagy
The CHERI pure capability programming model for C requires special definition of {u}intptr_t. Only the pure capability model is supported for hosted compilation, but for freestanding compilation there is limited support for other (hybrid capability) programming models too, which require new {u}intcap_t type definitions.
2022-10-27aarch64: morello: use separate c++-types.dataSzabolcs Nagy
The c++ mangling ABI for intptr_t and pthread_t are different on morello.
2022-10-27aarch64: morello: use separate localplt data for morelloSzabolcs Nagy
There is no longer PLT reference to matherr in libm.
2022-10-27aarch64: morello: Add separate lp64 and morello linux abilistsSzabolcs Nagy
The base symbol version is 2.36.
2022-10-27aarch64: morello: Add purecap abi-variants on linuxSzabolcs Nagy
2022-10-27aarch64: morello: configure change for purecap abiSzabolcs Nagy
Detect default-abi and add aarch64-purecap make variable. Purecap abi sets HIDDEN_VAR_NEEDS_DYNAMIC_RELOC and unsets SUPPORT_STATIC_PIE.
2022-10-27aarch64: morello: Use separate lp64 and morello sysdep directoriesSzabolcs Nagy
Provide separate directories for lp64 and purecap abi related sysdep functionality. purecap may be better name than morello, but we started with morello and that is more future compatible with alternative cheri-like extensions on top of aarch64.
2022-10-27aarch64: morello: add purecap support to build-many-glibcs.pySzabolcs Nagy
aarch64-linux-gnu compiler is a lp64,purecap multilib gcc and supported glibc variants: aarch64-linux-gnu aarch64-linux-gnu-purecap aarch64-linux-gnu-purecap-nopie aarch64-linux-gnu_purecap compiler is a default purecap gcc, with supported glibc variants: aarch64-linux-gnu_purecap aarch64-linux-gnu_purecap-nopie purecap libgomp and libitm builds fail so disabled for now.
2022-10-27aarch64: Use fewer ifdefs in bits/fcntl.hSzabolcs Nagy
This simplifies adding the Morello purecap abi target.
2022-10-27aarch64: cleanup MOVL definition in sysdep.hSzabolcs Nagy
PTR_REG is for ILP32, there is no point using it under __LP64__.
2022-10-27libio: adjust _IO_FILE / _IO_FILE_complete for 128 bit pointersSzabolcs Nagy
The size of the reserved space has to be adjusted because it underflows with 16 byte pointers. With the new value there should be enough space for 2 more pointers in the struct on CHERI targets.
2022-10-27static: glibc-bug: NL_CURRENT_INDIRECT is broken so disable itSzabolcs Nagy
nl_langinfo_l ignores its locale argument with NL_CURRENT_INDIRECT which is wrong when that argument does not match the current thread's locale. upstream glibc is not tested with static linking so this is not found.
2022-10-27cheri: Fix elf/tst-dlmodcount testSzabolcs Nagy
switch statement does not work for intptr_t, use a large int type that's guaranteed to work.
2022-10-27Fix stdlib/test-dlclose-exit-race to not hangSzabolcs Nagy
Use the standard wrapper that kills the test after a timeout.
2022-10-27Fix resource/bug-ulimit1 testSzabolcs Nagy
ulimit is a variadic function and the second argument must have type long (or unsigned long).
2022-10-27Fix elf/tst-dlmopen-twice to support enough link namespacesSzabolcs Nagy
The test dlmopens 10 namespaces recursively, which requires a glibc tunable setting, otherwise it may run out of static TLS.
2022-10-27Fix missing NUL terminator in stdio-common/scanf13 testSzabolcs Nagy
sscanf is only defined on nul terminated string input, but '\0' was missing in this test which caused _IO_str_init_static_internal to read OOB on the stack when computing the bounds of the string.
2022-10-27Fix malloc/tst-scratch_buffer OOB accessSzabolcs Nagy
The test used scratch_buffer_dupfree incorrectly: - The passed in size must be <= buf.length. - Must be called at most once on a buf object since it frees it. - After it is called buf.data and buf.length must not be accessed. All of these were violated, the test happened to work because the buffer was on the stack, which meant the test copied out-of-bounds bytes from the stack into a new buffer and then compared those bytes. Run one test and avoid the issues above.
2022-10-27Fix off-by-one OOB read in elf/tst-tls20Szabolcs Nagy
The int mods[nmods] array on the stack was overread by one.
2022-10-27Fix off-by-one OOB write in iconv/tst-iconv-mtSzabolcs Nagy
The iconv buffer sizes must not include the \0 string terminator. When \0 cannot be part of a valid character encoding glibc iconv would copy it to the output as expected, but then later the explicit output termination with *outbufpos = '\0' is out of bounds.
2022-10-27Use uintptr_t in string/tester for pointer alignmentSzabolcs Nagy
The code assumed unsigned long can represent pointers.
2022-10-27Fix the symbolic link of multilib dirsSzabolcs Nagy
If dir contains several / then "ln -s . $dir" does not link it to the current directory. Use the existing rellns.sh script to compute the correct relative path to .
2022-10-27elf: Fix alloca size in _dl_debug_vdprintfSzabolcs Nagy
The alloca size did not consider the optional width parameter for padding which could cause buffer underflow. The width is currently used e.g. by _dl_map_object_from_fd which passes 2 * sizeof(void *) which can be larger than the alloca buffer size on targets where sizeof(void *) >= 2 * sizeof(unsigned long). Even if large width is not used on existing targets it is better to fix the formatting code to avoid surprises.
2022-10-27malloc: Fix alignment logic in obstackSzabolcs Nagy
If sizeof(ptrdiff_t) < sizeof(void*) the alignment logic was wrong: incorrectly assumed that base was already sufficiently aligned. Use more robust alignment logic: this one should work on any target. Note: this is an installed header so it must be namespace clean and portable hence it uses unsigned long for the alignment offset.
2022-10-27malloc: Use uintptr_t in alloc_bufferSzabolcs Nagy
The values represnt pointers and not sizes. The members of struct alloc_buffer are already uintptr_t.
2022-10-27malloc: Use uintptr_t for pointer alignmentCarlos Eduardo Seo
Avoid integer casts that assume unsigned long can represent pointers.
2022-10-27Use uintptr_t in fts for pointer alignmentSzabolcs Nagy
The code assumed unsigned long can represent pointers.
2022-10-27Fix invalid pointer dereference in wcpcpy_chkSzabolcs Nagy
The src pointer is const and points to a different object, so accessing dest via src is invalid.
2022-10-27Fix invalid pointer dereference in wcscpy_chkSzabolcs Nagy
The src pointer is const and points to a different object, so accessing dest via src is invalid.
2022-10-27aarch64: Fix the extension header write in getcontext and swapcontextSzabolcs Nagy
The extension header is two 32bit words and in the last header both should be 0. There is plenty space in the __reserved area, but it's better not to write more than we mean to.