aspose file tools*
The moose likes Linux / UNIX and the fly likes reset RAM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "reset RAM " Watch "reset RAM " New topic
Author

reset RAM

Matt Brown
Ranch Hand

Joined: Jan 26, 2004
Posts: 70
Is there a syscal in RH Linux that allows you to reset the RAM to clean up the data in a specific part of RAM?


"I just use my muscles as a conversation piece, like someone walking a cheetah down 42nd Street." - Arnold Schwarzenegger
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

Not without some specifics. It would be rude to wipe out RAM belonging to another user, and you don't need a syscall to wipe out your own (the C memset function can do that).

Also, there's the question of whether you mean "RAM" as in Real or Virtual memory.


Customer surveys are for companies who didn't pay proper attention to begin with.
Matt Brown
Ranch Hand

Joined: Jan 26, 2004
Posts: 70
I'm talking about both (real and virtual).

This is what I need to do:

After processing a large file (~10MB), I want to call a function that resets
the memories which were only used by the file so that hackers would not be
able to get the file from the memory.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

That's a tricky one. One solution is to encrypt the file and decrypt only the parts you need. Has the extra advantage that the copy of the data on the disk itself/going over the LAN is also much harder to read.

In addition to/failing that, you should write your program to make sure as few intermediate copies of the data are made as possible. In many cases, the data will be read in chunks from the disk into system buffers, then cut down - or built up - to sizes more appropriate to the app, which may, in turn, move slices of the data around in its own memory. These copies should be bypassed where possible and wiped where not.

I've not have to get quite this paranoid, but there's a program that is. It's a password vault program called "pwsafe". I recommend you obtain the source code and see what they're doing. I do know that in order for it to wipe system/shared memory it has to run as root. Which has its own hazards.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reset RAM