All of lore.kernel.org
 help / color / mirror / Atom feed
* [refpolicy] [PATCH 1/3] Create new xattrfs attribute and fs_*_all_xattr_fs() interfaces
@ 2014-03-19 22:17 Laurent Bigonville
  2014-03-19 22:17 ` [refpolicy] [PATCH 2/3] Associate the new xattrfs attribute to some pseudo filesystems Laurent Bigonville
  2014-03-19 22:17 ` [refpolicy] [PATCH 3/3] Allow setfiles_t and restorecond_t to getattr on pseudo-fs Laurent Bigonville
  0 siblings, 2 replies; 4+ messages in thread
From: Laurent Bigonville @ 2014-03-19 22:17 UTC (permalink / raw)
  To: refpolicy

From: Laurent Bigonville <bigon@bigon.be>

Create a new attribute and fs_*_all_xattr_fs() interfaces that will be
used for pseudo filesystems that support xattr
---
 policy/modules/kernel/filesystem.if | 200 ++++++++++++++++++++++++++++++++++++
 policy/modules/kernel/filesystem.te |   1 +
 2 files changed, 201 insertions(+)

diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if
index 8416beb..36cb57b 100644
--- a/policy/modules/kernel/filesystem.if
+++ b/policy/modules/kernel/filesystem.if
@@ -108,6 +108,206 @@ interface(`fs_exec_noxattr',`
 
 ########################################
 ## <summary>
+##	Transform specified type into a filesystem
+##	type which has extended attribute
+##	support.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`fs_xattr_type',`
+	gen_require(`
+		attribute xattrfs;
+	')
+
+	fs_type($1)
+
+	typeattribute $1 xattrfs;
+')
+
+########################################
+## <summary>
+##	Mount a pseudo filesystem which
+##	has extended attributes.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`fs_mount_all_xattr_fs',`
+	gen_require(`
+		attribute xattrfs;
+	')
+
+	allow $1 xattrfs:filesystem mount;
+')
+
+########################################
+## <summary>
+##	Remount a pseudo filesystem which
+##	has extended attributes.
+##	This allows some mount options
+##	to be changed.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`fs_remount_all_xattr_fs',`
+	gen_require(`
+		attribute xattrfs;
+	')
+
+	allow $1 xattrfs:filesystem remount;
+')
+
+########################################
+## <summary>
+##	Unmount a pseudo filesystem which
+##	has extended attributes.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`fs_unmount_all_xattr_fs',`
+	gen_require(`
+		attribute xattrfs;
+	')
+
+	allow $1 xattrfs:filesystem unmount;
+')
+
+########################################
+## <summary>
+##	Get the attributes of pseudo
+##	filesystems which have extended
+##	attributes.
+## </summary>
+## <desc>
+##	<p>
+##	Allow the specified domain to
+##	get the attributes of a pseudo
+##	filesystems which have extended
+##	attributes.
+##	Example attributes:
+##	</p>
+##	<ul>
+##		<li>Type of the file system (e.g., tmpfs)</li>
+##		<li>Size of the file system</li>
+##		<li>Available space on the file system</li>
+##	</ul>
+## </desc>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <infoflow type="read" weight="5"/>
+## <rolecap/>
+#
+interface(`fs_getattr_all_xattr_fs',`
+	gen_require(`
+		attribute xattrfs;
+	')
+
+	allow $1 xattrfs:filesystem getattr;
+')
+
+########################################
+## <summary>
+##	Do not audit attempts to
+##	get the attributes of a pseudo
+##	filesystem which has extended
+##	attributes.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain to not audit.
+##	</summary>
+## </param>
+#
+interface(`fs_dontaudit_getattr_all_xattr_fs',`
+	gen_require(`
+		attribute xattrfs;
+	')
+
+	dontaudit $1 xattrfs:filesystem getattr;
+')
+
+########################################
+## <summary>
+##	Allow changing of the label of a
+##	pseudo filesystem with extended
+##	attributes using the context=
+##	mount option.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`fs_relabelfrom_all_xattr_fs',`
+	gen_require(`
+		attribute xattrfs;
+	')
+
+	allow $1 xattrfs:filesystem relabelfrom;
+')
+
+########################################
+## <summary>
+##	Get the pseudo filesystem quotas of
+##	a filesystem with extended attributes.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`fs_get_all_xattr_fs_quotas',`
+	gen_require(`
+		attribute xattrfs;
+	')
+
+	allow $1 xattrfs:filesystem quotaget;
+')
+
+########################################
+## <summary>
+##	Set the pseudo filesystem quotas of
+##	a filesystem with extended attributes.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`fs_set_all_xattr_fs_quotas',`
+	gen_require(`
+		attribute xattrfs;
+	')
+
+	allow $1 xattrfs:filesystem quotamod;
+')
+
+
+########################################
+## <summary>
 ##	Mount a persistent filesystem which
 ##	has extended attributes, such as
 ##	ext3, JFS, or XFS.
diff --git a/policy/modules/kernel/filesystem.te b/policy/modules/kernel/filesystem.te
index d9cc21f..4207e8f 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;
 
 ##############################
 #
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-04 19:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-19 22:17 [refpolicy] [PATCH 1/3] Create new xattrfs attribute and fs_*_all_xattr_fs() interfaces Laurent Bigonville
2014-03-19 22:17 ` [refpolicy] [PATCH 2/3] Associate the new xattrfs attribute to some pseudo filesystems Laurent Bigonville
2014-04-04 19:44   ` Christopher J. PeBenito
2014-03-19 22:17 ` [refpolicy] [PATCH 3/3] Allow setfiles_t and restorecond_t to getattr on pseudo-fs Laurent Bigonville

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.