| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
| |
Now you can build dumpelf with libFuzzer and beat the hell out of it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Mark all possible pointers const since we don't modify anything.
|
|
|
|
| |
Less likely to screw up the logic this way.
|
|
|
|
|
|
|
| |
Handle cases where the size fields would overflow the additions.
URL: https://bugs.gentoo.org/607898
Reported-by: Agostino Sarubbo <ago@gentoo.org>
|
|
|
|
|
| |
URL: https://bugs.gentoo.org/607896
Reported-by: Agostino Sarubbo <ago@gentoo.org>
|
|
|
|
|
| |
URL: https://bugs.gentoo.org/607894
Reported-by: Agostino Sarubbo <ago@gentoo.org>
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
| |
|
|
|
|
|
| |
URL: https://bugs.gentoo.org/567956
Reported-by: Brian Carpenter <brian.carpenter@gmail.com>
|
|
|
|
|
| |
URL: https://bugs.gentoo.org/567954
Reported-by: Brian Carpenter <brian.carpenter@gmail.com>
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
warnings #290543
|
| |
|
| |
|
|
|
|
| |
and add some more comments
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|