[lkml]   [2011]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 2/2] mm: restrict access to /proc/meminfo
/proc/meminfo stores information related to memory pages usage, which
may be used to monitor the number of objects in specific caches (and/or
the changes of these numbers). This might reveal private information
similar to /proc/slabinfo infoleaks. To remove the infoleak, just
restrict meminfo to root. If it is used by unprivileged daemons,
meminfo permissions can be altered the same way as slabinfo:

groupadd meminfo
usermod -a -G meminfo $MONITOR_USER
chmod g+r /proc/meminfo
chgrp meminfo /proc/meminfo

Signed-off-by: Vasiliy Kulikov <>
CC: Kees Cook <>
CC: Dave Hansen <>
CC: Christoph Lameter <>
CC: Pekka Enberg <>
CC: Linus Torvalds <>
CC: David Rientjes <>
CC: Alan Cox <>
fs/proc/meminfo.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 5861741..949bdee 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -187,7 +187,7 @@ static const struct file_operations meminfo_proc_fops = {

static int __init proc_meminfo_init(void)
- proc_create("meminfo", 0, NULL, &meminfo_proc_fops);
+ proc_create("meminfo", S_IFREG | S_IRUSR, NULL, &meminfo_proc_fops);
return 0;

 \ /
  Last update: 2011-09-27 19:59    [W:0.084 / U:38.200 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site