From b7335573a496fd332333ccc5718fb23ea11815ba Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Tue, 27 Sep 2022 11:55:45 -0400 Subject: 15021 upanic recursive mutex enter Reviewed by: Dan McDonald Approved by: Joshua M. Clulow --- usr/src/uts/common/exec/elf/elf_notes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/exec/elf/elf_notes.c b/usr/src/uts/common/exec/elf/elf_notes.c index 62c3025b65..78305cc076 100644 --- a/usr/src/uts/common/exec/elf/elf_notes.c +++ b/usr/src/uts/common/exec/elf/elf_notes.c @@ -28,6 +28,7 @@ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright 2018 Joyent, Inc. * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2022 Oxide Computer Company */ #include @@ -626,14 +627,15 @@ write_elfnotes(proc_t *p, int sig, vnode_t *vp, offset_t offset, PRUPANIC_BUFLEN); } + mutex_exit(&p->p_lock); error = elfnote(vp, &offset, NT_UPANIC, sizeof (prupanic_t), &bigwad->upanic, rlimit, credp); if (error != 0) { - mutex_exit(&p->p_lock); goto done; } + } else { + mutex_exit(&p->p_lock); } - mutex_exit(&p->p_lock); done: kmem_free(bigwad, bigsize); -- cgit v1.2.3