aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* sanitizer: fix feature tests under clangMike Frysinger2024-01-251-0/+7
| | | | | | | While gcc defines __SANITIZE_ADDRESS__, clang requires more verbose tests. Add them to make the cleanup/security logic work correctly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ar: switch from alloca to mallocMike Frysinger2024-01-251-3/+0
| | | | | | | | | | | | | If alloca allocates too much stack space, program behavior is undefined, and basically we segfault. There is no way to check whether this will happen ahead of time, so our only choice is to switch to malloc. If we try to allocate too much memory from the heap, we'll get a NULL pointer, and we can diagnose & exit ourselves. Kind of sucks as alloca was a perfect fit here, but since the size is coming directly from user input, we can't trust it is always "reasonable". Bug: https://bugs.gentoo.org/890579 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* build: use standard HAVE_xxx define styleMike Frysinger2024-01-241-10/+10
| | | | | | | | | Use the more standard HAVE_xxx convention, and only define when available. This avoids further confusion with code that is using "#ifdef" already. Signed-off-by: Mike Frysinger <vapier@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* build: use standard config.h namingMike Frysinger2024-01-241-1/+1
| | | | | Signed-off-by: Mike Frysinger <vapier@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fix various typos found w/codespellMike Frysinger2024-01-151-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* drop old __BOUNDS_CHECKING_ON supportMike Frysinger2024-01-151-7/+0
| | | | | | | | | The out-of-tree patches for -fbounds-checking in GCC were great, but they haven't been updated since the gcc-4.0 days, and the sanitizer options have made it obsolete, so it's unlikely we'll ever use this code again. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* update copyright headersMike Frysinger2024-01-011-2/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* porting.h: include <stddef.h> for size_t, sort includesSam James2023-01-291-2/+3
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* Probe the target system for needed headersArsen Arsenović2022-07-121-14/+11
| | | | | | | | | | | This prevents new or unconventional systems requiring upstream changes, though, this is not perfect, as it doesn't address some of the other defines related to OSes the preprocessor does (namely, wrt the ldso cache handling). I didn't touch these yet as I took a more conservative approach of (probably) not changing what happens at runtime. Signed-off-by: Arsen Arsenović <arsen@aarsen.me> Signed-off-by: Sam James <sam@gentoo.org>
* porting: don't include alloca.h on NetBSDFrederic Cambus2022-01-221-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* security: pregen seccomp bpf programsv1.3Mike Frysinger2021-04-171-0/+3
| | | | | | | | Since the bpf programs are the same across runs, generate it ahead of time. This way we don't have to link against libseccomp and run the library calls at runtime which helps cut out most overhead. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fuzz: add basic framework for using libFuzzerMike Frysinger2021-04-161-0/+5
| | | | | | | By itself, this commit doesn't do anything useful. We have to update each tool to hook into libFuzzer, so we'll do that in follow up commits. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* glob is used in paxldso.c for NetBSD too, but glob.h is not included inOBATA Akio2021-02-041-1/+1
| | | | | | porting.h for NetBSD. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* check for linux/securebits.h, missing on Linux 2.6.32Michael Haubenwallner2017-09-181-1/+3
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* dumpelf: clean up types all over the placeMike Frysinger2016-11-171-0/+1
| | | | | | Rather than blindly cast everything to unsigned long (which doesn't work when working with 64-bit ELFs on a 32-bit host), use the proper types in all the printf statements.
* porting: add O_PATH fallback tooMike Frysinger2016-06-191-0/+3
|
* scanelf: enable cleanup for coverityMike Frysinger2016-06-191-0/+4
|
* porting: fix android buildsMike Frysinger2015-10-081-1/+1
|
* security: add a debug handler for seccompMike Frysinger2015-08-241-0/+3
| | | | | | | If a bad syscall is hit, it can be hard to track down. Add a debug mode that people can enable to get useful error messages showing the failure. URL: https://bugs.gentoo.org/558482
* security: lock down privs a bit via prctlMike Frysinger2015-08-201-0/+4
| | | | Should prevent accidentally running set*id programs less of a problem.
* security: leverage namespaces to restrict the runtime a bitMike Frysinger2015-08-201-0/+1
| | | | | | | In practice this isn't terribly useful as people aren't attacking these tools, but might as well be paranoid. It'd be nice to use mount & net namespaces too, but they're way too slow.
* debug: improve cleanup logicMike Frysinger2015-08-181-2/+9
| | | | | | | | | | | Always set up the cleanup symbol and use it at C time rather than CPP. We can delete the warning code since we clean those strings up now. Add ASAN support so LSAN doesn't complain either. Fix a bug in the leak checking when the -F flag is used -- normally we don't allocate that string but set it to one of the argv constants.
* use __typeof__ instead of typeof to build with stricter standardsMike Frysinger2015-08-131-1/+1
|
* migrate to gitv1.0Mike Frysinger2015-03-021-1/+0
|
* add autotools supportMike Frysinger2014-10-191-1/+5
| | | | URL: https://bugs.gentoo.org/413967
* update elf.hMike Frysinger2014-01-111-15/+1
|
* scanelf: add support for multiple quiet levels and fix the wrap around ↵Mike Frysinger2013-04-021-1/+10
| | | | behavior to max out instead
* update copyright yearsMike Frysinger2012-11-041-4/+4
|
* if O_CLOEXEC is not defined, set it to 0Mike Frysinger2012-02-041-1/+5
|
* use glibc/uclibc defines to pull in byteswap.h/endian.h as these are ↵Mike Frysinger2011-10-081-2/+2
| | | | specific to glibc and not linux; report from Pino Toscano in deb bug 644607
* dont include alloca.h on openbsd #363903 by Maxim KoltsovMike Frysinger2011-04-301-2/+2
|
* make sure the maps we scan are aligned when needed (which often does not ↵Mike Frysinger2010-01-151-1/+12
| | | | happen when reading static library archives *.a)
* extend symbol lookup syntax to allow matching of symbols based on more fieldsMike Frysinger2009-12-011-1/+2
|
* allow pax-utils to detect endianness on HP-UX, patch by Michael HaubenwallnerFabian Groffen2009-10-251-2/+2
|
* tweak style slightly to make source tests happyMike Frysinger2008-12-301-3/+3
|
* pull in alloca.h for all hosts but freebsdMike Frysinger2008-11-161-2/+4
|
* sort headers alphabeticallyMike Frysinger2008-11-161-14/+13
|
* only include alloca.h on linux systems #246439 by Javier VillavicencioMike Frysinger2008-11-161-3/+3
|
* Silence a warningFabian Groffen2008-10-191-1/+2
|
* - update copyright headersNed Ludd2007-05-231-4/+4
|
* rewrite ELF_DATA fallback to account for ports that define macros, but dont ↵Mike Frysinger2007-04-081-22/+19
| | | | give them any value
* relax a little if only one endian is definedMike Frysinger2007-04-081-6/+3
|
* make sure LITTLE_ENDIAN/BIG_ENDIAN exist in the fallback caseMike Frysinger2007-04-081-1/+10
|
* cleanup __sun__ handlingMike Frysinger2007-04-081-4/+10
|
* - do not compile pspax on solaris.. make porting.h use __svr4__ vs __sun__ ↵Ned Ludd2007-04-081-3/+3
| | | | defines so we keep sparc-linux happy
* - make things a tad more portable to sparc and darwinNed Ludd2007-04-081-2/+8
|
* - added regexp symbol matching using existing gmatch optionNed Ludd2007-01-181-1/+2
|
* just whitespaceMike Frysinger2006-11-281-5/+6
|
* - add work arounds for NetBSDNed Ludd2006-06-031-2/+2
|
* cleanup style, touchup new QA envvar code, and be better about cleaning up ↵Mike Frysinger2006-05-141-1/+9
| | | | after ourselves