From: deraadt Date: Mon, 29 Aug 2022 16:53:46 +0000 (+0000) Subject: If ld.so loading fails inside execve, uprintf a message to report this X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=22c1e09064b1e80904e60b6dae4e97e7b6676b39;p=openbsd If ld.so loading fails inside execve, uprintf a message to report this before the SIGABRT kills the process. This clarifies the failure mode (and resolution to take) when a dynamic executable is run while /usr isn't mounted. ok miod kettenis --- diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index 10a03459f9f..a27dac2e817 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.167 2022/08/14 01:58:27 jsg Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.168 2022/08/29 16:53:46 deraadt Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -738,6 +738,7 @@ exec_elf_fixup(struct proc *p, struct exec_package *epp) if (interp && (error = elf_load_file(p, interp, epp, ap)) != 0) { + uprintf("execve: cannot load %s\n", interp); free(ap, M_TEMP, sizeof *ap); pool_put(&namei_pool, interp); kill_vmcmds(&epp->ep_vmcmds);