Browse files

pagemap: do not leak physical addresses to non-privileged userspace

commit ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce upstream.

As pointed by recent post[1] on exploiting DRAM physical imperfection,
/proc/PID/pagemap exposes sensitive information which can be used to do

This disallows anybody without CAP_SYS_ADMIN to read the pagemap.


[ Eventually we might want to do anything more finegrained, but for now
  this is the simple model.   - Linus ]

Change-Id: Ib62bf4429dcdafd9fc1cd9b1a0c5665c64cc5d18
Signed-off-by: Kirill A. Shutemov <>
Acked-by: Konstantin Khlebnikov <>
Acked-by: Andy Lutomirski <>
Cc: Pavel Emelyanov <>
Cc: Andrew Morton <>
Cc: Mark Seaborn <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Zefan Li <>
[mancha: Backported to 3.10]
Signed-off-by: mancha security <>
  • Loading branch information...
Kirill A. Shutemov authored and andi34 committed Mar 9, 2015
1 parent 7c79218 commit d46b07f49b8760a19cc79b192ed3cd9430622821
Showing with 10 additions and 0 deletions.
  1. +10 −0 fs/proc/task_mmu.c
@@ -1007,9 +1007,19 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
return ret;
static int pagemap_open(struct inode *inode, struct file *file)
/* do not disclose physical addresses to unprivileged
userspace (closes a rowhammer attack vector) */
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return 0;
const struct file_operations proc_pagemap_operations = {
.llseek = mem_lseek, /* borrow this */
.read = pagemap_read,
.open = pagemap_open,

0 comments on commit d46b07f

Please sign in to comment.