lorenzo-stoakes / linux-vm-hacks

Hacks and experiments for the linux kernel VM subsystem.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux VM Hacks

This repo is a place for experimental code and patches targeting linux 4.6 designed to help me better understand the linux VM subsystem.

This project's sister repo, linux-vm-notes contains notes on the subsystem.

experiments

Contains userland experiments for exploring the linux VM.

pagetables

Pagetables is a kernel module which outputs the precise PGD/PUD/PMD/PTE page table contents for a given process.

It differs from /proc/<pid>/pagemap (doc page) in that pagemap is vastly more useful :) it allows a process to map between virtual and physical pages without reference to individual page tables whereas pagetables is designed to expose these details.

Additionally, pagetables exposes kernel mappings.

Building

$ cd pagetables
$ make

Usage

WARNING: Don't use this with a kernel you care about. It's experimental and I've probably made horrific mistakes which will result in data/hair/firstborn loss.

EVEN MORE SERIOUS WARNING: This module is a security nightmare and exposes sensitive data, including kernel mappings and the mappings of any specified process. You've been warned!

$ cd pagetables
$ sudo insmod pagetables.ko
$ sudo ./pagetables <pid, defaults to pagetables itself>

License

All code here is licensed under GPL v2 to remain compatible with the kernel itself.

About

Hacks and experiments for the linux kernel VM subsystem.


Languages

Language:C 97.8%Language:Makefile 2.2%