linux_kernel_hacking / 1_Livepatch / 1.0_livepatch_sample /
@Harvey Phillips Harvey Phillips authored on 4 Jun 2020
..
Makefile livepatch sample 4 years ago
README.md add tested on line 4 years ago
livepatch-sample.c livepatch sample 4 years ago
README.md

Linux Kernel Hacking

1.0: Livepatch

Patching kernel functions in memory on a live machine. Taken from samples/livepatch.

This livepatch kernel module creates a replacement for cmdline_proc_show() from fs/proc/cmdline.c to simply print a message out instead of the usual cmdline.

To use:

  • Check the output of cat /proc/cmdline
  • Build with make, and load into the kernel with insmod livepatch-sample.ko
  • Check the output again of cat /proc/cmdline
  • Disable the livepatch with echo 0 | sudo tee /sys/kernel/livepatch/livepatch-sample/enabled
  • Unload from the kernel with rmmod livepatch-sample.ko

Tested on Ubuntu 20.04 running under Vagrant.