Re: Problem in accessing executable files

From: John T. Williams
Date: Tue Feb 01 2005 - 10:40:41 EST


This is just a thought.

Text files are better able to handle small faults. ie an extra space or
characters or even an unreadable piece of data might not cause the file to
become unreadable by most text editors. Binary files aren't as flexible.
Every bit could be an instruction to the processor and might cause a seg
fault.

Just to test the theory, I would start by making the encrypt decrypt
function only effect the first byte. If doing this doesn't cause a seg
fault, I would recheck my decrypt encrypt algorithm to make sure it doesn't
pad or expand at any point. maybe use them on a regular file and the an
md5sum on the file before and after, just to make extra sure.


----- Original Message -----
From: "Vineet Joglekar" <vintya@xxxxxxxxxx>
To: <linux-kernel@xxxxxxxxxxxxxxx>
Cc: <linux-c-programming@xxxxxxxxxxxxxxx>
Sent: Tuesday, February 01, 2005 8:58 AM
Subject: Problem in accessing executable files


>
> Hi all,
>
> I am trying to add some cryptographic functionality to ext2 file system
for my masters project. I am working with kernel 2.4.21
>
> since the routines do_generic_file_read and do_generic_file_write are used
in reading and writing, I am decrypting and encrypting the data in the resp.
functions. This is working fine for regular data files. If I try to copy /
execute executable files, I am getting segmentation fault. In kernel
messages, I see same functions (read and write) getting called for the
executables also. If I comment encrypt/decrypt functions, its working fine.
>
> Now since it is working for regular text files, I suppose there is not a
problem in my encrypt/decrypt routines, then what might be going wrong?
>
> Thanks and regards,
>
> Vineet
>
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
> -
> To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/