You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Recent security update changed default permissions of tmpfs #4971
Ah, I see what happened. runc will automatically set mode=N to the mode of the mount if it already exists (if it doesn't, mode=N doesn't get set), but in 72fbb34 we moved the creation logic so it happens first and so it will always get set to the mode we used to create the directories (unless it already existed, which isn't the case here). I used 0o755 as the default mode for the auto-created directories.
I also experienced this with latest update from https://download.docker.com/linux/debian bookworm stable
on Debian Trixie, it broke all my postgres containers with tmpfs mounted on /dev/shm .
Same here. all my postgresql containers with tmpfs on /dev/shm broke .
I started seeing some issues with PostgreSQL in container (docker swarm) after server maintenance today (ubuntu 22.04 and docker upgrade from 28.3 -> 28.5.2) .
I get this:
FATAL: could not open shared memory segment "/PostgreSQL.2193961348": Permission denied
@cyphar Thank you for pointing that out and it is indeed the correct way. However I have not found a way of passing that setting on docker swarm, it just doesnt take effect for me.
A solution that doesn't open you up to security issues is to manually configure mode=1777 for the tmpfs mount configuration.
If anyone gets this to work with Docker Swarm please let me know. In a simple docker compose it works fine but I could not get it to work with swarm: it ignores the tmpfs mode.
If you create a custom image with a directory that has the correct mode, that will be used as the tmpfs mode (i.e., mkdir /tmp; chmod =1777 /tmp). This unfortunately won't help with /dev/shm because /dev gets overmounted with a tmpfs first and so runc can't see the /dev/shm directory.
containerd is the wrong package to version lock, it's runc that you need to downgrade if necessary. The fix for this (#4973) will be in the next minor releases.
This approach creates a volume named <stack_name>_shm on the host using the local driver with tmpfs device, which did not happen with the previous approach.
This also killed my postgres on swarm. Fixed it with docker service update --mount-add type=tmpfs,target=/dev/shm,tmpfs-size=512000000,tmpfs-mode=1777 SERVICE_NAME
Activity
Explicitly specify mode=1777 for tmpfs to work around a recent runc r…
cyphar commentedon Nov 6, 2025
Ah, I see what happened. runc will automatically set
mode=Nto the mode of the mount if it already exists (if it doesn't,mode=Ndoesn't get set), but in 72fbb34 we moved the creation logic so it happens first and so it will always get set to the mode we used to create the directories (unless it already existed, which isn't the case here). I used0o755as the default mode for the auto-created directories.I'll prepare a patch tomorrow.
nowheretobefound commentedon Nov 6, 2025
I also experienced this with latest update from https://download.docker.com/linux/debian bookworm stable
on Debian Trixie, it broke all my postgres containers with tmpfs mounted on /dev/shm .
ieugen commentedon Nov 6, 2025
Same here. all my postgresql containers with tmpfs on /dev/shm broke .
I started seeing some issues with PostgreSQL in container (docker swarm) after server maintenance today (ubuntu 22.04 and docker upgrade from 28.3 -> 28.5.2) .
I get this:
because I had :
Removing tmpfs fixes postgresql start and stop.
nowheretobefound commentedon Nov 8, 2025
On debian this rolled back to a working version of runc :
Mark it as hold until it is fixed
cyphar commentedon Nov 8, 2025
A solution that doesn't open you up to security issues is to manually configure
mode=1777for the tmpfs mount configuration.nowheretobefound commentedon Nov 8, 2025
@cyphar Thank you for pointing that out and it is indeed the correct way. However I have not found a way of passing that setting on docker swarm, it just doesnt take effect for me.
pizaCat commentedon Nov 8, 2025
If anyone gets this to work with Docker Swarm please let me know. In a simple docker compose it works fine but I could not get it to work with swarm: it ignores the tmpfs mode.
cyphar commentedon Nov 8, 2025
If you create a custom image with a directory that has the correct mode, that will be used as the tmpfs mode (i.e.,
mkdir /tmp; chmod =1777 /tmp). This unfortunately won't help with/dev/shmbecause/devgets overmounted with a tmpfs first and so runc can't see the/dev/shmdirectory.pizaCat commentedon Nov 8, 2025
Yeah in my case it's postgres images and it's for a bigger shm. Docker swarm does not respect shm_size either unfortunately.
gettes commentedon Nov 9, 2025
cyphar commentedon Nov 9, 2025
containerd is the wrong package to version lock, it's runc that you need to downgrade if necessary. The fix for this (#4973) will be in the next minor releases.
hannosgit commentedon Nov 9, 2025
I had the same problem with Docker Swarm but I fixed it by defining a volume separately:
Before:
Afterwards:
guoard commentedon Nov 9, 2025
This approach creates a volume named
<stack_name>_shmon the host using thelocaldriver withtmpfsdevice, which did not happen with the previous approach.alastairtree commentedon Nov 10, 2025
This also killed my postgres on swarm. Fixed it with
docker service update --mount-add type=tmpfs,target=/dev/shm,tmpfs-size=512000000,tmpfs-mode=1777 SERVICE_NAME20 remaining items
[BUILD] Fix tmpfs permission mode
[BUILD] Fix tmpfs permission mode for Cassandra, Postgres and RabbitM…
Fix CI (due to tmpfs permissions changes in runc 1.3.3)
Dockerfile: update runc binary to v1.3.4
Dockerfile: update runc binary to v1.3.4
Dockerfile: update runc binary to v1.4.0
Dockerfile: update runc binary to v1.3.4
[BUILD] Fix tmpfs permission mode
[BUILD] Fix tmpfs permission mode
[BUILD] Fix tmpfs permission mode
[BUILD] Fix tmpfs permission mode
runc: bump to 1.4.0
[BUILD] Fix tmpfs permission mode
[BUILD] Fix tmpfs permission mode
fix: store balena session token in memory, drop /tmp/work tmpfs