mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Add a proc lock assertion and move another assertion up to the top of the
function.
This commit is contained in:
parent
4cac73c759
commit
c110b8e65e
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue