Age | Commit message (Collapse) | Author |
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
eventfd: evntfd assumes to take two arguments instead it
should be one evntfd expects two therefore implement both syscalls with
correct parameters
Thanks Eugene Rudoy for reporting it and also providing the patch
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
|
$a0 is saved across _dl_runtime_resolve(); $v0 is not. Unfortunately,
__syscall_error() uses $v0 for its argument, not $a0 as is the MIPS ABI
standard. This means that if lazy binding was used for __syscall_error(),
the errno value in $v0 could get corrupted.
The problem can be easily seen in testcases where syscalls in librt fail;
when librt tries to call __syscall_error() in libc, the argument gets
lost and errno gets set to a bogus value:
# ./tst-mqueue1 ; echo $?
mq_receive on O_WRONLY mqd_t did not fail with EBADF: Unknown error 2004684208
1
# ./tst-mqueue2 ; echo $?
mq_timedreceive with too small msg_len did not fail with EMSGSIZE: Unknown error 1997360560
1
# ./tst-mqueue4 ; echo $?
mq_timedsend did not fail with ETIMEDOUT: Unknown error 2008747440
1
When _dl_runtime_resolve() was taken out of the equation, the same test
cases passed:
# LD_BIND_NOW=y ./tst-mqueue1 ; echo $?
0
# LD_BIND_NOW=y ./tst-mqueue2 ; echo $?
0
# LD_BIND_NOW=y ./tst-mqueue4 ; echo $?
0
Changing __syscall_error() to look at $a0 instead of $v0 fixed the
problem.
(Note that there is also a "__syscall_error.c" file which presumably
uses the standard C calling conventions, but I do not think it is used
on MIPS.)
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Some callers passed the first argument in $v0, while others used $a0.
Change the callers to use $a0 consistently.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
For set-user-ID/set-group-ID ELF binaries, only libraries in the standard
search directories that are also set-user-ID must be loaded.
This patch fixes existing logic according to the above statement.
Furthermore if either library setuid bit isn't set or it cannot be found in
the standard search path, the library won't be preloaded but execution go
ahead with default one.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
The existing DSBT support relies on the kernel to provide DSBT info
as part of the load maps passed to user space. The problem with this
approach is that the DSBT info is in the dynamic section, so the
kernel must access a userspace mapping of the dynamic section (or
separately read a copy for the kernel) in order to retrieve the
information needed by userspace.
This patch reworks the DSBT support to remove the reliance on DSBT
info coming from the kernel. Instead, ldso reads the info itself from
the dynamic section. One other benefit of this is that it allows the
existing kernel FDPIC loader to also load DSBT binaries.
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Linux has provided these functions since the 2.1.x era, so no need to
keep these around. We'd rather find out when things are missing (and
fix that) than fall back to the unsafe hacks.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Some arches got this fix, but many did not. So copy the ifdef logic to
the ones that missed it to fix behavior in linux-2.6+.
URL: https://bugs.busybox.net/show_bug.cgi?id=5258
Reported-by: David Laight <david.laight@aculab.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Peter Mazinger says in [1]:
"I can revert it to the old behaviour in master (the change s://:/: should stay though)."
[1] http://lists.uclibc.org/pipermail/uclibc/2011-March/045049.html
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
This reverts commit 5dffed7dd1a413f3965af702fa7ecd79809d1988.
This breaks ldd when HARDWIRED_ABSPATH=n.
[1] http://lists.uclibc.org/pipermail/uclibc/2011-March/045048.html
From: Timo Teräs <timo.teras@iki.fi>
Your commit 5dffed7dd1a413f3965af702fa7ecd79809d1988 removed absolute
path from the interpreter binary name embedded in ELF files.
This makes ldd seg.fault as it seems to assume absolute paths.
gdb sayeth:
(gdb) where
#0 0x00111ae3 in find_elf_interpreter (ehdr=0xb7a74000) at
../utils/ldd.c:556
#1 0x00111f2a in find_dependencies (filename=0x114910
"/home/fabled/aports/main/libc0.9.32/src/uClibc-0.9.32-rc3/lib/librt.so.0.9.32")
at ../utils/ldd.c:676
#2 0x0011228e in main (argc=1, argv=0xbffff6e8) at ../utils/ldd.c:777
(gdb) p tmp
tmp = NULL
(gdb) p interp_dir
$1 = 0x116660 "ld-uClibc.so.0.9.32"
[2] http://lists.uclibc.org/pipermail/uclibc/2011-March/045054.html
From: Mike Frysinger <vapier@gentoo.org>
On Wed, Mar 23, 2011 at 7:18 AM, Peter Mazinger wrote:
>> Your commit 5dffed7dd1a413f3965af702fa7ecd79809d1988 removed absolute
>> path from the interpreter binary name embedded in ELF files.
>
> do you consider my patch wrong?
yes. the absolute path to the ldso must be encoded in binaries. the
point of HARDWIRED_ABSPATH is purely for sysroot/non-sysroot
toolchain, and the interp path isnt involved with that.
are you sure this even works at runtime ? i'm pretty sure the kernel
doesnt do any path lookups on the interp string.
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Fix the implementation of mmap based on the mmap2 system call, to
construct pgoffset from offset with an unsigned shift rather than a
signed (off_t) shift. The mmap2 test in the testsuite catches this case
by mmap'ing with a large offset (with the sign bit set). The signed
shift repeats the sign bit making the page shift way out of range. This
is already fixed similarly in mmap64().
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
The latest POSIX spec introduces a "m" character to allocate buffers for
the user when using scanf type functions. This is like the old glibc "a"
flag, but now standardized. With packages starting to use these, we need
to implement it.
for example:
char *s;
sscanf("foo", "%ms", &s);
printf("%s\n", s);
free(s);
This will automatically allocate storage for "s", read in "foo" to it,
and then display it.
I'm not terribly familiar with the stdio layer, so this could be wrong.
But it seems to work for me.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
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>
|
|
Tweak whitespace in preprocessor conditionals. No obj-code changes.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
This reverts commit 5e0dbdb9e5acdcf7dea29335a5db065f48c58766.
CROSS is only a compat thing and should not be advertised
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
should maybe better read "override CROSS_COMPILE from above"
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Pull in the epoll header for the epoll structs.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Only really old systems (<=linux-2.0) lack a dedicated vfork system call.
The code that is in place to support them is causing issues with newer
arches that also don't provide a vfork system call -- instead, they do
vfork by calling clone in userspace.
If anyone cares about these really old systems, they can submit a patch
to make the system work with them while not breaking newer systems.
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Mike, it would have been much simpler to just leave the header impl-free
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
The throw markings on the inline func trigger errors when building with
C++. Since this inline version doesn't throw any exceptions, just drop
the markings completely and be done with it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Since rpmatch will match ^[Yy] and ^[Nn] regardless of locale, this
lets us create a simple inline version. Newer procps versions use
this function.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Since glibc has split out arch-specific stuff to bits/epoll.h, we can
pull that sanity back into our tree and drop the arch ifdefs.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Older kernels use __NR__llseek for a 64-bit lseek syscall. Newer
kernels use __NR_llseek. This patch fixes the implementation of
lseek64 to use the __NR_llseek syscall if it exists.
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
The test for generating a stub for getpgrp was wrong and would
result in duplicate symbols when building without __NR_getpgrp,
but with __NR_getpgid and __NR_getpid.
A closer look at the getpgrp implementation using getpgid showed
that getpid was being called to pass the current pid to getpgid.
This is unnecessary because passing 0 to getpgid returns the
pgid of the current process.
This patch cleans up the getpgrp implementation and the stub test.
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Some arches check the size in INLINE_SYSCALL() and barf if it's
too big (i.e. a 64bit value getting truncated to 32bit).
Satisfy error-check on ppc32.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Should be no functional changes; just fixing:
libpthread/linuxthreads.old/manager.c: In function 'pthread_free':
libpthread/linuxthreads.old/manager.c:707:9: warning:
variable 'h_bottom_save' set but not used [-Wunused-but-set-variable]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
This matches the newer linuxthreads code, and fixes the build warning:
libpthread/linuxthreads.old/manager.c: In function 'pthread_handle_create':
libpthread/linuxthreads.old/manager.c:487:7: warning:
variable 'saved_errno' set but not used [-Wunused-but-set-variable]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Move spin_count down to the code block where it's used to fix the warning:
libpthread/linuxthreads.old/spinlock.c: In function '__pthread_lock':
libpthread/linuxthreads.old/spinlock.c:70:7: warning:
variable 'spin_count' set but not used [-Wunused-but-set-variable]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Reported-by: Tony Wu <tung7970@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
The normal error() func implicitly appends a newline, so make sure we do
the same. Otherwise getconf outputs an error message like so:
prompt$ getconf -h
Unrecognized variable `-h'prompt$
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
These stubs get used in libc as forwarding funcs, so we don't want them
labeled as hidden. Otherwise, attempting to use them in other libraries
(like libdl) will result in references to symbols that only libpthread
provides. Such as:
/usr/bin/python2.6: can't resolve symbol '__pthread_mutex_lock' in lib '/lib/libdl.so.0'.
This also brings the old code in line with the newer linuxthreads.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
getrlimit previously was only called for NPTL (why?), fix that to be
used everywhere.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
PR 4964
Eric Nadler writes:
It looks to me like the base structure is not fully initialized
with 0 (only a subset of the structure is initialized).
This later results in a free of base->collate.index2weight in
_locale_set_l.
This free tries to free uninitialized memory and segfaults.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Fix incorrect output of BOM when converting charactersets by name. Only
affective when iconv/locale enabled.
Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
PR 4201
ftok() always used 32bit stat
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
-4b
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
PR networking/4916
Reserve space for the terminating 0 alias and zero out the
scratch-buffer so the last entry of the alias list is empty.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|