pagemap: hide physical addresses from non-privileged users
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Tue, 8 Sep 2015 22:00:07 +0000 (15:00 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Oct 2015 02:46:08 +0000 (03:46 +0100)
commitb1fb185f26e85f76e3ac6ce557398d78797c9684
treeee8ad9d43a918a2ee29e586f0fd0fe3b8583661c
parent9d3eb706ab42eeb9336f7b62b0d14d5f85a1dd18
pagemap: hide physical addresses from non-privileged users

commit 1c90308e7a77af6742a97d1021cca923b23b7f0d upstream.

This patch makes pagemap readable for normal users and hides physical
addresses from them.  For some use-cases PFN isn't required at all.

See http://lkml.kernel.org/r/1425935472-17949-1-git-send-email-kirill@shutemov.name

Fixes: ab676b7d6fbf ("pagemap: do not leak physical addresses to non-privileged userspace")
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Mark Williamson <mwilliamson@undo-software.com>
Tested-by: Mark Williamson <mwilliamson@undo-software.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2:
 - Add the same check in the places where we look up a PFN
 - Add struct pagemapread * parameters where necessary
 - Open-code file_ns_capable()
 - Delete pagemap_open() entirely, as it would always return 0]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/proc/task_mmu.c