diff --git a/NEWS b/NEWS index 3e474dd3c45..2f45ac28068 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,21 @@ CHANGES WITH 263 in spe: org.freedesktop.sysupdate1.Target.DescribeFeature() is now an array of strings rather than a single optional string. + * The file system constraints encoded in the user.validatefs.* + extended attributes (as written by systemd-repart's AddValidateFS= + setting, which is enabled by default for most file systems) are now + also enforced when mounting partitions of disk images, i.e. via + systemd-dissect, systemd-nspawn, systemd-sysext, portabled, + systemd-mountfsd and RootImage=. Any constraint that is set must be + fulfilled: in particular this means that file systems carrying GPT + partition label or type constraints may no longer be used as bare + file system images without partition table (for example + partitions split out of a DDI via systemd-repart --split=yes), and + file systems declared for a specific mount point may no longer be + used as root file system. Set AddValidateFS=no when building such + images, or set $SYSTEMD_DISSECT_VALIDATEFS=0 when using them to + restore the previous behaviour. + Changes in systemd-udevd: * systemd-udevd now uses fanotify rather than inotify to watch device diff --git a/man/repart.d.xml b/man/repart.d.xml index 181835346b0..ceda2dd6ffb 100644 --- a/man/repart.d.xml +++ b/man/repart.d.xml @@ -1248,7 +1248,15 @@ scenarios, which puts together the mount hierarchy from untrusted data from the GPT partition table. As these extended attributes are stored inside the file system, they are typically authenticated as part of the file system (assuming it is contained in protected volume; i.e. LUKS or - dm-verity), and hence may be used to securely validate the matching partition table fields. + dm-verity), and hence may be used to securely validate the matching partition table fields. The + same constraints are also enforced when the partitions are mounted as part of a disk image, for + example via + systemd-dissect1 + or + systemd-nspawn1. + Note that this means that a file system generated with this option enabled cannot be used as bare + file system image without partition table anymore, since its GPT constraints cannot be fulfilled + then. diff --git a/man/systemd-validatefs@.service.xml b/man/systemd-validatefs@.service.xml index 030078e1e2d..a7d8e0a257d 100644 --- a/man/systemd-validatefs@.service.xml +++ b/man/systemd-validatefs@.service.xml @@ -74,6 +74,21 @@ systemd-repart8 tool generates these extended attributes automatically for the file systems it puts together, which may be controlled with the AddValidateFS= configuration option. + + The same constraints are also enforced whenever partitions of a disk image are mounted via the + generic image dissection logic, i.e. by + systemd-dissect1, + systemd-nspawn1, + systemd-sysext8, + systemd-portabled.service8, + systemd-mountfsd.service8 + or the RootImage= setting in unit files. In this case the mount point is checked + relative to the image's root directory. Any constraint that is set must be fulfilled in full: if + user.validatefs.gpt_label or user.validatefs.gpt_type_uuid are + set, but the file system is not placed on a GPT partition (for example because the image is a bare file + system image, or uses an MBR partition table) the mount is refused. This validation may be turned off by + setting the $SYSTEMD_DISSECT_VALIDATEFS environment variable to + 0. @@ -108,6 +123,7 @@ systemd-gpt-auto-generator8 systemd-fstab-generator8 systemd-repart8 + systemd-dissect1