How to dealwith mmap for a filesystem filter driver?

kipade kipade at 163.com
Sat Feb 16 03:16:43 EST 2019


Hello all,
I created a filter driver for the vfs, for some special file read, I want to replace its
data got from the disk and return to the new data to user space, eg. decryption.
my hooked read entry like this:
int my_hooked_read(struct file* filp, char* buffer, size_t count, loff_t* pos)
{
    int ret = orig_read(filp, buffer, count, pos);
    if(ret > 0)
    {
        //do something
    }
    return ret;
}
the code works file for normal read, but take no sense for read via mmap operations.
so, I want to know what should I do to resolve such issue?
Thanks.




 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20190216/607a8409/attachment.html>


More information about the Kernelnewbies mailing list