add read permission over dev_type to appdomain on android_cts enabled
PATCH 1/1 add read permission over dev_type to appdomain on android_cts enabled
--- cts.te | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
cts.te +1 -1
@@ -20,7 +20,7 @@ allow appdomain file_type:dir r_dir_perms; allow appdomain fs_type:dir r_dir_perms; allow appdomain dev_type:dir r_dir_perms; allow appdomain file_type:dir_file_class_set getattr; -allow appdomain dev_type:dir_file_class_set getattr; +allow appdomain dev_type:dir_file_class_set { getattr read }; allow appdomain fs_type:dir_file_class_set getattr; # Execute the shell or other system executables.
Signature · 7 lines
1.7.0.4 -- 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 · Haiqing Jiang
--- cts.te | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)cts.te +0
-0
cts.te allow appdomain file_type:dir r_dir_perms; · line 26
Quoted 8 lines
cts.te +1
-1@@ -20,7 +20,7 @@ allow appdomain file_type:dir r_dir_perms; allow appdomain fs_type:dir r_dir_perms; allow appdomain dev_type:dir r_dir_perms; allow appdomain file_type:dir_file_class_set getattr; -allow appdomain dev_type:dir_file_class_set getattr; +allow appdomain dev_type:dir_file_class_set { getattr read }; allow appdomain fs_type:dir_file_class_set getattr; # Execute the shell or other system executables.
I don't think you want to allow all app domains to read all devices. Nor should that be required even for CTS. Which devices triggered denials?
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
The denial information is shown as below:
*<5>[ 2219.393524] type=1400 audit(1342221801.398:17): avc: denied { read } for pid=2687 comm="ationTestRunner" name="mtdblock0" dev=tmpfs ino=2562 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:block_device:s0 tclass=lnk_file
<5>[ 2219.399566] type=1400 audit(1342221801.406:18): avc: denied { read} for pid=2687 comm="ationTestRunner" name="radio" dev=tmpfs ino=2527 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:radio_device:s0 tclass=lnk_file
<5>[ 2005.011016] type=1400 audit(1342224760.046:32): avc: denied { read} for pid=7264 comm="onCtsTestRunner" name="events" dev=tmpfs ino=2902 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:log_device:s0 tclass=chr_file*
Quoted 28 lines · Stephen Smalley
Quoted 9 lines · Haiqing Jiang
--- cts.te | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)cts.te +0
-0cts.te allow appdomain file_type:dir r_dir_perms; · line 26
Quoted 8 lines
cts.te +1
-1@@ -20,7 +20,7 @@ allow appdomain file_type:dir r_dir_perms; allow appdomain fs_type:dir r_dir_perms; allow appdomain dev_type:dir r_dir_perms; allow appdomain file_type:dir_file_class_set getattr; -allow appdomain dev_type:dir_file_class_set getattr; +allow appdomain dev_type:dir_file_class_set { getattr read }; allow appdomain fs_type:dir_file_class_set getattr; # Execute the shell or other system executables.I don't think you want to allow all app domains to read all devices. Nor should that be required even for CTS. Which devices triggered denials?
--
Stephen Smalley
National Security Agency
Signature · 4 lines
----------------------------------- Haiqing Jiang, PH.D student Computer Science Department, North Carolina State University
Quoted 5 lines · Haiqing Jiang
The denial information is shown as below:
<5>[ 2219.393524] type=1400 audit(1342221801.398:17): avc: denied { read } for pid=2687 comm="ationTestRunner" name="mtdblock0"
Quoted 7 lines
dev=tmpfs ino=2562 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:block_device:s0 tclass=lnk_file
<5>[ 2219.399566] type=1400 audit(1342221801.406:18): avc: denied{ read } for pid=2687 comm="ationTestRunner" name="radio" dev=tmpfs ino=2527 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:radio_device:s0 tclass=lnk_file
So you should only allow read for dev_type:lnk_file, not read access to all devices.
Quoted 4 lines
<5>[ 2005.011016] type=1400 audit(1342224760.046:32): avc: denied{ read } for pid=7264 comm="onCtsTestRunner" name="events" dev=tmpfs ino=2902 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:log_device:s0 tclass=chr_file
So you should just allow this one for reading logcat output:
allow appdomain log_device:chr_file read;
But you should definitely not allow reading arbitrary devices; you don't want apps reading raw block devices (shouldn't be possible anyway due to DAC controls, but in case of DAC privilege escalation via setuid binary).
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
The policy to the denials should be: allow untrusted_app {block_device, radio_device, log_device}:lnk_file read; (ignore the syntax error). Do you think it's OK to merge it to: allow appdomain dev_type:dir_file_class_set { getattr read }???? Or we need to add separate policies? (like, allow untrusted_app specific device type:lnk_file read;)
Quoted 58 lines · Haiqing Jiang
The denial information is shown as below:
*<5>[ 2219.393524] type=1400 audit(1342221801.398:17): avc: denied { read } for pid=2687 comm="ationTestRunner" name="mtdblock0" dev=tmpfs ino=2562 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:block_device:s0 tclass=lnk_file
<5>[ 2219.399566] type=1400 audit(1342221801.406:18): avc: denied { read} for pid=2687 comm="ationTestRunner" name="radio" dev=tmpfs ino=2527 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:radio_device:s0 tclass=lnk_file
<5>[ 2005.011016] type=1400 audit(1342224760.046:32): avc: denied { read} for pid=7264 comm="onCtsTestRunner" name="events" dev=tmpfs ino=2902 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:log_device:s0 tclass=chr_file*
Quoted 23 lines · Stephen Smalley
Quoted 9 lines · Haiqing Jiang
--- cts.te | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)cts.te +0
-0cts.te allow appdomain file_type:dir r_dir_perms; · line 26
Quoted 8 lines
cts.te +1
-1@@ -20,7 +20,7 @@ allow appdomain file_type:dir r_dir_perms; allow appdomain fs_type:dir r_dir_perms; allow appdomain dev_type:dir r_dir_perms; allow appdomain file_type:dir_file_class_set getattr; -allow appdomain dev_type:dir_file_class_set getattr; +allow appdomain dev_type:dir_file_class_set { getattr read }; allow appdomain fs_type:dir_file_class_set getattr; # Execute the shell or other system executables.I don't think you want to allow all app domains to read all devices. Nor should that be required even for CTS. Which devices triggered denials?
Quoted 5 lines
--
Stephen Smalley
National Security Agency--
-----------------------------------
Haiqing Jiang, PH.D studentComputer Science Department, North Carolina State University
Signature · 4 lines
----------------------------------- Haiqing Jiang, PH.D student Computer Science Department, North Carolina State University
Quoted 6 lines · Haiqing Jiang
The policy to the denials should be: allow
untrusted_app{block_device,radio_device, log_device}:lnk_file read; (ignore the syntax error). Do you think it's OK to merge it to: allow appdomain dev_type:dir_file_class_set { getattr read }???? Or we need to add separate policies? (like, allowuntrusted_appspecific device type:lnk_file read;)
Merging into the dev_type:dir_class_file_set rule opens up far more access than is necessary or desired - read access to every device in the system. So here you want a more specific rule. You can still use appdomain and dev_type attributes, but only for symlinks:
allow appdomain dev_type:lnk_file read;
And for the log device, a specific rule for its type:
allow appdomain log_device:chr_file read;
Quoted 89 lines
On Mon, Jul 30, 2012 at 10:33 AM, Haiqing Jiang
<[email protected]> wrote:The denial information is shown as below: <5>[ 2219.393524] type=1400 audit(1342221801.398:17): avc: denied { read } for pid=2687 comm="ationTestRunner" name="mtdblock0" dev=tmpfs ino=2562 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:block_device:s0 tclass=lnk_file <5>[ 2219.399566] type=1400 audit(1342221801.406:18): avc: denied { read } for pid=2687 comm="ationTestRunner" name="radio" dev=tmpfs ino=2527 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:radio_device:s0 tclass=lnk_file <5>[ 2005.011016] type=1400 audit(1342224760.046:32): avc: denied { read } for pid=7264 comm="onCtsTestRunner" name="events" dev=tmpfs ino=2902 scontext=u:r:untrusted_app:s0:c38 tcontext=u:object_r:log_device:s0 tclass=chr_file On Mon, Jul 30, 2012 at 5:14 AM, Stephen Smalley <[email protected]> wrote: On Fri, 2012-07-27 at 15:40 -0700, Haiqing Jiang wrote: > --- > cts.te | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/cts.te b/cts.te > index 489be1a..ff8a9f0 100644 > --- a/cts.te > +++ b/cts.te > @@ -20,7 +20,7 @@ allow appdomain file_type:dir r_dir_perms; > allow appdomain fs_type:dir r_dir_perms; > allow appdomain dev_type:dir r_dir_perms; > allow appdomain file_type:dir_file_class_set getattr; > -allow appdomain dev_type:dir_file_class_set getattr; > +allow appdomain dev_type:dir_file_class_set { getattr read }; > allow appdomain fs_type:dir_file_class_set getattr; > > # Execute the shell or other system executables. I don't think you want to allow all app domains to read all devices. Nor should that be required even for CTS. Which devices triggered denials? -- Stephen Smalley National Security Agency -- ----------------------------------- Haiqing Jiang, PH.D student Computer Science Department, North Carolina State UniversitySignature · 5 lines
----------------------------------- Haiqing Jiang, PH.D student Computer Science Department, North Carolina State University
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.