linux_kernel_hacking / 2_MemoryLoading / 2.0_no_arguments /
@Harvey Phillips Harvey Phillips authored on 12 Jun 2020
..
Makefile dynamically inject an LKM 4 years ago
README.md dynamically inject an LKM 4 years ago
load.c loading from memory 4 years ago
stub.c dynamically inject an LKM 4 years ago
README.md

Linux Kernel Hacking

2.0: Loading a Kernel Module from Memory (No Arguments)

Load the example.ko kernel module from memory - without using insmod.

To use:

  • Build with make
  • Execute as root with sudo ./load
  • Check output in kernel buffer with dmesg
  • See the module loaded in lsmod | grep example
  • Unload with rmmod example
  • Check the second output in the kernel buffer with dmesg

NOTE: This assumes that example.ko is in the current directory. If your LKM is named something else, change the first line in the Makefile.