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

Reuse tmpfs_t also for the ramfs filesystem #1491

Merged
merged 1 commit into from Dec 2, 2022

Conversation

WOnder93
Copy link
Member

@WOnder93 WOnder93 commented Dec 1, 2022

systemd-creds apparently runs in a chroot where /dev/shm is backed by ramfs instead of the usual tmpfs. ramfs currently uses a separate type (ramfs_t), but both ramfs and tmpfs can in fact be used for the same things interchangeably and since commit a769746 ("filesystem: add fs_use_trans for ramfs"), they also use the same superblock labeling scheme, and thus it would be natural to use a single type for both.

This commit implements this idea, dropping the ramfs_t type and instead using the tmpfs_t type in its place (with ramfs_t being an alias for tmpfs_t for backwards compatibility).

The ramfs-specific interfaces are deprecated and references to them are removed from the policy (as all of them seem to be related to rhgb or readahead, which are not currently shipped in Fedora and will likely be completely removed from the policy in the future).

I ran my work laptop with a policy including this patch for several days and noted no regressions or denials.

This is an alternative to #1295.

systemd-creds apparently runs in a chroot where /dev/shm is backed by
ramfs instead of the usual tmpfs. ramfs currently uses a separate type
(ramfs_t), but both ramfs and tmpfs can in fact be used for the same
things interchangeably and since commit a769746 ("filesystem: add
fs_use_trans for ramfs"), they also use the same superblock labeling
scheme, and thus it would be natural to use a single type for both.

This commit implements this idea, dropping the ramfs_t type and instead
using the tmpfs_t type in its place (with ramfs_t being an alias for
tmpfs_t for backwards compatibility).

The ramfs-specific interfaces are deprecated and references to them are
removed from the policy (as all of them seem to be related to rhgb or
readahead, which are not currently shipped in Fedora and will likely be
completely removed from the policy in the future).

I ran my work laptop with a policy including this patch for several days
and noted no regressions or denials.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
@zpytela
Copy link
Contributor

zpytela commented Dec 2, 2022

Merging, thank you.

@zpytela zpytela merged commit 8e908b8 into fedora-selinux:rawhide Dec 2, 2022
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.

None yet

2 participants