diff options
author | mjg <mjg@FreeBSD.org> | 2014-07-06 22:49:07 +0000 |
---|---|---|
committer | mjg <mjg@FreeBSD.org> | 2014-07-06 22:49:07 +0000 |
commit | aa97fde7f4ab5f1a73e154d32d43dd35a67eae06 (patch) | |
tree | 84acb77966bc2d94fbe4fd4a630efbe8bba409e5 | |
parent | 4c78be8a98b7fbf38b1045ca0d166e781666316e (diff) | |
download | FreeBSD-src-aa97fde7f4ab5f1a73e154d32d43dd35a67eae06.zip FreeBSD-src-aa97fde7f4ab5f1a73e154d32d43dd35a67eae06.tar.gz |
MFC r265247:
Request a non-exiting process in sysctl_kern_proc_{o,}filedesc
This fixes a race with exit1 freeing p_textvp.
-rw-r--r-- | sys/kern/kern_descrip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 48f62fa..1260cfc 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3043,7 +3043,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS) struct tty *tp; name = (int *)arg1; - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) return (error); fdp = fdhold(p); @@ -3540,7 +3540,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, FILEDESC_SBUF_SIZE, req); - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) { sbuf_delete(&sb); return (error); |