As with message queues and semaphore sets, the kernel maintains a special internal data structure for
each shared memory segment which exists within its addressing space. This structure is of type
shmid_ds, and is defined in linux/shm.h as follows:

Operations on this structure are performed by a special system call, and
should not be tinkered with directly. Here are descriptions of the more pertinent fields:

shm_perm

This is an instance of the ipc_perm structure, which is defined
for us in linux/ipc.h. This holds the permission information for
the segment, including the access permissions, and information
about the creator of the segment (uid, etc).