summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-04-17 22:12:12 +0000
committerjhb <jhb@FreeBSD.org>2003-04-17 22:12:12 +0000
commit9d63461efbd6290e8d71969851fad0858ac84a8e (patch)
tree30e55ebe17ee8b4af36038e2f13099ea425f6370 /sys/fs/procfs
parentdea441a5406d5df3b6176521231384ae8c38feff (diff)
downloadFreeBSD-src-9d63461efbd6290e8d71969851fad0858ac84a8e.zip
FreeBSD-src-9d63461efbd6290e8d71969851fad0858ac84a8e.tar.gz
Add a proc lock assertion and move another assertion up to the top of the
function.
Diffstat (limited to 'sys/fs/procfs')
-rw-r--r--sys/fs/procfs/procfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/fs/procfs/procfs.c b/sys/fs/procfs/procfs.c
index f6cab6a..cec4df1 100644
--- a/sys/fs/procfs/procfs.c
+++ b/sys/fs/procfs/procfs.c
@@ -93,6 +93,9 @@ procfs_docurproc(PFS_FILL_ARGS)
int
procfs_attr(PFS_ATTR_ARGS)
{
+
+ PROC_LOCK_ASSERT(p, MA_OWNED);
+
/* XXX inefficient, split into separate functions */
if (p->p_flag & P_SUGID)
vap->va_mode = 0;
@@ -106,8 +109,6 @@ procfs_attr(PFS_ATTR_ARGS)
strcmp(pn->pn_name, "fpregs") == 0)
vap->va_mode = 0600;
- /* p is locked by caller */
- PROC_LOCK_ASSERT(p, MA_OWNED);
vap->va_uid = p->p_ucred->cr_uid;
vap->va_gid = p->p_ucred->cr_gid;
@@ -121,6 +122,7 @@ procfs_attr(PFS_ATTR_ARGS)
int
procfs_notsystem(PFS_VIS_ARGS)
{
+ PROC_LOCK_ASSERT(p, MA_OWNED);
return ((p->p_flag & P_SYSTEM) == 0);
}
OpenPOWER on IntegriCloud