mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-23 19:31:09 +01:00
rtld: Allow to load ET_DYN && DF_1_PIE when tracing.
This makes old ldd to still work on newer tagged PIE binaries. Also move debug line for hashes before both decisions to not load are done, so that the end of digest_dynamic() processing and reason to not load or load is seen in debug trace. Noted by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
53b1c32035
commit
512baba6a5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362251
@ -2612,12 +2612,13 @@ do_load_object(int fd, const char *name, char *path, struct stat *sbp,
|
||||
obj->path = path;
|
||||
if (!digest_dynamic(obj, 0))
|
||||
goto errp;
|
||||
if (obj->z_pie) {
|
||||
dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path,
|
||||
obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount);
|
||||
if (obj->z_pie && (flags & RTLD_LO_TRACE) == 0) {
|
||||
dbg("refusing to load PIE executable \"%s\"", obj->path);
|
||||
_rtld_error("Cannot load PIE binary %s as DSO", obj->path);
|
||||
goto errp;
|
||||
}
|
||||
dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path,
|
||||
obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount);
|
||||
if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) ==
|
||||
RTLD_LO_DLOPEN) {
|
||||
dbg("refusing to load non-loadable \"%s\"", obj->path);
|
||||
|
Loading…
Reference in New Issue
Block a user