• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reset RAM

 
Matt Brown
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17620
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Matt Brown
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17620
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic