summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorghelmer <ghelmer@FreeBSD.org>2006-05-24 14:03:51 +0000
committerghelmer <ghelmer@FreeBSD.org>2006-05-24 14:03:51 +0000
commit8ffa3afe9221f247a5a1f989b871ff99567590b7 (patch)
treed5dbedfb6f0960d949d647332921bca8e6131d4a /sys/fs
parent499297c74cc00692bc00ddab18c1e67dcbfaf0a9 (diff)
downloadFreeBSD-src-8ffa3afe9221f247a5a1f989b871ff99567590b7.zip
FreeBSD-src-8ffa3afe9221f247a5a1f989b871ff99567590b7.tar.gz
Revision 1.4 set access for all sensitive files in /proc/<PID> to mode 0
if a process's uid or gid has changed, but the /proc/<PID> directory itself was also set to mode 0. Assuming this doesn't open any security holes, open access to the /proc/<PID> directory for users other than root to read or search the directory. Reviewed by: des (back in February) MFC after: 3 weeks
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/procfs/procfs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/fs/procfs/procfs.c b/sys/fs/procfs/procfs.c
index f2b5bf5..7f93414 100644
--- a/sys/fs/procfs/procfs.c
+++ b/sys/fs/procfs/procfs.c
@@ -98,9 +98,12 @@ 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;
- else if (strcmp(pn->pn_name, "ctl") == 0 ||
+ if (p->p_flag & P_SUGID) {
+ if (pn->pn_type == pfstype_procdir)
+ vap->va_mode = 0555;
+ else
+ vap->va_mode = 0;
+ } else if (strcmp(pn->pn_name, "ctl") == 0 ||
strcmp(pn->pn_name, "note") == 0 ||
strcmp(pn->pn_name, "notepg") == 0)
vap->va_mode = 0200;
OpenPOWER on IntegriCloud