Age | Commit message (Collapse) | Author |
|
Follow-up of e3d6c8bffe79b2c070bc7a3aabc9d9c65f6b099e
Signed-off-by: Eugene Rudoy <gene.devel@gmail.com>
Signed-off-by: Ralf Friedl <Ralf.Friedl@online.de>
|
|
After discussions on the busybox mailinglist.
Reported-by: Ralf Friedl <Ralf.Friedl@online.de>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
In the test-case of statfs from ltp-testsuite, it pass -1 to 2th
argument. eg: fstatfs(fd , -1)
When uclibc-ng parse the buf32 to buf will cause illegal address
access, the kernel will signal the process with SIGSEGV.
If we pass the -1 directly to the syscall of statfs/fstatfs, kernel
use copy_to_user() to prevent the signal of SIGSEGV and just return
EINVAL.
This is the ltp-testsuite expect.
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
|
|
The function towlower doesn't work with locales different from C.
Issue was introduced in commit: 8cde3a9bf2856dcb9a759dec7ecb04a68e712254
Call to setlocale is needed for correct generation of the table uplow_diff.
Otherwise you receive compile time error "range assumption error" after
uncommenting the call.
Similar problem described here:
http://lists.uclibc.org/pipermail/uclibc/2015-March/048852.html
This commit fix the problem by using int32_t values.
|
|
|
|
|
|
|
|
Signed-off-by: mirabilos <m@mirbsd.org>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
|
|
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
|
|
|
|
Remove __UCLIBC_HAS_OBSTACK__ as it isn't very uptodate and
maintained part. It shouldn't be required for any software and
mostly shipped with stuff which use it. (f.e. binutils-gdb)
|
|
Revert the removal of the weak pthread functions and
guarantee a link order so that single threaded applications
doesn't link in all the pthread functions they don't use.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
|
|
As __UCLIBC_HAS_GETTEXT_AWARENESS__ is never defined, this is
mostly dead code. It is planned to integrate libiconv-tiny
and gettext-tiny into uClibc-ng after the next release, so
that more software packages can be used without modification.
Remove any _/_N macro usage.
|
|
|
|
Originally fixed in GNU libc by:
commit 794c3ad3a405697e2663b00f616e319383b9bb7d
Author: Ulrich Drepper <drepper@gmail.com>
Date: Fri Jan 14 08:06:22 2011 -0500
Reported-by: Denys Vlasenko <vda.linux@googlemail.com>
via busybox mailinglist.
|
|
Change directory back to the parent before processing
the directory (after the contents have already been processed).
Signed-off-by: John Ata <john.ata@baesystems.com>
|
|
Enable locale application to be build when utils are
build. Remove useless compile and link warnings.
Default to minimal locale builds.
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Similar to musl libc a single libc has many benefits and solves
some open issues with uClibc-ng.
- no pthread_mutex_* weak symbols exported anymore
- applications no longer failing to link when either
-lrt or -lpthread are missing for dynamic and static linking mode
- smaller C library
- slightly better runtime performance
|
|
Nobody should use gcc 3.3 nowadays.
|
|
|
|
GDB 7.11 does not build if compiled against uclibc-ng (1.0.12 was used,
but the problematic code exists in 1.0.13 as well). The reason is that
GDB release includes its own obstack implementation, but elides the code
if <gnu-versions.h> declares a compatible obstack implementation in
libc. uclibc-ng does claim compatible obstack interface (GDB expects
version 2, but accepts version 1 if sizeof(int) == sizeof(size_t)),
however, uclibc-ng does not provide the _obstack_free symbol that is a
part of the interface (glibc does provide this symbol). This later
causes a link failure.
The attached patch makes uclibc-ng enables an alias _obstack_free ->
obstack_free.
Signed-off-by: Alexey Neyman <stilor@att.net>
|
|
The FR-V port is really broken, and I have no emulator
or hardware for this platform. I tried to get some hardware
from RedHat, who made the FR-V port initially. Unfortunately
Fujitsi didn't agreed to sent me some of their unused spare
hardware lying @RedHat. As I invested some time to get stuff compiled,
I decided to add the code and may be anytime later I can gain
access to some emulator or hardware.
GDB simulator for FR-V doesn't support booting Linux AFAIK.
|
|
Saves 0.6k bss with default buffer size(256).
text data bss dec hex filename
- 1172 8 408 1588 634 libc/misc/utmp/utent.os
- 429 0 256 685 2ad libc/unistd/getpass.os
+ 1208 8 28 1244 4dc libc/misc/utmp/utent.os
+ 471 0 4 475 1db libc/unistd/getpass.os
================================================================
+78 -632
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
Commit 4139fe5aec935ba3f462dcaf6aafb6e5eadf1ab9 fixes SIGSTOPed syslogd issue.
but introduced new one - messages will be lost when socket buffer gets full,
not only if syslogd is stalled, but even if it accepts message slower than
someone sends and possibly leads to security hole, when important messages get
lost as result of attacker flooding.
Patch adds 1 second waiting for socket buffer can accept the message, helps
when syslogd is working hard. If it's stalled/SIGSTOPed, message will be sent
to errout as before. After that, further non-blocking /dev/log connect attempts
will fail immediately with EAGAIN error until syslogd reads some from it.
function old new delta
openlog_intern 259 355 +96
static.tv - 8 +8
.rodata 151 159 +8
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 112/0) Total: 112 bytes
Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
|
|
If syslogd is stopped and restarted while a process has the log open, the next
message that process produces will be logged to the console and not to the new
instance of syslogd. Further messages will be routed correctly, but not the
first one.
Based on original patch
Bug 3889 - syslog loses messages when syslogd restarted
https://bugs.busybox.net/show_bug.cgi?id=3889
function old new delta
openlog 33 68 +35
__vsyslog 851 848 -3
openlog_intern 318 259 -59
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 35/-62) Total: -27 bytes
Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
|
|
Taken from Freetz.org.
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Move TLS initialization for static builds up to the calling
function as suggested by Daniel Fahlgren.
Reported-By: Daniel Fahlgren <daniel@fahlgren.se>
|
|
Change __gen_tempname() prototype in order to pass the additional
suffix lenght. In __gen_tempname() add a new check for suffixlen.
Update some comments in the code.
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Would fix: date -u +%4Y%2m%2d%2H%2M%2S
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
|
|
There seems to be a bug in gold with static TLS at least on x86_64 (?)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
|
|
Note: _PATH_UTMPX == _PATH_UTMP and the utmp struct is identical to the
utmpx struct so this only changes the external API entrypoints and NOT
the underlying data source.
This saves about 500b (~1300b from previously ~1950) while at it.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
indent only, no code changes
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>
|
|
This reverts commit 84135275cfeebc0b233c1c96eeada4d4178a0b18.
This change is said to make systemd deadlock (cannot reproduce this)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Conflicts:
include/utmp.h
|
|
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
|
|
mkostemp(char *template, int flags) generates a unique temporary
filename from a template. The flags parameter accepts three of
the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC. The
current implementation of mkostemp(3) does not respect the flags
and in fact confuses the flags with the file mode which should
always be S_IRUSR | S_IWUSR. This patch corrects this issue.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
mkostemp(char *template, int flags) generates a unique temporary
filename from a template. The flags parameter accepts three of
the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC. The
current implementation of mkostemp(3) does not respect the flags
and in fact confuses the flags with the file mode which should
always be S_IRUSR | S_IWUSR. This patch corrects this issue.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
issetugid() returns 1 if the process environment or memory address space
is considered tainted, and returns 0 otherwise. This happens, for example,
when a process's privileges are elevated by the setuid or setgid flags on
an executable belonging to root. This function first appeard in OpenBSD 2.0
and is needed for the LibreSSL.
This patch follows the same logic as the equivalent musl commit. For more
information see the commit message at
http://git.musl-libc.org/cgit/musl/commit/?id=ddddec106fd17c3aca3287005d21e92f742aa9d4
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Patch "LT.old: Make __errno_location/__h_errno_location thread safe"
uncovered yet another bug with static linking and errno (hopefully this
is last of them all).
Currently, __errno_location is declared weak but is defined strong.
While this provides with the desired weak semantics in dso, it
is subtly broken in static links.
Quoting Joern Rennecke (ARC gcc expert):
| I think the issue is that you declare the function as weak in the
| header file. That is a rare instance where you want the reference
| use declaration that differs a bit from the definition.
| If the reference uses a weakly declared function, that creates a
| weakref, i.e. the linker won't bother to look for this symbol at
| all - if it gets linked in for some other reason, fine,
| otherwise, it stays zero.
So the solution to declare strong, define weak.
Supporting data
-----------------
orig code: ARM mmap wrapper (LT.old build + my prev patch for errno)
_mmap:
@ args = 8, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
stmfd sp!, {r4, r5, r7, lr}
ldr r5, [sp, #20]
movs ip, r5, asl #20
beq .L2
bl __errno_location(PLT)
mov r3, #22
str r3, [r0, #0]
mvn r0, #0
...
...
.weak __errno_location
A statically linked hello world program which uses mmap too.
As we can see__errno_location is completely gone - which is
semantically wrong - we need functional errno.
00008274 <__GI_mmap>:
8274: e92d40b0 push {r4, r5, r7, lr}
8278: e59d5014 ldr r5, [sp, #20]
827c: e1b0ca05 lsls ip, r5, #20
8280: 0a000004 beq 8298
8284: e320f000 nop {0}
^^^^^^^^^^
8288: e3a03016 mov r3, #22
828c: e5803000 str r3, [r0]
8290: e3e00000 mvn r0, #0
This in turn is due to a fixup in ARM ld which transforms branch-to-null
into a nop. It is better than crashing but still wrong since errno
handling is removed.
With the patch, errno_location is restored back in test program.
00008274 <__GI_mmap>:
8274: e92d40b0 push {r4, r5, r7, lr}
8278: e59d5014 ldr r5, [sp, #20]
827c: e1b0ca05 lsls ip, r5, #20
8280: 0a000004 beq 8298 <__GI_mmap+0x24>
8284: eb000010 bl 82cc <__errno_location>
8288: e3a03016 mov r3, #22
828c: e5803000 str r3, [r0]
Cc: Christian Ruppert <christian.ruppert@abilis.com>
CC: Francois Bedard <Francois.Bedard@synopsys.com>
Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
Cc: Joern Rennecke <joern.rennecke@embecosm.com>
Cc: Jeremy Bennett <jeremy.bennett@embecosm.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
WHY: errno in uClibc is not thread safe
HOW: __errno_location and it's sibling __h_errno_location need to be called
via PLT - even from within libc. That way when linked with pthread,
intra-uClibc callers will also use the thread safe version.
This is achieved by removing the GI alias for these functions,
ensuring that they get called normally (via PLT)
Verified with ARC LT.old and ARM cubieboard2 buildroot (LT.old)
NPTL is unaffected by this bug.
------------ History behind this patch ---------------------
This is a long standing bug (https://bugs.busybox.net/show_bug.cgi?id=2089)
Others have tried to fix it in past (alteast Peter Korsgaard's patch in 2010),
but somehow failed to be merged (or were backed out afterwards).
http://lists.uclibc.org/pipermail/uclibc/2010-July/044176.html
One of the causes could be side effect of atleast one more bug related to
pthreads and static link which has now been fixed.
http://lists.uclibc.org/pipermail/uclibc/2013-October/047958.html
I have solved this w/o looking at other pacthes but would like to give
credit to Peter and others for confirming that it makes sense.
Cc: Christian Ruppert <christian.ruppert@abilis.com>
CC: Francois Bedard <Francois.Bedard@synopsys.com>
Cc: Joern Rennecke <joern.rennecke@embecosm.com>
Cc: Jeremy Bennett <jeremy.bennett@embecosm.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: buildroot@busybox.net
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|