From 10918f82974cbde34347eb734eac5286c20cf130 Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Sat, 11 Jun 2022 11:26:19 -0400 Subject: [PATCH] HBSD: harden_rtld is gated Refine one conditional to reflect the fact that harden_rtld is gated behind HARDENEDBSD. Signed-off-by: Shawn Webb --- libexec/rtld-elf/rtld.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index e8ef619084d7..edbc57013328 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -641,9 +641,15 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) cache_harden_rtld(); #endif - trust = !(issetugid() || harden_rtld); + trust = !issetugid(); direct_exec = false; +#ifdef HARDENEDBSD + if (trust && harden_rtld) { + trust = false; + } +#endif + md_abi_variant_hook(aux_info); rtld_init_env_vars(env);