diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if index 8416beb43..d24ae64f7 100644 --- a/policy/modules/kernel/filesystem.if +++ b/policy/modules/kernel/filesystem.if @@ -106,6 +106,64 @@ interface(`fs_exec_noxattr',` can_exec($1, noxattrfs) ') +######################################## +## +## Transform specified type into a filesystem +## type which has extended attribute +## support. +## +## +## +## Domain allowed access. +## +## +# +interface(`fs_xattr_type',` + gen_require(` + attribute xattrfs; + ') + + fs_type($1) + + typeattribute $1 xattrfs; +') + +######################################## +## +## Get the attributes of all the +## filesystems which have extended +## attributes. +## This includes pseudo filesystems. +## +## +## +## Allow the specified domain to +## get the attributes of a filesystems +## which have extended attributes. +## Example attributes: +## +## +## Type of the file system (e.g., tmpfs) +## Size of the file system +## Available space on the file system +## +## +## +## +## Domain allowed access. +## +## +## +## +# +interface(`fs_getattr_all_xattr_fs',` + gen_require(` + attribute xattrfs; + ') + + allow $1 xattrfs:filesystem getattr; +') + ######################################## ## ## Mount a persistent filesystem which diff --git a/policy/modules/kernel/filesystem.te b/policy/modules/kernel/filesystem.te index d9cc21f32..4207e8fae 100644 --- a/policy/modules/kernel/filesystem.te +++ b/policy/modules/kernel/filesystem.te @@ -8,6 +8,7 @@ policy_module(filesystem, 1.18.0) attribute filesystem_type; attribute filesystem_unconfined_type; attribute noxattrfs; +attribute xattrfs; ############################## #
+## Allow the specified domain to +## get the attributes of a filesystems +## which have extended attributes. +## Example attributes: +##