Date: Sun, 6 Jul 2014 22:49:07 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268336 - stable/10/sys/kern Message-ID: <201407062249.s66Mn74s068992@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sun Jul 6 22:49:07 2014 New Revision: 268336 URL: http://svnweb.freebsd.org/changeset/base/268336 Log: MFC r265247: Request a non-exiting process in sysctl_kern_proc_{o,}filedesc This fixes a race with exit1 freeing p_textvp. Modified: stable/10/sys/kern/kern_descrip.c Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:47:18 2014 (r268335) +++ stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:49:07 2014 (r268336) @@ -3043,7 +3043,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE 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 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407062249.s66Mn74s068992>