summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-03-18CVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug 18665).linaro_eglibc-2_19Carlos O'Donell
* A stack-based buffer overflow was found in libresolv when invoked from libnss_dns, allowing specially crafted DNS responses to seize control of execution flow in the DNS client. The buffer overflow occurs in the functions send_dg (send datagram) and send_vc (send TCP) for the NSS module libnss_dns.so.2 when calling getaddrinfo with AF_UNSPEC family. The use of AF_UNSPEC triggers the low-level resolver code to send out two parallel queries for A and AAAA. A mismanagement of the buffers used for those queries could result in the response of a query writing beyond the alloca allocated buffer created by _nss_dns_gethostbyname4_r. Buffer management is simplified to remove the overflow. Thanks to the Google Security Team and Red Hat for reporting the security impact of this issue, and Robert Holiday of Ciena for reporting the related bug 18665. (CVE-2015-7547) See also: https://sourceware.org/ml/libc-alpha/2016-02/msg00416.html https://sourceware.org/ml/libc-alpha/2016-02/msg00418.html
2016-03-18Properly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answerAndreas Schwab
Instead of trying to guess whether the second buffer needs to be freed set a flag at the place it is allocated
2016-03-18Fix memory leak in _nss_dns_gethostbyname4_r with big DNS answerAndreas Schwab
2016-03-18Avoid infinite loop in nss_dns getnetbyname [BZ #17630]Florian Weimer
[BZ #17630] * resolv/nss_dns/dns-network.c (getanswer_r): Iterate over alias names.
2016-03-18Fix invalid file descriptor reuse while sending DNS query (BZ #15946)Andreas Schwab
2016-03-18Check value at resplen2 if it is not NULLAurelien Jarno
2015-11-16Fix the big endian loader name.Szabolcs Nagy
2014-08-01version.h: Bump VERSIONWill Newton
2014-08-01version.h: Update VERSION for 2014.08linaro_eglibc-2_19-2014_08_releaseWill Newton
2014-08-01Fix lll_unlock twice in pthread_cond_broadcastYang Yingliang
lll_unlock() will be called again if it goes to "wake_all" in pthread_cond_broadcast(). This may make another thread which is waiting for lock in pthread_cond_timedwait() unlock. So there are more than one threads get the lock, it will break the shared data. It's introduced by commit 8313cb997d2d("FUTEX_*_REQUEUE_PI support for non-x86 code")
2014-07-04version.h: Bump versionWill Newton
2014-07-04version.h: Update VERSION for 2014.07 releaselinaro_eglibc-2_19-2014_07_releaseWill Newton
2014-07-03Add optimized strchr.Richard Earnshaw
Implementation of strchr for AArch64. Speedups taken from micro-bench show the improvements relative to the standard C code. The use of LD1 means we have identical code for both big- and little-endian systems.
2014-07-03Switch from FE_TOWARDZERO to _FPU_FPCR_RM_MASKWilco
2014-07-03Cleanup declarations in math_private.h.Wilco
2014-07-03aarch64: Remove PSEUDO_RETRichard Henderson
2014-07-03aarch64: Fix error return from __ioctlRichard Henderson
Forgotten in ca3cfa40c16ef34c74951a07a57cfcbcd58898b1 where the error branch was moved from PSEUDO_RET.
2014-07-03aarch64: Rely on syscalls preserving registersRichard Henderson
In several cases we've had asm routines rely on syscalls not clobbering call-clobbered registers, and that's now deemed ABI. So take advantage of this in the INLINE_SYSCALL path as well. Shrinks libc.so by about 1k.
2014-07-03aarch64: Use tpidr_el0 rather than __errno_location in librtRichard Henderson
2014-07-03aarch64: Use tpidr_el0 rather than __read_tp in librtRichard Henderson
2014-07-03aarch64: Improve syscall-cancel stack frameRichard Henderson
One push instead of N; use stp/ldp to halve the insns.
2014-07-03aarch64: Pass regno parameter to SINGLE_THREAD_PRichard Henderson
Use cbz instead of cmp+b.eq.
2014-07-03aarch64: Share code in syscall-cancel.hRichard Henderson
Fold nocancel and error handling paths.
2014-07-03aarch64: Tabify sysdep-cancel.hRichard Henderson
2014-07-03ARM: Fix handling of concurrent TLS descriptor resolutionWill Newton
The current code for handling concurrent resolution says that the ABI for _dl_tlsdesc_resolve_hold is the same as that of _dl_tlsdesc_lazy_resolver. However _dl_tlsdesc_resolve_hold is called from the trampoline directly rather than the lazy resolver stub so, for example, r2 has not been pushed so does not needed to be restored. This fixes an intermittent failure in nptl/tst-tls3 when building glibc for arm-linux-gnueabihf with -mtls-dialect=gnu2. ChangeLog: 2014-05-27 Will Newton <will.newton@linaro.org> [BZ #16990] * sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_resolve_hold): Save and restore r2 rather than just restoring.
2014-07-03correct alignment of TLS_TCB_ALIGN (BZ #16796)Kyle McMartin
This fixes a variety of testsuite failures for me: tststatic.out Error 1 tststatic2.out Error 1 tst-tls9-static.out Error 1 tst-audit8.out Error 127 tst-audit9.out Error 127 tst-audit1.out Error 127 and also has the added benefit of making LD_AUDIT/sotruss work on AArch64. Otherwise, we bail out early in _dl_try_allocate_static_tls as the alignment requirement of the PT_TLS section in libc is 16.
2014-07-03arm,aarch64: Remove SINGLE_THREAD_P_PICRichard Henderson
This macro was removed by 2005-11-16 Daniel Jacobowitz <dan@codesourcery.com> but not applied to the (still separate) eabi port so necro'd when the eabi port superceded the old abi. It was thence copied into the new AArch64 port.
2014-07-03aarch64: Tidy syscall error checkRichard Henderson
Move the error branch from the PSEUDO_RET macro to the PSEUDO macro. This is in line with other architectures, and will enable further improvments.
2014-07-03aarch64: Remove DOARGS/UNDOARGS macrosRichard Henderson
While they do something for AArch32, they're useless for AArch64.
2014-07-03aarch64: Merge __local_multiple_threads offset with memory referenceRichard Henderson
This also highlights that we'd been loading 64-bits instead of the proper 32-bits. Caught by the linker as a relocation error, since the variable happened to be unaligned for 64-bits.
2014-07-03aarch64: Merge rtld_errno offset with memory referenceRichard Henderson
2014-06-06version.h: Bump VERSIONWill Newton
2014-06-06version.h: Update VERSION for 2.19-2014.06linaro_eglibc-2_19-2014_06_releaseWill Newton
2014-06-06Remove ISB after FPCR write.Wilco
2014-06-06Rewrite feupdateenv (BZ 17009).Wilco
2014-06-06Fix ARM build with GCC trunk.Joseph Myers
sysdeps/unix/sysv/linux/arm/unwind-resume.c and sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static variables that are written in C code but only read from toplevel asms. Current GCC trunk now optimizes away such apparently write-only static variables, so causing a build failure. This patch marks those variables with __attribute_used__ to avoid that optimization. Tested that this fixes the build for ARM. * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c (libgcc_s_resume): Use __attribute_used__. * sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume): Likewise.
2014-06-06AArch64: Fix handling of nocancel syscall failuresWill Newton
The current code for nocancel syscalls does not do a comparison of the system call return value. This leads to code being generated where the b.cs follows the svc instruction directly without setting the flags on which the branch depends. ChangeLog: 2014-05-20 Will Newton <will.newton@linaro.org> * sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO): Test the return value of the system call in the nocancel case.
2014-06-06AArch64: Remove asm/ptrace.h inclusion in sys/user.h and sys/procfs.hYvan Roux
This patch fixes an issue observed by the Xen project, where including signal.h exposes various PSR_MODE #defines. This is due to the usage in sys/user.h and sys/procfs.h of the struct user_pt_regs and user_fpsimd_state included via asm/ptrace.h. The namespace pollution this inclusion introduce is already partially fixed with some #undef of the PTRACE_* symbols, but other symbols like the PSR_MODE ones are still present, and undefining them is not safe since a user can include ptrace.h before user.h. My proposition is to define the 2 structures we need in user.h and get rid of the asm/ptrace.h inclusion. Build and make check are clean on AArch64. 2014-05-20 Will Newton <will.newton@linaro.org> Yvan Roux <yvan.roux@linaro.org> * sysdeps/unix/sysv/linux/aarch64/sys/user.h: Remove unused #include of asm/ptrace.h. (PTRACE_GET_THREAD_AREA): Remove #undef. (PTRACE_GETHBPREGS): Likewise. (PTRACE_SETHBPREGS): Likewise. (struct user_regs_struct): New structure. (struct user_fpsimd_struct): New structure. * sysdeps/unix/sysv/linux/aarch64/sys/procfs.h: Remove unused #include of asm/ptrace.h and second #include of sys/user.h. (PTRACE_GET_THREAD_AREA): Remove #undef. (PTRACE_GETHBPREGS): Likewise. (PTRACE_SETHBPREGS): Likewise. (ELF_NGREG): Use new struct user_regs_struct. (elf_fpregset_t): Use new struct user_fpsimd_struct.
2014-06-06ARM: Improve fenv implementationWilco
2014-06-06ARM: Add optimized ARMv7 strcmp implementationWill Newton
Add an optimized implementation of strcmp for ARMv7-A cores. This implementation is significantly faster than the current generic C implementation, particularly for strings of 16 bytes and longer. Tested with the glibc string tests for arm-linux-gnueabihf and armeb-linux-gnueabihf. The code was written by ARM, who have agreed to assign the copyright to the FSF for integration into glibc. ChangeLog: 2014-05-09 Will Newton <will.newton@linaro.org> * sysdeps/arm/armv7/strcmp.S: New file. * NEWS: Mention addition of ARMv7 optimized strcmp.
2014-06-06Clean up ARM old-ABI symbol versioning relics.Joseph Myers
This patch cleans up some symbol versioning code in the ARM port that exists only as relics of the old-ABI port, which was removed some time ago. The minimum symbol version in the ARM port is GLIBC_2.4 (the version where the EABI port was introduced). Thus, any SHLIB_COMPAT conditionals where the later version is 2.4 or later are obsolete and can be removed. In addition, there is no need to set symbol versions before 2.4 explicitly if the symbols would have a version of 2.4 by default anyway. This includes most of the entries in sysdeps/unix/sysv/linux/arm/Versions: those for GLIBC_2.0 are for libgcc unwind functions that aren't actually in ARM EABI glibc at all, while those for GLIBC_2.2 and GLIBC_2.3.3 are for functions which for the old-ABI port may have had versions different from the architecture-independent default, but where for EABI the default suffices (both the default and the version in that file map to 2.4, so the entries in that file do nothing). The GLIBC_2.1 entries are needed (architecture-specific functions), but it seems less confusing for those to say GLIBC_2.4, as the actual version those symbols in fact have. Various cases in the <fenv.h> functions where a function is defined as __fe* with an fe* versioned alias are cleaned up just to define fe* directly, as done e.g. on AArch64. If in future we actually need an __fe* name for use from C90 functions in libm as discussed recently, of course we can add one on all architectures and make the fe* name into a weak alias for that particular function, but for now the __fe* names aren't needed. In the case of posix_fadvise64, the __posix_fadvise64_l64 name and posix_fadvise64 alias are kept as __posix_fadvise64_l64 is used in posix_fadvise. (For that to be a namespace-clean use, posix_fadvise64 needs to be a *weak* alias not a strong one as at present, but that's an independent preexisting bug.) (There remain references to GLIBC_2_2 in sysdeps/unix/sysv/linux/arm/{msgctl.c,semctl.c,shmctl.c}. As those files are used by alpha which has a genuine 2.2 version for those functions, I think those references need to stay as-is.) Tested that the disassembly of installed shared libraries is unchanged by this patch (though function names shown in disassembly change to no longer have @@GLIBC_2.4, now those functions get versioned only by the version map and not redundantly at assembler time) and that the ABI tests pass. * sysdeps/arm/fclrexcpt.c (__feclearexcept): Rename to feclearexcept. Remove symbol versioning code. * sysdeps/arm/fegetenv.c (__fegetenv): Rename to fegetenv. Remove symbol versioning code. * sysdeps/arm/fesetenv.c (__fesetenv): Rename to fesetenv. Remove symbol versioning code. * sysdeps/arm/feupdateenv.c (__feupdateenv): Rename to feupdateenv. Remove symbol versioning code. * sysdeps/arm/fgetexcptflg.c (__fegetexceptflag): Rename to fegetexceptflag. Remove symbol versioning code. * sysdeps/arm/fsetexcptflg.c (__fesetexceptflag): Rename to fesetexceptflag. Remove symbol versioning code. * sysdeps/unix/sysv/linux/arm/Versions (libc): Remove GLIBC_2.0, GLIBC_2.2 and GLIBC_2.3.3 entries. Change GLIBC_2.1 to GLIBC_2.4. * sysdeps/unix/sysv/linux/arm/posix_fadvise64.c (__posix_fadvise64_l32): Remove prototype. [SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)]: Remove conditional code.
2014-06-06Suppress unnecessary FPSR and FPCR writes.Ian Bolton
2014-06-06Add support for fenv_private on ARM.Wilco Dijkstra
2014-06-06Define HAVE_RM_CTX and related hooks.Ian Bolton
2014-06-06Provide initial implementation of math_private.h.Ian Bolton
2014-06-06Optional trapping exceptions support.Marcus Shawcroft
Trapping exceptions in AArch64 are optional. The relevant exception control bits in FPCR are are defined as RES0 hence the absence of support can be detected by reading back the FPCR and comparing with the desired value.
2014-04-30version.h: Bump VERSIONWill Newton
2014-04-30version.h: Update VERSION for 2014.05 releaselinaro_eglibc-2_19-2014_05_releaseWill Newton
2014-04-30aarch64: Add setjmp and longjmp SystemTap probesVenkataramanan Kumar
Add setjmp, longjmp and longjmp_target SystemTap probes. ChangeLog: 2014-04-22 Will Newton <will.newton@linaro.org> Venkataramanan Kumar <venkataramanan.kumar@linaro.org> * sysdeps/aarch64/__longjmp.S: Include stap-probe.h. (__longjmp): Add longjmp and longjmp_target SystemTap probes. * sysdeps/aarch64/setjmp.S: Include stap-probe.h. (__sigsetjmp): Add setjmp SystemTap probe.
2014-04-30aarch64: Re-implement setcontext without rt_sigreturn syscallWill Newton
The current implementation of setcontext uses rt_sigreturn to restore the contents of registers. This contrasts with the way most other architectures implement setcontext: powerpc64, mips, tile: Call rt_sigreturn if context was created by a call to a signal handler, otherwise restore in user code. powerpc32: Call swapcontext system call and don't call sigreturn or rt_sigreturn. x86_64, sparc, hppa, sh, ia64, m68k, s390, arm: Only support restoring "synchronous" contexts, that is contexts created by getcontext, and restoring in user code and don't call sigreturn or rt_sigreturn. alpha: Call sigreturn (but not rt_sigreturn) in all cases to do the restore. The text of the setcontext manpage suggests that the requirement to be able to restore a signal handler created context has been dropped from SUSv2: If the context was obtained by a call to a signal handler, then old standard text says that "program execution continues with the program instruction following the instruction interrupted by the signal". However, this sentence was removed in SUSv2, and the present verdict is "the result is unspecified". Implementing setcontext by calling rt_sigreturn unconditionally causes problems when used with sigaltstack as in BZ #16629. On this basis it seems that aarch64 is broken and that new ports should only support restoring contexts created with getcontext and do not need to call rt_sigreturn at all. This patch re-implements the aarch64 setcontext function to restore the context in user code in a similar manner to x86_64 and other ports. ChangeLog: 2014-04-17 Will Newton <will.newton@linaro.org> [BZ #16629] * sysdeps/unix/sysv/linux/aarch64/setcontext.S (__setcontext): Re-implement to restore registers in user code and avoid rt_sigreturn system call.