Commit graph

296 commits

Author SHA1 Message Date
Ajay Panicker
a45672614d Allow bluetooth service to access bluetooth directory and add /logs (6/6)
Bug: 31466840
Change-Id: I3984754034349e6c41de6ae9cccbaab95ca5a918
2016-09-16 20:20:31 +00:00
Martijn Coenen
6b952393f6 Initial hardware servicemanager sepolicy.
Change-Id: I07d188e4dd8801a539db1e9f3edf82a1d662648e
(cherry picked from commit 61a082a55dbc2798d50d0d4b766151d69334729a)
2016-09-14 16:35:34 +00:00
Andreas Gampe
a3a0bb446b Sepolicy: Add otapreopt_slot
(cherry picked from commit eb717421b1)

The new A/B OTA artifact naming scheme includes the target slot so
that the system is robust with respect to unexpected reboots. This
complicates the renaming code after reboot, so it is moved from the
zygote into a simple script (otapreopt_slot) that is hooked into
the startup sequence in init.

Give the script the subset of the rights that the zygote had so that
it can move the artifacts from /data/ota into /data/dalvik-cache.
Relabeling will be done in the init rc component, so relabeling
rights can be completely removed.

Bug: 25612095
Bug: 28069686
Change-Id: Iad56dc3d78ac759f4f2cce65633cdaf1cab7631b
2016-09-13 20:45:39 +00:00
Tao Bao
e06ed7d09a Add ota_package_file label for OTA packages.
(cherry picked from commit 6c3f2831ac)

Allow priv_app, uncrypt, update_engine to access the OTA packages at
/data/ota_package (both A/B and non-A/B). GMSCore (priv_app) checks
the existence of the folder, and downloads the package there if present.

Bug: 28944800
Change-Id: I3c0717861fce7f93b33874a99f6a4a55567612a5
2016-09-13 03:29:37 +00:00
Alex Light
b7ebb32fb2 Allow cppreopts to work with selinux
(cherry picked from commit d3edd6b577)

Bug: 29278988
Change-Id: I199572377a6b5c33116c718a545159ddcf50df30
2016-09-12 21:53:27 +00:00
Mitchell Wills
d48127be41 Merge changes from topic 'wifi-aosp-master' into stage-aosp-master
* changes:
  Allow wificond to drop privileges after startup
  Allow wificond to set interfaces up and down
  Allow wificond to clean up wpa_supplicant state
  Allow wificond to drop signals on hostapd
  Give wificond permission to start/stop init services
  Give hostapd permissions to use its control socket
  Allow wificond to write wifi component config files
  add netlink socket permission for wificond
  SEPolicy to start hostapd via init
  Allow system_server to call wificond via Binder
  Allow wificond to mark interfaces up and down
  Separate permissions to set WiFi related properties
  Define explicit label for wlan sysfs fwpath
  sepolicy: Add permissions for wpa_supplicant binder
  sepolicy: add sepolicy binder support for wificond
  Sepolicy files for wificond
2016-08-29 20:03:20 +00:00
Jeff Vander Stoep
0474e7c5f5 resurrect camera_device
(cherry picked from commit e8a53dff5b)

With the breakup of mediaserver, distinguishing between
camera_device and video_device is meaningful. Only grant
cameraserver access to camera_device.

Bug: 28359909
Change-Id: I0ae12f87bac8a5c912f0a693d1d56a8d5af7f3f3
2016-08-28 15:36:33 -07:00
Christopher Wiley
d29c1a0af2 SEPolicy to start hostapd via init
While here, remove a lot of extra permissions that we apparently
had because hostapd was inheriting fds from netd.

Bug: 30041118
Test: netd can request init to start/stop hostapd without denials.

Change-Id: Ia777497443a4226a201030eccb9dfc5a40f015dd
(cherry picked from commit 8a6c5f8553)
2016-08-26 13:18:05 -07:00
Christopher Wiley
97db27d8c5 Define explicit label for wlan sysfs fwpath
avc: denied { write } for name="fwpath" dev="sysfs" ino=6863
scontext=u:r:wificond:s0 tcontext=u:object_r:sysfs_wlan_fwpath:s0
tclass=file permissive=0

Test: wificond and netd can write to this path, wifi works
Test: `runtest frameworks-wifi` passes

Bug: 29579539

Change-Id: Ia21c654b00b09b9fe3e50d564b82966c9c8e6994
(cherry picked from commit 7d13dd806f)
2016-08-26 13:15:41 -07:00
Ningyuan Wang
3cbf14a183 Sepolicy files for wificond
This sepolicy change allows wificond to run as a deamon.

BUG=28865186
TEST=compile
TEST=compile with ag/1059605
  Add wificond to '/target/product/base.mk'
  Adb shell ps -A | grep 'wificond'

Change-Id: If1e4a8542ac03e8ae42371d75aa46b90c3d8545d
(cherry picked from commit 4ef44a616e)
2016-08-26 13:13:51 -07:00
Andreas Gampe
47b373af33 Sepolicy: allow dex2oatd and patchoatd
Give debug versions the same rights as non-debug versions for
ART.

Change-Id: I9906d100c3857c3a87344ff37aabc53107562c61
2016-08-25 19:36:49 -07:00
Elliott Hughes
98fbb31855 Merge \"Simplify /dev/kmsg SELinux policy.\"
am: aa2aa21902

Change-Id: I5e1634a8c0cee6cb759e0acea086b68dbd21fb7e
2016-07-27 15:47:13 +00:00
Elliott Hughes
63b33dc2db Simplify /dev/kmsg SELinux policy.
Bug: http://b/30317429
Change-Id: I5c499c48d5e321ebdf588a162d29e949935ad8ee
Test: adb shell dmesg | grep ueventd
2016-07-26 09:46:20 -07:00
David Sehr
90b0089568 SELinux policy for /data/misc/profman
am: a5d0792508

* commit 'a5d07925080f59073b03d24d3997aecd6d4bbf2c':
  SELinux policy for /data/misc/profman

Change-Id: I1329afb3191abaa1b08ce9a706228a02a0c53a47
2016-06-01 14:01:32 +00:00
David Sehr
a5d0792508 SELinux policy for /data/misc/profman
Bug: 28748264
Change-Id: I872c25666707beb737f3ce7a4f706c0135df7ad5
2016-05-31 17:36:41 -07:00
Fyodor Kupolov
72f0fbb2f7 SELinux policies for /data/preloads directory
am: 49ac2a3d7a

* commit '49ac2a3d7a40d998e3b1be0b0172be8f651bc935':
  SELinux policies for /data/preloads directory

Change-Id: Ib928cda316ef31f361ad09ef29b264eb9df754d5
2016-05-24 22:18:41 +00:00
Fyodor Kupolov
49ac2a3d7a SELinux policies for /data/preloads directory
A new directory is created in user data partition that contains preloaded
content such as a retail mode demo video and pre-loaded APKs.

The new directory is writable/deletable by system server. It can only be
readable (including directory list) by privileged or platform apps

Bug: 28855287
Change-Id: I3816cd3a1ed5b9a030965698a66265057214f037
2016-05-24 20:17:45 +00:00
Patrick Tjin
2a52d92810 sepolicy: add support for devices without cache partition
am: ad7a0ad2ce

* commit 'ad7a0ad2ce259de8146fe79c21e5f7fac2569b6f':
  sepolicy: add support for devices without cache partition

Change-Id: I0a81cd1aafb01cd722e5cf452cd8dd2e3b136bd4
2016-05-14 03:36:08 +00:00
Patrick Tjin
ad7a0ad2ce sepolicy: add support for devices without cache partition
Adds the rules for /data/cache used for devices which do
not have a cache partition.

Bug: 28747374
Change-Id: I7c749e7692c9b8eab02029bbae5a3c78585030da
2016-05-13 22:55:20 +00:00
Jeff Vander Stoep
e806cc9699 move gpsd domain to device specific policy am: 3ba2d46616
am: 30a5ea5c72

* commit '30a5ea5c72e61ac2a2025d938e644847ea31efc7':
  move gpsd domain to device specific policy

Change-Id: If892add123561972e6008615ce055de5c6befa9c
2016-05-13 00:15:05 +00:00
Jeff Vander Stoep
3ba2d46616 move gpsd domain to device specific policy
Only used by Flounder.

Bug: 8435593
Change-Id: I06655e897ab68a1724190950e128cd390617f2bd
2016-05-12 15:46:07 -07:00
Andreas Gampe
c46ef41cfe Merge "Selinux: Policies for otapreopt_chroot and postinstall_dexopt" into nyc-dev
am: 8785a647a1

* commit '8785a647a15a5bf49c64756f59a48e1b4d551be3':
  Selinux: Policies for otapreopt_chroot and postinstall_dexopt

Change-Id: Icf7e37c3f1e6141d04a21a1b8ce4cd88bf185dbc
2016-04-22 16:09:29 +00:00
Andreas Gampe
e5d8a947bd Selinux: Policies for otapreopt_chroot and postinstall_dexopt
Give mount & chroot permissions to otapreopt_chroot related to
postinstall.

Add postinstall_dexopt for otapreopt in the B partition. Allow
the things installd can do for dexopt. Give a few more rights
to dex2oat for postinstall files.

Allow postinstall files to call the system server.

Bug: 25612095
Change-Id: If7407473d50c9414668ff6ef869c2aadd14264e7
2016-04-21 22:41:56 -07:00
Mark Salyzyn
05806470b7 Add recovery_persist & recovery_refresh
(cherry pick from commit 16fe52c90c)

One time executables. recovery_refresh can be used at any time to
ensure recovery logs in pmsg are re-placed at the end of the FIFO.
recovery_persist takes the recovery logs in pmsg and drops them
into /data/misc/recovery/ directory.

Bug: 27176738
Change-Id: Ife3cf323930fb7a6a5d1704667961f9d42bfc5ac
2016-03-24 12:48:26 -07:00
Mark Salyzyn
000c03b481 Add recovery_persist & recovery_refresh
am: 16fe52c

* commit '16fe52c90caae18c0d91918d6bfc471f2e637207':
  Add recovery_persist & recovery_refresh
2016-03-24 19:37:02 +00:00
Mark Salyzyn
16fe52c90c Add recovery_persist & recovery_refresh
One time executables. recovery_refresh can be used at any time to
ensure recovery logs in pmsg are re-placed at the end of the FIFO.
recovery_persist takes the recovery logs in pmsg and drops them
into /data/misc/recovery/ directory.

Bug: 27176738
Change-Id: Ife3cf323930fb7a6a5d1704667961f9d42bfc5ac
2016-03-24 11:30:29 -07:00
dcashman
f100b2c4e6 Create sysfs_hwrandom type.
HwRngTest needs access to the hwrandom sysfs files, but untrused_app
does not have access to sysfs.  Give these files their own label and
allow the needed read access.

(cherry-pick from internal commit: 85c0f8affa)

Bug: 27263241
Change-Id: If572ad0931a534d76e148b688b76687460e99af9
2016-03-14 10:27:33 -07:00
dcashman
7fa51de7f1 Merge "Create sysfs_hwrandom type." into nyc-dev
am: 9404522aeb

* commit '9404522aebd395d4a58bd3dfd0ac7d5a394af816':
  Create sysfs_hwrandom type.
2016-03-14 17:21:31 +00:00
Daniel Cashman
9404522aeb Merge "Create sysfs_hwrandom type." into nyc-dev 2016-03-14 17:14:26 +00:00
Janis Danisevskis
e249da09fe Leftovers of SELinux policy reload mechanism
am: 1c983327cf

* commit '1c983327cf7e841183da15934c7ba2e99d0979c0':
  Leftovers of SELinux policy reload mechanism
2016-03-13 14:52:43 +00:00
dcashman
85c0f8affa Create sysfs_hwrandom type.
HwRngTest needs access to the hwrandom sysfs files, but untrused_app
does not have access to sysfs.  Give these files their own label and
allow the needed read access.

Bug: 27263241
Change-Id: I718ba485e9e6627bac6e579f746658d85134b24b
2016-03-11 15:44:44 -08:00
Janis Danisevskis
1c983327cf Leftovers of SELinux policy reload mechanism
Remove references to /data/security and the corresponding
type securitly_file.

Bug: 26544104
Change-Id: Iac00c293daa6b781a24c2bd4c12168dfb1cceac6
2016-03-11 17:48:19 +00:00
Oleksandr Peletskyi
33fe4784c3 Modified security policy to allow user to get their own icon.
BUG: 27583869
Change-Id: I0a25bd03f3998d48dba355b91140611e38ce7b0d
2016-03-10 14:11:36 +01:00
Makoto Onuki
085c16914c Allow "shortcut manager" icons to be returned to apps
... and client apps to read them.

A full path looks like this:
/data/system_ce/[user-id]/shortcut_service/bitmaps/[creator-app-package]/[timestamp].png

System server will:
- Create/delete the directories.
- Write/remove PNG files in them.
- Open the PNG files and return file descriptors to client apps

Client apps will:
- Receive file descriptors and read from them.

Bug 27548047

Change-Id: I3d9ac6ab0c92b2953b84c3c5aabe1f653e6bea6b
2016-03-08 17:09:27 -08:00
Alex Deymo
a52b561859 New postinstall domain and rules to run post-install program.
When using the A/B updater, a device specific hook is sometimes needed
to run after the new partitions are updated but before rebooting into
the new image. This hook is referred to throughout the code as the
"postinstall" step.

This patch creates a new execution domain "postinstall" which
update_engine will use to run said hook. Since the hook needs to run
from the new image (namelly, slot "B"), update_engine needs to
temporarly mount this B partition into /postinstall and then run a
program from there.

Since the new program in B runs from the old execution context in A, we
can't rely on the labels set in the xattr in the new filesystem to
enforce the policies baked into the old running image. Instead, when
temporarily mounting the new filesystem in update_engine, we override
all the new file attributes with the new postinstall_file type by
passing "context=u:object_r:postinstall_file:s0" to the mount syscall.
This allows us to set new rules specific to the postinstall environment
that are consistent with the rules in the old system.

Bug: 27177071
TEST=Deployed a payload with a trivial postinstall script to edison-eng.

(cherry picked from commit 6cb2c893b1)

Change-Id: I49a529eecf1ef0524819470876ef7c8c2659c7ef
2016-03-04 15:49:15 -08:00
Tao Bao
acf4e09999 Merge "Add /dev/socket/uncrypt." into nyc-dev 2016-03-03 19:52:46 +00:00
Alex Deymo
6cb2c893b1 New postinstall domain and rules to run post-install program.
When using the A/B updater, a device specific hook is sometimes needed
to run after the new partitions are updated but before rebooting into
the new image. This hook is referred to throughout the code as the
"postinstall" step.

This patch creates a new execution domain "postinstall" which
update_engine will use to run said hook. Since the hook needs to run
from the new image (namelly, slot "B"), update_engine needs to
temporarly mount this B partition into /postinstall and then run a
program from there.

Since the new program in B runs from the old execution context in A, we
can't rely on the labels set in the xattr in the new filesystem to
enforce the policies baked into the old running image. Instead, when
temporarily mounting the new filesystem in update_engine, we override
all the new file attributes with the new postinstall_file type by
passing "context=u:object_r:postinstall_file:s0" to the mount syscall.
This allows us to set new rules specific to the postinstall environment
that are consistent with the rules in the old system.

Bug: 27177071
TEST=Deployed a payload with a trivial postinstall script to edison-eng.

Change-Id: Ib06fab92afb45edaec3c9c9872304dc9386151b4
2016-03-02 15:33:12 -08:00
Tao Bao
c285cad1a6 Add /dev/socket/uncrypt.
system_server used to communicate with uncrypt via files (e.g.
/cache/recovery/command and /cache/recovery/uncrypt_status). Since A/B
devices may not have /cache partitions anymore, we switch to communicate
via /dev/socket/uncrypt to allow things like factory reset to keep
working.

Bug: 27176738
Change-Id: I73b6d6f1ecdf16fd4f3600b5e524da06f35b5bca
2016-03-02 10:51:13 -08:00
Calin Juravle
837bc42f5f Add SElinux policies to allow foreign dex usage tracking.
This is a special profile folder where apps will leave profile markers
for the dex files they load and don't own. System server will read the
markers and decide which apk should be fully compiled instead of
profile guide compiled.

Apps need only to be able to create (touch) files in this directory.
System server needs only to be able to check wheter or not a file with a
given name exists.

Bug: 27334750
Bug: 26080105

Change-Id: I2256e4aba1ec0e5117de6497123223b9a74f404e
2016-03-01 15:50:08 +00:00
Glenn Kasten
a33fbb3cf8 Merge "Restore audio tee sink" into nyc-dev 2016-02-24 16:50:23 +00:00
Glenn Kasten
962e3a6a05 Restore audio tee sink
Bug: 27323882
Change-Id: Idf3977d74817c4f90f9e993d2e1e5302cc56f41d
2016-02-23 16:16:16 -08:00
Jeff Sharkey
62bb52c4d4 Offer to cache ringtones in system DE storage.
Ringtones often live on shared media, which is now encrypted with CE
keys and not available until after the user is unlocked.  To improve
the user experience while locked, cache the default ringtone,
notification sound, and alarm sound in a DE storage area.

Also fix bug where wallpaper_file wasn't getting data_file_type.

Bug: 26730753
Change-Id: Ib1f08d03eb734c3dce91daab41601d3ed14f4f0d
2016-02-23 13:45:29 -07:00
Calin Juravle
89625c9a64 Update permissions for the dedicated profile folders
Bug: 26719109
Bug: 26563023

Change-Id: Ie0ca764467c874c061752cbbc73e1bacead9b995
2016-02-19 13:40:33 +00:00
Christopher Tate
2e1556dc76 Track wallpaper API changes
Bug 25454162

Change-Id: I3cd299ce28bf6235605265c47762969851845b78
2016-02-18 22:56:42 +00:00
Jeff Tinker
0d5bac13e1 Add mediadrm service
Part of media security hardening

This is an intermediate step toward moving
mediadrm to a new service separate from mediaserver.
This first step allows mediadrmservice to run based
on the system property media.mediadrmservice.enable
so it can be selectively enabled on devices that
support using native_handles for secure buffers.

bug: 22990512
Change-Id: I2208c1e87a6bd8d5bfaed06b1fdcb0509c11cff2
2016-02-12 19:38:22 -08:00
Marco Nelissen
c3ba2e5130 selinux rules for codec process
Bug: 22775369

Change-Id: Ic6abe3d0e18ba6f7554d027e0ec05fd19011709b
2016-02-09 14:13:13 -08:00
Andreas Gampe
47ebae1a7a Selinux: introduce policy for OTA preopt
Add permissions to dex2oat, introduce otapreopt binary and otadexopt
service.

Bug: 25612095
Change-Id: I80fcba2785e80b2931d7d82bb07474f6cd0099f7
2016-02-04 16:58:43 -08:00
Christopher Tate
b8104a47dd Move staged backup content to a specific cache subdir
Also narrowly specify the domain for the local transport's bookkeeping.

Bug 26834865

Change-Id: I2eea8a10f29356ffecabd8e102f7afa90123c535
2016-01-29 14:05:35 -08:00
Chris Tate
02bffbb8dc Merge "Add rules for original + processed wallpaper files" 2016-01-29 00:38:36 +00:00
Christopher Tate
fdeeb59bdb Add rules for original + processed wallpaper files
Bug 25454501

Change-Id: I31357e658ecdbcc69df47fbc2d22e4849dd1539b
2016-01-28 13:52:09 -08:00