[PATCH] wprintf overflow

2007-12-11 Thread Kevin Cernekee
Hi, I am seeing a buffer overflow in uClibc-0.9.28 on mipsel, illustrated by the following test program: #include #include int main(int argc, char **argv) { wprintf(L"This line is OK\n"); wprintf(L"This line is no problem either because the format spec is at the end: %d\n", 1)

Re: [PATCH] wprintf overflow

2008-02-25 Thread Kevin Cernekee
On Thu, 7 Feb 2008, Carmelo AMOROSO wrote: > The fix I committed I think it's better... because solve the stack > overflow but keep the check against > higher character. > I tested it and it works. Let me know your comments. Hi, One of the concerns I had with that loop is that it always aborts

[PATCH] MIPS NPTL: Clean up _ABI64 warnings

2009-09-26 Thread Kevin Cernekee
Signed-off-by: Kevin Cernekee --- ldso/ldso/mips/elfinterp.c |2 +- libc/sysdeps/linux/mips/sys/regdef.h |2 ++ .../unix/sysv/linux/mips/bits/pthreadtypes.h |2 ++ 3 files changed, 5 insertions(+), 1 deletions(-) diff --git a/ldso/ldso

[PATCH] Fix GNU make v3.80 compatibility

2011-02-10 Thread Kevin Cernekee
Commits 1f6601a and 094d82d introduced the "else ifeq" construct, which requires GNU make v3.81 or higher. This breaks the build on RHEL4 hosts. Signed-off-by: Kevin Cernekee --- libc/sysdeps/linux/common/Makefile.in |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-)

Re: static linking failed with sigaction testing program

2011-03-26 Thread Kevin Cernekee
On Fri, Mar 25, 2011 at 6:33 PM, Peter Mazinger wrote: > I assume you are using NPTL as threads, NPTL devs, one of the __sigactions > needs probably be weak > I would say, do not use that syntax, the compiler defaults should be correct > (speak, -lc is added at the end of linking, if any earl

Re: static linking failed with sigaction testing program

2011-03-27 Thread Kevin Cernekee
On Sat, Mar 26, 2011 at 10:26 PM, Mike Frysinger wrote: > really you should be looking at how the linker processes things.  use > -Wl,-M for both. Thanks for the tip. That is useful. So, for "-static -lpthread -lc" on uClibc: The test program needs sigaction(), and this pulls in libpthread.a(p

[PATCH] Drop GNU make 3.80 compatibility

2011-04-01 Thread Kevin Cernekee
holdouts still running 3.80. So we might as well officially require 3.81. Signed-off-by: Kevin Cernekee --- Rules.mak |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Rules.mak b/Rules.mak index 0aa6843..70fb851 100644 --- a/Rules.mak +++ b/Rules.mak @@ -17,8 +17,8 @@

Re: [PATCH] Drop GNU make 3.80 compatibility

2011-04-01 Thread Kevin Cernekee
On Fri, Apr 1, 2011 at 1:43 PM, Mike Frysinger wrote: > On Fri, Apr 1, 2011 at 11:23 AM, Kevin Cernekee wrote: >> The "$(and" operator requires GNU make 3.81.  On 3.80 it is a no-op. >> Consequently, strange build problems (failure to compile madvise.c) pop >> up wh

[PATCH] buildsys: fix GNU make v3.80 compatibility again

2011-04-09 Thread Kevin Cernekee
GNU make 3.80 cannot handle "$(and)" or "$(or)" from commit 18e7136e (buildsys: use kbuild style). Replace them with ifeq/ifneq. Signed-off-by: Kevin Cernekee --- libc/sysdeps/linux/common/Makefile.in |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff

Re: [PATCH] Drop GNU make 3.80 compatibility

2011-04-09 Thread Kevin Cernekee
On Fri, Apr 8, 2011 at 5:34 PM, Khem Raj wrote: > I think it would be nice to keep it working with make 3.80 even though > its 10 years old. Are these problems widespread ? if not then consider > cooking up a patch :) Done. There is one more occurrence in the link.asneeded function (Rules.mak) w

[PATCH 1/2] dl-startup: fix typos in block comment

2011-04-16 Thread Kevin Cernekee
Signed-off-by: Kevin Cernekee --- ldso/ldso/dl-startup.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c index a51b583..4492660 100644 --- a/ldso/ldso/dl-startup.c +++ b/ldso/ldso/dl-startup.c @@ -32,8 +32,8

[PATCH/RFC 2/2] Cache AT_PLATFORM and AT_L1D_CACHESHAPE from auxvec

2011-04-16 Thread Kevin Cernekee
Signed-off-by: Kevin Cernekee --- include/libc-internal.h |4 libc/misc/internals/__uClibc_main.c | 13 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/libc-internal.h b/include/libc-internal.h index 3ac0b05..ef5ce59 100644 --- a/in

Re: [PATCH/RFC 2/2] Cache AT_PLATFORM and AT_L1D_CACHESHAPE from auxvec

2011-04-17 Thread Kevin Cernekee
On Sun, Apr 17, 2011 at 1:56 AM, Carmelo Amoroso wrote: > I'm really interested into such a thing. I've posted months ago a patch for > SH4 to retrieve Cache info through auxvect > as well (also pagesize). I do remember seeing your patch on the list. Didn't realize it was never merged. > I thi

Re: [PATCH 1/3] libc_elf: improve auxiliary vector handling

2011-05-02 Thread Kevin Cernekee
On Mon, May 2, 2011 at 9:44 AM, Carmelo AMOROSO wrote: > This patch is aimed to improve the aux vect handling to gather some useful > information from the system through the aux vect. It is achieved by: Thanks for working on this - it looks like we're on the right track. A few cosmetic nitpicks:

Re: [PATCH 2/3] libc_elf_sh: specific auxiliary vector handling for SH

2011-05-02 Thread Kevin Cernekee
On Mon, May 2, 2011 at 9:44 AM, Carmelo AMOROSO wrote: > +/* Decode the cpu dcache way size from the dcache shape */ > +/* Bits 0-3 contains associativity; bits 4-7 contains log2 of line size */ > + > +#define shape_to_waysize(__shape)((__shape & ~0xff) / (__shape & 0xf)) It may be useful to

Re: [PATCH 3/3] libc_elf_mips: specific auxiliary vector handling for MIPS

2011-05-02 Thread Kevin Cernekee
On Mon, May 2, 2011 at 9:44 AM, Carmelo AMOROSO wrote: > Extend aux vect handling for MIPS to retrieve DCache shape information > and platform string. I had to add a (verbatim) copy of the SH Makefile.arch, for MIPS, in order to get the new dl-support.c file added to the build. > +attribute_hidd

[PATCH/RFC future] nptl: reinstate SIGCANCEL/SIGSETXID safeguards

2011-05-07 Thread Kevin Cernekee
libpthread. Signed-off-by: Kevin Cernekee --- libc/signal/sigfillset.c|4 libc/sysdeps/linux/common/sigprocmask.c |4 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/libc/signal/sigfillset.c b/libc/signal/sigfillset.c index ef60f10..e041f08 100644 --- a

Re: [PATCH/RFC future] nptl: reinstate SIGCANCEL/SIGSETXID safeguards

2011-05-07 Thread Kevin Cernekee
On Sat, May 7, 2011 at 7:16 PM, Rich Felker wrote: >> libc sigfillset() returns a full set: all 128 bits are set.  libpthread >> sigfillset() sets only 126 bits: everything except SIGCANCEL/SIGSETXID. > > I fail to see how having sigfillset/sigaddset do the blocking of these > signals makes sense.

Re: [PATCH/RFC future] nptl: reinstate SIGCANCEL/SIGSETXID safeguards

2011-05-08 Thread Kevin Cernekee
On Sun, May 8, 2011 at 8:19 AM, Peter Mazinger wrote: >> libc sigfillset() returns a full set: all 128 bits are set.  libpthread >> sigfillset() sets only 126 bits: everything except SIGCANCEL/SIGSETXID. >> >> libpthread sigprocmask() has extra code to prevent the caller from >> blocking >> SIGCAN

Re: [PATCH/RFC future] nptl: reinstate SIGCANCEL/SIGSETXID safeguards

2011-05-08 Thread Kevin Cernekee
Couple more data points to muddy the waters: x86 glibc 2.11.1 (same result for -pthread and non -pthread): sigfillset refused to set: 32 (Unknown signal 32) sigfillset refused to set: 33 (Unknown signal 33) sigprocmask refused to mask: 9 (Killed) sigprocmask refused to mask: 19 (Stopped (signal))

Re: [PATCH/RFC future] nptl: reinstate SIGCANCEL/SIGSETXID safeguards

2011-05-10 Thread Kevin Cernekee
On Tue, May 10, 2011 at 2:06 PM, Peter Mazinger wrote: > I am for only one implementation (that should go only into libc), else you > have unpredictable/different results depending on which linking order you > choose libc/libpthread Austin's patch in the -future branch does accomplish this, but

New libgcc_eh dependency for ARM_EABI targets

2011-06-10 Thread Kevin Cernekee
Commit 4916fd88 (present in v0.9.32, but not in v0.9.32-rc3) created a new dependency on libgcc_eh.a for the final link stage: uClibc-0.9.32/libubacktrace/Makefile.in: ifeq ($(CONFIG_ARM_EABI),y) LIBGCC += $(shell $(CC) -print-file-name=libgcc_eh.a) endif I build gcc stage 1 with --disable-share

Re: New libgcc_eh dependency for ARM_EABI targets

2011-06-10 Thread Kevin Cernekee
> Sorry, my patch actually not meant to address your exact situation, > but rather the unconditional linking of gcc_eh when libubacktrace is > not enabled. One possibility is to apply your patch, build the first stage uClibc with UCLIBC_HAS_BACKTRACE disabled, then re-enable it and rebuild once gc

Re: Buildroot and bitbake

2011-06-11 Thread Kevin Cernekee
On Sat, Jun 11, 2011 at 12:58 PM, Thomas Petazzoni wrote: > Rob Landley a écrit : >> I dunno about "recommended".  By who?  There are people using >> buildroot (which is a repository accumulating build descriptions for >> the "bitbake" build tool) > > Sorry to contradict, Buildroot is not related

Re: dlsym call fails

2011-07-21 Thread Kevin Cernekee
On Thu, Jul 21, 2011 at 2:52 AM, manish kumar wrote: >        if(!libc_malloc) >                libc_malloc = (void *(*)(size_t))dlsym(RTLD_NEXT, "malloc"); > dlerror(); You probably want braces here, but that is not a likely cause of the reported problem. I have seen cases where uClibc dlsym(R

[PATCH 1/3] ldso/mips: Enable bootstrap relocations

2011-07-24 Thread Kevin Cernekee
dso itself crashes before the program even starts. This is caused by _dl_dprintf() dereferencing an unadjusted string pointer such as 0xe570. This patch enables the missing relocations and allows LD_DEBUG to work as designed. Signed-off-by: Kevin Cernekee --- ldso/ldso/dl-startup.c |2 +

[PATCH 2/3] ldso/mips: dlsym() incorrectly matches undefined symbols

2011-07-24 Thread Kevin Cernekee
cause check_match to report a false positive when examining the external symbol reference. Consequently dlsym() will return a bad pointer to the caller. Use the special MIPS logic from glibc-ports-2.13 to avoid this situation. Signed-off-by: Kevin Cernekee --- ldso/ldso/dl-hash.c|

[PATCH 3/3] ldso/mips: Clean up warnings

2011-07-24 Thread Kevin Cernekee
warning: assignment makes pointer from integer without a cast In file included from ldso/ldso/ldso.c:1097:0: ldso/ldso/dl-elf.c: In function '_dl_load_elf_shared_library': ldso/ldso/dl-elf.c:811:3: warning: assignment makes pointer from integer without a cast Signed-off-by: Kevin Ce

Re: negative memcpy

2011-08-10 Thread Kevin Cernekee
On a MIPS 74K I would expect it to end up here: >>   400338:     28c80008        slti    t0,a2,8 >>   40033c:     1535        bnez    t0,400414 <__BMIPS3300_memcpy_last8> >>   400340:     00801021        move    v0,a0 ... >> 00400414 <__BMIPS3300_memcpy_last8>: >>   400414:     18c6    

[PATCH 1/2] test/README: Trivial fixes for spelling error and long lines

2012-02-08 Thread Kevin Cernekee
Signed-off-by: Kevin Cernekee --- test/README |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 8fb12d9..7d0fe52 100644 --- a/test/README +++ b/test/README @@ -1,7 +1,7 @@ --- For: User --- -Following make targets

[PATCH 2/2] MIPS: Fix more *_NONBLOCK definitions

2012-02-08 Thread Kevin Cernekee
ds special treatment. Signed-off-by: Kevin Cernekee --- libc/sysdeps/linux/mips/sys/inotify.h | 105 + libc/sysdeps/linux/mips/sys/timerfd.h | 60 +++ 2 files changed, 165 insertions(+), 0 deletions(-) create mode 100644 libc/sysdeps/linux/mips/sys

Re: [PATCH 2/2] MIPS: Fix more *_NONBLOCK definitions

2012-02-08 Thread Kevin Cernekee
On Wed, Feb 8, 2012 at 10:12 PM, Kevin Cernekee wrote: > SOCK_NONBLOCK: correct > SFD_NONBLOCK: correct (fixed in recent commit f87898ca) > TFD_NONBLOCK: incorrect > IN_NONBLOCK: incorrect Attaching the test cases I wrote to validate that these four syscalls work correctly on my n

Re: [PATCH] prevent retries on fclose/fflush after write errors

2012-03-10 Thread Kevin Cernekee
On Sat, Feb 12, 2011 at 6:31 PM, Denys Vlasenko wrote: >> >Currently, uclibc retains buffered data on stdio write errors, >> >and subsequent fclose and fflush will try to write it out again >> >(in most cases, in vain). This seems to be causing some strange problems on bash as well. Is there any

Re: [PATCH] prevent retries on fclose/fflush after write errors

2012-03-11 Thread Kevin Cernekee
t the second > write() attempt seems strange, and leads to an unwanted outcome. GPIO 5 gets > exported. This patch prevents that. Signed-off-by: Denys Vlasenko Signed-off-by: Kevin Cernekee --- libc/stdio/_WRITE.c | 30 -- 1 files changed, 24 insertions(+), 6 de

[PATCH 1/8] test: Ignore various test objects

2012-04-07 Thread Kevin Cernekee
Signed-off-by: Kevin Cernekee --- test/.gitignore |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/test/.gitignore b/test/.gitignore index c892816..a39fbec 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -29,11 +29,15 @@ dlopen/dltest2 dlopen/dlundef dlopen

[PATCH 3/8] test/signal: Fix compile warning in tst-sigset

2012-04-07 Thread Kevin Cernekee
Move up the variable declaration, to fix this: tst-sigset.c: In function 'do_test': tst-sigset.c:28:3: warning: ISO C90 forbids mixed declarations and code Signed-off-by: Kevin Cernekee --- test/signal/tst-sigset.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) di

[PATCH 4/8] test/signal: Add tst-signalfd

2012-04-07 Thread Kevin Cernekee
Signed-off-by: Kevin Cernekee --- test/.gitignore|1 + test/signal/tst-signalfd.c | 63 2 files changed, 64 insertions(+), 0 deletions(-) create mode 100644 test/signal/tst-signalfd.c diff --git a/test/.gitignore b/test/.gitignore

[PATCH 5/8] test/time: Add tst-timerfd

2012-04-07 Thread Kevin Cernekee
Signed-off-by: Kevin Cernekee --- test/.gitignore |1 + test/time/tst-timerfd.c | 71 +++ 2 files changed, 72 insertions(+), 0 deletions(-) create mode 100644 test/time/tst-timerfd.c diff --git a/test/.gitignore b/test/.gitignore index

[PATCH 6/8] test/inet: Add tst-sock-nonblock

2012-04-07 Thread Kevin Cernekee
Signed-off-by: Kevin Cernekee --- test/.gitignore |1 + test/inet/tst-sock-nonblock.c | 53 + 2 files changed, 54 insertions(+), 0 deletions(-) create mode 100644 test/inet/tst-sock-nonblock.c diff --git a/test/.gitignore b/test

[PATCH 7/8] test/misc: Add tst-inotify

2012-04-07 Thread Kevin Cernekee
Signed-off-by: Kevin Cernekee --- test/.gitignore |1 + test/misc/tst-inotify.c | 66 +++ 2 files changed, 67 insertions(+), 0 deletions(-) create mode 100644 test/misc/tst-inotify.c diff --git a/test/.gitignore b/test/.gitignore index

[PATCH V2 8/8] MIPS: Fix more *_NONBLOCK definitions

2012-04-07 Thread Kevin Cernekee
add #ifdef clauses for __mips__, similar to what was done for SFD_NONBLOCK in include/sys/signalfd.h . This fixes the two failing test cases. Signed-off-by: Kevin Cernekee --- libc/sysdeps/linux/common/sys/inotify.h | 11 +++ libc/sysdeps/linux/common/sys/timerfd.h | 11 ++

Re: [PATCH V2 8/8] MIPS: Fix more *_NONBLOCK definitions

2012-04-07 Thread Kevin Cernekee
On Sat, Apr 7, 2012 at 2:09 PM, Khem Raj wrote: >> After seeing a problem report involving one of the O_NONBLOCK >> "derivatives," I looked through the tree to see what else might be >> affected.  Here is what I found: > > We already have this kind of patch in future branch IIRC I think TFD_NONBL

Re: [PATCH V2 8/8] MIPS: Fix more *_NONBLOCK definitions

2012-04-07 Thread Kevin Cernekee
On Sat, Apr 7, 2012 at 10:32 PM, Mike Frysinger wrote: > On Saturday 07 April 2012 16:31:32 Kevin Cernekee wrote: >> The proposed change is to add #ifdef clauses for __mips__, similar to >> what was done for SFD_NONBLOCK in include/sys/signalfd.h .  This fixes >> the t

[PATCH 1/4] inotify_rm_watch: Change second argument to int

2012-04-08 Thread Kevin Cernekee
>From glibc: 2009-01-30 Ulrich Drepper [BZ #7040] * sysdeps/unix/sysv/linux/sys/inotify.h: Second parameter of inotify_rm_watch should have type int. This change allows us to copy inotify.h verbatim from glibc into uClibc. Signed-off-by: Kevin Cernekee --- l

[PATCH 2/4] inotify.h: Use new "bits/" scheme for arch-specific flags

2012-04-08 Thread Kevin Cernekee
has not been updated in glibc. All others use the common definition. Signed-off-by: Kevin Cernekee --- Makefile.in |1 + libc/sysdeps/linux/alpha/bits/inotify.h | 29 + libc/sysdeps/linux/common/bits/inotify.h | 29

[PATCH 3/4] timerfd.h: Use new "bits/" scheme for arch-specific flags

2012-04-08 Thread Kevin Cernekee
has not been updated in glibc. All others use the common definition. Signed-off-by: Kevin Cernekee --- Makefile.in |1 + libc/sysdeps/linux/alpha/bits/timerfd.h | 29 + libc/sysdeps/linux/common/bits/timerfd.h | 29

[PATCH 4/4] signalfd.h: Use new "bits/" scheme for arch-specific flags

2012-04-08 Thread Kevin Cernekee
it has not been updated in glibc. All others use the common definition. Signed-off-by: Kevin Cernekee --- Makefile.in|1 + include/.gitignore |1 + libc/sysdeps/linux/alpha/bits/signalfd.h | 29

[PATCH 1/2] MIPS: Convert __syscall_error() callers to use $a0 for argument

2012-06-05 Thread Kevin Cernekee
Some callers passed the first argument in $v0, while others used $a0. Change the callers to use $a0 consistently. Signed-off-by: Kevin Cernekee --- libc/sysdeps/linux/mips/vfork.S|1 + .../unix/sysv/linux/mips/mips64/sysdep-cancel.h|2 +- .../sysdeps/unix/sysv

[PATCH 2/2] MIPS: Use $a0 instead of $v0 for __syscall_error() argument

2012-06-05 Thread Kevin Cernekee
presumably uses the standard C calling conventions, but I do not think it is used on MIPS.) Signed-off-by: Kevin Cernekee --- libc/sysdeps/linux/mips/syscall_error.S |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libc/sysdeps/linux/mips/syscall_error.S b/libc/sysdeps/

Re: [PATCH 1/2] MIPS: Convert __syscall_error() callers to use $a0 for argument

2012-06-06 Thread Kevin Cernekee
On Wed, Jun 6, 2012 at 12:38 AM, Bernhard Reutner-Fischer wrote: > On Tue, Jun 05, 2012 at 03:05:19PM -0700, Kevin Cernekee wrote: >>Some callers passed the first argument in $v0, while others used $a0. >>Change the callers to use $a0 consistently. > > Applied the

Re: [PATCH 2/2] MIPS: Use $a0 instead of $v0 for __syscall_error() argument

2012-06-06 Thread Kevin Cernekee
On Wed, Jun 6, 2012 at 12:06 PM, Rich Felker wrote: > Why would lazy binding ever be used for __syscall_error? Shouldn't > this be bound at link time via appropriate visibility or otherwise? I > can't think of any reason you'd want it to be possible to override > it... Within libc.so itself, I be

[PATCH] buildsys: clean up libubacktrace linker script handling

2012-06-07 Thread Kevin Cernekee
. Signed-off-by: Kevin Cernekee --- Makefile.in |7 +-- Rules.mak|8 +--- libc/Makefile.in |1 + 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index fb118c0..8405f43 100644 --- a/Makefile.in +++ b/Makefile.in @@ -341,18

Re: [PATCH] buildsys: clean up libubacktrace linker script handling

2012-06-14 Thread Kevin Cernekee
On Wed, Jun 13, 2012 at 12:58 AM, Bernhard Reutner-Fischer wrote: > On Tue, Jun 12, 2012 at 04:52:21PM +0100, Carmelo AMOROSO wrote: >>On 07/06/2012 19.32, Kevin Cernekee wrote: >>> Move the AS_NEEDED insertion into libc/Makefile.in, and add a case to >>> the HAR

Re: [PATCH] buildsys: clean up libubacktrace linker script handling

2012-06-15 Thread Kevin Cernekee
HARDWIRED_ABSPATH setting now, and introduces slightly less cruft in Makefile.in. -- 8< -- From: Kevin Cernekee Commit 01c125c3bd8f949f8e5711e09152859eecd1b004 (buildsys: clean up libubacktrace linker script handling) caused a regression seen when bootstrapping a new compiler: the libc.so linker scr