How do I configure my Gramine manifest so that shmget() works? #1902
Replies: 1 comment 2 replies
-
@fwoodruff-ab I have bad news for you. Gramine currently doesn't support System-V shared memory (https://man7.org/linux/man-pages/man7/sysvipc.7.html). Please check this docs: https://gramine.readthedocs.io/en/stable/devel/features.html#shared-memory What Gramine supports is the POSIX shared memory (https://man7.org/linux/man-pages/man7/shm_overview.7.html), with the I'm afraid Postgres is adamant on requiring System-V shared memory, they have an interesting top-level comment: https://github.com/postgres/postgres/blob/c50d4f4028e5518511b9bfc3a17860a90dc88357/src/backend/port/sysv_shmem.c#L43-L55 So Postgres requires both Sys-V shared memory and POSIX shared memory to be implemented in the OS. Gramine unfortunately implements only POSIX shared memory. Technically we could implement Sys-V shared memory, but it would be a major feature request and would take some time... Alternatively, you/we can bug Postgres developers to remove Sys-V requirement (or make it an optional feature). |
Beta Was this translation helpful? Give feedback.
-
I am looking to run Postgres inside Gramine. Postgres allocates shared memory upfront. I am configuring
pg_hba.conf
so that the shared memory does not leak anything we are concerned about.Therefore I need shmget()/shmctl().
Almost all code that uses shm* instructions within Postgres is in this file:
https://github.com/postgres/postgres/blob/master/src/backend/port/sysv_shmem.c
I have the following manifest file.
sgx.allowed_files = [ "file:/" ]
is staying in there until I have something that actually runs. It is harder to test security assumptions about code you can't run.What changes should I make to enable the various shared memory system calls?
Beta Was this translation helpful? Give feedback.
All reactions