<div dir="ltr"><div class="gmail_extra">The purpose of assignment is to check the authenticity of the user executing the system call, and prevent certain users from executing, kind of like certain security programs (although I don't exactly know how they work).</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 8, 2017 at 8:50 PM, Greg KH <span dir="ltr"><<a href="mailto:greg@kroah.com" target="_blank">greg@kroah.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Jul 08, 2017 at 07:53:31PM +0530, Ajinkya Surnis wrote:<br>
> Actually, I've been given an assignment to write a kernel module such that<br>
> whenever a certain system call (e.g. open()) is executed, the control should<br>
> come to my new module; then it will do some processing on the parameters and<br>
> then call the actual syscall function (sys_open()).<br>
<br>
</span>Horrible assignment, please pass along my regards to the professor that<br>
this is not anything that should ever be assigned. Seriously, do you<br>
want me to email them this?<br>
<span class=""><br>
> I only found the way of intercepting 'sys_call_table'. I know this kind of<br>
> hacking is probably not a good idea.<br>
> Can you suggest any alternative way?<br>
> I would really appreciate.<br>
<br>
</span>Don't do it.<br>
<br>
Really, this is not a valid thing to do in Linux.<br>
<br>
Feel free to quote me.<br>
<br>
Also, the assignment said nothing about 2 modules, so are you sure you<br>
are even doing this right? :)<br>
<br>
thanks,<br>
<br>
greg k-h<br>
</blockquote></div><br></div></div>