SELinux-Refpolicy Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] Add interface to read efivarfs_t directory
@ 2019-12-17 23:34 Sugar, David
  2019-12-17 23:34 ` [PATCH 2/2] Fix indent to match the rest of the file (space -> tab) Sugar, David
  2019-12-26 17:00 ` [PATCH 1/2] Add interface to read efivarfs_t directory Chris PeBenito
  0 siblings, 2 replies; 4+ messages in thread
From: Sugar, David @ 2019-12-17 23:34 UTC (permalink / raw)
  To: selinux-refpolicy

I'm seeing the following denial when using 'efivars --list'.  This
interface grants access
2019-12-17T15:22:06-05:00 ip-tsc-black tag_audit_log: type=AVC msg=audit(1576596109.149:95): avc:  denied  { read } for  pid=2329 comm="efivar" name="/" dev="efivarfs" ino=11266 scontext=system_u:system_r:my_app_t:s0 tcontext=system_u:object_r:efivarfs_t:s0 tclass=dir permissive=1

Signed-off-by: Dave Sugar <dsugar@tresys.com>
---
 policy/modules/kernel/filesystem.if | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if
index 62911f12..98f3af5d 100644
--- a/policy/modules/kernel/filesystem.if
+++ b/policy/modules/kernel/filesystem.if
@@ -1982,6 +1982,24 @@ interface(`fs_manage_dos_files',`
 	manage_files_pattern($1, dosfs_t, dosfs_t)
 ')
 
+########################################
+## <summary>
+##	List dirs in efivarfs filesystem.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`fs_list_efivars',`
+	gen_require(`
+		type efivarfs_t;
+	')
+
+	list_dirs_pattern($1, efivarfs_t, efivarfs_t)
+')
+
 #######################################
 ## <summary>
 ##      Read files in efivarfs
-- 
2.23.0


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

* [PATCH 2/2] Fix indent to match the rest of the file (space -> tab)
  2019-12-17 23:34 [PATCH 1/2] Add interface to read efivarfs_t directory Sugar, David
@ 2019-12-17 23:34 ` Sugar, David
  2019-12-26 17:00   ` Chris PeBenito
  2019-12-26 17:00 ` [PATCH 1/2] Add interface to read efivarfs_t directory Chris PeBenito
  1 sibling, 1 reply; 4+ messages in thread
From: Sugar, David @ 2019-12-17 23:34 UTC (permalink / raw)
  To: selinux-refpolicy

Signed-off-by: Dave Sugar <dsugar@tresys.com>
---
 policy/modules/kernel/filesystem.if | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if
index 98f3af5d..3e6324e7 100644
--- a/policy/modules/kernel/filesystem.if
+++ b/policy/modules/kernel/filesystem.if
@@ -2013,11 +2013,11 @@ interface(`fs_list_efivars',`
 ## <rolecap/>
 #
 interface(`fs_read_efivarfs_files',`
-        gen_require(`
-                type efivarfs_t;
-        ')
+	gen_require(`
+		type efivarfs_t;
+	')
 
-        read_files_pattern($1, efivarfs_t, efivarfs_t)
+	read_files_pattern($1, efivarfs_t, efivarfs_t)
 ')
 
 ########################################
-- 
2.23.0


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

* Re: [PATCH 1/2] Add interface to read efivarfs_t directory
  2019-12-17 23:34 [PATCH 1/2] Add interface to read efivarfs_t directory Sugar, David
  2019-12-17 23:34 ` [PATCH 2/2] Fix indent to match the rest of the file (space -> tab) Sugar, David
@ 2019-12-26 17:00 ` Chris PeBenito
  1 sibling, 0 replies; 4+ messages in thread
From: Chris PeBenito @ 2019-12-26 17:00 UTC (permalink / raw)
  To: Sugar, David, selinux-refpolicy

On 12/17/19 6:34 PM, Sugar, David wrote:
> I'm seeing the following denial when using 'efivars --list'.  This
> interface grants access
> 2019-12-17T15:22:06-05:00 ip-tsc-black tag_audit_log: type=AVC msg=audit(1576596109.149:95): avc:  denied  { read } for  pid=2329 comm="efivar" name="/" dev="efivarfs" ino=11266 scontext=system_u:system_r:my_app_t:s0 tcontext=system_u:object_r:efivarfs_t:s0 tclass=dir permissive=1
> 
> Signed-off-by: Dave Sugar <dsugar@tresys.com>
> ---
>   policy/modules/kernel/filesystem.if | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
> 
> diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if
> index 62911f12..98f3af5d 100644
> --- a/policy/modules/kernel/filesystem.if
> +++ b/policy/modules/kernel/filesystem.if
> @@ -1982,6 +1982,24 @@ interface(`fs_manage_dos_files',`
>   	manage_files_pattern($1, dosfs_t, dosfs_t)
>   ')
>   
> +########################################
> +## <summary>
> +##	List dirs in efivarfs filesystem.
> +## </summary>
> +## <param name="domain">
> +##	<summary>
> +##	Domain allowed access.
> +##	</summary>
> +## </param>
> +#
> +interface(`fs_list_efivars',`
> +	gen_require(`
> +		type efivarfs_t;
> +	')
> +
> +	list_dirs_pattern($1, efivarfs_t, efivarfs_t)
> +')
> +
>   #######################################
>   ## <summary>
>   ##      Read files in efivarfs

Merged.

-- 
Chris PeBenito

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

* Re: [PATCH 2/2] Fix indent to match the rest of the file (space -> tab)
  2019-12-17 23:34 ` [PATCH 2/2] Fix indent to match the rest of the file (space -> tab) Sugar, David
@ 2019-12-26 17:00   ` Chris PeBenito
  0 siblings, 0 replies; 4+ messages in thread
From: Chris PeBenito @ 2019-12-26 17:00 UTC (permalink / raw)
  To: Sugar, David, selinux-refpolicy

On 12/17/19 6:34 PM, Sugar, David wrote:
> Signed-off-by: Dave Sugar <dsugar@tresys.com>
> ---
>   policy/modules/kernel/filesystem.if | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if
> index 98f3af5d..3e6324e7 100644
> --- a/policy/modules/kernel/filesystem.if
> +++ b/policy/modules/kernel/filesystem.if
> @@ -2013,11 +2013,11 @@ interface(`fs_list_efivars',`
>   ## <rolecap/>
>   #
>   interface(`fs_read_efivarfs_files',`
> -        gen_require(`
> -                type efivarfs_t;
> -        ')
> +	gen_require(`
> +		type efivarfs_t;
> +	')
>   
> -        read_files_pattern($1, efivarfs_t, efivarfs_t)
> +	read_files_pattern($1, efivarfs_t, efivarfs_t)
>   ')
>   
>   ########################################

Merged.

-- 
Chris PeBenito

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 23:34 [PATCH 1/2] Add interface to read efivarfs_t directory Sugar, David
2019-12-17 23:34 ` [PATCH 2/2] Fix indent to match the rest of the file (space -> tab) Sugar, David
2019-12-26 17:00   ` Chris PeBenito
2019-12-26 17:00 ` [PATCH 1/2] Add interface to read efivarfs_t directory Chris PeBenito

SELinux-Refpolicy Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux-refpolicy/0 selinux-refpolicy/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux-refpolicy selinux-refpolicy/ https://lore.kernel.org/selinux-refpolicy \
		selinux-refpolicy@vger.kernel.org
	public-inbox-index selinux-refpolicy

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux-refpolicy


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git