in Education by
Without getting into the details of why, I'm looking for a clean (as possible) way to replace kernel functions and system calls from a loadable module. My initial idea was to write some code to override some functions, which would take the original function (perhaps, if possible, call the function), and then add some of my own code. The key is that the function that I write has to have the name of the original function, so other code, upon trying to access it, will access mine instead. I can easily (comparatively) do this directly in the kernel by just throwing my code into the appropriate functions, but I was wondering if anyone knew a little C magic that isn't necessarily horrible kernel (or C) coding practice that could achieve the same result. Thoughts of #defines and typedefs come to mind, but I can't quite hack it out in my head. In short: does anyone know a way to effectively override functions in the Linux kernel (from a module)? EDIT: Since it's been asked, I essentially want to log certain functions (creating/deleting directories, etc.) from within the kernel, but for sanity's sake, a loadable module seems to make sense, rather than having to write a big patch to the kernel code and recompile on every change. A minimal amount of added code to the kernel is okay, but I want to offload most of the work to a module. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I realise that the question is three years old, but for the benefit of other people trying to do this sort of thing, the kernel has an interface called kprobes to do just what you needed.

Related questions

0 votes
    Has anyone managed to run an ipynb Python notebook using a local kernel but connecting to a remote GitHub ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    Here is what I want to do: protocol GenericFactory { associatedtype Input associatedtype Value func create(with ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    I am trying to override the tomcat session manager with an embedded tomcat. These are the steps preformed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I am new to OpenCL. I would like to write a generic kernel so later I can extend its use to ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
0 votes
    I am new to machine learning and I was following this blog on how to write a model with mobilenet ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I am writing an OpenCL code to assemble a sparse matrix from Finite Element discretization and I would ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I've programmed a kernel module. The module is part of a thesis on the subject of Smartphone Security. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    ___________ shares the OS kernel of the host system. 1. Virtual Machine 2. Container 3. VMware 4. Hypervisor...
asked Sep 18, 2021 in Education by JackTerrance
0 votes
    Multiple containers running on a single machine all share the same resources such as the operating system kernel for instant boot and ... ? 1. True 2. False 3. Doesn't make sense...
asked Jun 22, 2021 in Technology by JackTerrance
0 votes
    What is the difference between method overloading and method overriding?...
asked Feb 9, 2023 in Technology by JackTerrance
0 votes
    What is method overriding in Java?...
asked Feb 9, 2023 in Technology by JackTerrance
0 votes
    What is method overriding in Java?...
asked Feb 8, 2023 in Technology by JackTerrance
0 votes
    I'm am adding the following code to the constructor of App.xaml.cs in my WP7 application. Resources[ ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    Which of these keywords can be used to prevent Method overriding? (a) static (b) constant (c) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is the difference between method overloading and method overriding in C#?...
asked Jul 27, 2021 in Technology by JackTerrance
...