diff options
author | Ryan Zezeski <ryan@zinascii.com> | 2016-01-21 00:51:55 +0000 |
---|---|---|
committer | Patrick Mooney <pmooney@pfmooney.com> | 2016-01-21 02:45:54 +0000 |
commit | 5f61927a04d66e0d1f42a7c0f1572de01debacae (patch) | |
tree | 36170651b7ef67b2ff98cca3896209187bf95219 | |
parent | 6c0f58680b8b7c7b88f2bada7f886e95f31c4bb9 (diff) | |
download | illumos-joyent-5f61927a04d66e0d1f42a7c0f1572de01debacae.tar.gz |
OS-5103 lx_proc careless with locks in pid/env
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
-rw-r--r-- | usr/src/uts/common/brand/lx/procfs/lx_prvnops.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c b/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c index 5899b3c884..9745ba4a03 100644 --- a/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c +++ b/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c @@ -1298,6 +1298,7 @@ lxpr_read_pid_env(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf) proc_t *p; char *buf; size_t asz = lxpr_maxenvvlen, sz; + int r; ASSERT(lxpnp->lxpr_type == LXPR_PID_ENV); @@ -1310,13 +1311,15 @@ lxpr_read_pid_env(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf) return; } - if (prreadenvv(p, buf, asz, &sz) != 0) { + r = prreadenvv(p, buf, asz, &sz); + lxpr_unlock(p); + + if (r != 0) { lxpr_uiobuf_seterr(uiobuf, EINVAL); } else { lxpr_uiobuf_write(uiobuf, buf, sz); } - lxpr_unlock(p); kmem_free(buf, asz); } |