hello
I am working on adding a simple encryption to file contents in ext4 driver (for learning purposes) I added simple XOR encryption to aio_read and aio_write functions and it worked until I faced this problem:aio_write_enc(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
size_t i;
ssize_t ret;
char *data=""> copy_from_user(data,iov->iov_base,iov->iov_len);
for(i=0;i<iov->iov_len;i++)
{
data[i]^=5;
}
struct iovec iov_enc= { .iov_base = iov->iov_base, .iov_len = iov->iov_len };
copy_to_user(iov_enc.iov_base,data,iov->iov_len);
ret=ext4_file_write(iocb,&iov_enc,nr_segs,pos);
vfree(data);
return ret;
}
this just changes the data and then calls original function.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies