[BUG] What if sombody uses our PROF_SHMEM_KEY?

Andrew Bartlett abartlet at pcug.org.au
Fri Sep 7 02:47:02 GMT 2001

I'm a little worried about what happens if somebody else uses the same
shared memory key as samba:  From what I have seen, if somebody else (in
particular an unprivileged user) creates a SHM segment with the correct
key they can prevent any SMBD from starting on the system.

This is because we check that root created the shm segment before we use

With the recent changes to always build create the profiling shared
memory area - and the dropping of the root-ownership check, I'm a little
worried about the implications if we overwrite another processes data. 
(I have a patch to restore this check, in the form of

The reason I bring this up is that I had exactly this occur earlier this
evening, on my freshly booted system, samba refused to start.  The
logfiles complained that the SHM segment was owned by a non-root user -
I'm presuming it would be apache, what else creates shm segments on a
freshly booted machine?

In the end I rebooted, not having the time to explore the problem
properly, and samba started fine.

Maybe we need a better way to ensure this can't happen, and in
particular it can't happon on purpose.


Andrew Bartlett

Andrew Bartlett                                 abartlet at pcug.org.au
Samba Team member, Build Farm maintainer        abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net

More information about the samba-technical mailing list