aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fuzzer: fix unused setting on argc & argvHEADmasterMike Frysinger2024-08-091-2/+0
| | | | | | | | | | At some point the compiler changed to not propagate argument attributes from the prototype to the definition. Add a hacky macro to insert it by default instead to avoid need for (void) casts. Signed-off-by: Mike Frysinger <vapier@gentoo.org> (cherry picked from commit 6508649486444d20636d1ff15df7db7302f3c46c) Signed-off-by: Sam James <sam@gentoo.org>
* dumpelf: limit note name displayMike Frysinger2024-08-091-1/+1
| | | | | | | | | | | The note name is supposed to be NUL terminated, but if it's not, make sure we don't keep reading data until we hit out of bounds by limiting to exactly the number of bytes declared (and that we already verified fit within valid memory). Signed-off-by: Mike Frysinger <vapier@gentoo.org> (cherry picked from commit c7d34ad6cf90f3cbb2a184050996d37966fe2ef1) Signed-off-by: Sam James <sam@gentoo.org>
* dumpelf: improve note memory checkMike Frysinger2024-08-091-1/+1
| | | | | | | | | | Make sure the entire structure fits within the bounds of memory, not just the start of it. Bug: https://bugs.gentoo.org/922906 Signed-off-by: Mike Frysinger <vapier@gentoo.org> (cherry picked from commit a5298c41c27a35a5c2dcca0723c808029d241953) Signed-off-by: Sam James <sam@gentoo.org>
* dumpelf: check dyn pointer before DT_NULL check tooMike Frysinger2024-08-091-1/+6
| | | | | | | | | We were checking the pointer before dumping it, but missed the DT_NULL check in the overall while loop. Signed-off-by: Mike Frysinger <vapier@gentoo.org> (cherry picked from commit 7b37c40d0409d79a925b71135e9de96343096ce8) Signed-off-by: Sam James <sam@gentoo.org>
* dumpelf: free elf after fuzzing it to avoid leakingMike Frysinger2024-01-251-0/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* unify usage() output across all the toolsMike Frysinger2024-01-241-13/+7
| | | | | | | The scanelf --help output is the best & most flexible, so move that to common code so the rest of the tools can benefit from it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fix various typos found w/codespellMike Frysinger2024-01-151-2/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* dumpelf: use explicit 64-bit to display off_tMike Frysinger2024-01-021-2/+2
| | | | | | | There's no guarantee that %j (uintmax_t) is large enough to handle off_t. Signed-off-by: Mike Frysinger <vapier@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* update copyright headersMike Frysinger2024-01-011-2/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Undo IWYU fixesSam James2023-01-291-14/+0
| | | | | | | | | | | | I wasn't paying enough attention, it's better to just fold the needed bits into porting.h. This reverts commit ffedc60fa41d307bda28fd108e6ff1b8da1fc2ee. This reverts commit f8287200aec0ca33ef07fafcdd5aef0aa6eb1306. This reverts commit aa907a42d89ddfd5a7e64d8182a1da35277f2f6e. Bug: https://github.com/gentoo/pax-utils/pull/11#issuecomment-1407566344 Signed-off-by: Sam James <sam@gentoo.org>
* *: IWYU fixes deuxSam James2023-01-291-0/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* *: IWYU fixesSam James2023-01-281-0/+13
| | | | | | | Separate from the first commit as this one was done programmatically with dev-util/include-what-you-use. Signed-off-by: Sam James <sam@gentoo.org>
* dumpelf: constify elfobj in APIsMike Frysinger2021-04-161-15/+13
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* dumpelf: add libFuzzer supportMike Frysinger2021-04-161-9/+34
| | | | | | Now you can build dumpelf with libFuzzer and beat the hell out of it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* dumpelf.c: add missing break when decoding SHT_GNU_LIBLISTSergei Trofimovich2020-02-161-0/+1
| | | | | | | | | | | | Detected by gcc-10 as: ``` dumpelf.c: In function 'dump_shdr': dumpelf.c:462:4: warning: this statement may fall through [-Wimplicit-fallthrough=] 462 | printf("\t */\n"); \ | ^~~~~~~~~~~~~~~~~ ``` Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* dumpelf: constify misc pointersMike Frysinger2018-06-071-7/+7
| | | | Mark all possible pointers const since we don't modify anything.
* add helper for checking memory/elf rangesMike Frysinger2017-02-111-1/+1
| | | | Less likely to screw up the logic this way.
* dumpelf: check for invalid notesMike Frysinger2017-02-011-7/+16
| | | | | | | Handle cases where the size fields would overflow the additions. URL: https://bugs.gentoo.org/607898 Reported-by: Agostino Sarubbo <ago@gentoo.org>
* dumpelf: check for invalid program headersMike Frysinger2017-02-011-4/+4
| | | | | URL: https://bugs.gentoo.org/607896 Reported-by: Agostino Sarubbo <ago@gentoo.org>
* dumpelf: check for invalid section entry sizesMike Frysinger2017-02-011-22/+28
| | | | | URL: https://bugs.gentoo.org/607894 Reported-by: Agostino Sarubbo <ago@gentoo.org>
* dumpelf: add support for prelink sectionsMike Frysinger2016-11-231-0/+34
|
* dumpelf: add support for dumping notesMike Frysinger2016-11-231-9/+76
|
* dumpelf: clean up types all over the placeMike Frysinger2016-11-171-87/+88
| | | | | | 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.
* dumpelf: improve decodingMike Frysinger2016-01-031-26/+76
| | | | | | | | | - push down section header validity checks (previous one was too strict) - fix section header walking (was missing braces in for loop) - dump all of the pad bytes in the elf header - expand program header output and decode/explain more fields - use uintptr_t for doing pointer math - handle SHT_NOBITS better
* dumpelf: handle invalid section namesMike Frysinger2015-12-121-0/+7
|
* dumpelf: constify pointersMike Frysinger2015-12-121-23/+23
|
* dumpelf: handle corrupt dynamic tagsMike Frysinger2015-12-121-0/+4
| | | | | URL: https://bugs.gentoo.org/567956 Reported-by: Brian Carpenter <brian.carpenter@gmail.com>
* dumpelf: handle corrupt section headersMike Frysinger2015-12-121-1/+12
| | | | | URL: https://bugs.gentoo.org/567954 Reported-by: Brian Carpenter <brian.carpenter@gmail.com>
* dumpelf: reset dynamic phdr pointer with every elfMike Frysinger2015-12-121-1/+3
| | | | | | When dumping multiple ELFs, the dynamic phdr pointer might be left pointing to memory from the previous ELF. Make sure we clear it at the start of every run.
* 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.
* migrate to gitv1.0Mike Frysinger2015-03-021-4/+2
|
* drop __DATE__ usage as the rcsid provides all the details we care aboutMike Frysinger2015-02-221-4/+4
|
* update copyright yearsMike Frysinger2012-11-041-5/+5
|
* dumpelf: add support for dumping dynamic tagsMike Frysinger2011-10-131-23/+72
|
* simplify rcsid a littleMike Frysinger2011-09-271-2/+2
|
* constify help string arrayMike Frysinger2010-12-081-3/+3
|
* change to simpler const argv0 stringMike Frysinger2010-12-081-3/+3
|
* touchup a few more ->data void points and castsMike Frysinger2010-01-151-4/+4
|
* convert core pointers to void* to avoid ugly casts and gcc alignment ↵Mike Frysinger2010-01-151-4/+5
| | | | warnings #290543
* avoid using reserved keyword "bool"Mike Frysinger2009-12-011-8/+8
|
* - mainly whitespace updatesNed Ludd2008-01-171-10/+2
|
* split xfuncs off into a sep file for all utils to use, cleanup misc things, ↵Mike Frysinger2007-08-201-4/+4
| | | | and add some more comments
* - update copyright headersNed Ludd2007-05-231-5/+5
|
* - do not output elf.h if we are doing dumpelf /dev/nullNed Ludd2007-02-031-3/+5
|
* add support for displaying em_machine via %a format flagMike Frysinger2006-12-111-3/+3
|
* just whitespaceMike Frysinger2006-11-281-3/+3
|
* delay include elf.h statement until actually neededMike Frysinger2006-11-281-3/+4
|
* - /* within quotes messes up my syntax highlighting */Ned Ludd2006-02-031-6/+6
|
* update copyright years and unify headers in porting.hMike Frysinger2006-01-051-17/+5
|
* cleanup how we dump section headers and support for SHT_DYNSYMMike Frysinger2005-12-091-12/+42
|