diff options
-rw-r--r-- | sys/fs/procfs/procfs.h | 5 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs.h | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/fs/procfs/procfs.h b/sys/fs/procfs/procfs.h index 07c6da2..f5547ee 100644 --- a/sys/fs/procfs/procfs.h +++ b/sys/fs/procfs/procfs.h @@ -95,12 +95,13 @@ struct pfsnode { * Evaluates to 1 if access is allowed. */ #define CHECKIO(p1, p2) \ - (PRISON_CHECK(p1, p2) && \ + ((p1) == (p2) || \ + (PRISON_CHECK(p1, p2) && \ ((((p1)->p_cred->pc_ucred->cr_uid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_ruid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_svuid == (p2)->p_cred->p_ruid) && \ ((p2)->p_flag & P_SUGID) == 0) || \ - (suser_xxx(0, (p1), PRISON_ROOT) == 0))) + (suser_xxx(0, (p1), PRISON_ROOT) == 0)))) #define PROCFS_FILENO(pid, type) \ (((type) < Pproc) ? \ diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index 07c6da2..f5547ee 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -95,12 +95,13 @@ struct pfsnode { * Evaluates to 1 if access is allowed. */ #define CHECKIO(p1, p2) \ - (PRISON_CHECK(p1, p2) && \ + ((p1) == (p2) || \ + (PRISON_CHECK(p1, p2) && \ ((((p1)->p_cred->pc_ucred->cr_uid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_ruid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_svuid == (p2)->p_cred->p_ruid) && \ ((p2)->p_flag & P_SUGID) == 0) || \ - (suser_xxx(0, (p1), PRISON_ROOT) == 0))) + (suser_xxx(0, (p1), PRISON_ROOT) == 0)))) #define PROCFS_FILENO(pid, type) \ (((type) < Pproc) ? \ |