Open eagle1maledetto opened 6 years ago
Finally got a chance to look at this today - my latest system is kernel 4.15.6 which compiles without issue, so it's likely a change to the upstream between 4.15 and 4.16 that I need to account for. Will have to build out a new VM to start testing this. Thanks for the report.
Any news?
you should prob. add the following lines in fopskit.c
you should prob. add the following lines in fopskit.c
ifndef FTRACE_OPS_FL_IPMODIFY
define FTRACE_OPS_FL_IPMODIFY 0
endif
No luck
# make
make -C /usr/src/linux-headers-3.16.0-4-amd64 M=/root/tpe-lkm modules
make[1]: ingresso nella directory "/usr/src/linux-headers-3.16.0-4-amd64"
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-4-amd64'
CC [M] /root/tpe-lkm/fopskit.o
CC [M] /root/tpe-lkm/tpe_core.o
CC [M] /root/tpe-lkm/tpe_module.o
In file included from /root/tpe-lkm/tpe_module.c:3:0:
/root/tpe-lkm/fopskit.h:48:38: error: ‘FTRACE_OPS_FL_IPMODIFY’ undeclared here (not in a function)
.flags = FTRACE_OPS_FL_SAVE_REGS | FTRACE_OPS_FL_IPMODIFY, \
^
/root/tpe-lkm/tpe_module.c:32:1: note: in expansion of macro ‘fopskit_hook_handler’
fopskit_hook_handler(security_mmap_file) {
^
I've modified the file according to your suggestion:
# head -n 4 fopskit.c
#include "fopskit.h"
#ifndef FTRACE_OPS_FL_IPMODIFY
#define FTRACE_OPS_FL_IPMODIFY 0
#endif
Thank you
Sorry, the modification should to be added in "fopskit.h" before this portion of code:
static void notrace fopskit_##val(unsigned long, unsigned long, \
struct ftrace_ops *, struct pt_regs *); \
static struct ftrace_ops fops_##val __read_mostly = { \
.func = fopskit_##val, \
.flags = FTRACE_OPS_FL_SAVE_REGS | FTRACE_OPS_FL_IPMODIFY, \
}; \
static void notrace fopskit_##val(unsigned long ip, unsigned long parent_ip, \
struct ftrace_ops *fops, struct pt_regs *regs)
@h-amine it worked like a charm! Now the module is built and loadable in the kernel.
When I load it I get this messages tho:
[39606818.901490] fopskit: fopskit_find_sym_addr() failed with return code -14 for fops_hook { name => selinux_enabled, addr => 0, found => 0, hooked => 0 } at fopskit_find_sym_addr() line 222 [39606818.907077] fopskit: fopskit_find_sym_addr() failed with return code -14 for fops_hook { name => selinux_disabled, addr => 0, found => 0, hooked => 0 } at fopskit_find_sym_addr() line 222 [39606818.907080] tpe: warning: cred->security was not remapped; the soften_mmap flag won't persist to child processes. [39606818.968566] tpe: added to kernel
Is another issue?
Thank you
Hi,
I'm trying to compile on a 3.16.0-4-amd64 kernel, on an host with Devuan 8 (same kernel and issue on Debian 8).
The CONFIG_FUNCTION_TRACER is enabled.
Any hint?
Gianluca