Re: Unswappable memory needed is user space

Kev (klmitch@mit.edu)
Tue, 08 Dec 1998 18:16:46 EST


> I'm making a crypto program (under french law).
> It crypts a file and then totally erase the uncrypted by filling it with
> zero.
>
> My problem is that if the crypting process is swapped out during
> crypting, one could be able to recover parts of uncrypted file
> in swap partition.
>
> Is there a way to malloc a non swappable part of memory ?

You can use mlock() to lock pages into memory...but only as root.

-- 
Kevin L. Mitchell <klmitch@mit.edu>
-------------------------  -. .---- --.. ..- -..-  --------------------------
http://web.mit.edu/klmitch/www/              (PGP5 keys availiable from here)
   DSS Key ID ED0DB34E: D9BF 0E74 FDCB 43F5 C597  878F 9455 EC24 ED0D B34E
   DH  Key ID 2A2C31D4: 1A77 4BA5 9E32 14AE 87DA  9FEC 7106 FC62 2A2C 31D4

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