Commit graph

211 commits

Author SHA1 Message Date
Benjamin Gordon
65214c688a Merge "sepolicy: Add rules for non-init namespaces" am: b9ea282c65 am: d41e616199
am: 44957a90f3

Change-Id: I363639d2cdf70b1772da3d6c7f7c814554063dfc
2017-11-21 17:47:23 +00:00
Benjamin Gordon
9b2e0cbeea sepolicy: Add rules for non-init namespaces
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
2017-11-21 08:34:32 -07:00
Vishnu Nair
62edfe5a18 Allow system_server to remove files in /data/misc/wmtrace/* am: df8d4b87ef am: 063ad62779
am: 06d0fdc998

Change-Id: Iffe0682a5c5035624a96025c122156eb276ce3ec
2017-11-21 03:23:30 +00:00
Vishnu Nair
df8d4b87ef Allow system_server to remove files in /data/misc/wmtrace/*
Bug: 64831661
Test: adb shell cmd window tracing start && adb shell cmd window tracing stop
Test: adb shell su root dmesg | grep 'avc: '
Change-Id: I1578aac9e102246ec722c78a6e9efb5581259d81
2017-11-20 15:21:56 -08:00
Vishnu Nair
219d62c1be Merge "Add window trace files SELinux policy rules" am: 97c86514be am: dcd0baf627
am: 5187196692

Change-Id: Id7363e8c5e6bc6a41bb74e0536eb80577189107d
2017-11-17 19:50:59 +00:00
Tri Vo
a087581232 Merge "system_server: access to /proc/sys/fs/pipe-max-size" am: 25576730c9 am: 1bd4443aa6
am: 00057abcfc

Change-Id: I6d6b75701e35b35501935162670f906f9c757d4b
2017-11-17 17:25:23 +00:00
Vishnu Nair
2d6942d397 Add window trace files SELinux policy rules
- Allow system_server to create and write to /data/misc/wmtrace/*
- Allow surfaceflinger to create and write files from /data/misc/wmtrace/*
- Allow dumpstate to read files from /data/misc/wmtrace/*
permissions are restricted to userdebug or eng builds

Bug: 64831661

Test: adb shell cmd window tracing start && adb shell cmd window tracing stop
Test: adb shell su root service call SurfaceFlinger 1025 i32 1 >/dev/null && adb shell su root service call SurfaceFlinger 1025 i32 0 >/dev/null
Test: adb bugreport ~/tmp.zip && adb shell su root dmesg | grep 'avc: '

Change-Id: I0b15166560739d73d7749201f3ad197dbcf5791c
2017-11-17 17:17:36 +00:00
Tri Vo
e7f4934d06 system_server: access to /proc/sys/fs/pipe-max-size
Label /proc/sys/fs/pipe-max-size with new type proc_pipe_conf and give
system_server access to it.

Addresses this denial:
avc: denied { read } for name="pipe-max-size" dev="proc" ino=93817
scontext=u:r:system_server:s0 tcontext=u:object_r:proc:s0 tclass=file
permissive=0

Bug: 69175449
Bug: 69324398
Test: sailfish boots
Test: adb bugreport
Test: craft an unresponsive app, trigger ANR, make sure traces are dumped
into /data/anr
Above denial from system_server not observed, no denials to proc_pipe_conf
observed.
Change-Id: I7c71f05820a4945ba982e29f76e9d9f4458b2b59
2017-11-16 12:30:53 -08:00
Nicolas Geoffray
2b669ed3f0 Merge "Revert "Revert "Put pm.* property in new pm_prop context""" am: 0d7e5047ff am: 0181d23f8d
am: fa7f3a9d1e

Change-Id: Id56db24bfb5821d7a7255b8646fb2dfcf22271d9
2017-11-16 09:49:24 +00:00
Calin Juravle
5316548f0d Revert "Revert "Put pm.* property in new pm_prop context""
This reverts commit 248b6dc644.

Reason for revert: The dashboard complains that devices don't boot after this revert.

Change-Id: I6a4648b64b096cbaa97c67aae6bc38b76d54cb48
2017-11-16 05:28:14 +00:00
Calin Juravle
09770bda68 Revert "Put pm.* property in new pm_prop context" am: 248b6dc644 am: e3cec84111
am: 0386eaed6e

Change-Id: I7b2aec9510271d509759eb4822ba8d97993af2ff
2017-11-16 01:33:21 +00:00
Calin Juravle
248b6dc644 Revert "Put pm.* property in new pm_prop context"
This reverts commit d1cf3a4056.

Reason for revert: It breaks CTS b/69309298 and other platform tests which read pm.dexopt properties.

Change-Id: I5c7cde041113e9c19bb23218edd99f699fcf4a06
2017-11-15 22:11:35 +00:00
Victor Hsieh
2d5623d69b Put pm.* property in new pm_prop context am: d1cf3a4056 am: d23bbbf6d7
am: 02414be8e2

Change-Id: I5d1bf80b7e71c02f3eae9bd8d598aecb966da942
2017-11-08 17:28:17 +00:00
Victor Hsieh
d1cf3a4056 Put pm.* property in new pm_prop context
Test: system server does not crash with this change
Bug: 67415855
Bug: 63920015
Change-Id: I3d0982220743137098dbc683d5c4aded105648c2
2017-11-08 16:57:38 +00:00
Max Bires
87b86875c3 Adding statscompanion_service and a dontaudit for find/add am: 0187b23113 am: cee16b0553
am: 5e489b4a5b

Change-Id: If7edc88a75be0aa62adaac5f05f016ca3a374e9b
2017-10-24 17:38:01 +00:00
Max Bires
0187b23113 Adding statscompanion_service and a dontaudit for find/add
Instead of removing the denial generating code, a dontaudit and a
service label will be provided so that the team working on this new
feature doesn't have to get slowed up with local revision patches.

The dontaudit should be removed upon resolution of the linked bug.

Bug: 67468181
Test: statscompanion denials aren't audited
Change-Id: Ib4554a7b6c714e7409ea504f5d0b82d5e1283cf7
2017-10-23 16:45:13 -07:00
Jin Qian
81d8b0ee01 storaged: move storaged file from DE to CE
Allow vold/system_server to call storaged service

Test: adb shell storaged -u
Bug: 63740245
Change-Id: I88219e32520006db20299468b7a8c7ce0bfa58e0
Merged-In: I88219e32520006db20299468b7a8c7ce0bfa58e0
(cherry picked from commit fa6c3d7c4c)
2017-10-23 08:31:46 -07:00
Nick Kralevich
f86969af42 Merge "Fixup neverallow rule" am: 917cf072d2 am: 88b23b42af am: 96e3981081
am: 1041d34bdb

Change-Id: I828ef6ee6ecc256249819e57798753fd8f979108
2017-10-20 23:08:47 +00:00
Nick Kralevich
2ec15e5b27 Fixup neverallow rule
When we removed /data/dalvik-cache execute permission for system_server
(b/37214733, b/31780877), I forgot to fixup this neverallow rule.
Fix rule.

Test: policy compiles.
Change-Id: I38b821a662e0d8304b8390a69a6d9e923211c31e
2017-10-20 13:27:26 -07:00
TreeHugger Robot
c8b8e093c0 Merge changes from topic "health2_healthd_hwbinder"
* changes:
  system_server allow to add batteryproperties_service
  healthd provides health@2.0 service.
2017-10-20 00:09:59 +00:00
TreeHugger Robot
7b948db877 Merge "storaged: move storaged file from DE to CE" 2017-10-19 21:23:54 +00:00
Max Bires
37e236c07b Merge "Allowing system_server to search sysfs_power dir" am: 35f2cf802c am: a6734faca9 am: 7d6a23ad1b
am: 2d44373062

Change-Id: I24ff25f7126ee237fdeacbf1ba509217cbc8e297
2017-10-19 19:19:57 +00:00
Yifan Hong
dc9815e226 system_server allow to add batteryproperties_service
BatteryService now serves batteryproperties_service
(previously served by healthd) to allow BatteryManager
to continue to work.

Test: boots (BatteryService correctly starts up)

Bug: 63702641
Change-Id: If5c4c82d58c960c966b03afa3fc7902cda04222b
2017-10-18 23:30:48 +00:00
Max Bires
aed69d67f7 Allowing system_server to search sysfs_power dir
rw access to sysfs_power file is not enough; in some cases search access
is also needed

Bug: 67895406
Test: system_server can access memory power statistics
Change-Id: I471e8e60626e6eed35e74e25a0f4be470885a459
2017-10-17 12:45:16 -07:00
Jin Qian
fa6c3d7c4c storaged: move storaged file from DE to CE
Allow vold/system_server to call storaged service

Test: adb shell storaged -u
Bug: 63740245
Change-Id: I88219e32520006db20299468b7a8c7ce0bfa58e0
2017-10-16 16:39:13 -07:00
Robert Quattlebaum
fd03d51736 lowpan: Add wpantund to SEPolicy
Bug: b/64399219
Test: Manual
Change-Id: I4f6c7e4e3339ae95e43299bf364edff40d07c796
(cherry picked from commit c8bd93d7e8)
2017-10-16 14:10:40 -07:00
Tri Vo
1c166c6d83 Merge "Label system_server's dependencies in sysfs." am: 975efbe5d2 am: fb49dc5211 am: 8269fec076
am: 24f994bba7

Change-Id: I4656b8b13db086950040055f36c444bb01197de0
2017-10-15 05:49:31 +00:00
Tri Vo
1960215c49 Label system_server's dependencies in sysfs.
New types:
sysfs_android_usb
sysfs_ipv4
sysfs_power
sysfs_rtc
sysfs_switch
sysfs_wakeup_reasons

Labeled:
/sys/class/android_usb, /sys/devices/virtual/android_usb ->sysfs_android_usb
/sys/class/rtc -> sysfs_rtc
/sys/class/switch, /sys/devices/virtual/switch -> sysfs_switch
/sys/power/state, /sys/power/wakeup_count -> sysfs_power
/sys/kernel/ipv4 -> sysfs_ipv4
/sys/kernel/wakeup_reasons -> sysfs_wakeup_reasons

Removed access to sysfs and sysfs_type from system_server and added
appropriate access to new types.

Bug: 65643247
Test: sailfish boots without violation from system_server or to new labels.
Change-Id: I27250fd537d76c8226defa138d84fe2a4ce2d5d5
2017-10-12 14:51:20 -07:00
Yifan Hong
9788e83cd7 selinux changes for android.hardware.health@2.0
health@2.0 is a service used by BatteryService in framework.

Test: health hal works

Change-Id: I6cccf3ab085686fd67b0e048aaf201e64ec311c4
2017-10-11 14:23:04 -07:00
Tri Vo
cc5464fd7d Merge "Extend access to proc/asound/*" am: a045c854c5 am: bd435bf8e9 am: 32f7d8f89e
am: 16ef7ca87c

Change-Id: I1562fed1d63a80682684ff0dfaf6a3773eaf60f0
2017-10-06 20:10:25 +00:00
Tri Vo
464f59ae10 Extend access to proc/asound/*
Renamed this type:
proc_asound_cards -> proc_asound

Labeled /proc/asound/devices as proc_asound.

We now use proc_asound type to label files under /proc/asound which we
want to expose to system components.

Bug: 66988327
Test: Pixel 2 boots, can play sound with or without headphones, and
selinux denials to proc_asound are not seen.

Change-Id: I453d9bfdd70eb80931ec9e80f17c8fd0629db3d0
2017-10-06 10:29:03 -07:00
Dan Cashman
91d398d802 Sync internal master and AOSP sepolicy.
Bug: 37916906
Test: Builds 'n' boots.
Change-Id: Ia1d86264446ebecc1ca79f32f11354921bc77668
Merged-In: I208ec6a864127a059fb389417a9c6b259d7474cb
2017-09-26 14:38:47 -07:00
TreeHugger Robot
b5f6ee91ee Merge "lowpan: Add wpantund to SEPolicy" 2017-09-26 20:53:20 +00:00
Robert Quattlebaum
c8bd93d7e8 lowpan: Add wpantund to SEPolicy
Bug: b/64399219
Test: Manual
Change-Id: I4f6c7e4e3339ae95e43299bf364edff40d07c796
2017-09-21 10:27:59 -07:00
Tri Vo
6928dd3b8b Merge "Explicitly label system_server's dependencies in /proc" 2017-09-20 16:43:45 +00:00
Tri Vo
8c2323d3f9 Explicitly label system_server's dependencies in /proc
Labeled:
/proc/asound/cards -> proc_asound_cards
/proc/loadavg -> proc_loadavg
/proc/pagetypeinfo -> proc_pagetypeinfo
/proc/version -> proc_version
/proc/vmallocinfo -> proc_vmallocinfo

system_server: added access to all new types  and removed access to proc label.
init: added access to proc_version.
dumpstate: added access to proc_pagetypeinfo, proc_version,
proc_vmallocinfo.
hal_audio: added access to proc_asound_cards.
all_untrusted_apps: extended neverallow rule to include new labels.

Bug: 65980789
Test: device boots without selinux denials to the newly introduced
labels.
Test: "adb shell dumpstate" throws no violations to new labels.
Change-Id: Ic60facd3d4776e38d5e3ba003d06ada4e52c7dca
2017-09-19 21:23:06 +00:00
Jeff Sharkey
2740a3d100 Destroy vold socket interface completely.
Long live Binder.

Test: yes
Bug: 13758960
Change-Id: I11da7f14862024d9e9b901cfac1f22f1147174fa
2017-09-18 17:04:41 -06:00
Tomasz Wasilczyk
26ff5eb6b9 Move Broadcast Radio HAL to a separate binary.
Bug: 63600413
Test: VTS, instrumentation, audit2allow
Test: after cherry-pick - it builds
Change-Id: I57c0150a52c13f1ce21f9ae2147e3814aad0fb7e
(cherry picked from commit 567b947d85)
2017-09-15 10:16:48 -07:00
Jeff Sharkey
0fa3fb0257 Start paving the way for vold calls over Binder.
This change is the bare minimum needed to publish a new vold
Binder service and move the simple "reset" call over to go through
the new interface.

The new rules here are mirrored on the existing installd rules, but
with a handful of neverallow rules relaxed due to funky interactions
with hal_client_domain().

Test: builds, boots
Bug: 13758960
Change-Id: Ia9522ea7a68698cb0edce7879abfbf22b9d67c76
2017-09-06 16:16:20 -06:00
Steven Moreland
fa459fc96d Revert "Permissions for screencap saving files to /sdcard/"
am: f606a51e5a

Change-Id: If76f2528ca0edb4f0ad37a85fdc85356ab1e14ae
2017-09-01 19:45:43 +00:00
Steven Moreland
f606a51e5a Revert "Permissions for screencap saving files to /sdcard/"
This reverts commit c12c734932.

Bug: 65206688

Change-Id: Ia2a04906f8585bf295b8c75e0b3d09490afb5d24
2017-09-01 10:00:09 -07:00
Steven Moreland
fb3fda0ee9 Permissions for screencap saving files to /sdcard/
am: c12c734932

Change-Id: I419f605b03d497d3babd09651b977bc065677c71
2017-08-31 20:22:45 +00:00
Steven Moreland
c12c734932 Permissions for screencap saving files to /sdcard/
Before screencap was in its own domain, it was able to do
this by using all of shell's permissions.

The following denials are caused (along with times from running the below test command)
when screencap is invoked to write a file onto the sdcard:
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:23): avc: denied { read } for name="primary" dev="tmpfs" ino=19547 scontext=u:r:screencap:s0 tcontext=u:object_r:storage_file:s0 tclass=lnk_file permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:24): avc: denied { search } for name="/" dev="tmpfs" ino=19529 scontext=u:r:screencap:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:25): avc: denied { search } for name="user" dev="tmpfs" ino=19535 scontext=u:r:screencap:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:26): avc: denied { read } for name="primary" dev="tmpfs" ino=31198 scontext=u:r:screencap:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=lnk_file permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:27): avc: denied { search } for name="/" dev="sdcardfs" ino=1310722 scontext=u:r:screencap:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:28): avc: denied { write } for name="image.png" dev="sdcardfs" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:29): avc: denied { open } for path="/storage/emulated/0/image.png" dev="sdcardfs" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:30): avc: denied { write open } for path="/data/media/0/image.png" dev="sda45" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
08-30 21:03:32.582  4990  4990 I screencap: type=1400 audit(0.0:31): avc: denied { execute } for name="sh" dev="dm-0" ino=998 scontext=u:r:screencap:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=1
08-30 21:03:32.582  4990  4990 I screencap: type=1400 audit(0.0:32): avc: denied { read open } for path="/system/bin/sh" dev="dm-0" ino=998 scontext=u:r:screencap:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=1
08-30 21:03:32.582  4990  4990 I screencap: type=1400 audit(0.0:33): avc: denied { execute_no_trans } for path="/system/bin/sh" dev="dm-0" ino=998 scontext=u:r:screencap:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=1
08-30 21:03:32.582  4990  4990 I sh      : type=1400 audit(0.0:34): avc: denied { getattr } for path="/system/bin/sh" dev="dm-0" ino=998 scontext=u:r:screencap:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=1
08-30 21:03:32.586  4990  4990 I sh      : type=1400 audit(0.0:35): avc: denied { ioctl } for path="socket:[57515]" dev="sockfs" ino=57515 ioctlcmd=5401 scontext=u:r:screencap:s0 tcontext=u:r:adbd:s0 tclass=unix_stream_socket permissive=1
08-30 21:03:32.586  4990  4990 I sh      : type=1400 audit(0.0:36): avc: denied { getattr } for path="socket:[57515]" dev="sockfs" ino=57515 scontext=u:r:screencap:s0 tcontext=u:r:adbd:s0 tclass=unix_stream_socket permissive=1
08-30 21:03:32.589  4991  4991 I sh      : type=1400 audit(0.0:37): avc: denied { execute_no_trans } for path="/system/bin/am" dev="dm-0" ino=1178 scontext=u:r:screencap:s0 tcontext=u:object_r:system_file:s0 tclass=file permissive=1
08-30 21:03:32.739  4992  4992 I cmd     : type=1400 audit(0.0:38): avc: denied { call } for scontext=u:r:screencap:s0 tcontext=u:r:system_server:s0 tclass=binder permissive=1
08-30 21:03:32.739  4992  4992 I cmd     : type=1400 audit(0.0:39): avc: denied { use } for path="/dev/null" dev="tmpfs" ino=19514 scontext=u:r:system_server:s0 tcontext=u:r:screencap:s0 tclass=fd permissive=1
08-30 21:03:32.739  4992  4992 I cmd     : type=1400 audit(0.0:40): avc: denied { transfer } for scontext=u:r:screencap:s0 tcontext=u:r:system_server:s0 tclass=binder permissive=1
08-30 21:03:32.741   575   575 E SELinux : avc:  denied  { find } for service=activity pid=4992 uid=2000 scontext=u:r:screencap:s0 tcontext=u:object_r:activity_service:s0 tclass=service_manager permissive=1
08-30 21:03:32.749   837   837 I Binder:837_9: type=1400 audit(0.0:41): avc: denied { call } for scontext=u:r:system_server:s0 tcontext=u:r:screencap:s0 tclass=binder permissive=1

If /data/media/ is deleted, the following denials also occur:
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:43): avc: denied { search } for name="0" dev="sda45" ino=1310728 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:44): avc: denied { read open } for path="/data/media/0" dev="sda45" ino=1310728 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:48): avc: denied { write } for name="0" dev="sda45" ino=1310728 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:49): avc: denied { add_name } for name="image.png" scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:50): avc: denied { create } for name="image.png" scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:51): avc: denied { setattr } for name="image.png" dev="sda45" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:53): avc: denied { write open } for path="/data/media/0/image.png" dev="sda45" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
08-31 01:04:29.741  6625  6625 W screencap: type=1400 audit(0.0:23): avc: denied { write } for name="0" dev="sdcardfs" ino=655364 scontext=u:r:screencap:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=0

Test: adb shell screencap -p /sdcard/phone.png
Bug: 65206688
Change-Id: I808429b25fa3118fef7931050ab757c9bcd61881
2017-08-30 18:08:28 -07:00
Tomasz Wasilczyk
e325e36570 Merge "Move Broadcast Radio HAL to a separate binary." into oc-mr1-dev
am: 4f6e5b987d

Change-Id: I3054dc9c9c6d43b9d751b5ceca74671112628cfc
2017-08-29 14:10:02 +00:00
Tomasz Wasilczyk
567b947d85 Move Broadcast Radio HAL to a separate binary.
Bug: 63600413
Test: VTS, instrumentation, audit2allow
Change-Id: I57c0150a52c13f1ce21f9ae2147e3814aad0fb7e
2017-08-28 09:44:50 -07:00
Mark Salyzyn
5249c4277b Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property" am: d27aee3322 am: e028be05dc
am: e5f67cb590

Change-Id: Ie63a32a1b78c63db64a9a3e041c23e0b5953734e
2017-08-25 14:47:56 +00:00
Mark Salyzyn
e028be05dc Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property"
am: d27aee3322

Change-Id: Ia64de6f9da61ce31ae10d8258a3692ce5a0e5815
2017-08-25 14:25:50 +00:00
Mark Salyzyn
006c2e9934 Switch /data/misc/reboot/last_reboot_reason to persistent property
Switch from /data/misc/reboot/last_reboot_reason to persistent
Android property persist.sys.boot.reason for indicating why the
device is rebooted or shutdown.

Introduce protection for all boot reason properties

Protect the following properties with these labels

ro.boot.bootreason      u:object_r:bootloader_boot_reason_prop:s0
sys.boot.reason         u:object_r:sys_boot_reason_prop:s0
persist.sys.boot.reason u:object_r:last_boot_reason_prop:s0

Setup the current as-need access rules for each.

ToDo: Remove u:object_r:reboot_data_file after internal fixes.

Test: system/core/bootstat/boot_reason_test.sh
Bug: 64687998
Change-Id: I3771c73933e8ae2d94aee936c7a38b6282611b80
2017-08-24 15:19:30 -07:00
Jeff Vander Stoep
2faba8e890 system_server: allow writing to timerslack_ns am: 5c41d40ecd am: 4e9601887f am: f1876d58b3
am: c29fd93ca3

Change-Id: I0fb17936f69cf8b3c4080ba853c596786ff61d5f
2017-07-29 02:45:33 +00:00
Jeff Vander Stoep
c29fd93ca3 system_server: allow writing to timerslack_ns am: 5c41d40ecd am: 4e9601887f
am: f1876d58b3

Change-Id: I9b878eace2de33a483f648376f005277ef9283c6
2017-07-29 02:43:02 +00:00