Secure shm for sensitive key/crypto material

Secure shm for sensitive key/crypto material

Post by G. Sumner Haye » Wed, 24 Mar 1999 04:00:00



I'm currently working on Linux but am interested in solutions on other
Unix platforms (and even non-Unix platforms, gasp).

Is there any secure shared memory on Linux
that can be guaranteed not to hit disk?  I'm working on a crypto
key-management daemon, and I really don't want sensitive data to
touch magnetic media.  SysV shm seems insecure (32-bit keys can be
guessed at random by other local users, no?).  If I mlock() a segment
of MAP_SHARED mmap()'d memory on Linux, will that guarantee that it
doesn't get written back out to the backing file?  I don't see any
reason to assume that, unfortunately.  Is there any way
to get such a guarantee?  I couldn't find any documentation for POSIX
shm on Linux; does glibc 2.1 support this?  Is it secure?  

I know that I can unlink() the backing file to an mmap()'d file as soon
as everyone's mmap()'d it, but if the data ever actually hits disk
(even when unlinked) then the Bad Guys might still bust in to my
house, grab the hard drive, peek at the platters with electron
microscopes, and learn the secrets of my new-and-improved jackboots --
now with chrome buckles!

Read that last sentence as:

  "Being overly paranoid results in more intellectually interesting
  challenges to overcome, even though in real life they'd just use
  *-hose cryptanalysis"

Alternatively, read it as "I'm curious".

Thanks for your time,

  Sumner

 
 
 

Secure shm for sensitive key/crypto material

Post by pwaecht.. » Thu, 25 Mar 1999 04:00:00


Previously, G. Sumner Hayes wrote in comp.os.linux.development.system, comp.unix.programmer:

Quote:> I'm currently working on Linux but am interested in solutions on other
> Unix platforms (and even non-Unix platforms, gasp).

> Is there any secure shared memory on Linux
> that can be guaranteed not to hit disk?  I'm working on a crypto
> key-management daemon, and I really don't want sensitive data to
> touch magnetic media.  SysV shm seems insecure (32-bit keys can be
> guessed at random by other local users, no?).  If I mlock() a segment
> of MAP_SHARED mmap()'d memory on Linux, will that guarantee that it
> doesn't get written back out to the backing file?  I don't see any
> reason to assume that, unfortunately.  Is there any way
> to get such a guarantee?  I couldn't find any documentation for POSIX
> shm on Linux; does glibc 2.1 support this?  Is it secure?  

On Linux, Kernel memory never get swapped out. So you could write
a driver module and interact via read/write/ioctl.
Drawback: it isn't very portable.
My first thought was: use DMA-save memory - but this leads also to a driver...

 
 
 

Secure shm for sensitive key/crypto material

Post by Dr. Michael Alber » Thu, 25 Mar 1999 04:00:00


Quote:> > that can be guaranteed not to hit disk?  I'm working on a crypto
> > key-management daemon, and I really don't want sensitive data to
> > touch magnetic media.  SysV shm seems insecure (32-bit keys can be
> On Linux, Kernel memory never get swapped out. So you could write
> a driver module and interact via read/write/ioctl.
> Drawback: it isn't very portable.
> My first thought was: use DMA-save memory - but this leads also to a driver...

For the really paranoid, you also need to worry that your
memory segment will be written to disk if the bad guys can
force a system panic.

If you're really worried about this and want to do something
portable, it should be pointed out that bulk data need not be
stored in the server's memory in "plain-text" or "plain bytes",
and you probably can arrange to force the key to be stored in
a register or two (not completely portable).  This makes life
a bit harder for the bad guys, though there is no real gaurd against
someone causing a system panic then taking the disk unless you muck with
the kernel.

Best wishes,
 Mike

 
 
 

1. Secure shm for ipc

I want to set up a secure method of inter process communication
between two processes, so that each process of the pair can
be relatively secure that no one else can spoof into.  Regular
permissions are not adequate, because there may be processes
that want to spoof that are set to the same uid as one of
the pair.

I'm considering using shm as a mailbox, letting both processes
attach, and the set the permissions so no one else can r/w.  Then
make sure no one sneaked in before setting the permissions by
checking the number of attachments.

This seems to work on Linux, but I'm concerned about portability.
Will most unix varients allow processes to r/w attachem shm
segments, even after r/w permissions have been changed with a shmctl
call?  Or might something cause a failure, like say a segment
getting swapped out, and during the reload on a page fault noticing
that the uid cannot write to the segment anymore?

2. Intel PRO/100s NIC support?

3. migrating SuSE crypto fs to crypto api?

4. looking for strongarm development board

5. RFC 3207 (SMTP Service Extension for Secure SMTP over Transport Layer Security) - materials

6. Linux for RMCobol

7. Public Key Crypto in Public Domain?

8. eth0 problem (bug?) in 1.1.86

9. Secure Secure Secure

10. how to distinguish enter key and key pad enter key?

11. SUMMARY: how to distinguish enter key and key pad enter key?

12. securing apache ssl private keys