Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static/writable-paths: set safer options for tmpfs mounts #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alfonsosanchezbeato
Copy link
Member

Set safer options for mount points backed by tmpfs, so we make sure
that nosuid,nodev are set. The options are the default ones
recommended by systemd (see /usr/share/systemd/tmp.mount) and we were
actually using them already for /tmp in the initramfs.

@@ -16,10 +16,10 @@
# snap data
/var/snap auto persistent transition none
# generic
/media none temporary none defaults
/mnt none temporary none defaults
/media none temporary none mode=1777,strictatime,nosuid,nodev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need mode=1777 for /mnt and /media ? Those are not really dirs that have the same semantic as /tmp, they are more dirs with a similar semantic as /run AIUI. Or is there soemthing I'm missing here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, when I run stat on /mnt and /media it actually shows mode 1777 already, so I think that is the default mode. This just shows that more explicitly. So we can remove it I guess, I do not have a strong opinion either way.

@alfonsosanchezbeato
Copy link
Member Author

I've removed the change for /var/lib/sudo as anyway that folder can be used only by root.

Copy link
Contributor

@anonymouse64 anonymouse64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks for this

Copy link
Member

@Meulengracht Meulengracht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, LGTM

Set safer options for mount points backed by tmpfs and writable by all
users, so we make sure that nosuid,nodev are set. The options are the
default ones recommended by systemd (see /usr/share/systemd/tmp.mount)
and we were actually using them already for /tmp in the initramfs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants