- Oct 11, 2018
-
-
Tri Vo authored
What changed: - Removed cgroup access from untrusted and priv apps. - Settings app writes to /dev/stune/foreground/tasks, so system_app domain retains access to cgroup. - libcutils exports API to /dev/{cpuset, stune}/*. This API seems to be used abundantly in native code. So added a blanket allow rule for (coredomain - apps) to access cgroups. - For now, only audit cgroup access from vendor domains. Ultimately, we want to either constrain vendor access to individual domains or, even better, remove vendor access and have platform manage cgroups exclusively. Changes from original aosp/692189 which was reverted: - There seem to be spurious denials from vendor-specific apps. So added back access from { appdomain -all_untrusted_apps -priv_app } to cgroup. Audit this access with intent to write explicit per-domain rules for it. Bug: 110043362 Test: adb shell setprop ro.config.per_app_memcg true, device correctly populates /dev/memcg on a per app basis on a device that supports that. Test: aosp_sailfish, wahoo boot without cgroup denials This reverts commit cacea25e. Change-Id: I05ab404f348a864e8409d811346c8a0bf49bc47a
-
- Oct 10, 2018
-
-
Nick Kralevich authored
They are unneeded. Test: device boots and no obvious problems. Change-Id: Ib788a89645c893c8c36acbe7fb34ce93bf6a57d7
-
Nick Kralevich authored
Remove kernel attack surface associated with ioctls on plain files. In particular, we want to ensure that the ioctls FS_IOC_ENABLE_VERITY and FS_IOC_MEASURE_VERITY are not exposed outside a whitelisted set of entities. However, it's straight forward enough to turn on ioctl whitelisting for everything, so we choose to do so. Test: policy compiles and device boots Test: device boots with data wipe Test: device boots without data wipe Change-Id: I545ae76dddaa2193890eeb1d404db79d1ffa13c2
-
Nick Kralevich authored
This reverts commit 9899568f. Reason for revert: Reports of high numbers of SELinux denials showing up on the SELinux dashboard. Bug: 110043362 Change-Id: Id8fc260c47ffd269ac2f15ff7dab668c959e3ab0
-
- Oct 09, 2018
-
-
Tri Vo authored
What changed: - Removed cgroup access from untrusted and priv apps. - Settings app writes to /dev/stune/foreground/tasks, so system_app domain retains access to cgroup. - libcutils exports API to /dev/{cpuset, stune}/*. This API seems to be used abundantly in native code. So added a blanket allow rule for (coredomain - apps) to access cgroups. - For now, only audit cgroup access from vendor domains. Ultimately, we want to either constrain vendor access to individual domains or, even better, remove vendor access and have platform manage cgroups exclusively. Bug: 110043362 Test: adb shell setprop ro.config.per_app_memcg true, device correctly populates /dev/memcg on a per app basis on a device that supports that. Test: aosp_sailfish, wahoo boot without cgroup denials Change-Id: I9e441b26792f1edb1663c660bcff422ec7a6332b
-
- Oct 08, 2018
-
-
Igor Murashkin authored
This daemon is very locked down. Only system_server can access it. Bug: 72170747 Change-Id: I7b72b9191cb192be96001d84d067c28292c9688f
-
Mark Salyzyn authored
A default set of options are available, but can override in a fstab overlay entry with upperdir=, lowerdir= to the same mount point, workdir=. The default is a valid /mnt/scratch/overlay/ or /cache/overlay/ directory, with .../<mount_point>/upper and .../<mount_point>/work, associated with each system partition <mount_point>. Test: manual Bug: 109821005 Change-Id: I5662c01fad17d105665be065f6dcd7c3fdc40d95
-
- Oct 04, 2018
-
-
Martijn Coenen authored
apexd is a new daemon for managing APEX packages installed on the device. It hosts a single binder service, "apexservice". Bug: 112455435 Test: builds, binder service can be registered, apexes can be accessed, verified and mounted Change-Id: I634ad100f10b2edcd9a9c0df0d33896fa5d4ed97
-
- Sep 27, 2018
-
-
Nick Kralevich authored
system_file_type is a new attribute used to identify files which exist on the /system partition. It's useful for allow rules in init, which are based off of a blacklist of writable files. Additionally, it's useful for constructing neverallow rules to prevent regressions. Additionally, add commented out tests which enforce that all files on the /system partition have the system_file_type attribute. These tests will be uncommented in a future change after all the device-specific policies are cleaned up. Test: Device boots and no obvious problems. Change-Id: Id9bae6625f042594c8eba74ca712abb09702c1e5
-
- Sep 19, 2018
-
-
Benjamin Gordon authored
kernel commit 2a4c22426955d4fc04069811997b7390c0fb858e (fs: switch order of CAP_DAC_OVERRIDE and CAP_DAC_READ_SEARCH checks) swapped the order of dac_override and dac_read_search checks. Domains that have dac_override will now generate spurious denials for dac_read_search unless they also have that permission. Since dac_override is a strict superset of dac_read_search, grant dac_read_search to all domains that already have dac_override to get rid of the denials. Bug: 114280985 Bug: crbug.com/877588 Test: Booted on a device running 4.14. Change-Id: I5c1c136b775cceeb7f170e139e8d4279e73267a4
-
- Sep 14, 2018
-
-
Nick Kralevich authored
Add additional compile time constraints on the ability to ptrace various sensitive domains. llkd: remove some domains which llkd should never ptrace, even on debuggable builds, such as kernel threads and init. crash_dump neverallows: Remove the ptrace neverallow checks because it duplicates other neverallow assertions spread throughout the policy. Test: policy compiles and device boots Change-Id: Ia4240d1ce7143b983bb048e046bb4729d0af5a6e
-
- Sep 11, 2018
-
-
Martijn Coenen authored
But in a very restricted form: 1) Nobody can initiate calls into init 2) Nobody can transfer binder objects into init, except servicemanager Bug: 112684055 Test: device boots Change-Id: Icfb218f2871e234284c74e096eccd7a2e786cf94
-
- Aug 28, 2018
-
-
Mark Salyzyn authored
Test: compile Bug: 64114943 Change-Id: I1d20cc027dbd1a94e2a79b6aebdd265cefe8a6a5
-
- Aug 13, 2018
-
-
Nick Kralevich authored
Linux kernel 4.14+ SELinux starts explicit map permission check for file mmap operations. For backards compat, add mmap in more places where we explicitly list out individual file permissions. Test: policy compiles Change-Id: Idc4ca53769f2e7aa12ed93ab27191ed92da37a3e
-
- Aug 08, 2018
-
-
Mark Salyzyn authored
/cache/overlay directory in support of overlayfs mounts on userdebug and eng devices. Overlayfs in turn can be capable of supporting adb remount for read-only or restricted-storage filesystems like squashfs or right-sized (zero free space) system partitions respectively. Test: compile Bug: 109821005 Bug: 110985612 Change-Id: I3ece03886db7cc97f864497cf93ec6c6c39bccd1
-
- Aug 02, 2018
-
-
Nick Kralevich authored
Currently, both untrusted apps and priv-apps use the SELinux file label "app_data_file" for files in their /data/data directory. This is problematic, as we really want different rules for such files. For example, we may want to allow untrusted apps to load executable code from priv-app directories, but disallow untrusted apps from loading executable code from their own home directories. This change adds a new file type "privapp_data_file". For compatibility, we adjust the policy to support access privapp_data_files almost everywhere we were previously granting access to app_data_files (adbd and run-as being exceptions). Additional future tightening is possible here by removing some of these newly added rules. This label will start getting used in a followup change to system/sepolicy/private/seapp_contexts, similar to: -user=_app isPrivApp=true domain=priv_app type=app_data_file levelFrom=user +user=_app isPrivApp=true domain=priv_app type=privapp_data_file levelFrom=user For now, this newly introduced label has no usage, so this change is essentially a no-op. Test: Factory reset and boot - no problems on fresh install. Test: Upgrade to new version and test. No compatibility problems on filesystem upgrade. Change-Id: I9618b7d91d1c2bcb5837cdabc949f0cf741a2837
-
- Jul 31, 2018
-
-
Tom Cherry authored
Bug: 111883560 Test: fsck runs successfully during early mount Change-Id: I697d0ab8ba51824d5c5062b48370a73438311566
-
- Jun 14, 2018
-
-
Mark Salyzyn authored
init, dumpstate and shell Test: check avc for init is now gone Bug: 7232205 Bug: 109821005 Change-Id: I299a0ba29bcc97a97047f12a5c48f6056f5e6de5
-
- May 29, 2018
-
-
Jeff Vander Stoep authored
In particular, add assertions limiting which processes may directly open files owned by apps. Reduce this to just apps, init, and installd. App data is protected by a combination of selinux permissions and Unix permissions, so limiting the open permission to just apps (which are not allowed to have CAP_DAC_OVERRIDE or CAP_DAC_READ_SEARCH) ensures that only installd and init have complete access an app's private directory. In addition to apps/init/installd, other processes currently granted open are mediaserver, uncrypt, and vold. Uncrypt's access appears to be deprecated (b/80299612). Uncrypt now uses /data/ota_package instead. b/80418809 and b/80300620 track removal for vold and mediaserver. Test: build/boot aosp_taimen-userdebug. Verify no "granted" audit messages in the logs. Bug: 80190017 Bug: 80300620 Bug: 80418809 Fixes: 80299612 Change-Id: I153bc7b62294b36ccd596254a5976dd887fed046
-
- May 18, 2018
-
-
Paul Crowley authored
Test: booted metadata-encrypted device Bug: 79781913 Change-Id: Ib4cb4a04145e5619994083da055f06fe7ae0137a
-
- May 07, 2018
-
-
Mark Salyzyn authored
Test: compile Bug: 64114943 Change-Id: I2bbf84a6e472d720f02282e10d56795b75ac62d1
-
- May 04, 2018
-
-
Jeff Vander Stoep authored
Files in /proc/net leak information. This change is the first step in determining which files apps may use, whitelisting benign access, and otherwise removing access while providing safe alternative APIs. To that end, this change: * Introduces the proc_net_type attribute which will assigned to any new SELinux types in /proc/net to avoid removing access to privileged processes. These processes may be evaluated later, but are lower priority than apps. * Labels /proc/net/{tcp,tcp6,udp,udp6} as proc_net_vpn due to existing use by VPN apps. This may be replaced by an alternative API. * Audits all other proc/net access for apps. * Audits proc/net access for other processes which are currently granted broad read access to /proc/net but should not be including storaged, zygote, clatd, logd, preopt2cachename and vold. Bug: 9496886 Bug: 68016944 Test: Boot Taimen-userdebug. On both wifi and cellular: stream youtube navigate maps, send text message, make voice call, make video call. Verify no avc "granted" messages in the logs. Test: A few VPN apps including "VPN Monster", "Turbo VPN", and "Freighter". Verify no logspam with the current setup. Test: atest CtsNativeNetTestCases Test: atest netd_integration_test Test: atest QtaguidPermissionTest Test: atest FileSystemPermissionTest Change-Id: I7e49f796a25cf68bc698c6c9206e24af3ae11457 Merged-In: I7e49f796a25cf68bc698c6c9206e24af3ae11457 (cherry picked from commit 08731895)
-
- May 01, 2018
-
-
Tri Vo authored
Bug: 65643247 Test: device boots without denials from init to proc_* Change-Id: I44729e791366cdedec27603558b2e929fa414168
-
- Apr 23, 2018
-
-
Paul Crowley authored
Bug: 77335096 Test: booted device with metadata encryption and without Change-Id: I5bc5d46deb4e91912725c4887fde0c3a41c9fc91
-
- Apr 20, 2018
-
-
Paul Crowley authored
Bug: 77335096 Test: booted device with metadata encryption and without Change-Id: I5bc5d46deb4e91912725c4887fde0c3a41c9fc91
-
- Apr 18, 2018
-
-
Jeff Vander Stoep authored
Create a new label for /data/system/dropbox, and neverallow direct access to anything other than init and system_server. While all apps may write to the dropbox service, only apps with android.permission.READ_LOGS, a signature|privileged|development permission, may read them. Grant access to priv_app, system_app, and platform_app, and neverallow access to all untrusted_apps. Bug: 31681871 Test: atest CtsStatsdHostTestCases Test: atest DropBoxTest Test: atest ErrorsTests Change-Id: Ice302b74b13c4d66e07b069c1cdac55954d9f5df
-
- Apr 09, 2018
-
-
Alan Stokes authored
cgroupfs doesn't allow files to be created, so this can't be needed. Also remove redundant neverallow and dontaudit rules. These are now more broadly handled by domain.te. Bug: 74182216 Test: Denials remain silenced. Change-Id: If7eb0e59f567695d987272a2fd36dbc251516e9f (cherry picked from commit 8e8c1093)
-
- Apr 06, 2018
-
-
Alan Stokes authored
cgroupfs doesn't allow files to be created, so this can't be needed. Also remove redundant neverallow and dontaudit rules. These are now more broadly handled by domain.te. Bug: 74182216 Test: Denials remain silenced. Change-Id: If7eb0e59f567695d987272a2fd36dbc251516e9f
-
- Mar 16, 2018
-
-
padarshr authored
Allow init the ability to relabel recovery block devices. In the case where we have recovery as a chain partition, due to its presence in early mount node, init, in first stage itself would require relabel permissions for the restorecon operation on recovery block device. Bug: 73642793 Test: On bootup, recovery partition gets the appropriate se-label. Perform OTA on non-A/B device with recovery as chain partition, now the recovery partition gets upgraded successfully, now that it has the correct se-label. Change-Id: I370c510320e78ab78c9c55573073415b4983d0f6 Merged-In: I370c510320e78ab78c9c55573073415b4983d0f6 (cherry picked from commit bc14ee3c)
-
- Mar 15, 2018
-
-
padarshr authored
Allow init the ability to relabel recovery block devices. In the case where we have recovery as a chain partition, due to its presence in early mount node, init, in first stage itself would require relabel permissions for the restorecon operation on recovery block device. Bug: 73642793 Test: On bootup, recovery partition gets the appropriate se-label. Perform OTA on non-A/B device with recovery as chain partition, now the recovery partition gets upgraded successfully, now that it has the correct se-label. Change-Id: I370c510320e78ab78c9c55573073415b4983d0f6
-
- Feb 27, 2018
-
-
Alan Stokes authored
The write is here: https://android.googlesource.com/platform/system/core/+/master/rootdir/init.rc#257. Denials (on a device with the sysfs_vibrator label properly applied): denied { write } for name="vibrator" dev="sysfs" ino=49613 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_vibrator:s0 tclass=dir denied { write } for name="trigger" dev="sysfs" ino=49620 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_vibrator:s0 tclass=file denied { open } for path="/sys/devices/<redacted>/vibrator/trigger" dev="sysfs" ino=49620 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_vibrator:s0 tclass=file Bug: b/72643420 Test: Device boots, denials gone Change-Id: Ib50d9a8533303daccb1330685e3204bea3fbd8a8
-
- Feb 22, 2018
-
-
Sandeep Patil authored
This required for kernel to do loopback mounts on filesystem images created by the kernel system call tests in LTP. Add a corresponding neverallow to stop all domains from accessing the location at /data/local/tmp/ltp. Bug: 73220071 Test: Boot sailfish successfully Test: run vts-kernel -m VtsKernelLtp -t syscalls.fchown04 Change-Id: I73f5f14017e22971fc246a05751ba67be4653bca Signed-off-by:
Sandeep Patil <sspatil@google.com>
-
- Feb 05, 2018
-
-
Carmen Jackson authored
This changes tracefs files to be default-enabled in debug mode, but default-disabled with specific files enabled in user mode. Bug: 64762598 Test: Successfully took traces in user mode. Change-Id: I572ea22253e0c1e42065fbd1d2fd7845de06fceb
-
- Jan 24, 2018
-
-
Joel Galenson authored
Init tries to write /proc/sys/vm/min_free_order_shift but fails due to a SELinux denial. This gives the file a new label and gives init the ability to write it. Test: Build and booted Sailfish (a couple of days ago). Change-Id: Ic93862b85c468afccff2019d84b927af9ed2a84d
-
- Jan 08, 2018
-
-
Luis Hector Chavez authored
This reverts commit 640e595a. The corresponding code in libcutils was removed, so this is now unneeded. Bug: 71632076 Test: aosp_sailfish still works Change-Id: I615bab83e9a83bc14439b8ab90c00d3156b0a7c4
-
- Jan 03, 2018
-
-
Jeff Vander Stoep authored
Commit erroneously 55039509 removed init's read access to /sys/devices/virtual/block/zram*. Restore access. Test: cat /proc/meminfo ... SwapTotal: 524284 kB SwapFree: 524284 kB ... Bug: 71510938 Change-Id: I20268168caa541a7dafa1e32339641095e1e524b
-
- Jan 02, 2018
-
-
Chenbo Feng authored
Some necessary sepolicy rule changes for init process to create directory, mount cgroupv2 module and mount bpf filesystem. Also allow netd to create and pin bpf object as files and read it back from file under the directory where bpf filesystem is mounted. Test: bpf maps show up under /sys/fs/bpf/ Change-Id: I579d04f60d7e20bd800d970cd28cd39fda9d20a0
-
- Dec 20, 2017
-
-
Tri Vo authored
Removes open, read, setattr permissions to sysfs_type. Adds explicit permissions to: sysfs_dt_firmware_android sysfs_vibrator sysfs_wake_lock Bug: 65643247 Test: walleye boots without denials to sysfs_type. Change-Id: I2e344831655c2c8e8e48b07ecce6a2704f2a206a
-
- Dec 13, 2017
-
-
Tom Cherry authored
Allow init to create a serialized property_info file and allow all processes to read it. Bug: 36001741 Test: boot bullhead, walleye using property_info Change-Id: Ie51d4c0f0221b128dd087029c811fda15b4d7093
-
- Dec 06, 2017
-
-
Tri Vo authored
Add write access to: sysfs_android_usb sysfs_leds sysfs_power sysfs_zram Add setattr access to: sysfs_android_usb sysfs_devices_system_cpu sysfs_lowmemorykiller sysfs_power sysfs_leds sysfs_ipv4 Bug: 70040773 Bug: 65643247 Change-Id: I68e2e796f5599c9d281897759c8d8eef9363559a Test: walleye boots with no denials from init to sysfs.
-