| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
elf_memory call in __libdw_open_elf_memory can return NULL. It was not
checked and led to the null pointer dereference.
Signed-off-by: Aleksei Vetrov <vvvvvv@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
debuginfod/ChangeLog:
* debuginfod-client.c: Typo simultaniously.
doc/ChangeLog:
* debuginfod.8: Typo succesfully.
lib/ChangeLog:
* dynamicsizehash_concurrent.c: Typo modul.
* system.h: Typo dependend.
libdwfl/ChangeLog:
* open.c: Typo non-existant.
src/ChangeLog:
* nm.c: Typo Covert.
* strings.c: Likewise.
tests/ChangeLog:
* elfstrmerge.c: Typo outselves.
* run-debuginfod-extraction.sh: Typo accidentially.
* run-debuginfod-fd-prefetch-caches.sh: Likewise.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
A couple of files undefined _, which is defined in lib/eu-config.h as
gettext helper macro. This seems unnecessary and arbitrary.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
| |
Rely on include dirs being set up correctly. Setup libdw AM_CPPFLAGS
to include libebl directory. In libdwfl note that debuginfod.h is a
generated file in the builddir. Only include it in the one file
debuginfod-client.c that really needs it.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
| |
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method allows to read and report ELF from memory instead of opening
a file. That way arbitrary memory can be worked with, e.g. when coming
from a stream without the need to persist.
Another useful application is for fuzzing, because fuzzers might be able
to track accesses to the memory and change the fuzzer input to cover
more edge cases through more targeted input. Hence, add a new function
along with a test case.
Signed-off-by: Aleksei Vetrov <vvvvvv@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Newer kernels might be compressed using ZSTD add support to libdwfl open
so we can can automatically read ZSTD compressed files and kernel images.
The support is very similar to the bzip2 and lzma support, but slightly
different. With a bit more macros it could maybe have used the gzip.c
USE_INFLATE code path. But I felt that the many macros didn't really help
understand the code. So the unzip routine has a slightly different code
path for ZSTD.
https://sourceware.org/bugzilla/show_bug.cgi?id=26632
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dwelf_elf_begin was slightly different from elf_begin in case the file
turned out to not be an ELF file. elf_begin would return an Elf handle
with ELF_K_NONE. But dwelf_elf_begin would return NULL. This made it
impossible to tell the difference between a file or decompression error
and a (decompressed) file not being an ELF file.
Since dwelf_elf_begin could still return different kinds of ELF files
(ELF_K_ELF or ELF_K_AR - and theoretically ELF_K_COFF) this was not
really useful anyway. So make it so that dwelf_elf_begin always returns
an Elf handle unless there was a real error reading or decompressing
the file. Otherwise return NULL to make clear there was a real error.
Make sure that the decompression function returns DWFL_E_BADELF only
when the file isn't compressed. In which case the Elf handle won't
be replaced and can be returned (as ELF_K_NONE).
Add a new version to dwelf_elf_begin so programs can rely on it
returning NULL only for real errors.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces a new function dwelf_elf_begin which creates a (read-only)
ELF handle from a possibly compressed file handle or a file that start
with a linux kernel header. This can be used in eu-readelf to (re)open a
(pure) ELF.
eu-readelf uses libdwfl to relocate addresses in the original file in
case it is ET_REL. But to show the "raw" data it might need to (re)open
the file. Which could fail if the file was compressed. And produced an
obscure error message: "cannot create EBL handle".
This rewrites __libdw_open_file a little so that the given file handle
will never be closed (whether on success or failure) and introduces a
new internal function __libdw_open_elf that dwelf_elf_begin wraps.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
config.h doesn't have include guards, so including it twice is bad. We
deal with this by checking for PACKAGE_NAME, but only in some places.
Once we start using gnulib, we will need to include config.h before any
gnulib-generated headers. This is problematic if we include it
transitively through our own private headers.
In order to set a clear rule about inclusion of config.h, it is now
included in every .c file as first header, but not in any header. This
will definitely avoid double-inclusion and satisfy the condition that it
has to be included before gnulib headers. It comes at the price of
adding some redundancy, but there is no clean way to avoid this.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
Now that we always require zlib support we don't need to conditionally
build or compile code that depends on it.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AC_SYS_LARGEFILE defines _FILE_OFFSET_BITS in config.h if needed for
LFS, and this automatically maps things like open to open64. But quite
a few places used explicit 64-bit names, which won't work on platforms
like FreeBSD where off_t is always 64-bit and there are no foo64 names.
It's better to just trust that AC_SYS_LARGEFILE is doing it correctly.
But we can verify this too, as some file could easily forget to include
config.h. The new tests/run-lfs-symbols.sh checks all build targets
against lfs-symbols (taken from lintian) to make sure everything was
implicitly mapped to 64-bit variants when _FILE_OFFSET_BITS is set.
Signed-off-by: Josh Stone <jistone@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
rhbz #909481. When a compression library wasn't installed libdwfl would
not try the next compression library for opening a file. Retry with the
next available compression library if a previous one isn't installed. Also
disable tests that depend on a particular compression library
(run-readelf-s.sh and run-dwflsyms.sh) if that library isn't installed.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Change name from "Red Hat elfutils" to "elfutils".
* Update license of standalone tools and test from GPLv2 to GPLv3+.
* Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+.
* Add Developer Certificate of Origin based contributor policy.
top-level:
- COPYING: Upgraded from GPLv2 to GPLv3.
- CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files.
- NEWS: Added note about new contribution and license policy.
- Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST.
- configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'.
backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf:
- All files updated to GPLv2/LGPLv3+. Except some very small files
(<5 lines) which didn't have any headers at all before, the linker
.maps files and the libcpu/defs files which only contain data and
libelf/elf.h which comes from glibc and is under LGPLv2+.
config:
- elfutils.spec.in: Add new License: headers and new %doc files.
- Update all license headers to GPLv2/LGPLv3+ for files used by libs.
src, tests:
- All files updated to GPLv3+. Except for the test bz2 data files, the
linker maps and script files and some very small files (<5 lines)
that don't have any headers.
Signed-off-by: Richard Fontana <rfontana@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
support uncompressed payloads.
|
| |
|
| |
|
| |
|
|
|