summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2022-08-29 16:53:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2022-08-29 16:53:47 +0000
commitf2fdbdd7af357185a67b8758bf9361a0620796f7 (patch)
tree09adf18725b059d4338daa710b0a1357ab56cad2
parent86f2e0e623e659fa3177db34af27c4db3f8552e6 (diff)
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
-rw-r--r--sys/kern/exec_elf.c3
1 files changed, 2 insertions, 1 deletions
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);