Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upConsider getting rid of u2mfn module and use /proc/PID/pagemap #1654
Comments
marmarek
added
enhancement
C: gui-virtualization
C: kernel
P: major
release-notes
labels
Jan 17, 2016
marmarek
added this to the Release 4.0 milestone
Jan 17, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 17, 2016
Member
Documentation: http://www.mjmwired.net/kernel/Documentation/vm/pagemap.txt
|
Documentation: http://www.mjmwired.net/kernel/Documentation/vm/pagemap.txt |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Mar 11, 2016
Member
any idea what config options pagemap is tied to? I can't see it.
Looks like CONFIG_PROC_PAGE_MONITOR
I also imagine it's somewhat harmful to ASLR,
Process owner can't access it - it requires CAP_SYS_ADMIN. From the above documentation:
Since Linux 4.0 only users with the CAP_SYS_ADMIN capability can get PFNs.
In 4.0 and 4.1 opens by unprivileged fail with -EPERM. Starting from
4.2 the PFN field is zeroed if the user does not have CAP_SYS_ADMIN.
Reason: information about PFNs helps in exploiting Rowhammer vulnerability.
Anyway, it looks like /proc/$pid/pagemap doesn't contain enough information to really replace u2mfn. It gives PFNs (guest-specific pseudo-physical frame number), but we need MFNs (machine physical frame number).
Looks like CONFIG_PROC_PAGE_MONITOR
Process owner can't access it - it requires CAP_SYS_ADMIN. From the above documentation:
Anyway, it looks like /proc/$pid/pagemap doesn't contain enough information to really replace u2mfn. It gives PFNs (guest-specific pseudo-physical frame number), but we need MFNs (machine physical frame number). |
marmarek commentedJan 17, 2016
Starting with 2.6.25 Linux kernel does provide an interface to get MFN out of process virtual address. Which means we could replace custom
u2mfnwith that. While the change theoretically is small, this would mean we could use stock kernel, without any custom modules in the VM.