From mboxrd@z Thu Jan 1 00:00:00 1970 From: bawejakunal15@gmail.com (Kunal Baweja) Date: Fri, 30 Jan 2015 13:17:10 +0000 Subject: Intercepting memory mapped files References: <32604.1422623634@turing-police.cc.vt.edu> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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 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