lkml.org 
[lkml]   [2018]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH -mm] mm, pagemap: Fix swap offset value for PMD migration entry
Date
Andrew Morton <akpm@linux-foundation.org> writes:

> On Sun, 8 Apr 2018 11:37:37 +0800 "Huang, Ying" <ying.huang@intel.com> wrote:
>
>> From: Huang Ying <ying.huang@intel.com>
>>
>> The swap offset reported by /proc/<pid>/pagemap may be not correct for
>> PMD migration entry. If addr passed into pagemap_range() isn't
>
> pagemap_pmd_range(), yes?

Yes. Sorry for typo.

>> aligned with PMD start address,
>
> How can this situation come about?

After open /proc/<pid>/pagemap, if user seeks to a page whose address
doesn't aligned with PMD start address. I have verified this with a
simple test program.

>> the swap offset reported doesn't
>> reflect this. And in the loop to report information of each sub-page,
>> the swap offset isn't increased accordingly as that for PFN.
>>
>> BTW: migration swap entries have PFN information, do we need to
>> restrict whether to show them?
>
> For what reason? Address obfuscation?

This is an existing feature for PFN report of /proc/<pid>/pagemap,
reason is in following commit log. I am wondering whether that is
necessary for migration swap entries too.

ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce
Author: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
AuthorDate: Mon Mar 9 23:11:12 2015 +0200
Commit: Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Tue Mar 17 09:31:30 2015 -0700

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

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

This disallows anybody without CAP_SYS_ADMIN to read the pagemap.

[1] http://googleprojectzero.blogspot.com/2015/03/exploiting-dram-rowhammer-bug-to-gain.html

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

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Andy Lutomirski <luto@amacapital.net>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Seaborn <mseaborn@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Best Regards,
Huang, Ying

\
 
 \ /
  Last update: 2018-04-10 02:57    [W:0.058 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site