- Dec 12, 2016
-
-
Roshan Pius authored
We're going to be using Android framework directly to invoke Wifi HIDL calls. So, change permissions appropriately. Bug: 33398154 Test: Verfied that framework is able to make HIDL calls using go/aog/310610. Change-Id: I4d0d88961753ad73f3876aec58b26b89486cc02a
-
- Nov 07, 2016
-
-
Roshan Pius authored
Adding back the binder permission to access keystore from wpa_supplicant. This was removed by mistake in the previous patch (commit#: 6caeac) to add hwbinder permissions. Denials in logs: 11-03 14:37:54.831 9011 9011 I auditd : type=1400 audit(0.0:1490): avc: denied { call } for comm="wpa_supplicant" scontext=u:r:wpa:s0 tcontext=u:r:servicemanager:s0 tclass=binder permissive=0 11-03 14:37:54.831 9011 9011 W wpa_supplicant: type=1400 audit(0.0:1490): avc: denied { call } for scontext=u:r:wpa:s0 tcontext=u:r:servicemanager:s0 tclass=binder permissive=0 11-03 14:37:55.838 9011 9011 I ServiceManager: Waiting for service android.security.keystore... 11-03 14:37:55.834 9011 9011 I auditd : type=1400 audit(0.0:1491): avc: denied { call } for comm="wpa_supplicant" scontext=u:r:wpa:s0 tcontext=u:r:servicemanager:s0 tclass=binder permissive=0 11-03 14:37:55.834 9011 9011 W wpa_supplicant: type=1400 audit(0.0:1491): avc: denied { call } for scontext=u:r:wpa:s0 tcontext=u:r:servicemanager:s0 tclass=binder permissive=0 11-03 14:37:56.838 9011 9011 I ServiceManager: Waiting for service android.security.keystore... 11-03 14:37:56.834 9011 9011 I auditd : type=1400 audit(0.0:1492): avc: denied { call } for comm="wpa_supplicant" scontext=u:r:wpa:s0 tcontext=u:r:servicemanager:s0 tclass=binder permissive=0 11-03 14:37:56.834 9011 9011 W wpa_supplicant: type=1400 audit(0.0:1492): avc: denied { call } for scontext=u:r:wpa:s0 tcontext=u:r:servicemanager:s0 tclass=binder permissive=0 11-03 14:37:57.839 9011 9011 I ServiceManager: Waiting for service android.security.keystore... 11-03 14:37:57.834 9011 9011 I auditd : type=1400 audit(0.0:1493): avc: denied { call } for comm="wpa_supplicant" scontext=u:r:wpa:s0 tcontext=u:r:servicemanager:s0 tclass=binder permissive=0 11-03 14:37:57.834 9011 9011 W wpa_supplicant: type=1400 audit(0.0:1493): avc: denied { call } for scontext=u:r:wpa:s0 tcontext=u:r:servicemanager:s0 tclass=binder permissive=0 Bug: 32655747 Test: Compiles. Will send for integration testing. Change-Id: Ic57a5bf0e6ea15770efc0d09f68d04b2db9ec1b8
-
- Oct 26, 2016
-
-
Roshan Pius authored
Modify permissions for wpa_supplicant to use hwbinder (for HIDL), instead of binder. Denials: 01-15 14:31:58.573 541 541 W wpa_supplicant: type=1400 audit(0.0:10): avc: denied { call } for scontext=u:r:wpa:s0 tcontext=u:r:hwservicemanager:s0 tclass=binder permissive=0 01-15 14:31:58.573 541 541 W wpa_supplicant: type=1400 audit(0.0:11): avc: denied { call } for scontext=u:r:wpa:s0 tcontext=u:r:hwservicemanager:s0 tclass=binder permissive=0 BUG: 31365276 Test: Compiled and ensured that the selinux denials are no longer present in logs. Change-Id: Ifa4630edea6ec5a916b3940f9a03ef9dc6fc9af2
-
- Oct 06, 2016
-
-
dcashman authored
Divide policy into public and private components. This is the first step in splitting the policy creation for platform and non-platform policies. The policy in the public directory will be exported for use in non-platform policy creation. Backwards compatibility with it will be achieved by converting the exported policy into attribute-based policy when included as part of the non-platform policy and a mapping file will be maintained to be included with the platform policy that maps exported attributes of previous versions to the current platform version. Eventually we would like to create a clear interface between the platform and non-platform device components so that the exported policy, and the need for attributes is minimal. For now, almost all types and avrules are left in public. Test: Tested by building policy and running on device. Change-Id: Idef796c9ec169259787c3f9d8f423edf4ce27f8c
-
- Sep 11, 2016
-
-
Jeff Vander Stoep authored
Remove the ioctl permission for most socket types. For others, such as tcp/udp/rawip/unix_dgram/unix_stream set a default unprivileged whitelist that individual domains may extend (except where neverallowed like untrusted_app). Enforce via a neverallowxperm rule. Change-Id: I15548d830f8eff1fd4d64005c5769ca2be8d4ffe
-
- Sep 10, 2016
-
-
Jeff Vander Stoep authored
Grant permissions observed. Bug: 28760354 Change-Id: Ie63cda709319bbf635ef7bffbba3477c2cccc11b
-
- Sep 09, 2016
-
-
Jeff Vander Stoep authored
This reverts commit 9c820a11. Bug: 31364540 Change-Id: I98a34bd32dd835e6795d31a90f16f4ccd691e6e5
-
Jeff Vander Stoep authored
This reverts commit c71c6622. Bug: 31364540 Change-Id: I3f4f132d4769e3cbc9d03ff908104a69f05bd2ef
-
- Aug 29, 2016
-
-
Jeff Vander Stoep authored
Grant permissions observed. (cherry picked from commit 9c820a11) Merged-in: Ifdead51f873eb587556309c48fb84ff1542ae303 Bug: 28760354 Change-Id: Ifdead51f873eb587556309c48fb84ff1542ae303
-
- Aug 26, 2016
-
-
Roshan Pius authored
Add the necessary permissions for |wpa_supplicant| to expose a binder interface. This binder interface will be used by the newly added |wificond| service (and potentially system_server). |wpa_supplicant| also needs to invoke binder callbacks on |wificond|. Changes in the CL: 1. Allow |wpa_supplicant| to register binder service. 2. Allow |wpa_supplicant| to invoke binder calls on |wificond|. 3. Allow |wificond| to invoke binder calls on |wpa_supplicant| Denials: 06-30 08:14:42.788 400 400 E SELinux : avc: denied { add } for service=wpa_supplicant pid=20756 uid=1010 scontext=u:r:wpa:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=1 BUG:29877467 TEST: Compiled and ensured that the selinux denials are no longer present in logs. TEST: Ran integration test to find the service. Change-Id: Ib78d8e820fc81b2c3d9260e1c877c5faa9f1f662 (cherry picked from commit 18883a93)
-
- Jun 30, 2016
-
-
Roshan Pius authored
Add the necessary permissions for |wpa_supplicant| to expose a binder interface. This binder interface will be used by the newly added |wificond| service (and potentially system_server). |wpa_supplicant| also needs to invoke binder callbacks on |wificond|. Changes in the CL: 1. Allow |wpa_supplicant| to register binder service. 2. Allow |wpa_supplicant| to invoke binder calls on |wificond|. 3. Allow |wificond| to invoke binder calls on |wpa_supplicant| Denials: 06-30 08:14:42.788 400 400 E SELinux : avc: denied { add } for service=wpa_supplicant pid=20756 uid=1010 scontext=u:r:wpa:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=1 BUG:29877467 TEST: Compiled and ensured that the selinux denials are no longer present in logs. TEST: Ran integration test to find the service. Change-Id: Ib78d8e820fc81b2c3d9260e1c877c5faa9f1f662
-
- Jun 15, 2016
-
-
Jeff Vander Stoep authored
Remove the ioctl permission for most socket types. For others, such as tcp/udp/rawip/unix_dgram/unix_stream set a default unprivileged whitelist that individual domains may extend (except where neverallowed like untrusted_app). Enforce via a neverallowxperm rule. Change-Id: I15548d830f8eff1fd4d64005c5769ca2be8d4ffe
-
- Jun 06, 2016
-
-
Jeff Vander Stoep authored
Grant permissions observed. Bug: 28760354 Change-Id: Ifdead51f873eb587556309c48fb84ff1542ae303
-
- Mar 03, 2016
-
-
Stephen Smalley authored
Define new netlink socket security classes introduced by upstream kernel commit 6c6d2e9bde1c1c87a7ead806f8f5e2181d41a652 ("selinux: update netlink socket classes"). This was merged in Linux 4.2 and is therefore only required for Android kernels based on 4.2 or newer (e.g. the android-4.4 branch of the kernel/common tree). Add the new socket classes to socket_class_set. Add an initial set of allow rules although further refinement will likely be necessary. Any allow rule previously written on :netlink_socket may need to be rewritten or duplicated for one or more of the more specific classes. For now, we retain the existing :netlink_socket rules for compatibility on older kernels. Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov> (cherry picked from commit 01d95c23) Change-Id: Ic00a0d474730cda91ba3bc387e0cc14482f82114
-
Stephen Smalley authored
Define new netlink socket security classes introduced by upstream kernel commit 6c6d2e9bde1c1c87a7ead806f8f5e2181d41a652 ("selinux: update netlink socket classes"). This was merged in Linux 4.2 and is therefore only required for Android kernels based on 4.2 or newer (e.g. the android-4.4 branch of the kernel/common tree). Add the new socket classes to socket_class_set. Add an initial set of allow rules although further refinement will likely be necessary. Any allow rule previously written on :netlink_socket may need to be rewritten or duplicated for one or more of the more specific classes. For now, we retain the existing :netlink_socket rules for compatibility on older kernels. Change-Id: I5040b30edd2d374538490a080feda96dd4bae5bf Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Nov 03, 2015
-
-
Jeff Vander Stoep authored
Motivation: Domain is overly permissive. Start removing permissions from domain and assign them to the domain_deprecated attribute. Domain_deprecated and domain can initially be assigned to all domains. The goal is to not assign domain_deprecated to new domains and to start removing domain_deprecated where it is not required or reassigning the appropriate permissions to the inheriting domain when necessary. Bug: 25433265 Change-Id: I8b11cb137df7bdd382629c98d916a73fe276413c
-
- Nov 06, 2014
-
-
Nick Kralevich authored
wpa should never trust any data coming from the sdcard. Add a compile time assertion to make sure no rules are ever added allowing this access. Change-Id: I5f50a8242aa30f6cc0cfd89d82b2b153625105f6
-
- Jun 26, 2014
-
-
Riley Spahn authored
Add keystore_key class and an action for each action supported by keystore. Add policies that replicate the access control that already exists in keystore. Add auditallow rules for actions not known to be used frequently. Add macro for those domains wishing to access keystore. Change-Id: Iddd8672b9e9b72b45ee208e6eda608cc9dc61edc
-
- Jun 17, 2014
-
-
Stephen Smalley authored
As reported by sepolicy-analyze -D -P /path/to/sepolicy. No semantic difference reported by sediff between the policy before and after this change. Deduplication of selinuxfs read access resolved by taking the common rules to domain.te (and thereby getting rid of the selinux_getenforce macro altogether). Change-Id: I4de2f86fe2efe11a167e8a7d25dd799cefe482e5 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Mar 12, 2014
-
-
Stephen Smalley authored
Addresses denials such as: avc: denied { call } for pid=2275 comm="wpa_supplicant" scontext=u:r:wpa:s0 tcontext=u:r:servicemanager:s0 tclass=binder Change-Id: I8ab148046dd06f56630a2876db787b293e14c0ae Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Mar 06, 2014
-
-
Robert Craig authored
The filename should be the same as the domain with all the .te files. Change-Id: Ib05eb84f881c680eb5bb43a4814cfb038fbff339 Signed-off-by:
rpcraig <rpcraig@tycho.ncsc.mil>
-
- Feb 28, 2014
-
-
Nick Kralevich authored
With wpa_supplicant in enforcing, wpa_cli doesn't work. Denial: type=1400 audit(1390597866.260:59): avc: denied { write } for pid=3410 comm="wpa_supplicant" name="wpa_ctrl_4852-1" dev="mmcblk0p28" ino=618993 scontext=u:r:wpa:s0 tcontext=u:object_r:wifi_data_file:s0 tclass=sock_file After I9e35cc93abf89ce3594860aa3193f84a3b42ea6e and I51b09c5e40946673a38732ea9f601b2d047d3b62, the /data/misc/wifi/sockets directory is labeled properly. This change allows the communication between the su domain and wpa. Steps to reproduce: Start wifi (so wpa_supplicant will run) Start wpa_cli - it will hand $ adb root $ adb shell # wpa_cli -g @android:wpa_wlan0 Bug: 12721629 Change-Id: I03170acc155ad122c5197baaf590d17fc1ace6a5
-
Stephen Smalley authored
This will ensure that any sockets created in this directory will default to wpa_socket unless a type_transition is defined. Define a type transition for system_server to keep its separate system_wpa_socket type assigned for its socket. Allow wpa to create and unlink sockets in the directory. We leave the already existing rules for wifi_data_file in place for compatibility with existing devices that have wifi_data_file on /data/misc/wifi/sockets. Change-Id: I9e35cc93abf89ce3594860aa3193f84a3b42ea6e Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Feb 25, 2014
-
-
Stephen Smalley authored
Replace * or any permission set containing create with create_socket_perms or create_stream_socket_perms. Add net_domain() to all domains using network sockets and delete rules already covered by domain.te or net.te. For netlink_route_socket, only nlmsg_write needs to be separately granted to specific domains that are permitted to modify the routing table. Clarification: read/write permissions are just ability to perform read/recv() or write/send() on the socket, whereas nlmsg_read/ nlmsg_write permissions control ability to observe or modify the underlying kernel state accessed via the socket. See security/selinux/nlmsgtab.c in the kernel for the mapping of netlink message types to nlmsg_read or nlmsg_write. Delete legacy rule for b/12061011. This change does not touch any rules where only read/write were allowed to a socket created by another domain (inherited across exec or received across socket or binder IPC). We may wish to rewrite some or all of those rules with the rw_socket_perms macro but that is a separate change. Change-Id: Ib0637ab86f6d388043eff928e5d96beb02e5450e Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Feb 21, 2014
-
-
Stephen Smalley authored
It appears that wpa_supplicant tries to rmdir /data/misc/wifi/sockets and re-create it at times, so make sure that it remains labeled correctly when re-created in this manner via a name-based type transition rule. Do the same for hostapd as it also has permissions for creating/removing this directory. <5>[83921.800071] type=1400 audit(1392997522.105:26): avc: denied { rmdir } for pid=3055 comm="wpa_supplicant" name="sockets" dev="mmcblk0p28" ino=618957 scontext=u:r:wpa:s0 tcontext=u:object_r:wpa_socket:s0 tclass=dir We no longer need the type_transition for sock_file as it will inherit the type from the parent directory which is set via restorecon_recursive /data/misc/wifi/sockets or via type_transition, so drop it. Change-Id: Iffa61c426783eb03205ba6964c624c6ecea32630 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Feb 04, 2014
-
-
Nick Kralevich authored
With wpa_supplicant in enforcing, wpa_cli doesn't work. Denial: type=1400 audit(1390597866.260:59): avc: denied { write } for pid=3410 comm="wpa_supplicant" name="wpa_ctrl_4852-1" dev="mmcblk0p28" ino=618993 scontext=u:r:wpa:s0 tcontext=u:object_r:wifi_data_file:s0 tclass=sock_file After I9e35cc93abf89ce3594860aa3193f84a3b42ea6e and I51b09c5e40946673a38732ea9f601b2d047d3b62, the /data/misc/wifi/sockets directory is labeled properly. This change allows the communication between the su domain and wpa. Steps to reproduce: Start wifi (so wpa_supplicant will run) Start wpa_cli - it will hand $ adb root $ adb shell # wpa_cli -g @android:wpa_wlan0 Bug: 12721629 Change-Id: I03170acc155ad122c5197baaf590d17fc1ace6a5
-
Stephen Smalley authored
This will ensure that any sockets created in this directory will default to wpa_socket unless a type_transition is defined. Define a type transition for system_server to keep its separate system_wpa_socket type assigned for its socket. Allow wpa to create and unlink sockets in the directory. We leave the already existing rules for wifi_data_file in place for compatibility with existing devices that have wifi_data_file on /data/misc/wifi/sockets. Change-Id: I9e35cc93abf89ce3594860aa3193f84a3b42ea6e Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Jan 14, 2014
-
-
Stephen Smalley authored
Change-Id: Idc26aadd0add9f39447d51a1d82a55a957a88e9a Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Jan 11, 2014
-
-
Nick Kralevich authored
Permissive domains are only intended for development. When a device launches, we want to ensure that all permissive domains are in, at a minimum, unconfined+enforcing. Add FORCE_PERMISSIVE_TO_UNCONFINED to Android.mk. During development, this flag is false, and permissive domains are allowed. When SELinux new feature development has been frozen immediately before release, this flag will be flipped to true. Any previously permissive domains will move into unconfined+enforcing. This will ensure that all SELinux domains have at least a minimal level of protection. Unconditionally enable this flag for all user builds. Change-Id: I1632f0da0022c80170d8eb57c82499ac13fd7858
-
- Nov 13, 2013
-
-
Stephen Smalley authored
Change-Id: Iaa4ed5428d1c49cb4cff3a39c48800cb108f2ac3 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Oct 21, 2013
-
-
Nick Kralevich authored
This change removes the permissive line from unconfined domains. Unconfined domains can do (mostly) anything, so moving these domains into enforcing should be a no-op. The following domains were deliberately NOT changed: 1) kernel 2) init In the future, this gives us the ability to tighten up the rules in unconfined, and have those tightened rules actually work. When we're ready to tighten up the rules for these domains, we can: 1) Remove unconfined_domain and re-add the permissive line. 2) Submit the domain in permissive but NOT unconfined. 3) Remove the permissive line 4) Wait a few days and submit the no-permissive change. For instance, if we were ready to do this for adb, we'd identify a list of possible rules which allow adbd to work, re-add the permissive line, and then upload those changes to AOSP. After sufficient testing, we'd then move adb to enforcing. We'd repeat this for each domain until everything is enforcing and out of unconfined. Change-Id: If674190de3262969322fb2e93d9a0e734f8b9245
-
- May 20, 2013
-
-
repo sync authored
This prevents denials from being generated by the base policy. Over time, these rules will be incrementally tightened to improve security. Change-Id: I4be1c987a5d69ac784a56d42fc2c9063c402de11
-
- May 15, 2013
-
-
repo sync authored
Bug: 4070557 Change-Id: I027f76cff6df90e9909711cb81fbd17db95233c1
-
- May 08, 2013
-
-
repo sync authored
Change-Id: I544c0c1bbe84834970958a65fcef1d10e7e29047
-
- May 07, 2013
-
-
repo sync authored
This allows wpa_supplicant to interact with the sockets created for it by init. Eventually we'll want those to be properly labelled, but allow until then. Change-Id: I33fcd22173a8d47bbc4ada8d6aa62b4d159cbb15
-
- May 06, 2013
-
-
Jon Larimer authored
Change-Id: I9b05f0f2ce6c6c52b4207cac3120f06565b7da30
-
- Aug 10, 2012
-
-
rpcraig authored
-
- Jan 04, 2012
-
-
Stephen Smalley authored
-