Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error: implicit declaration of function flush_tlb_mm_range #20

Open
patacca opened this issue Dec 5, 2020 · 0 comments
Open

Comments

@patacca
Copy link

patacca commented Dec 5, 2020

I've tried compiling the module without success.
This error appears when I launch ./load.sh

rmmod: ERROR: Module afl_snapshot is not currently loaded
env ARCH='x64' LINUX_SYSTEM_MAP='/proc/kallsyms' python3 lookup_symbols.py
make -C '/lib/modules/5.9.9-arch1-1/build' M='/home/patacca/Documenti/Software/AFL-Snapshot-LKM/src' modules
make[1]: Entering directory '/usr/lib/modules/5.9.9-arch1-1/build'
  CC [M]  /home/patacca/Documenti/Software/AFL-Snapshot-LKM/src/memory.o
In file included from /home/patacca/Documenti/Software/AFL-Snapshot-LKM/src/snapshot.h:92,
                 from /home/patacca/Documenti/Software/AFL-Snapshot-LKM/src/task_data.h:4,
                 from /home/patacca/Documenti/Software/AFL-Snapshot-LKM/src/memory.c:3:
./arch/x86/include/asm/tlb.h: In function ‘tlb_flush’:
./arch/x86/include/asm/tlb.h:24:2: error: implicit declaration of function ‘flush_tlb_mm_range’; did you mean ‘flush_icache_range’? [-Werror=implicit-function-declaration]
   24 |  flush_tlb_mm_range(tlb->mm, start, end, stride_shift, tlb->freed_tables);
      |  ^~~~~~~~~~~~~~~~~~
      |  flush_icache_range
/home/patacca/Documenti/Software/AFL-Snapshot-LKM/src/memory.c: In function ‘recover_memory_snapshot’:
/home/patacca/Documenti/Software/AFL-Snapshot-LKM/src/memory.c:483:30: warning: unused variable ‘entry’ [-Wunused-variable]
  483 |   pte_t *               pte, entry;
      |                              ^~~~~
/home/patacca/Documenti/Software/AFL-Snapshot-LKM/src/memory.c:481:30: warning: unused variable ‘prev_sp’ [-Wunused-variable]
  481 |   struct snapshot_page *sp, *prev_sp = NULL;
      |                              ^~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:283: /home/patacca/Documenti/Software/AFL-Snapshot-LKM/src/memory.o] Error 1
make[1]: *** [Makefile:1784: /home/patacca/Documenti/Software/AFL-Snapshot-LKM/src] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.9.9-arch1-1/build'
make: *** [Makefile:52: all] Error 2
insmod: ERROR: could not insert module afl_snapshot.ko: Invalid parameters

I've also tried to compile it with CCFLAGS=-Wno-implicit-function-declaration and even though it comiples succesfully when I load the module in the kernel the operating system suddenly freezes.

$ uname -a
Linux patacca-laptop 5.9.9-arch1-1 #1 SMP PREEMPT Wed, 18 Nov 2020 19:52:04 +0000 x86_64 GNU/Linux
@patacca patacca changed the title Compilation error: implicit declaration of function 'flush_tlb_mm_range' Compilation error: implicit declaration of function flush_tlb_mm_range Dec 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant