]> git.ipfire.org Git - thirdparty/glibc.git/commit
elf: Fix failure handling in _dl_map_object_from_fd
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 24 Nov 2020 12:34:39 +0000 (12:34 +0000)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 15 Dec 2020 10:13:46 +0000 (10:13 +0000)
commitc6b016532705e158a330c31697e9dd4826aa68af
tree15189b94faffea0b00afbadac54776a6e6b45c6a
parentcb5648b00f1f6f883d0d1691abc0d2fad2fcafd7
elf: Fix failure handling in _dl_map_object_from_fd

The failure paths in _dl_map_object_from_fd did not clean every
potentially allocated resource up.

Handle l_phdr, l_libname and mapped segments in the common failure
handling code.

There are various bits that may not be cleaned properly on failure
(e.g. executable stack, incomplete dl_map_segments) fixing those
need further changes.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
elf/dl-load.c