AFLplusplus / AFL-Snapshot-LKM

A Linux Kernel Module that implements a fast snapshot mechanism for fuzzing.
135 stars 24 forks source link

"could not insert module afl_snapshot.ko: Operation not permitted" on Ubuntu 20.04.1 #13

Open wolframroesler opened 4 years ago

wolframroesler commented 4 years ago

I'm getting the following error on Ubuntu 20.04.1:

$ sudo ./load.sh 
sudo env LINUX_SYSTEM_MAP='/boot/System.map-5.4.0-47-generic' python3 lookup_symbols.py
make -C '/lib/modules/5.4.0-47-generic/build' M='/opt/AFL-Snapshot-LKM/src' modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-47-generic'
  CC [M]  /opt/AFL-Snapshot-LKM/src/memory.o
/opt/AFL-Snapshot-LKM/src/memory.c: In function ‘recover_memory_snapshot’:
/opt/AFL-Snapshot-LKM/src/memory.c:483:30: warning: unused variable ‘entry’ [-Wunused-variable]
  483 |   pte_t *               pte, entry;
      |                              ^~~~~
/opt/AFL-Snapshot-LKM/src/memory.c:481:30: warning: unused variable ‘prev_sp’ [-Wunused-variable]
  481 |   struct snapshot_page *sp, *prev_sp = NULL;
      |                              ^~~~~~~
  CC [M]  /opt/AFL-Snapshot-LKM/src/files.o
/opt/AFL-Snapshot-LKM/src/files.c: In function ‘recover_files_snapshot’:
/opt/AFL-Snapshot-LKM/src/files.c:56:24: warning: unused variable ‘file’ [-Wunused-variable]
   56 |           struct file *file = fdt->fd[i];
      |                        ^~~~
/opt/AFL-Snapshot-LKM/src/files.c: In function ‘clean_files_snapshot’:
/opt/AFL-Snapshot-LKM/src/files.c:78:24: warning: unused variable ‘files’ [-Wunused-variable]
   78 |   struct files_struct *files = current->files;
      |                        ^~~~~
  CC [M]  /opt/AFL-Snapshot-LKM/src/threads.o
  CC [M]  /opt/AFL-Snapshot-LKM/src/task_data.o
  CC [M]  /opt/AFL-Snapshot-LKM/src/snapshot.o
  CC [M]  /opt/AFL-Snapshot-LKM/src/hook.o
  CC [M]  /opt/AFL-Snapshot-LKM/src/module.o
  LD [M]  /opt/AFL-Snapshot-LKM/src/afl_snapshot.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /opt/AFL-Snapshot-LKM/src/afl_snapshot.mod.o
  LD [M]  /opt/AFL-Snapshot-LKM/src/afl_snapshot.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-47-generic'
insmod: ERROR: could not insert module afl_snapshot.ko: Operation not permitted

Any help would be appreciated. Thanks!

vanhauser-thc commented 4 years ago

what happens if you do "sudo insmod src/afl_snapshot.ko" ? are you currently running 5.4.0.47?

wolframroesler commented 4 years ago
$ sudo insmod src/afl_snapshot.ko
insmod: ERROR: could not insert module src/afl_snapshot.ko: Operation not permitted

and my kernel is 5.4.0-47-generic.

wolframroesler commented 3 years ago

The same thing happens on a freshly installed Ubuntu 20.10. The kernel is now 5.8.0-29-generic.