We assume you already know how to build your kernel
-
Clone this repository.
Navigate to drivers directory in your kernel sources e.g.
src/linux-5.9.1/drivers
and copy directoryproc-integrity
from this repository there. -
Navigate up to
src/linux-5.9.1/drivers
.Edit
Kcofig
. Add the following line:source "drivers/proc-integrity/Kconfig"
before
endmenu
Edit
Makefile
. Add the following line:obj-$(CONFIG_PROC_INTEGRITY) += proc-integrity/
-
With the
O
parameter specifying your kernel build location, run the following command:$ make O=/path/to/build/linux-5.9.1 menuconfig
A menu will pop up. Find and enable the following options as built-in (*), not module (M):
PROC_INTEGRITY
(Device Drivers -> Simple process integrity checker)CRYPTO_STREEBOG
(Cryptographic API -> Streebog Hash Function)KPROBE_EVENTS
(Kernel hacking -> Tracers -> Enable kprobes-based dynamic events)DYNAMIC_FTRACE
(Kernel hacking -> Tracers -> Kernel Function Tracer -> enable/disable function tracing dynamically)
Close the menu with saving configuration.
-
Build the kernel:
make O=/path/to/build/linux-5.9.1/ -j4
. Parameterj
stands for thread count.
Just run your the kernel. You should now see integrity check results at regular intervals.