Age | Commit message (Collapse) | Author |
|
It's not safe to use the aux vect inside __uClibc_main if we are running
with shared libraries, because it could have been already modified.
For example, if some constructor plays with environment variables by
using unsetenv, the modifications done into the stack to unset an
environment variable, have impacts on the aux vect due to the extra NULL
entries added.
Due to this, __uClibc_main is not able to detect where the aux vect
starts, so all the entries that are used by __uClibc_main (AT_UID,
AT_EUID, AT_GID, AT_EGID, AT_PAGESZ and possibly other arch specific)
are impacted.
Same side effect on the aux vect is caused by the ld.so when running a
SUID program with some of the unsecure environment variables set, that
will be unset by the ld.so itself.
In order to fix this issue, it needs to handle aux vect entries into
__uClibc_main only if SHARED is not defined.
In SHARED case, libc refers to __dl_secure and _dl_pagesize as initialised
by the ld.so where the aux vext is still untouched.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Reviewed-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
This matches a similar change made to glibc.
No functional changes here.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
test post-receive hook
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
independent options
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Move h_errno related stuff to separate file.
Do not hide errno and h_errno for non-TLS, else it keeps being 0.
Make __[h_]errno_location weak for non-TLS.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Remove unneeded headers.
Guard inclusion of fcntl.h.
While there, remove an obsoleted comment.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Define a common view of __errno_location, __h_errno_location in common header
and use that everywhere, __uClibc_main.c is no special.
The rule adopted:
for enabled threads we make in libc the __GI_x() variants strong, x() weak
and (should) provide another strong x() in libpthread.
If threads are disabled, even the __GI_x() variants are weak.
_stdio_init,_stdio_term,_locale_init: make all hidden weak in common header
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
The linker can cope with it if it is hidden.
No need for the __GI___uClibc_init.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
No need for a visible version
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Handle _dl_skip_args in the asm part of the dynamic linker startup,
to skip the ldso arguments, so we can keep this symbol hidden as other archs do.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
and shuffle tokens memsetting around.
No obj-code changes.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
fix signed vs. unsigned comparison warnings while at it
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
* origin/master: (137 commits)
utils/ldd: Check for returned pointer from strrchr not the value it holds
cris: add provide arch-specific vfork implementation
lutimes.c, stubs.c: fix compiling lutimes, if __NR_utimensat is not defined
bump version to 0.9.32-rc3-git
release 0.9.32-rc3
memalign: include sys/param.h for MAX
arm/bits/atomic.h: Include common/bit/atomic.h for thumb1
wctype.h: fix libc_hidden_proto for iswupper and add it for iswspace
add libc_hidden_proto for wcs[n]casecmp_l
really fix missing __libc_drand48_data
Revert "missing prototype of __libc_drand48_data fixed"
missing prototype of __libc_drand48_data fixed
time.c, time.h: remove unused hidden strftime/strptime
nanosleep.c: remove duplicated libc_hidden_proto
ctype.c, ctype.h: remove commented parts that were banned for removal after 0.9.31
_wctype.c, wctype.h: remove unused isw* and wctype_l hidden functions
time.c, wchar.h: remove unused hidden wcsftime
str[n]casecmp.c: fix hidden usage
remove unused hidden functions
frv/memset.S: add missing libc_hidden_def
...
Conflicts:
ldso/ldso/ldso.c
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
Avoid using strong_alias in ssp, some archs dislike it.
Make stack_chk_guard static.
Export __stack_smash_handler only if compatibility option is enabled.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
|
|
Add some missing prototypes
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
|
|
The printf precision takes an integer, not a size_t. Otherwise we get:
libc/misc/internals/tempname.c: In function '___path_search':
libc/misc/internals/tempname.c:116: warning:
field precision should have type 'int', but argument 3 has type 'size_t'
field precision should have type 'int', but argument 5 has type 'size_t'
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Conflicts:
ldso/include/dl-hash.h
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
If line is longer then size of given buffer and buffer is not allocated by
the config parser itself, then discard rest of line.
Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
We must always initialize line pointer since data pointer might
have changed due to a realloc (in getserv.c for example).
Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
We need to update the parser->line pointer on realloc and do not
initialize the token array til after the potensial realloc in
bb_get_chunk_with_continuation().
While here, also replace a realloc() with malloc() where pointer always
is NULL.
Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
The dynamic linker can be run either indirectly through running some
dynamically linked program or library (in which case no command line options
to the dynamic linker can be passed and, in the ELF case, the dynamic linker
which is stored in the .interp section of the program is executed)
or directly by running:
/lib/ld-uClibc.so.* [OPTIONS] [PROGRAM [ARGUMENTS]]
Stand-alone execution is a prerequisite for adding prelink capabilities
to uClibc dynamic linker, as well useful for testing an updated version
of the dynamic linker without breaking the whole system.
Currently supported option:
--library-path PATH use given PATH instead of content of the environment
variable LD_LIBRARY_PATH
(Mandatory for prelinking)
Not supported options:
--list list all dependencies and how they are resolved
--verify verify that given object really is a dynamically linked
object we can handle
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names
in LIST
This feature can be enabled by setting LDSO_STANDALONE_SUPPORT=y
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
This patch fixes the following build error:
CC libc/misc/internals/__h_errno_location.os
CC libc/misc/internals/parse_config.os
libc/misc/internals/parse_config.c: In function
'bb_get_chunk_with_continuation':
libc/misc/internals/parse_config.c:77: error: 'PAGE_SIZE' undeclared (first use in this function)
libc/misc/internals/parse_config.c:77: error: (Each undeclared identifier is reported only once
libc/misc/internals/parse_config.c:77: error: for each function it appears in.)
make[2]: *** [libc/misc/internals/parse_config.os] Error 1
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
e.g. getservbyname()
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
fgets will happily write over allocated area limits. Adjusted the
buffer size according to how much is already read.
Also increase the maximum default line length, as 80 is slightly
small. It might be better if bb_get_chunk_with_continuation would
reallocate the line buffer if it was not user given.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
This reverts commit 0d6ee549bc86fd330672a79d9a87d2c3825eea67.
We need to find a solution that will work in shared and static libraries
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Closes #2089 (https://bugs.busybox.net/show_bug.cgi?id=2089)
__errno_location / __h_errno_location access has to go through the PLT
like malloc/free, so the linuxthread variants gets used instead when
compiling with -pthread.
Based on http://github.com/mat-c/uClibc/commit/328d392c54aa5dc2b8e7f398a419087de497de2b
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Commit 2e53dd645d5348f207cec7f8595969dc566c5a55 workarounds GCC
bug when accessing _locale_init and _stdio_init. We need the same
fix for __errno_location and __h_errno_location otherwise we crash
calling null with static and non-threaded builds.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
|
This patch fixes some issues building uclibc with linuxthreads, that seem to have
been introduced by the NPTL changes.
Signed-off-by: Andrew Stubbs <ams@codesourcery.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
Otherwise we get compiler errors due to undefined prototypes
as noticed by Denys.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
we ended up calling 0
Fixes bug #1033
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Linker is smart and does not pull in weaks.os, ever. This happens
because that compilation unit does not get strong references and
ld eliminates dead code. We really need the weaks for static build
in a compilation unit that is always there, otherwise it won't work.
Signed-off-by: Timo Teras <timo.teras@iki.fi>
Acked-by: Roman I Khimov <khimov@altell.ru>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Conflicts:
Makefile.in
extra/Configs/Config.in
libc/sysdeps/linux/common/bits/kernel-features.h
libc/sysdeps/linux/common/poll.c
libc/sysdeps/linux/common/sysdep.h
libc/sysdeps/linux/sh/sysdep.h
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Conflicts:
libc/stdlib/Makefile.in
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
|
Conflicts:
libc/inet/Makefile.in
libc/inet/hostid.c
Synchronise nptl branch with master branch @ c4b750195714ec7c10aa4de15610c5aae0751c1c
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
__gen_tempname now needs to not be hidden so libpthread can get at it
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
sem_open(3) needs to create a temporary file in a way which can't
be efficiently implemented in terms of POSIX API. Extend
__gen_tempname with mode_t mode argument in order to ease
sem_open implementation.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
* setup memory for the cancellation buffer
* remove unneeded weak's
* deallocation of tsd on main thread exit
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|