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

RFE: X-mount.auto-fstypes= mount option #1969

Closed
poettering opened this issue Dec 21, 2022 · 1 comment
Closed

RFE: X-mount.auto-fstypes= mount option #1969

poettering opened this issue Dec 21, 2022 · 1 comment

Comments

@poettering
Copy link
Contributor

I am currently working for systemd's gpt-auto logic to tighten the rules somewhat. i.e. right now we look at the GPT partition table, and basically mount whatever we find, regardless of any safety rules.

I am tightening this at various ends now, so that depending on the usecase we will only mount specific partitions, if they are match certain conditions (e.g. are encrypted, have luks, …). One thing I'd also like to lock down: choice of permitted file systems. Right now we'll mount whatever blkid identifies in many cases, including the most random, legacy file systems Linux knows.

Now, sometimes I'd like to like /bin/mount probe the file system, as in "-t auto", but I'd like to tell it the specific set of file system types it may then act on. For example i'd like to say: "whatever you detect as long as it is one of ext4,xfs,btrfs" or so.

I understand that "mount -t" actually allows something similar, i.e. takes multiple fstypes that are tried in order. But AFAIU this will just try to mount the block device with each fs driver until one works. That's something I'd like to avoid though, already because there's a good chance this results in all kinds of kmsg spew.

Hence I think a new pseudo-mount option X-mount.auto-fstypes= or so would make sense, that allow tuning of the file systems that -t auto will actually act on. If libblkid detects a file system not among the listed ones /bin/mount should simply fail.

With that in place we'd have a really nice way to express gpt-auto policies, and allow a nice amount of automatic detection but still limit the attack surface somewhat.

@karelzak
Copy link
Collaborator

karelzak commented Jan 6, 2023

I like the idea and it's strange we do not have this feature yet ;-)

The ideal would be to integrate it somehow into the current -t (and fstab fstype field), but all ideas like auto(ext4,btrfs,xfs) or auto:ext4:btrfs:xfs seems very backwardly incompatible and ugly. X-mount.auto-fstypes= is probably better.

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

No branches or pull requests

2 participants