summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@fingolfin.org>2021-03-17 16:59:56 -0700
committerRobert Mustacchi <rm@fingolfin.org>2021-03-19 13:44:28 -0700
commit88a8a2ff3233e21e4ab8bc203109d12dc5d5a189 (patch)
tree69a61e4314629032749121ba10dd9f5400958d3f
parent59f9bde980b4c29f439b7a8f41b4ee2e8d2d9a12 (diff)
downloadillumos-joyent-88a8a2ff3233e21e4ab8bc203109d12dc5d5a189.tar.gz
13654 upanic needs to finish auditing the syscall before auditing cores
Reviewed by: Jason King <jason.king@joyent.com> Reviewed by: Alex Wilson <alex@cooperi.net> Reviewed by: Andy Fiddaman <andy@omnios.org> Approved by: Gordon Ross <gordon.w.ross@gmail.com>
-rw-r--r--usr/src/uts/common/os/upanic.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr/src/uts/common/os/upanic.c b/usr/src/uts/common/os/upanic.c
index 8acb9440f2..b4d23eeaff 100644
--- a/usr/src/uts/common/os/upanic.c
+++ b/usr/src/uts/common/os/upanic.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2020 Oxide Computer Company
+ * Copyright 2021 Oxide Computer Company
*/
#include <sys/proc.h>
@@ -83,8 +83,14 @@ upanic(void *addr, size_t len)
p->p_upanicflag = upflag;
mutex_exit(&p->p_lock);
- if (auditing) /* audit core dump */
+ /*
+ * If we're auditing we need to finish the system call itself and then
+ * begin the core dump.
+ */
+ if (auditing) {
+ audit_finish(0, SYS_upanic, 0, NULL);
audit_core_start(SIGABRT);
+ }
code = core(SIGABRT, B_FALSE);
if (auditing) /* audit core dump */
audit_core_finish(code ? CLD_KILLED : CLD_DUMPED);