summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs/procfs_map.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-08-14 15:26:44 +0000
committerrwatson <rwatson@FreeBSD.org>2003-08-14 15:26:44 +0000
commit941eda46ed7265c222950da5f31fad99560efa06 (patch)
treeb13da3bdd531dc7de4c1cdb360680f715a8eec50 /sys/fs/procfs/procfs_map.c
parent30892cac87d9df43868e7472d8dfc5aac4cd25b4 (diff)
downloadFreeBSD-src-941eda46ed7265c222950da5f31fad99560efa06.zip
FreeBSD-src-941eda46ed7265c222950da5f31fad99560efa06.tar.gz
Add p_candebug() check to access a process map file in procfs; limit
access to map information for processes that you wouldn't otherwise have debug rights on. Tested by: bms
Diffstat (limited to 'sys/fs/procfs/procfs_map.c')
-rw-r--r--sys/fs/procfs/procfs_map.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c
index cae1fc4..3808145 100644
--- a/sys/fs/procfs/procfs_map.c
+++ b/sys/fs/procfs/procfs_map.c
@@ -80,6 +80,12 @@ procfs_doprocmap(PFS_FILL_ARGS)
GIANT_REQUIRED;
+ PROC_LOCK(p);
+ error = p_candebug(td, p);
+ PROC_UNLOCK(p);
+ if (error)
+ return (error);
+
if (uio->uio_rw != UIO_READ)
return (EOPNOTSUPP);
OpenPOWER on IntegriCloud