- Mar 12, 2020
-
-
Jeff Vander Stoep authored
Apps can cause selinux denials by accessing CE storage and/or external storage. In either case, the selinux denial is not the cause of the failure, but just a symptom that storage isn't ready. Many apps handle the failure appropriately. These denials are not helpful, are not the cause of a problem, spam the logs, and cause presubmit flakes. Suppress them. Bug: 145267097 Bug: 151188413 Test: build Merged-In: If87b9683e5694fced96a81747b1baf85ef6b2124 Change-Id: If87b9683e5694fced96a81747b1baf85ef6b2124
-
- Aug 12, 2019
-
-
ji, zhenlong z authored
This is used to address a CTS testcase failure. This CTS testcase need to access the content of Contact, some data from ContactProvider is transfered through ashmem. Currently ashmem is backed by the tmpfs filesystem, ContactProvider in android run as a priv_app, so the file context of the ashmem created by ContactProvider is priv_app_tmpfs. CTS runs as an untrusted_app, need to be granted the read permission to the priv_app_tmpfs files. RESTRICT AUTOMERGE Bug: 117961216 [Android Version]: android_p_mr0_r0 [Kernel Version]: 4.19.0-rc8 [CTS Version]: cts-9.0_r1 [Failed Testcase]: com.android.cts.devicepolicy.ManagedProfileTest#testManagedContactsPolicies [Error Log]: 11-11 11:15:50.479 12611 12611 W AndroidTestSuit: type=1400 audit(0.0:811): avc: denied { read } for path=2F6465762F6173686D656D202864656C6574656429 dev="tmpfs" ino=174636 scontext=u:r:untrusted_app:s0:c113,c256,c522,c768 tcontext=u:object_r:priv_app_tmpfs:s0:c522,c768 tclass=file permissive=0 [Test Result With This Patch]: PASS (cherry picked from fdfa42bf) (cherry picked from commit e4ccef0f35a86d5f7ee9732a296bc1864105308c) CRs-Fixed:2491460 Change-Id: I45efacabe64af36912a53df60ac059889fde1629
-
Benjamin Gordon authored
Kernel commit 8a2af06415ef0fc922162503dd18da0d9be7771f (ashmem: switch to ->read_iter) switched ashmem from using __vfs_read to vfs_iter_read to read the backing shmem file. Prior to this, reading from an ashmem fd that was passed between processes didn't hit any permission checks; now SELinux checks that the receiver can read from the creator's file context. Some apps receive buffers through ashmem from system_server, e.g., the settings app reads battery stats from system_server through ashmem when an app details page is opened. Restore this ability by giving apps read access to system_server_tmpfs. system_server is still responsible for creating and passing across the ashmem buffers, so this doesn't give apps the ability to read anything system_server isn't willing to give them. Bug: 112987536 Bug: 111381531 Test: atest android.appsecurity.cts.PermissionsHostTest on kernel 4.14 (cherry picked from 360559e7) (cherry picked from commit 7e799f995abfb2dd2cb8708db3b0042b73476ef3) CRs-Fixed:2491460 Change-Id: Ice5e25f55bc409e91ad7e8c7ea8b28ae213191a3
-
- Apr 01, 2019
-
-
Xiao Ma authored
Since ipmemorystore service has been moved to network stack from system service, also should revert the relevant sepolicy which is corresponding to the previous configuration. Bug: 128392280 Test: atest FrameworksNetTests NetworkStackTests Change-Id: I1ae09696e620b246f817db71e7b71c32aae9be05
-
- Jan 30, 2019
-
-
Jeff Vander Stoep authored
Move all app tmpfs types to appdomain_tmpfs. These are still protected by mls categories and DAC. TODO clean up other app tmpfs types in a separate change. Treble-ize tmpfs passing between graphics composer HAL and surfaceflinger. Bug: 122854450 Test: boot Blueline with memfd enabled. Change-Id: Ib98aaba062f10972af6ae80fb85b7a0f60a32eee
-
- Jan 17, 2019
-
-
William Hester authored
The testharness service will manage Test Harness Mode and provide a command-line interface for users to enable Test Harness Mode; however it does not directly provide a public API. Bug: 80137798 Test: make Test: flash crosshatch Change-Id: Ie396e40fcea8914b4dd2247f2314e029b66ad84e
-
- Jan 10, 2019
-
-
Chalard Jean authored
Bug: 116512211 Test: Builds, boots, including upcoming changes needing this Change-Id: I6f119368c5a4f7ac6c0325915dff60124c5a6399
-
- Dec 12, 2018
-
-
Nick Kralevich authored
When an app uses renderscript to compile a Script instance, renderscript compiles and links the script using /system/bin/bcc and /system/bin/ld.mc, then places the resulting shared library into the application's code_cache directory. The application then dlopen()s the resulting shared library. Currently, this executable code is writable to the application. This violates the W^X property (https://en.wikipedia.org/wiki/W%5EX), which requires any executable code be immutable. This change introduces a new label "rs_data_file". Files created by /system/bin/bcc and /system/bin/ld.mc in the application's home directory assume this label. This allows us to differentiate in security policy between app created files, and files created by renderscript on behalf of the application. Apps are allowed to delete these files, but cannot create or write these files. This is enforced through a neverallow compile time assertion. Several exceptions are added to Treble neverallow assertions to support this functionality. However, because renderscript was previously invoked from an application context, this is not a Treble separation regression. This change is needed to support blocking dlopen() for non-renderscript /data/data files, which will be submitted in a followup change. Bug: 112357170 Test: cts-tradefed run cts -m CtsRenderscriptTestCases Change-Id: Ie38bbd94d26db8a418c2a049c24500a5463698a3
-
- Nov 29, 2018
-
-
Nick Kralevich authored
Move rules / neverallow assertions from public to private policy. This change, by itself, is a no-op, but will make future patches easier to read. The only downside of this change is that it will make git blame less effective. Motivation: When rules are placed into the public directory, they cannot reference a private type. A future change will modify these rules to reference a private type. Test: compiles Bug: 112357170 Change-Id: I56003409b3a23370ddab31ec01d69ff45c80d7e5
-
- Oct 23, 2018
-
-
ji, zhenlong z authored
This is used to address a CTS testcase failure. This CTS testcase need to access the content of Contact, some data from ContactProvider is transfered through ashmem. Currently ashmem is backed by the tmpfs filesystem, ContactProvider in android run as a priv_app, so the file context of the ashmem created by ContactProvider is priv_app_tmpfs. CTS runs as an untrusted_app, need to be granted the read permission to the priv_app_tmpfs files. Bug: 117961216 [Android Version]: android_p_mr0_r0 [Kernel Version]: 4.19.0-rc8 [CTS Version]: cts-9.0_r1 [Failed Testcase]: com.android.cts.devicepolicy.ManagedProfileTest#testManagedContactsPolicies [Error Log]: 11-11 11:15:50.479 12611 12611 W AndroidTestSuit: type=1400 audit(0.0:811): avc: denied { read } for path=2F6465762F6173686D656D202864656C6574656429 dev="tmpfs" ino=174636 scontext=u:r:untrusted_app:s0:c113,c256,c522,c768 tcontext=u:object_r:priv_app_tmpfs:s0:c522,c768 tclass=file permissive=0 [Test Result With This Patch]: PASS Change-Id: I45efacabe64af36912a53df60ac059889fde1629
-
- Sep 10, 2018
-
-
Benjamin Gordon authored
Kernel commit 8a2af06415ef0fc922162503dd18da0d9be7771f (ashmem: switch to ->read_iter) switched ashmem from using __vfs_read to vfs_iter_read to read the backing shmem file. Prior to this, reading from an ashmem fd that was passed between processes didn't hit any permission checks; now SELinux checks that the receiver can read from the creator's file context. Some apps receive buffers through ashmem from system_server, e.g., the settings app reads battery stats from system_server through ashmem when an app details page is opened. Restore this ability by giving apps read access to system_server_tmpfs. system_server is still responsible for creating and passing across the ashmem buffers, so this doesn't give apps the ability to read anything system_server isn't willing to give them. Bug: 112987536 Bug: 111381531 Test: atest android.appsecurity.cts.PermissionsHostTest on kernel 4.14 Change-Id: Ice5e25f55bc409e91ad7e8c7ea8b28ae213191a3
-
- Apr 03, 2018
-
-
Nathan Harold authored
Because applications should be able to set the receive timeout on UDP encapsulation sockets, we need to allow setsockopt(). getsockopt() is an obvious allowance as well. Bug: 68689438 Test: compilation Merged-In: I2eaf72bcce5695f1aee7a95ec03111eca577651c Change-Id: I2eaf72bcce5695f1aee7a95ec03111eca577651c
-
Nathan Harold authored
Because applications should be able to set the receive timeout on UDP encapsulation sockets, we need to allow setsockopt(). getsockopt() is an obvious allowance as well. Bug: 68689438 Test: compilation Change-Id: I2eaf72bcce5695f1aee7a95ec03111eca577651c
-
- Jan 15, 2018
-
-
Nathan Harold authored
This gives the privilege to system apps, platform apps, ephemeral apps, and privileged apps to receive a UDP socket from the system server. This is being added for supporting UDP Encapsulation sockets for IPsec, which must be provided by the system. This is an analogous change to a previous change that permitted these sockets for untrusted_apps: 0f75a62e Bug: 70389346 Test: IpSecManagerTest, System app verified with SL4A Change-Id: Iec07e97012e0eab92a95fae9818f80f183325c31
-
- Dec 22, 2017
-
-
Jeffrey Vander Stoep authored
This reverts commit 84f96859. Fixes: 70874565 Reason for revert: massive logspam during phone calls. Change-Id: If00e46535f71209eea999e4d5d499bf40a5f16fd (cherry picked from commit 67808214)
-
Jeffrey Vander Stoep authored
This reverts commit 84f96859. Fixes: 70874565 Reason for revert: massive logspam during phone calls. Change-Id: If00e46535f71209eea999e4d5d499bf40a5f16fd
-
- Dec 20, 2017
-
-
Jeff Vander Stoep authored
Vendor-specific app domains depend on the rules in app.te so they must reside in public policy. Bug: 70517907 Test: build Change-Id: If45557a5732a06f78c752779a8182e053beb25a2 Merged-In: If45557a5732a06f78c752779a8182e053beb25a2 (cherry picked from commit 1f4cab8b)
-
- Dec 19, 2017
-
-
Jeff Vander Stoep authored
Vendor-specific app domains depend on the rules in app.te so they must reside in public policy. Bug: 70517907 Test: build Change-Id: If45557a5732a06f78c752779a8182e053beb25a2
-
- Dec 16, 2017
-
-
Jeff Vander Stoep authored
Many processes including third party apps are expected to access /proc/net/xt_qtaguid/stats. Give this file a new label to avoid spamming the logs and temporarily grant read access to all processes. Read-only permission is adequate for all processes based on unix permissions. sailfish:/ # ls -laZ /proc/net/xt_qtaguid/stats -r--r--r-- 1 root net_bw_stats u:object_r:proc_net_xt_qtaguid_stats:s0 stats Bug: 9496886 Bug: 68016944 Bug: 70722355 Test: Build/flash Sailfish. Browse in Chrome and watch videos in youtube. No "denied" or "granted" selinux messages observed in the logs. Change-Id: I29f1ee806c8149988b9b93a950790d14754927ef
-
- Dec 12, 2017
-
-
Marissa Wall authored
Do not let apps read uid_concurrent_active_time and uid_concurrent_policy_time. b/68399339 Test: Check that they can't be read from the shell without root permissions and system_server was able to read them Change-Id: I6f09ef608607cb9f4084ba403a1e7254b8c49a06
-
- Nov 21, 2017
-
-
Benjamin Gordon authored
In kernel 4.7, the capability and capability2 classes were split apart from cap_userns and cap2_userns (see kernel commit 8e4ff6f228e4722cac74db716e308d1da33d744f). Since then, Android cannot be run in a container with SELinux in enforcing mode. This change applies the existing capability rules to user namespaces as well as the root namespace so that Android running in a container behaves the same on pre- and post-4.7 kernels. This is essentially: 1. New global_capability_class_set and global_capability2_class_set that match capability+cap_userns and capability2+cap2_userns, respectively. 2. s/self:capability/self:global_capability_class_set/g 3. s/self:capability2/self:global_capability2_class_set/g 4. Add cap_userns and cap2_userns to the existing capability_class_set so that it covers all capabilities. This set was used by several neverallow and dontaudit rules, and I confirmed that the new classes are still appropriate. Test: diff new policy against old and confirm that all new rules add only cap_userns or cap2_userns; Boot ARC++ on a device with the 4.12 kernel. Bug: crbug.com/754831 Change-Id: I4007eb3a2ecd01b062c4c78d9afee71c530df95f
-
- Sep 26, 2017
-
-
Dan Cashman authored
Bug: 37916906 Test: Builds 'n' boots. Change-Id: Ia1d86264446ebecc1ca79f32f11354921bc77668 Merged-In: I208ec6a864127a059fb389417a9c6b259d7474cb
-
- Sep 18, 2017
-
-
Jeff Sharkey authored
Long live Binder. Test: yes Bug: 13758960 Change-Id: I11da7f14862024d9e9b901cfac1f22f1147174fa
-
- Sep 05, 2017
-
-
Steven Moreland authored
This reverts commit 9216a6ad. Bug: 65206688 Merged-In: I8e61b77a1abe9543e4fba77defb8062407676fcf Change-Id: I8e61b77a1abe9543e4fba77defb8062407676fcf
-
- Sep 01, 2017
-
-
Steven Moreland authored
This reverts commit f27bba93. Bug: 65206688 Change-Id: I8e61b77a1abe9543e4fba77defb8062407676fcf
-
- Aug 14, 2017
-
-
Steven Moreland authored
Only seeing this denial in permissive: allow shell screencap_exec:file getattr; Bug: 37565047 Test: adb shell screencap w/o root Test: cts-tradefed run cts-dev --module CtsAadbHostTestCases Merged-In: I9f31d2067e002e7042646ee38dbfc06687481ac7 Change-Id: I9f31d2067e002e7042646ee38dbfc06687481ac7
-
Steven Moreland authored
Only seeing this denial in permissive: allow shell screencap_exec:file getattr; Bug: 37565047 Test: adb shell screencap w/o root Test: cts-tradefed run cts-dev --module CtsAadbHostTestCases Merged-In: I9f31d2067e002e7042646ee38dbfc06687481ac7 Change-Id: I9f31d2067e002e7042646ee38dbfc06687481ac7
-
- Aug 11, 2017
-
-
Nick Kralevich authored
Android uses hidepid=2 to restrict visibility to other /proc entries on the system. This helps preserve user, application, and system confidentiality by preventing unauthorized access to application metadata, and addresses attacks such as http://www.cs.ucr.edu/~zhiyunq/pub/sec14_android_activity_inference.pdf Ensure the SELinux (weaker) equivalent is being enforced by adding neverallow compile time assertions. TODO: The "shell" user runs as both an Android application, as well as spawned via adb shell. This was a mistake. We should separate out the "shell" Android app into it's own SELinux domain. For now, exclude the shell from this assertion. (The shell Android app is covered by hidepid=2, so there's no leaking of data, but still, it's over privileged today and should be cleaned up. Bug: 23310674 Test: policy compiles. Compile time assertion only. Change-Id: I0e1a6506b2719aabf7eb8127f046c4ada947ba90
-
Steven Moreland authored
Only seeing this denial in permissive: allow shell screencap_exec:file getattr; Bug: 37565047 Test: adb shell screencap w/o root Test: cts-tradefed run cts-dev --module CtsAadbHostTestCases Change-Id: I9f31d2067e002e7042646ee38dbfc06687481ac7
-
- Jul 28, 2017
-
-
Philip P. Moltmann authored
Bug: 37281396 Test: cts-tradefed run cts-dev -m CtsContentTestCases --test=android.content.pm.cts.InstallSessionTransferTest Change-Id: If2094057d1acfbbf007ae108225decd9ad70e459
-
- Jul 13, 2017
-
-
Andreas Gampe authored
Allow wrapped app to send pid back to zygote. (cherry picked from commit ee694980) Bug: 63566721 Bug: 63635227 Test: lunch angler-userdebug && m Test: lunch angler-user && m Test: lunch angler-user && m && fastboot flashall && m cts && cts-tradefed run commandAndExit cts-dev -m CtsWrapWrapDebugTestCases Change-Id: Ie1b41c3eb124aa5ee321c124d0121a0e965f0f0e
-
Andreas Gampe authored
Allow wrapped app to send pid back to zygote. Bug: 63566721 Bug: 63635227 Test: lunch angler-userdebug && m Test: lunch angler-user && m Test: lunch angler-user && m && fastboot flashall && m cts && cts-tradefed run commandAndExit cts-dev -m CtsWrapWrapDebugTestCases Change-Id: Ie1b41c3eb124aa5ee321c124d0121a0e965f0f0e
-
- Jun 23, 2017
-
-
Jeff Vander Stoep authored
avc: denied { find } for interface=android.hardware.configstore::ISurfaceFlingerConfigs scontext=u:r:system_server:s0 tcontext=u:object_r:hal_configstore_ISurfaceFlingerConfigs:s0 tclass=hwservice_manager permissive=0 Bug: 35197529 Test: Device boots without this denial Change-Id: Ia43bc5879e03a1f2056e373b17cc6533636f98b1
-
Narayan Kamath authored
NOTE: This change is marked dnma because we don't want it on oc-dr1-dev-plus-aosp or any other downstream branch. Moreover, oc-dr1-dev-plus-aosp is the only outgoing merger from oc-dr1-dev for this project. This reverts commit 11bfcc1e. Bug: 62908344 Test: make Change-Id: Ide61829cf99f15777c46f657a0e140d594f88243
-
- Jun 22, 2017
-
-
Daniel Rosenberg authored
This adds parellel rules to the ones added for media_rw_data_file to allow apps to access vfat under sdcardfs. This should be reverted if sdcardfs is modified to alter the secontext it used for access to the lower filesystem Change-Id: Idb123206ed2fac3ead88b0c1ed0b66952597ac65 Bug: 62584229 Test: Run android.appsecurity.cts.ExternalStorageHostTest with an external card formated as vfat Signed-off-by:
Daniel Rosenberg <drosen@google.com>
-
- Jun 16, 2017
-
-
Daniel Rosenberg authored
This adds parellel rules to the ones added for media_rw_data_file to allow apps to access vfat under sdcardfs. This should be reverted if sdcardfs is modified to alter the secontext it used for access to the lower filesystem Change-Id: Idb123206ed2fac3ead88b0c1ed0b66952597ac65 Bug: 62584229 Test: Run android.appsecurity.cts.ExternalStorageHostTest with an external card formated as vfat Signed-off-by:
Daniel Rosenberg <drosen@google.com>
-
- May 31, 2017
-
-
Narayan Kamath authored
tombstoned allows dumpstate to install "intercepts" to java trace requests for a given process. When an "intercept" is installed, all trace output is redirected to a pipe provided by dumpstate instead of the default location (usually in /data/anr or /data/tombstone). Note that these processes are already granted "write" and "getattr" on dumpstate:fifo_file in order to communicate with dumpstate; this change adds "append" to the existing set of permissions. Bug: 32064548 Test: manual Change-Id: Iccbd78c59071252fef318589f3e55ece51a3c64c
-
Narayan Kamath authored
Applications connect to tombstoned via a unix domain socket and request an open FD to which they can write their traces. This socket has a new label (tombstoned_java_trace_socket) and appdomain and system_server are given permissions to connect and write to it. Apps no longer need permissions to open files under /data/anr/ and these permissions will be withdrawn in a future change. Bug: 32064548 Test: Manual (cherry picked from commit a8832dabc7f3b7b2381760d2b95f81abf78db709) (cherry picked from commit 11bfcc1e) Change-Id: Icc60d227331c8eee70a9389ff1e7e78772f37e6f
-
Narayan Kamath authored
Applications connect to tombstoned via a unix domain socket and request an open FD to which they can write their traces. This socket has a new label (tombstoned_java_trace_socket) and appdomain and system_server are given permissions to connect and write to it. Apps no longer need permissions to open files under /data/anr/ and these permissions will be withdrawn in a future change. Bug: 32064548 Test: Manual Merged-In: I70a3e6e230268d12b454e849fa88418082269c4f Change-Id: Ib4b73fc130f4993c44d96c8d68f61b6d9bb2c7d5
-
- May 30, 2017
-
-
Narayan Kamath authored
Applications connect to tombstoned via a unix domain socket and request an open FD to which they can write their traces. This socket has a new label (tombstoned_java_trace_socket) and appdomain and system_server are given permissions to connect and write to it. Apps no longer need permissions to open files under /data/anr/ and these permissions will be withdrawn in a future change. Bug: 32064548 Test: Manual (cherry picked from commit a8832dabc7f3b7b2381760d2b95f81abf78db709) Change-Id: I70a3e6e230268d12b454e849fa88418082269c4f
-