mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
pagemap: was missing one bit in lkmc_pagemap_get_entry for pfn
Credits to Phidelux: https://stackoverflow.com/questions/6284810/proc-pid-pagemaps-and-proc-pid-maps-linux/45500208?noredirect=1#comment109030479_45500208
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* https://github.com/torvalds/linux/blob/v4.9/Documentation/vm/pagemap.txt
|
||||
*/
|
||||
typedef struct {
|
||||
uint64_t pfn : 54;
|
||||
uint64_t pfn : 55;
|
||||
unsigned int soft_dirty : 1;
|
||||
unsigned int file_page : 1;
|
||||
unsigned int swapped : 1;
|
||||
@@ -46,8 +46,8 @@ int lkmc_pagemap_get_entry(LkmcPagemapEntry *entry, int pagemap_fd, uintptr_t va
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
entry->pfn = data & (((uint64_t)1 << 54) - 1);
|
||||
entry->soft_dirty = (data >> 54) & 1;
|
||||
entry->pfn = data & (((uint64_t)1 << 55) - 1);
|
||||
entry->soft_dirty = (data >> 55) & 1;
|
||||
entry->file_page = (data >> 61) & 1;
|
||||
entry->swapped = (data >> 62) & 1;
|
||||
entry->present = (data >> 63) & 1;
|
||||
|
||||
Reference in New Issue
Block a user