From cc130424648e2c82b59822ac357d0fdcd2f042dd Mon Sep 17 00:00:00 2001 From: kib Date: Sat, 26 Dec 2015 15:40:12 +0000 Subject: [PATCH] Do not substitute interpeter if the brand interpreter path is different from the interpreter path requested by the binary. Before this change, it is impossible to activate non-default interpreter for 32bit image on amd64, when /libexec/ld-elf32.so.1 file exists. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks --- sys/kern/imgact_elf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 2e7df7694938..8a7a11a242d9 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1002,7 +1002,9 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) if (error == 0) have_interp = TRUE; } - if (!have_interp && newinterp != NULL) { + if (!have_interp && newinterp != NULL && + (brand_info->interp_path == NULL || + strcmp(interp, brand_info->interp_path) == 0)) { error = __elfN(load_file)(imgp->proc, newinterp, &addr, &imgp->entry_addr, sv->sv_pagesize); if (error == 0)