Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 273365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:26:46+00:00 2026-05-12T00:26:46+00:00

I was wondering – are there any known techniques to control access to a

  • 0

I was wondering – are there any known techniques to control access to a shared memory object from anywhere but an authorized program?

For instance, lets say I create a shared memory segment for use in a program P, to be accessed by Q, and I make it Read-Write. I can access it using Q because I’ve given it (Q) the required permissions to do so (running as a particular user with groups, etc).

However, I’m guessing there are instances where someone could potentially access this shared memory from a program R – simply attaching to it and modifying it. To stop this, you could make the memory segment read only – but now program R could still read what was in the memory.

My question is in parts –

  1. Is there a way to,

    a) allow only Q to access the shared memory?

    b) figure whether a read was done by someone apart from Q – and who did it? [Is this even possible?] For bonus points, could this be done cross-platform? [Probably not, but no harm trying :)]

  2. Under what circumstances could a rogue program attach to the shared memory? I presume one way is if a user is able to exploit OS holes and become the user that started the program. Any others?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T00:26:47+00:00Added an answer on May 12, 2026 at 12:26 am

    POSIX shared memory has the same permissions system as files – if you run ipcs you’ll see the permissions of the shared memory segments on your system:

    $ ipcs -m
    IPC status from <running system> as of Tue Jul 14 23:21:25 BST 2009
    T     ID     KEY        MODE       OWNER    GROUP
    Shared Memory:
    m  65536 0x07021999 --rw-r--r--     root    wheel
    m  65537 0x60022006 --rw-r--r--     root    wheel
    

    In answer to question 1a), you can use the normal UNIX permissions system to only allow access from a certain user and/or group. This can be controlled using shmctl :

    struct ipc_perm perms;
    perms.uid = 100;
    perms.gid = 200;
    perms.mode = 0660; // Allow read/write only by 
                       // uid '100' or members of group '200'
    shmctl(shmid, IPC_SET, &perms);
    

    For 1b), I don’t think any auditing interfaces exist for shared memory access.

    With regards to your second question, any process running as the shm owner/group, or running as root will be able to access your memory – this is no different to accessing any other resource. Root can always access anything on a *ix system; and so any exploit which escalated a user to root would allow access to any shared memory region.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wondering if there is any way to get the lambda expressions that result from
Wondering if there is any way to build and fire an event (e.g. on
Wondering if there is any php script out there which takes an sql db
wondering if there's any way to make it so that a list I have
wondering if there is any full application tutorial and application includes, main screen with
Wondering if there is any Text to Speech software available as a plug in
Wondering if anybody out there has any success in using the JDEdwards XMLInterop functionality.
Wondering if there's any not-too-hard way to edit non-form text in html 4. I
Wondering if there is a way to change the object on the heap that
Wondering if there is a good way to generate temporary URLs that expire in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.