sophos / talpa

Talpa Kernel file access interception modules
GNU General Public License v2.0
17 stars 11 forks source link

Compile Error: linux_systemroot.c:93:13: error: implicit declaration of function ‘task_lock’ #4

Closed Montecito closed 7 years ago

Montecito commented 7 years ago

After updating kernel to version 4.11.2, following compile error occurs when compiling talpa:

root@localhost talpa-1.22.7 $ make make all-recursive make[1]: Entering directory '/opt/sophos-av/talpa/build/talpa-1.22.7' Making all in tests make[2]: Entering directory '/opt/sophos-av/talpa/build/talpa-1.22.7/tests' Making all in modules make[3]: Entering directory '/opt/sophos-av/talpa/build/talpa-1.22.7/tests/modules' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory '/opt/sophos-av/talpa/build/talpa-1.22.7/tests/modules' make[3]: Entering directory '/opt/sophos-av/talpa/build/talpa-1.22.7/tests' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory '/opt/sophos-av/talpa/build/talpa-1.22.7/tests' make[2]: Leaving directory '/opt/sophos-av/talpa/build/talpa-1.22.7/tests' make[2]: Entering directory '/opt/sophos-av/talpa/build/talpa-1.22.7' make -C /lib/modules/4.11.2-1-ARCH/build M=/opt/sophos-av/talpa/build/talpa-1.22.7 modules make[3]: Entering directory '/usr/lib/modules/4.11.2-1-ARCH/build' CC [M] /opt/sophos-av/talpa/build/talpa-1.22.7/src/app-ctrl/core/talpa-linux/talpa_linux_module.o CC [M] /opt/sophos-av/talpa/build/talpa-1.22.7/src/platforms/linux/glue.o CC [M] /opt/sophos-av/talpa/build/talpa-1.22.7/src/platforms/linux/vfs_mount.o CC [M] /opt/sophos-av/talpa/build/talpa-1.22.7/src/components/services/linux_filesystem_impl/linux_systemroot.o /opt/sophos-av/talpa/build/talpa-1.22.7/src/components/services/linux_filesystem_impl/linux_systemroot.c: In function ‘newLinuxSystemRoot’: /opt/sophos-av/talpa/build/talpa-1.22.7/src/components/services/linux_filesystem_impl/linux_systemroot.c:93:13: error: implicit declaration of function ‘task_lock’ [-Werror=implicit-function-declaration] task_lock(inittask); ^~~~~ /opt/sophos-av/talpa/build/talpa-1.22.7/src/components/services/linux_filesystem_impl/linux_systemroot.c:114:13: error: implicit declaration of function ‘task_unlock’ [-Werror=implicit-function-declaration] task_unlock(inittask); ^~~ cc1: some warnings being treated as errors make[4]: [scripts/Makefile.build:295: /opt/sophos-av/talpa/build/talpa-1.22.7/src/components/services/linux_filesystem_impl/linux_systemroot.o] Error 1 make[3]: [Makefile:1492: module/opt/sophos-av/talpa/build/talpa-1.22.7] Error 2 make[3]: Leaving directory '/usr/lib/modules/4.11.2-1-ARCH/build' make[2]: [makefile:2006: talpa_core.ko] Error 2 make[2]: Leaving directory '/opt/sophos-av/talpa/build/talpa-1.22.7' make[1]: [makefile:1633: all-recursive] Error 1 make[1]: Leaving directory '/opt/sophos-av/talpa/build/talpa-1.22.7' make: *** [makefile:715: all] Error 2

I hope this is sufficient information

paperclip commented 7 years ago

4.11 kernel was released after 1.22.7 talpa was produced. If you want to use bleeding-edge kernels, you'll need to get talpa from github, preferably using the autodeploy.sh script - https://gist.github.com/paperclip/7892031

Montecito commented 7 years ago

With the latest version of talpa from github it is possible to compile, but not possible to load the talpa-syscallhook module:

dmesg: [ 7217.741791] talpa-syscallhook: The syscall32_table value is not valid, you will need to reboot your system

I think this error is not related to the error above?

paperclip commented 7 years ago

No it's not related. It means the symbols on disk (/boot/System.map-*) doesn't match the running kernel.

Montecito commented 7 years ago

hmm, running kernel is: uname -r : 4.11.2-1-ARCH with system map: System.map-4.11.2-1-ARCH

Wouldn't it fail to compile/configure if I'm on a different kernel?

paperclip commented 7 years ago

not if the two kernels have the same name - the reason the message suggests rebooting is to improve the chance the kernel on disk will match the one running. Ubuntu/Debian have released kernel updates which keep the same kernel version number, which is why the message is reported. The other possibility is that the System.map is just corrupt and doesn't match the kernel despite having the same name.

Montecito commented 7 years ago

Ok, I will double check that when I'm back from vacation, until then I'll close this issue.

Thx for the quick response