Intercepting memory mapped files

Kunal Baweja bawejakunal15 at gmail.com
Fri Jan 30 08:17:10 EST 2015


Obviously I am writing the encrypted data :-/ I will post my code on github
in an hour so that everyone gets to know what exactly I am doing :-)

On 6:44pm, Fri 30-Jan-2015 null <Valdis.Kletnieks at vt.edu> wrote:

> On Fri, 30 Jan 2015 17:18:21 +0530, Kunal Baweja said:
>
> > void encrypt(char *data, char *encrypted, size_t size)
> > {
> >     unsigned int i;
> >     for(i=0;i<(unsigned int)size;i++)
> >         encrypted[i] = data[i] + 3;
> >     printk(KERN_INFO "%s",encrypted);
> >     return;
> > }
> >
> > So in the given code wherever u see the calls to *wrapfs_encrypt*, I have
> > replaced with my simpler encryption function.
> >
> > But I am not able to figure out why calling this function creates a
> > problem, the printk() statement inside the function shows me the
> correctly
> > encrypted contents but the file is still blank.
>
> Stupid question, but... once you call encrypt(data, encrypted, size),
> do you then write out the 'encrypted' buffer, or do you write out 'data'?
>
> (Bonus points for avoiding a memory leak here :)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150130/c5d5950a/attachment.html 


More information about the Kernelnewbies mailing list