summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv
AgeCommit message (Collapse)AuthorFilesLines
2013-12-04PowerPC64: Fix incorrect CFI in *context routinesUlrich Weigand2-0/+27
The context established by "makecontext" has a link register pointing back to an error path within the makecontext routine. This is currently covered by the CFI FDE for makecontext itself, which is simply wrong for the stack frame *inside* the context. When trying to unwind (e.g. doing a backtrace) in a routine inside a context created by makecontext, this can lead to uninitialized stack slots being accessed, causing the unwinder to crash in the worst case. Similarly, during parts of the "setcontext" routine, when the stack pointer has already been switched to point to the new context, the address range is still covered by the CFI FDE for setcontext. When trying to unwind in that situation (e.g. backtrace from an async signal handler for profiling), it is again possible that the unwinder crashes. Theses are all problems in existing code, but the changes in stack frame layout appear to make the "worst case" much more likely in the ELFv2 ABI context. This causes regressions e.g. in the libgo testsuite on ELFv2. This patch fixes this by ending the makecontext/setcontext FDEs before those problematic parts of the assembler, similar to what is already done on other platforms. This fixes the libgo regression on ELFv2.
2013-12-03Properly handle shm_open validation. Fixes bug 16274.Ondřej Bílka1-2/+2
2013-11-28Add powerpc-nofpu/e500 support functions for atomic compound assignment and ↵Joseph Myers1-0/+6
FLT_ROUNDS.
2013-11-26PowerPC: Fix __fe_nomask_env missing symbolAdhemerval Zanella2-4/+4
This patch fix the missing symbol __fe_nomask_env from commit 41e8926aa4b7f17bc95984737ee82a254ad0911c for GLIBC_2.1.
2013-11-26Use __glibc_reserved instead __unused.Ondřej Bílka40-169/+169
2013-11-25Fix typo in sys/ptrace.h.Carlos O'Donell1-1/+1
The event code is PTRACE_EVENT_SECCOMP, not PTRAVE_EVENT_SECCOMP. This patch fixes the V->C typo. There are no ABI issues since the number remains the same for the code. Code using the old wrong name will need to be updated.
2013-11-13PowerPC: Fix __fe_mask_env exportAdhemerval Zanella2-2/+2
Change SHLIB_COMPAT calls to GLIBC_2_19 for __fe_nomask_env symbol.
2013-11-13Set arch_minimum_kernel to 3.4.0 for x32H.J. Lu2-0/+6
x32 ABI support was added in Linux kernel 3.4.0.
2013-11-13PowerPC: Fix __fe_mask_env exportAdhemerval Zanella3-6/+10
This patch does not export __fe_mask_env anymore, only providing a compatibility symbol. It fixes BZ#14143.
2013-11-08PowerPC: Fix vDSO missing ODP entriesAdhemerval Zanella3-5/+28
This patch fixes the vDSO symbol used directed in IFUNC resolver where they do not have an associated ODP entry leading to undefined behavior in some cases. It adds an artificial OPD static entry to such cases and set its TOC to non 0 to avoid triggering lazy resolutions.
2013-10-31Restrict shm_open and shm_unlink to SHMDIR. Fixes bugs 14752 and 15763.Ondřej Bílka1-6/+8
2013-10-30rename configure.in to configure.acMike Frysinger4-2/+2
Autoconf has been deprecating configure.in for quite a long time. Rename all our configure.in and preconfigure.in files to .ac. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-10-18Add e500 port.Joseph Myers2-1/+4
2013-10-04Move powerpc ports pieces to libc.Joseph Myers24-0/+4153
2013-10-04e500 port: adjust sysdeps/unix/sysv/linux/configure.in case.Joseph Myers2-2/+2
2013-10-04e500 port: getcontext / setcontext / swapcontext.Joseph Myers3-0/+17
2013-10-04PowerPC SIGSTKSZAlan Modra1-0/+54
http://sourceware.org/ml/libc-alpha/2013-08/msg00093.html This copies the sparc version of sigstack.h, which gives powerpc #define MINSIGSTKSZ 4096 #define SIGSTKSZ 16384 Before the VSX changes, struct rt_sigframe size was 1920 plus 128 for __SIGNAL_FRAMESIZE giving ppc64 exactly the default MINSIGSTKSZ of 2048. After VSX, ucontext increased by 256 bytes. Oops, we're over MINSIGSTKSZ, so powerpc has been using the wrong value for quite a while. Add another ucontext for TM and rt_sigframe is now at 3872, giving actual MINSIGSTKSZ of 4000. The glibc testcase that I was looking at was tst-cancel21, which allocates 2*SIGSTKSZ (not because the test is trying to be conservative, but because the test actually has nested signal stack frames). We blew the allocation by 48 bytes when using current mainline gcc to compile glibc (le ppc64). The required stack depth in _dl_lookup_symbol_x from the top of the next signal frame was 10944 bytes. I guess you'd want to add 288 to that, implying an actual SIGSTKSZ of 11232. * sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h: New file.
2013-10-04PowerPC makecontextAlan Modra2-4/+10
http://sourceware.org/ml/libc-alpha/2013-08/msg00092.html Use conditional form of branch and link to avoid destroying the cpu link stack used to predict blr return addresses. * sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S: Use conditional form of branch and link when obtaining pc. * sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise.
2013-10-04PowerPC LE _dl_hwcap accessAlan Modra3-16/+16
http://sourceware.org/ml/libc-alpha/2013-08/msg00091.html More LE support, correcting word accesses to _dl_hwcap. * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Use HIWORD/LOWORD. * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Ditto. * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Ditto.
2013-09-28tst-fanotify: fix styleMike Frysinger1-8/+9
Reported-by: Andreas Jaeger <aj@suse.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-11Add O_TMPFILE to <fcntl.h>Andreas Schwab2-0/+5
2013-09-06Coordinate IPv6 definitions for Linux and glibcCarlos O'Donell1-0/+12
This change synchronizes the glibc headers with the Linux kernel headers and arranges to coordinate the definition of structures already defined the Linux kernel UAPI headers. It is now safe to include glibc's netinet/in.h or Linux's linux/in6.h in any order in a userspace application and you will get the same ABI. The ABI is guaranteed by UAPI and glibc.
2013-09-05tst-fanotify: skip when we get back EPERMMike Frysinger1-5/+8
Since fanotify_init requires CAP_SYS_ADMIN in order to work (which usually means running as root), we need to handle that error case too. Reported-by: Andreas Jaeger <aj@suse.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-02tst-fanotify: new simple testMike Frysinger2-1/+57
Basic test for the fanotify functions. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-08-30Fix typos.Ondřej Bílka3-3/+3
2013-08-29Remove aix specific files.Ondřej Bílka9-869/+0
2013-08-29Support ELFOSABI_GNU on all GNU systems.Thomas Schwinge1-23/+0
2013-08-29Use ELFOSABI_GNU instead of ELFOSABI_LINUX.Thomas Schwinge1-4/+4
2013-08-29Fix typos.Ondřej Bílka6-6/+6
2013-08-27Clean up __libc_sa_len helper.Roland McGrath3-66/+13
2013-08-21Fix typos.Ondřej Bílka1-1/+1
2013-08-20PowerPC: fix backtrace to handle signal trampolinesAdhemerval Zanella2-0/+23
This patch fixes backtrace for PPC32 and PPC64 to correctly handle signal trampolines. The 'debug/tst-backtrace6.c' also check for SA_SIGINFO handling, where is triggers another vDSO symbols for PPC32.
2013-08-20Include <string.h> in sysdeps/unix/sysv/linux/mmap64.c.Joseph Myers1-0/+1
2013-08-20Use __getpagesize and __ffs in MMAP2_PAGE_SHIFT == -1 case of mmap64.Joseph Myers1-3/+2
2013-08-20 * sysdeps/unix/sysv/linux/s390/sys/procfs.h (struct elf_prstatus):Andreas Krebbel1-1/+2
Align 32 bit compat elf_greg to 8 bytes.
2013-08-16CVE-2013-4237, BZ #14699: Buffer overflow in readdir_rFlorian Weimer2-2/+0
* sysdeps/posix/dirstream.h (struct __dirstream): Add errcode member. * sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode member. * sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member. * sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit. Return delayed error code. Remove GETDENTS_64BIT_ALIGNED conditional. * sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define GETDENTS_64BIT_ALIGNED. * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise. * manual/filesys.texi (Reading/Closing Directory): Document ENAMETOOLONG return value of readdir_r. Recommend readdir more strongly. * manual/conf.texi (Limits for Files): Add portability note to NAME_MAX, PATH_MAX. (Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX.
2013-07-23PowerPC: use _dl_static_init to set GLRO(gl_pagesize)Adhemerval Zanella4-0/+129
This patch fixes dlfcn/tststatic5 for PowerPC where pagesize variable was not properly initialized in certain cases. This patch is based on other architecture code.
2013-07-21CVE-2013-2207, BZ #15755: Disable pt_chown.Carlos O'Donell1-2/+3
The helper binary pt_chown tricked into granting access to another user's pseudo-terminal. Pre-conditions for the attack: * Attacker with local user account * Kernel with FUSE support * "user_allow_other" in /etc/fuse.conf * Victim with allocated slave in /dev/pts Using the setuid installed pt_chown and a weak check on whether a file descriptor is a tty, an attacker could fake a pty check using FUSE and trick pt_chown to grant ownership of a pty descriptor that the current user does not own. It cannot access /dev/pts/ptmx however. In most modern distributions pt_chown is not needed because devpts is enabled by default. The fix for this CVE is to disable building and using pt_chown by default. We still provide a configure option to enable hte use of pt_chown but distributions do so at their own risk.
2013-07-16BZ #15711: Avoid circular dependency for syscall.hCarlos O'Donell1-2/+9
The generated header is compiled with `-ffreestanding' to avoid any circular dependencies against the installed implementation headers. Such a dependency would require the implementation header to be installed before the generated header could be built (See bug 15711). In current practice the generated header dependencies do not include any of the implementation headers removed by the use of `-ffreestanding'. --- 2013-07-15 Carlos O'Donell <carlos@redhat.com> [BZ #15711] * sysdeps/unix/sysv/linux/Makefile ($(objpfx)bits/syscall%h): Avoid system header dependency with -ffreestanding. ($(objpfx)bits/syscall%d): Likewise.
2013-07-04Sync sys/ptrace with Linux 3.10Andreas Jaeger4-5/+80
2013-06-28Add GLRO(dl_hwcap2) for new AT_HWCAP2 auxv_t a_type.Ryan S. Arnold2-2/+10
2013-06-28Consistently use page_shift in sysdeps/unix/sysv/linux/mmap64.c.Joseph Myers1-1/+1
2013-06-24PowerPC: Enable POWER8 platform sans hwcap bits.Ryan S. Arnold2-0/+4
2013-06-22Include <string.h> in sysdeps/unix/sysv/linux/libc_fatal.c.Joseph Myers1-0/+1
2013-06-15New API to set default thread attributesSiddhesh Poyarekar10-0/+40
This patch introduces two new convenience functions to set the default thread attributes used for creating threads. This allows a programmer to set the default thread attributes just once in a process and then run pthread_create without additional attributes.
2013-06-13Improve precision of clock() function on LinuxSiddhesh Poyarekar1-20/+16
Resolves #12515. Use CLOCK_PROCESS_CPUTIME_ID instead of times to get better precision in the value returned by clock.
2013-06-11Fix symbol definitions for __clock_* functionsSiddhesh Poyarekar2-5/+5
__clock_gettime and other __clock_* functions could result in an extra PLT reference within libc.so if it actually gets used. None of the code currently uses them, which is why this probably went unnoticed.
2013-06-08Use (void) in no-arguments function definitions.Joseph Myers4-7/+7
2013-06-06Fix leading whitespaces.Ondrej Bilka2-2/+2
2013-06-05Remove trailing whitespace.Joseph Myers29-70/+70