Age | Commit message (Collapse) | Author |
|
Even in current (1.0.55) releaes of uClibc-ng there will be 100% reproducible crashes of statically linked binaries (on all kind of platforms), when calling "dlopen(...)" with wrong or non-existing .so-files).
#0 0x0000000000404b62 in _dl_load_shared_library ()
#1 0x0000000000404d49 in do_dlopen ()
#2 0x0000000000405286 in dlopen ()
This is caused by missing checks on "_dl_loaded_modules" in "ldso/ldso/dl-elf.c".
When "_dl_loaded_modules" is NULL in static linked binaries, it becomes dereferenced and causes an segfault.
This patch fixes the issue by adding an extra assignment-check for "_dl_loaded_modules".
Signed-off-by: Stephan Baerwolf <stephan@matrixstorm.com>
|
|
This fixes a linking error with f.e. Kodi. Code behaves like
glibc now.
|
|
|
|
|
|
Add the obsolescent SUSv3 family of user context manipulating functions
for kvx.
Signed-off-by: Julian Vetter <jvetter@kalrayinc.com>
|
|
To satisfy detection of LFS support add these glibc internal macros.
Fixes f.e. libselinux compile.
Reported-By: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
|
|
This fixes a long standing bug in the ldso code for aarch64.
It fixes the newly problems occuring with python3, where python3
is segfaulting on startup.
|
|
|
|
|
|
Other C libraries like musl/glibc does not define it.
Including stdio.h here breaks Grub2 compilation with
gcc 14 and above.
Thanks to Thomas Petazzoni for analyzing the Grub2 build error.
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
|
|
|
|
|
|
In later kernel versions, IPC_64 is no longer required in the *ctl
function, so it is defined as 0.
|
|
In functions that modify sp, debug and unwind information should
be located by fp instead of sp, and the conversion is completed
through FORCE_FRAME_POINTER. With gcc -Os, FORCE_FRAME_POINTER is
optimized away, and the modified sp is still used, causing a
segmentation fault in the recvfrom().
Adding a meaningless assembly instruction to use the return value
of FORCE_FRAME_POINTER to prevent it from being deleted.
|
|
This fixes a bug that can lead to the calculation of a wrong bin `idx`,
which in turn leads to a too small chunk of memory being chosen for the
number of bytes (`nb`) to be allocated. This leads to a fault (or
possibly to memory being written in the wrong location) when using the
offset `nb` on top of the chunk for a write operation.
malloc() takes the number of bytes to allocate as size_t, but the
calculation of the global bin index idx is done via
malloc_largebin_index() which takes as parameter and calculates
internally with unsigned int. This leads, for large allocations, to a
truncation of the value and consequently to the idx being wrongly
calculated.
idx is an index into the bins which are sorted in ascending order of
size range of its including chunks (e.g. 8-16, 16-32, 32-64,...).
The malloc() algorithm depends on the idx being calculated such that
we begin searching only at a bin whose chunks are always large enough
to include the memory size to be allocated (nb).
If the idx is too small (as can happen due to the described integer
overflow), this code will lead to a write to a wrong
address (remainder->bk resp. remainder->fd) (lines from malloc.c):
1086 size = chunksize(victim);
1087
1088 /* We know the first chunk in this bin is big enough to use. */
1089 assert((unsigned long)(size) >= (unsigned long)(nb));
1108 remainder = chunk_at_offset(victim, nb);
1111 remainder->bk = remainder->fd = unsorted_chunks(av);
The chunk victim should normally be from a bin of a range where each
chunk is at least of the size nb. Since it's not, its size may be
smaller than nb. With assertions enabled the assertion in 1089 would
fail. Without assertions we add nb as an offset to the chunk but since
the size of the chunk is a lot smaller than nb, this will point to an
address somewhere else.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
|
|
- fix dependency for libc_hidden_def(utimes) statement, fixes (on ARM-64bit):
./include/libc-symbols.h:431:32: error: '__EI_utimes' aliased to undefined symbol '__GI_utimes'
431 | extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local)))) \
| ^~~~~
./include/libc-symbols.h:435:41: note: in expansion of macro '__hidden_ver1'
435 | # define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
| ^~~~~~~~~~~~~
./include/libc-symbols.h:503:32: note: in expansion of macro 'hidden_def'
503 | # define libc_hidden_def(name) hidden_def (name)
| ^~~~~~~~~~
libc/sysdeps/linux/common/utimes.c:54:1: note: in expansion of macro 'libc_hidden_def'
54 | libc_hidden_def(utimes)
| ^~~~~~~~~~~~~~~
- fix dependency for 64-bit implementation, fixes (on ARM-64bit):
.../build/busybox-1.37.0/libbb/copy_file.c:433:(.text.copy_file+0x2b0): undefined reference to `utimes'
Fixes: 48591e2a2 ("Provide fixups for riscv32.")
Fixes: 5aee86ed3 ("utimes: force to use 64-bit implementation if available and requested")
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
|
Add missing header in commit 19fe75f0ab09c9661ff03738579171624fc35018
Reported-By: Ronald Wahl <ronald.wahl@legrand.com>
|
|
|
|
Fixes 64-/32-bit time_t regression on ARM32 (reported for buildroot, see [1]
for details).
[1] https://gitlab.com/buildroot.org/buildroot/-/issues/128
Fixes: 48591e2a2 ("Provide fixups for riscv32.")
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
|
According to POSIX the getnameinfo flags parameter is int and not
unsigned. Adapt accordingly. Glibc has also fixed this in commit
e4ecafe004b3d4270b3a9dace8f970047400ed38 in 2001.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
The use of ptsname_r instead of the custom pts_name seems to have proven
in the field.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
The termios and winsize arguments are const as per the POSIX standard,
and also uclibc and musl define them as such. Adapt the uclibc-ng
definitions and declarations accordingly to improve compatibility.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Thorsten Glaser <tg@debian.org>
|
|
|
|
In file included from /home/thomas/external/buildroot2/output/host/mips64-buildroot-linux-uclibc/sysroot/usr/include/linux/fs.h:19,
from /home/thomas/external/buildroot2/output/host/mips64-buildroot-linux-uclibc/sysroot/usr/include/linux/btrfs.h:29,
from libmount/src/btrfs.c:22:
/home/thomas/external/buildroot2/output/host/mips64-buildroot-linux-uclibc/sysroot/usr/include/sys/mount.h:38:3: error: expected identifier before numeric constant
38 | MS_NOSUID = 2, /* Ignore suid and sgid bits. */
| ^~~~~~~~~
Fixes:
- https://github.com/util-linux/util-linux/issues/3501
- https://lore.kernel.org/buildroot/CACXRmJioVq7PUwBkCPNj0k-47hrJ_vtgVYtzp+_84ZgimDe9CA@mail.gmail.com/
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
|
|
is available
The reallocarray() primitive is only provided by the malloc-standard
implementation: neither malloc nor malloc-simple provide it. This
causes issues when building for example util-linux on noMMU platforms
as:
- noMMU platforms can't use malloc-standard, so either malloc or
malloc-simple are used, which means reallocarray() is not
implemented
- util-linux detects the absence of reallocarray(), and provides its
own implementation, but the prototype clashes with the prototype in
uClibc's <stdlib.h>
The combination of which causes the following build failure:
In file included from lib/color-names.c:7:
./include/c.h:586:21: error: static declaration of ‘reallocarray’ follows non-static declaration
586 | static inline void *reallocarray(void *ptr, size_t nmemb, size_t size)
| ^~~~~~~~~~~~
In file included from ./include/c.h:16:
/home/thomas/projets/buildroot/output/host/arm-buildroot-uclinux-uclibcgnueabi/sysroot/usr/include/stdlib.h:898:14: note: previous declaration of ‘reallocarray’ with type ‘void *(void *, size_t, size_t)’ {aka ‘void *(void *, unsigned int, unsigned int)’}
898 | extern void *reallocarray (void *__ptr, size_t __m, size_t __n);
| ^~~~~~~~~~~~
make[3]: *** [Makefile:12354: lib/libtcolors_la-color-names.lo] Error 1
To fix this, let's not expose the prototype of reallocarray() if we
don't provide the implementation for it.
Upstream: https://mailman.openadk.org/mailman3/hyperkitty/list/devel@uclibc-ng.org/thread/BX4ENNZYO23YQJQF5XITW7TETSJHEFK5/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
|
|
|
|
Signed-off-by: Jeffrey H. Johnson <trnsz@pobox.com>
|
|
Avoid the warning by marking the unused parameter appropriately.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
Recent Clang versions (Starting from 20) have this macro built-in. The
compiler does not warn about this normally because <stdint.h> is a
system header. In special cases where stdint.h may be included as normal
header it does warn however. Avoid re-defining if a definition already
exists.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
The _start symbol does not necessarily have to be on the first page of
the application. But the __ehdr_start symbol is always at address zero
for PIE binaries.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
So far, uclibc relied on the informal behaviour of GNU ld to put the
link address of the _DYNAMIC symbol in the first GOT entry. This does
not work with LLVM lld which does not follow this convention.
Consequently, glibc has abandoned its usage in favour of using
__ehdr_start as magic symbol to infer the load address [1].
Note that this implies that the link time address of __ehdr_start is
*always* 0! So far, this seems to be the case on all platforms.
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=28203
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
The LLVM linker seems to be quite clever. When resolving relocations,
accesses to the GOT are potentially replaced by PC relative addressing
to the requested symbol. This breaks the old method of calculating the
load address by using an unrelocated GOT entry value. Instead, rely on
__ehdr_start having a link address of zero.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
Signed-off-by: Thorsten Glaser <tg@debian.org>
|