summaryrefslogtreecommitdiffstats
path: root/fs/proc/internal.h
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2008-01-02 15:09:57 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-02 22:13:27 +0100
commit831830b5a2b5d413407adf380ef62fe17d6fcbf2 (patch)
treeb08f54f15374b5b98b0b3bea20a1d2ea8d1f50e0 /fs/proc/internal.h
parentscsi: revert "[SCSI] Get rid of scsi_cmnd->done" (diff)
downloadlinux-831830b5a2b5d413407adf380ef62fe17d6fcbf2.tar.xz
linux-831830b5a2b5d413407adf380ef62fe17d6fcbf2.zip
restrict reading from /proc/<pid>/maps to those who share ->mm or can ptrace pid
Contents of /proc/*/maps is sensitive and may become sensitive after open() (e.g. if target originally shares our ->mm and later does exec on suid-root binary). Check at read() (actually, ->start() of iterator) time that mm_struct we'd grabbed and locked is - still the ->mm of target - equal to reader's ->mm or the target is ptracable by reader. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/internal.h')
-rw-r--r--fs/proc/internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 1820eb2ef762..05b3e9006262 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -27,6 +27,8 @@ struct vmalloc_info {
unsigned long largest_chunk;
};
+extern struct mm_struct *mm_for_maps(struct task_struct *);
+
#ifdef CONFIG_MMU
#define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START)
extern void get_vmalloc_info(struct vmalloc_info *vmi);