udisks
udisks copied to clipboard
RFE: Consider mounting `exfat`/`ntfs`/`vfat` and similar filesystems with a reasonable `fmask`/`dmask` defaults
Problem: when an external flash drive with exfat (and likely ntfs/vfat) filesystem is automatically mounted with UDisks, all files on the drive are present as executable [which may be a security issue].
Currently if no fmask/dmask is specified on the mount options for exfat and vfat filesystems, the calling process umask is used for it, which is typically 0022, which leads to files on the mounted drive to have 0755/-rwxr-xr-x permissions (i.e. executable by everyone).
Since UDisks already setups some mount options by default, consider also setting fmask=0113,dmask=0002 there by default.
Pros:
- Having non-executable regular files by default is aligned with Linux filesystems best practices and reduces security risks (e.g. as stated in https://github.com/storaged-project/udisks/issues/644).
- Will make mounted disks satisfy User Private Groups pattern (https://github.com/storaged-project/udisks/issues/509)
Cons:
- Users won't be able to execute files by default from inserted flash drives. Not sure how common this scenario, but users still will be able to override
fmask/dmaskto a suitable value in/etc/udisks2/mount_options.conf.
I vaguely remember fmask and/or dmask were a problem for fuse-exfat. We still need to support both drivers as it's difficult to find out which one gets actually used during mount. This needs to be tested first.