Changing the hierarchy of system calls executed in response to a command
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I want to change the way linux reacts to commands and user executables..
i.e i want to change the system calls which will be executed in response to it.
I will have to involve my new code before system goes to sys_execve() to execute the executable
One way could be by tapping the sys_call_table i.e exporting it(which will require a patch) and changing the pointer to point to my code and then my program will point to execve()
Could you explain what you are trying to accomplish?
What is the purpose of this? (Any code or examples?)
Are you sure you need to do this in the kernel? (Can't you keep to userland?)
In what way does your approach differ from malicious kernel subversion?
Have you ever checked out the LSM?
I have embedded certain stuffs in the ELF format for the binary executables.
SO everytime the executable runs, i want it to extract the watermark and then proceed to make the system calls. i.e sys_execve() and the rest
I was thinking of changing the pointer location in sys_call_table to point to my code then simultaneously, to the system call from there.
Its like hacking into the system.
Is there any userland method i could use to support this
What i need now is to develop a kernel module program in response to the binary signature i have already embedded. i.e, i need to develop the kernel module program to initiate the shell to check the elf before running it.
Since the DigSig kernel module already lays the groundwork for a checking mechanism plus hooks into the LSM, wouldn't it be convenient to use it as conceptual and practical framework to base your work on? Or doesn't that fit the requirements for your assignment?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.