Skip to content
Snippets Groups Projects
  1. Jun 02, 2016
  2. May 24, 2016
    • Fyodor Kupolov's avatar
      SELinux policies for /data/preloads directory · 49ac2a3d
      Fyodor Kupolov authored
      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
      49ac2a3d
  3. May 16, 2016
  4. May 13, 2016
  5. May 12, 2016
  6. May 05, 2016
    • Philip Cuadra's avatar
      Add CAP_IPC_LOCK and pinner to system_server · 96da70eb
      Philip Cuadra authored
      Add pinner service to system_service services.
      Add CAP_IPC_LOCK permissions to system_server in order to allow
      system_server to pin more memory than the lockedmem ulimit.
      
      bug 28251566
      
      Change-Id: I990c73d25fce4f2cc9a2db0015aa238fa7b0e984
      96da70eb
  7. Apr 30, 2016
  8. Apr 23, 2016
    • Nick Kralevich's avatar
      reduce duplicate SELinux rules · 34936824
      Nick Kralevich authored
      When using domain_trans(init, foo_exec, foo), don't add the
      following rule:
      
        allow foo init:process sigchld;
      
      This is already allowed for all domains in domain.te:
      
        # Allow reaping by init.
        allow domain init:process sigchld;
      
      So adding it over and over again is redundant and bloats the
      policy. More specifically, when I run:
      
        sepolicy-analyze out/target/product/bullhead/root/sepolicy dups
      
      this change reduces the number of duplicate policy statements
      from 461 to 389.
      
      Change-Id: I8632e5649a54f63eb1f79ea6405c4b3f515f544c
      34936824
  9. Apr 22, 2016
    • Andreas Gampe's avatar
      Selinux: Policies for otapreopt_chroot and postinstall_dexopt · e5d8a947
      Andreas Gampe authored
      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
      e5d8a947
  10. Apr 20, 2016
    • Christopher Tate's avatar
      Allow system_server to hard link its own files · d9b0a34a
      Christopher Tate authored
      Specifically, backup of wallpaper imagery needs to use hard links to
      achieve "real file" access to the large imagery files without rewriting
      the contents all the time just to stage for backup.  They can't be
      symlinks because the underlying backup mechanisms refuse to act on
      symbolic links for other security reasons.
      
      Bug 25727875
      
      Change-Id: Ic48fba3f94c92a4b16ced27a23646296acf8f3a5
      d9b0a34a
  11. Apr 19, 2016
    • mukesh agrawal's avatar
      allow system server to set log.tag.WifiHAL · e651f6f4
      mukesh agrawal authored
      On eng and userdebug builds (only), allow system server
      to change the value of log.tag.WifiHAL. WifiStateMachine
      will set this property to 'D' by default. If/when a user
      enables "Developer options -> Enable Wi-Fi Verbose Logging",
      WifiStateMachine change log.tag.WifiHAL to 'V'.
      
      BUG=27857554
      TEST=manual (see below)
      
      Test detail
      1. on user build:
         $ adb shell setprop log.tag.WifiHAL V
         $ adb shell getprop log.tag.WifiHAL
         <blank line>
         $ adb bugreport | grep log.tag.WifiHAL
         <11>[  141.918517] init: avc:  denied  { set } for property=log.tag.WifiHAL pid=4583 uid=2000 gid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:wifi_log_prop:s0 tclass=property_service permissive=0
         <11>[  141.918566] init: sys_prop: permission denied uid:2000  name:log.tag.WifiHAL
      2. on userdebug build:
         $ adb shell getprop log.tag.WifiHAL
         $ <blank line>
         $ adb shell setprop log.tag.WifiHAL V
         $ adb shell getprop log.tag.WifiHAL
         V
      3. on userdebug build with modified WifiStateMachine:
         $ adb shell getprop log.tag.WifiHAL
         D
      
      Change-Id: I9cdd52a2b47a3dd1065262ea8c329130b7b044db
      e651f6f4
  12. Apr 14, 2016
  13. Apr 06, 2016
    • Nick Kralevich's avatar
      system_server: neverallow new file exec types · f84b7981
      Nick Kralevich authored
      Add a neverallow rule (CTS test + compile time assertion) blocking
      system_server from executing files outside of a few select file
      types.
      
      In general, it's dangerous to fork()/exec() from within a multi-threaded
      program. See
      https://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-using-them
      This change helps discourage the introduction of new execs.
      
      Bug: 28035297
      Change-Id: Idac824308183fa2cef75f17159dae14447290e5b
      f84b7981
    • Jeff Sharkey's avatar
      Allow system_server to execute timeout. · 75b25dd1
      Jeff Sharkey authored
      We've seen evidence that the logcat binary can end up wedged, which
      means we can eventually starve system_server for FDs.  To mitigate
      this, wrap logcat using the timeout utility to kill and clean up if
      it takes too long to exit.
      
      avc: denied { execute } for name="toybox" dev="mmcblk0p43" ino=457 scontext=u:r:system_server:s0 tcontext=u:object_r:toolbox_exec:s0 tclass=file permissive=1
      avc: denied { read open } for path="/system/bin/toybox" dev="mmcblk0p43" ino=457 scontext=u:r:system_server:s0tcontext=u:object_r:toolbox_exec:s0 tclass=file permissive=1
      avc: denied { execute_no_trans } for path="/system/bin/toybox" dev="mmcblk0p43" ino=457 scontext=u:r:system_server:s0 tcontext=u:object_r:toolbox_exec:s0 tclass=file permissive=1
      
      Bug: 27994717, 28021719, 28009200
      Change-Id: I76d3c7fe5b37fb9a144a3e5dbcc9150dfea495ee
      75b25dd1
  14. Apr 05, 2016
    • Daniel Rosenberg's avatar
      Allow search/getattr access to media_rw_data_file for now. · b80bdef0
      Daniel Rosenberg authored
      With sdcardfs, we no longer have a separate sdcardd acting as
      an intermediate between the outside world and /data/media.
      Unless we modify sdcardfs to change contexts, we need these.
      Added for: system_server, dumpstate, and bluetooth
      
      Remove this patch if sdcardfs is updated to change the
      secontext of fs accesses.
      
      Bug: 27932396
      Change-Id: I294cfe23269b7959586252250f5527f13e60529b
      b80bdef0
  15. Mar 24, 2016
    • dcashman's avatar
      Move sysfs_thermal to global policy and grant access. · df72abb3
      dcashman authored
      sysfs_thermal nodes are common enough to warrant an entry in global
      policy and the new HardwarePropertiesManagerService exists explicitly to
      expose some of this information.
      
      Address the following denials:
      avc: denied { search } for name="thermal" dev="sysfs" ino=17509 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=dir permissive=1
      avc: denied { read } for name="temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
      avc: denied { open } for path="/sys/devices/virtual/thermal/thermal_zone8/temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
      avc: denied { getattr } for path="/sys/devices/virtual/thermal/thermal_zone8/temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
      
      (cherry-pick of internal commit: 98eff7c3)
      
      Bug: 27809332
      Change-Id: I6f812a7e281e348aa24c76b119e71ed95e1a1d9f
      df72abb3
    • dcashman's avatar
      Move sysfs_thermal to global policy and grant access. · 98eff7c3
      dcashman authored
      sysfs_thermal nodes are common enough to warrant an entry in global
      policy and the new HardwarePropertiesManagerService exists explicitly to
      expose some of this information.
      
      Address the following denials:
      avc: denied { search } for name="thermal" dev="sysfs" ino=17509 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=dir permissive=1
      avc: denied { read } for name="temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
      avc: denied { open } for path="/sys/devices/virtual/thermal/thermal_zone8/temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
      avc: denied { getattr } for path="/sys/devices/virtual/thermal/thermal_zone8/temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
      
      Bug: 27809332
      Change-Id: I2dbc737971bf37d197adf0d5ff07cb611199300d
      98eff7c3
    • Pierre Imai's avatar
      Remove references to deleted dhcpcd · c5859951
      Pierre Imai authored
      Change-Id: I0c0bce9cd50a25897f5c4521ee9b4fada6648a59
      c5859951
  16. Mar 21, 2016
  17. Mar 14, 2016
    • dcashman's avatar
      Mark batteryproperties service as app_api_service. · 027ec206
      dcashman authored
      Applications do not explicitly request handles to the batteryproperties
      service, but the BatteryManager obtains a reference to it and uses it
      for its underlying property queries.  Mark it as an app_api_service so
      that all applications may use this API.  Also remove the batterypropreg
      service label, as this does not appear to be used and may have been a
      duplication of batteryproperties.  As a result, remove the
      healthd_service type and replace it with a more specific
      batteryproperties_service type.
      
      (cherry-picked from commit: 9ed71eff)
      
      Bug: 27442760
      Change-Id: I537c17c09145b302728377bf856c1147e4cc37e9
      027ec206
    • dcashman's avatar
      Mark batteryproperties service as app_api_service. · 9ed71eff
      dcashman authored
      Applications do not explicitly request handles to the batteryproperties
      service, but the BatteryManager obtains a reference to it and uses it
      for its underlying property queries.  Mark it as an app_api_service so
      that all applications may use this API.  Also remove the batterypropreg
      service label, as this does not appear to be used and may have been a
      duplication of batteryproperties.  As a result, remove the
      healthd_service type and replace it with a more specific
      batteryproperties_service type.
      
      Bug: 27442760
      Change-Id: I5c0f9d7992ff2ec64adaeef22356e88fd0e8169c
      9ed71eff
  18. Mar 11, 2016
  19. Mar 10, 2016
  20. Mar 09, 2016
    • Makoto Onuki's avatar
      Allow "shortcut manager" icons to be returned to apps · 085c1691
      Makoto Onuki authored
      ... 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
      085c1691
  21. Mar 07, 2016
  22. Mar 03, 2016
    • Stephen Smalley's avatar
      Update netlink socket classes. · 423fd19d
      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: default avatarStephen Smalley <sds@tycho.nsa.gov>
      
      (cherry picked from commit 01d95c23)
      
      Change-Id: Ic00a0d474730cda91ba3bc387e0cc14482f82114
      423fd19d
    • Stephen Smalley's avatar
      Update netlink socket classes. · 01d95c23
      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: default avatarStephen Smalley <sds@tycho.nsa.gov>
      01d95c23
  23. Mar 02, 2016
    • Tao Bao's avatar
      Add /dev/socket/uncrypt. · c285cad1
      Tao Bao authored
      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
      c285cad1
  24. Mar 01, 2016
    • Calin Juravle's avatar
      Add SElinux policies to allow foreign dex usage tracking. · 837bc42f
      Calin Juravle authored
      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
      837bc42f
  25. Feb 23, 2016
    • Jeff Sharkey's avatar
      Offer to cache ringtones in system DE storage. · 62bb52c4
      Jeff Sharkey authored
      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
      62bb52c4
  26. Feb 22, 2016
  27. Feb 18, 2016
    • Lorenzo Colitti's avatar
      Allow the framework to communicate with netd via a binder service · 24dcc8b1
      Lorenzo Colitti authored
      This will allow us to provide a better interface between Java
      services (e.g., ConnectivityService) and netd than the current
      FrameworkListener / NativeDaemonConnector interface which uses
      text strings over a Unix socket.
      
      Bug: 27239233
      Change-Id: If40582ae2820e54f1960556b7bf7e88d98c525af
      24dcc8b1
  28. Feb 13, 2016
    • Jeff Tinker's avatar
      Add mediadrm service · 0d5bac13
      Jeff Tinker authored
      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
      0d5bac13
  29. Feb 10, 2016
  30. Feb 09, 2016
  31. Feb 03, 2016
    • Daichi Hirono's avatar
      Fix SELinux warning when passing fuse FD from system server. · 59e3d7b4
      Daichi Hirono authored
      Before applying the CL, Android shows the following error when passing
      FD of /dev/fuse.
      
      > Binder_2: type=1400 audit(0.0:38): avc: denied { getattr } for
      > path="/dev/fuse" dev="tmpfs" ino=9300 scontext=u:r:system_server:s0
      > tcontext=u:object_r:fuse_device:s0 tclass=chr_file permissive=0
      
      Change-Id: I59dec819d79d4e2e1a8e42523b6f521481cb2afd
      59e3d7b4
  32. Jan 29, 2016
Loading