Is the usercanread attribute still needed?
Hello all,
I noticed the apache.te file used the file_types() macro instead of the file_config_file() macro for the configuration files, so I looked into the differences between the macros.
The files_config_file macro is listed below:
interface(files_config_file',
gen_require(`
attribute usercanread;
')
files_type($1)
# this is a hack and should be removed.
typeattribute $1 usercanread;')
After reading the comment above the typeattribute, I was curious to figure out what the usercanread attribute was used for. Looking through the SVN tree I found the following uses.
$ find . -type f | xargs grep usercanread | grep -v '.svn' ./modules/kernel/files.if: attribute usercanread; ./modules/kernel/files.if: typeattribute $1 usercanread; ./modules/kernel/files.te:attribute usercanread;
I used the attached patched to remove the attribute from the files.te and files.if file and the policy still compiled. Is it safe to assume we can remove the attribute now? Or is the hack still needed for something I am not seeing?
Thanks!
- Ryan
modules/kernel/files.if +0 -7
@@ -110,14 +110,7 @@ ## </param> # interface(`files_config_file',` - gen_require(` - attribute usercanread; - ') - files_type($1) - - # this is a hack and should be removed. - typeattribute $1 usercanread; ') ########################################
modules/kernel/files.te +0 -3
@@ -30,9 +30,6 @@ attribute tmpfile; attribute tmpfsfile; -# this is a hack and should be changed -attribute usercanread; - # # boot_t is the type for files in /boot #
Quoted 30 lines · Ryan Bradetich
Hello all,
I noticed the apache.te file used the
file_types()macro instead of thefile_config_file()macro for the configuration files, so I looked into the differences between the macros.The
files_config_filemacro is listed below:interface(
files_config_file',gen_require(` attribute usercanread; ') files_type($1) # this is a hack and should be removed. typeattribute $1 usercanread;')
After reading the comment above the typeattribute, I was curious to figure out what the usercanread attribute was used for. Looking through the SVN tree I found the following uses.
$ find . -type f | xargs grep usercanread | grep -v '.svn' ./modules/kernel/files.if: attribute usercanread; ./modules/kernel/files.if: typeattribute $1 usercanread; ./modules/kernel/files.te:attribute usercanread;
Quoted 4 lines
I used the attached patched to remove the attribute from the files.te and files.if file and the policy still compiled. Is it safe to assume we can remove the attribute now? Or is the hack still needed for something I am not seeing?
Since modules are statically compiled, we can't completely remove the attribute yet, otherwise it might cause some policies to fail to link if it is still required. However, the typeattribute could be removed from files_config_file().
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Sorry all,
I forgot to include the SELinux mailing list.
Thanks,
- Ryan
Quoted 9 lines · Ryan Bradetich
Hello Chris,
Thanks much for your reply!
I have attached an updated patch that leaves the attribute definition in the files.te file.Just out of curiosity, what is the policy for obsoleting these attributes? At next policy file rev?
Quoted 17 lines
Thanks!
- Ryan
Quoted 9 lines · Christopher J. PeBenito
Since modules are statically compiled, we can't completely remove the attribute yet, otherwise it might cause some policies to fail to link if it is still required. However, the typeattribute could be removed from
files_config_file().--
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 9 lines · Ryan Bradetich
Quoted 8 lines
Hello Chris,
Thanks much for your reply!
I have attached an updated patch that leaves the attribute definition in the files.te file.Just out of curiosity, what is the policy for obsoleting these attributes? At next policy file rev?
It has to stay around for "a reasonable transition time". Since this is a fairly widely used interface, it'll probably have to stay for a few releases.
Please resend the patch to the list.
Quoted 5 lines
Quoted 5 lines · Christopher J. PeBenito
Quoted 4 lines
Since modules are statically compiled, we can't completely remove the attribute yet, otherwise it might cause some policies to fail to link if it is still required. However, the typeattribute could be removed from
files_config_file().
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Hello Chris,
I thought I did forward the patch, but it looks like the foward stripped the patch :(
Here is the patch again.
Thanks!
- Ryan
Quoted 22 lines · Christopher J. PeBenito
Quoted 9 lines · Ryan Bradetich
Quoted 8 lines
Hello Chris,
Thanks much for your reply!
I have attached an updated patch that leaves the attribute definition in the files.te file.Just out of curiosity, what is the policy for obsoleting these attributes? At next policy file rev?
It has to stay around for "a reasonable transition time". Since this is a fairly widely used interface, it'll probably have to stay for a few releases.
Please resend the patch to the list.
Quoted 5 lines
Quoted 5 lines · Christopher J. PeBenito
Quoted 4 lines
Since modules are statically compiled, we can't completely remove the attribute yet, otherwise it might cause some policies to fail to link if it is still required. However, the typeattribute could be removed from
files_config_file().
Quoted 6 lines
--
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150
modules/kernel/files.if +0 -7
@@ -110,14 +110,7 @@ ## </param> # interface(`files_config_file',` - gen_require(` - attribute usercanread; - ') - files_type($1) - - # this is a hack and should be removed. - typeattribute $1 usercanread; ') ########################################
modules/kernel/files.te +3 -1
@@ -30,7 +30,9 @@ attribute tmpfile; attribute tmpfsfile; -# this is a hack and should be changed +# this attribute is not currently used and should be removed in the future. +# unfortenately, this attribute can nob be removed yet because it may fail +# some policies to fail to link if it is still required. attribute usercanread; #
Quoted 3 lines · Ryan Bradetich
I thought I did forward the patch, but it looks like the foward stripped the patch :(
Here is the patch again.
Merged.
Quoted 29 lines · Christopher J. PeBenito
Quoted 28 lines
Quoted 9 lines · Ryan Bradetich
Quoted 8 lines
Hello Chris,
Thanks much for your reply!
I have attached an updated patch that leaves the attribute definition in the files.te file.Just out of curiosity, what is the policy for obsoleting these attributes? At next policy file rev?
It has to stay around for "a reasonable transition time". Since this is a fairly widely used interface, it'll probably have to stay for a few releases.
Please resend the patch to the list.
Quoted 5 lines
Quoted 5 lines · Christopher J. PeBenito
Quoted 4 lines
Since modules are statically compiled, we can't completely remove the attribute yet, otherwise it might cause some policies to fail to link if it is still required. However, the typeattribute could be removed from
files_config_file().--
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.