Skip to contentSkip to conversation

Patches to target denies of GpsLocationProvider and media_app over mtp_device

PATCH In review hqjiang 3 participants 6 messages Jul 11, 2012 – Jul 12, 2012 SELinux security module

lore
Share & tools
lore

hqjiang

author
#0 lore raw

One thing should be paid attentions here:
We add a new entry of "user=app_* name=android.process.media domain=media_app levelFromUid=true" to seapp_context file. One would say it's nonecessary because there's already one policy "user=app_* seinfo=media domain=media_app levelFromUid=true". But the thing is that the seinfo of "android.process.media" is not media.

If you have better ideas, pleae let us know. And we can resubmit the refined patches later.

--
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.

author
#1 lore raw

PATCH 1/1 Correct the denies of android.process.media when accessing to mtp_device

---
 seapp_contexts |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
seapp_contexts +1 -0
index 502206a..1e98f91 100644
@@ -38,3 +38,4 @@ user=app_* seinfo=shared domain=shared_app levelFromUid=true
 user=app_* seinfo=media domain=media_app levelFromUid=true
 user=app_* seinfo=release domain=release_app levelFromUid=true
 user=app_* seinfo=release name=com.android.browser domain=browser_app levelFromUid=true
+user=app_* name=android.process.media domain=media_app levelFromUid=true
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.
#2 lore raw

Re: [PATCH] Correct the denies of android.process.media when accessing to mtp_device

seapp_contexts user=app_* seinfo=shared domain=shared_app levelFromUid=true · line 41

Quoted 13 lines · hqjiang
---
 seapp_contexts |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
seapp_contexts +1 -0
index 502206a..1e98f91 100644
@@ -38,3 +38,4 @@ user=app_* seinfo=shared domain=shared_app levelFromUid=true
 user=app_* seinfo=media domain=media_app levelFromUid=true
 user=app_* seinfo=release domain=release_app levelFromUid=true
 user=app_* seinfo=release name=com.android.browser domain=browser_app levelFromUid=true
+user=app_* name=android.process.media domain=media_app levelFromUid=true

android.process.media was correctly labeled for us on the Xoom. Need to track down the real cause of the problem (if it persists after a re-sync), not just hide it via configuration.

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.
author
#3 lore raw

PATCH 1/1 GPSLocation Provider needs socket connection

In reply to hqjiang
---
 system.te |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
system.te +3 -0
index 1a94c75..f35e9a2 100644
@@ -192,3 +192,6 @@ allow system domain:file r_file_perms;
 # to uart driver and ctrl proc entry
 allow system gps_device:chr_file rw_file_perms;
 allow system gps_control:file rw_file_perms;
+
+# GpsLocationProvider Connection
+allow system rild:unix_stream_socket connectto;
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.
#4 lore raw

Re: [PATCH] GPSLocation Provider needs socket connection

Quoted 9 lines · hqjiang
---
 system.te |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
system.te +0 -0
index 1a94c75..f35e9a2 100644

system.te allow system domain:file r_file_perms; · line 197

Quoted 6 lines
system.te +3 -0
@@ -192,3 +192,6 @@ allow system domain:file r_file_perms;
 # to uart driver and ctrl proc entry
 allow system gps_device:chr_file rw_file_perms;
 allow system gps_control:file rw_file_perms;
+
+# GpsLocationProvider Connection
+allow system rild:unix_stream_socket connectto;

This should be written using the unix_socket_connect() macro, which takes three arguments: clientdomain, sockettype, serverdomain. What type is assigned to the socket file?

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.
#5 lore raw
In reply to hqjiang

What branch are you on? I have a build of master that has android.process.media labeled as

u:r:media_app:s0:c10

which would suggest to me that the seinfo string is media. If your android.process.media is
not being labeled as media that what is its label. There was a brief period on the master
branch that the mac_permissions.xml file was wrong because of some updates on
Jelly Bean permissions needed by some of the apps. Specifically the MediaProvider.
Are you seeing any "MMAC_DENIAL" messages in logcat for any media apps during
install?

I would try to re-sync on master and see what happens.

Quoted 16 lines · hqjiang

One thing should be paid attentions here:
We add a new entry of "user=app_* name=android.process.media domain=media_app levelFromUid=true" to seapp_context file. One would say it's nonecessary because there's already one policy "user=app_* seinfo=media domain=media_app levelFromUid=true". But the thing is that the seinfo of "android.process.media" is not media.

If you have better ideas, pleae let us know. And we can resubmit the refined patches later.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] the words "unsubscribe selinux" without quotes as the message.