All of lore.kernel.org
 help / color / mirror / Atom feed
* [refpolicy] restorecon needs to read bin_t symlinks
@ 2011-03-19 15:45 Guido Trentalancia
  2011-03-19 15:51 ` Dominick Grift
  0 siblings, 1 reply; 10+ messages in thread
From: Guido Trentalancia @ 2011-03-19 15:45 UTC (permalink / raw)
  To: refpolicy

Hello !

I have recently started to experience AVC denials due to restorecon
trying to read bin_t symbolic links. It is not entirely clear to me what
is triggering this, since everything has been working fine for a long
time.

In any case, I had to apply the following patch on my system (and I am
still asking myself why not files_read_all_symlinks then ?):

diff -pruN refpolicy-git-17032011/policy/modules/kernel/files.if refpolicy-git-17032011-restorecon/policy/modules/kernel/files.if
--- refpolicy-git-17032011/policy/modules/kernel/files.if	2011-02-22 18:50:44.460551925 +0100
+++ refpolicy-git-17032011-restorecon/policy/modules/kernel/files.if	2011-03-19 16:21:01.701636861 +0100
@@ -4425,7 +4425,28 @@ interface(`files_relabelfrom_usr_files',
 
 ########################################
 ## <summary>
-##	Read symbolic links in /usr.
+##	Read symbolic links with type
+##	bin_t (usually located in /bin,
+##	/sbin, /usr/bin and /usr/sbin).
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`files_read_bin_symlinks',`
+	gen_require(`
+		type bin_t;
+	')
+
+	read_lnk_files_pattern($1, bin_t, bin_t)
+')
+
+########################################
+## <summary>
+##	Read symbolic links with type
+##	usr_t (usually located in /usr).
 ## </summary>
 ## <param name="domain">
 ##	<summary>
diff -pruN refpolicy-git-17032011/policy/modules/system/selinuxutil.te refpolicy-git-17032011-restorecon/policy/modules/system/selinuxutil.te
--- refpolicy-git-17032011/policy/modules/system/selinuxutil.te	2011-01-17 19:36:10.814131755 +0100
+++ refpolicy-git-17032011-restorecon/policy/modules/system/selinuxutil.te	2011-03-19 16:16:13.198810817 +0100
@@ -527,6 +527,7 @@ files_read_etc_runtime_files(setfiles_t)
 files_read_etc_files(setfiles_t)
 files_list_all(setfiles_t)
 files_relabel_all_files(setfiles_t)
+files_read_bin_symlinks(setfiles_t)
 files_read_usr_symlinks(setfiles_t)
 
 fs_getattr_xattr_fs(setfiles_t)

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

end of thread, other threads:[~2011-03-22 12:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-19 15:45 [refpolicy] restorecon needs to read bin_t symlinks Guido Trentalancia
2011-03-19 15:51 ` Dominick Grift
2011-03-19 17:12   ` Guido Trentalancia
2011-03-19 19:54     ` Guido Trentalancia
2011-03-19 20:05       ` Sven Vermeulen
2011-03-19 20:25         ` Guido Trentalancia
2011-03-19 20:38         ` Guido Trentalancia
2011-03-21 13:29           ` Christopher J. PeBenito
     [not found]   ` <1300555758.3034.35.camel@tesla.lan>
     [not found]     ` <4D84E955.8030304@gmail.com>
     [not found]       ` <1300556614.3034.47.camel@tesla.lan>
     [not found]         ` <4D84EBC4.2050504@gmail.com>
     [not found]           ` <1300557149.3034.52.camel@tesla.lan>
     [not found]             ` <4D84EE9B.20604@gmail.com>
     [not found]               ` <1300558205.18208.2.camel@tesla.lan>
2011-03-19 18:15                 ` Dominick Grift
2011-03-22 12:12                   ` Daniel J Walsh

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.