Code Monkey home page Code Monkey logo

Comments (6)

cormander avatar cormander commented on July 21, 2024 1

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.

from tpe-lkm.

h-amine avatar h-amine commented on July 21, 2024 1

Sorry, the modification should to be added in "fopskit.h" before this portion of code:

#define fopskit_hook_handler(val)
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)

from tpe-lkm.

eagle1maledetto avatar eagle1maledetto commented on July 21, 2024

Any news?

from tpe-lkm.

h-amine avatar h-amine commented on July 21, 2024

you should prob. add the following lines in fopskit.c

#ifndef FTRACE_OPS_FL_IPMODIFY
#define FTRACE_OPS_FL_IPMODIFY 0
#endif

from tpe-lkm.

eagle1maledetto avatar eagle1maledetto commented on July 21, 2024

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

from tpe-lkm.

eagle1maledetto avatar eagle1maledetto commented on July 21, 2024

@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

from tpe-lkm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.