Skip to content
Snippets Groups Projects
  1. Jul 29, 2015
  2. Jul 08, 2015
    • William Roberts's avatar
      neverallow: domain execute data_file_type · 7028bdcc
      William Roberts authored
      
      To help reduce code injection paths, a neverallow is placed
      to prevent domain, sans untrusted_app and shell, execute
      on data_file_type. A few data_file_type's are also exempt
      from this rule as they label files that should be executable.
      
      Additional constraints, on top of the above, are placed on domains
      system_server and zygote. They can only execute data_file_type's
      of type dalvikcache_data_file.
      
      Change-Id: I15dafbce80ba2c85a03c23128eae4725703d5f02
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      7028bdcc
  3. Jun 09, 2015
    • Tao Bao's avatar
      Allow system server and uncrypt to operate pipe file · 51b33ac9
      Tao Bao authored
      System server and uncrypt need to communicate with a named pipe on the
      /cache partition. It will be created and deleted by system server.
      
      Bug: 20012567
      Bug: 20949086
      (cherry picked from commit 70c6dbf0)
      Change-Id: I4ddc523c2a0f4218877dae8f8a9b7fcf3f786625
      51b33ac9
  4. May 18, 2015
    • dcashman's avatar
      Label /dev/rtc0 as rtc_device. · c7594898
      dcashman authored
      Grant access to system_server, as it is used by AlarmManagerService.
      
      Change-Id: I4f099fe30ba206db07d636dd454d43d3df9d3015
      c7594898
  5. May 14, 2015
  6. May 12, 2015
  7. May 07, 2015
    • William Roberts's avatar
      Replace unix_socket_connect() and explicit property sets with macro · 625a3526
      William Roberts authored
      
      A common source of mistakes when authoring sepolicy is properly
      setting up property sets. This is a 3 part step of:
      1. Allowing the unix domain connection to the init/property service
      2. Allowing write on the property_socket file
      3. Allowing the set on class property_service
      
      The macro unix_socket_connect() handled 1 and 2, but could be
      confusing for first time policy authors. 3 had to be explicitly
      added.
      
      To correct this, we introduce a new macros:
      set_prop(sourcedomain, targetprop)
      
      This macro handles steps 1, 2 and 3.
      
      No difference in sediff is expected.
      
      Change-Id: I630ba0178439c935d08062892990d43a3cc1239e
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@linux.intel.com>
      625a3526
  8. Apr 09, 2015
    • Nick Kralevich's avatar
      gatekeeperd: neverallow non-system_server binder call · 2234f9ff
      Nick Kralevich authored
      The current neverallow rule (compile time assertion)
      
        neverallow { domain -gatekeeperd -system_server } gatekeeper_service:service_manager find;
      
      asserts that no rule is present which allows processes other than
      system_server from asking servicemanager for a gatekeeperd token.
      
      However, if system_server leaks the token to other processes, it may
      be possible for those processes to access gatekeeperd directly, bypassing
      servicemanager.
      
      Add a neverallow rule to assert that no process other than system_server
      are allowed to make binder calls to gatekeeperd. Even if another process
      was to manage to get a binder token to gatekeeperd, it would be useless.
      
      Remove binder_service() from gatekeeperd. The original use of the
      binder_service() macro was to widely publish a binder service.
      If this macro is present and the calling process has a gatekeeperd
      binder token, it's implicitly possible for the following processes
      to make a binder call to gatekeeperd:
      
       * all app processes
       * dumpstate
       * system_server
       * mediaserver
       * surfaceflinger
      
      Removing binder_service revokes this implicit access.
      
      Add explicit access for system_server to make binder calls to
      gatekeeperd.
      
      Add explicit access for gatekeeperd to make calls to keystore.
      This was implicitly granted via binder_service() before, but now
      needs to be explicit.
      
      Change-Id: I23c1573d04ab670a42660d5922b39eecf4265b66
      2234f9ff
    • dcashman's avatar
      Enforce more specific service access. · bd7f5803
      dcashman authored
      Move the remaining services from tmp_system_server_service to appropriate
      attributes and remove tmp_system_server and associated logging:
      
      registry
      restrictions
      rttmanager
      scheduling_policy
      search
      sensorservice
      serial
      servicediscovery
      statusbar
      task
      textservices
      telecom_service
      trust_service
      uimode
      updatelock
      usagestats
      usb
      user
      vibrator
      voiceinteraction
      wallpaper
      webviewupdate
      wifip2p
      wifi
      window
      
      Bug: 18106000
      Change-Id: Ia0a6d47099d82c53ba403af394537db6fbc71ca0
      bd7f5803
  9. Apr 08, 2015
    • dcashman's avatar
      Enforce more specific service access. · 03a6f64f
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      network_management
      network_score
      notification
      package
      permission
      persistent
      power
      print
      processinfo
      procstats
      
      Bug: 18106000
      Change-Id: I9dfb41fa41cde72ef0059668410a2e9eb1af491c
      03a6f64f
    • Nick Kralevich's avatar
      system_server: support hard linking for split APKs · 9bef2502
      Nick Kralevich authored
      Commit 85ce2c70 removed hard link
      support from create_file_perms, but system_server requires hard
      link support for split APKs. Allow it.
      
      Addresses the following denial:
      
        audit(0.0:152): avc: denied { link } for name="base.apk" dev="dm-0" ino=816009 scontext=u:r:system_server:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0
      
      Steps to reproduce:
      1) Find the directory "hellogoogle3.splitapk"
      2) adb install-multiple -r hellogoogle3_incremental.apk
      3) adb install-multiple -r -p com.google.android.samples.hellogoogle3 native.apk
      
      Expected:
        2nd APK installs successfully.
      
      Actual:
        2nd APK fails to install.
      
      Change-Id: Ib69fc70dd1c7cd158590db3fd117d6b05acf1cf7
      9bef2502
  10. Apr 07, 2015
    • Nick Kralevich's avatar
      Allow system_server to collect app heapdumps (debug builds only) · 8a06c077
      Nick Kralevich authored
      On debuggable builds, system_server can request app heap dumps
      by running something similar to the following commands:
      
        % adb shell am set-watch-heap com.android.systemui 1048576
        % adb shell dumpsys procstats --start-testing
      
      which will dump the app's heap to /data/system/heapdump. See
      framework/base commit b9a5e4ad30c9add140fd13491419ae66e947809d.
      
      Allow this behavior.
      
      Addresses the following denial:
      
        avc: denied { write } for path="/data/system/heapdump/javaheap.bin" dev="dm-0" ino=150747 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
      
      Bug: 20073185
      Change-Id: I4b925033a5456867caf2697de6c2d683d0743540
      8a06c077
    • dcashman's avatar
      Enforce more specific service access. · 91b7c67d
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      jobscheduler
      launcherapps
      location
      lock_settings
      media_projection
      media_router
      media_session
      mount
      netpolicy
      netstats
      
      Bug: 18106000
      Change-Id: Ia82d475ec41f658851f945173c968f4abf57e7e1
      91b7c67d
    • dcashman's avatar
      Enforce more specific service access. · 3cc6fc5f
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      diskstats
      display
      dreams
      dropbox
      ethernet
      fingerprint
      graphicstats
      hardware
      hdmi_control
      input_method
      input_service
      
      Bug: 18106000
      Change-Id: Iadd8aab9e78d9d39fb00cf0b5a95fa1927d02095
      3cc6fc5f
    • Fyodor Kupolov's avatar
      Allow system_server to read oat dir · 3af8c9d0
      Fyodor Kupolov authored
      Required for PackageManagerService to perform restorecon recursively on a
      staging dir.
      
      Addresses the following denial:
      avc: denied { open } for name="oat" dev="mmcblk0p28" ino=163027 scontext=u:r:system_server:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=dir
      
      Bug: 19550105
      Bug: 20087446
      Change-Id: I0f6ebb79745091ecb4d6d3dbe92f65606b7469da
      3af8c9d0
    • dcashman's avatar
      Enforce more specific service access. · d4c78f4b
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      battery
      bluetooth_manager
      clipboard
      commontime_management
      connectivity
      content
      country_detector
      device_policy
      deviceidle
      
      Bug: 18106000
      Change-Id: I0d0f2a075c0509a783631d88ba453ac13399cdf2
      d4c78f4b
    • Jeff Sharkey's avatar
      Initial policy for expanded storage. · 73d9c2a9
      Jeff Sharkey authored
      Expanded storage supports a subset of the features of the internal
      data partition.  Mirror that policy for consistency.  vold is also
      granted enough permissions to prepare initial directories.
      
      avc: denied { write } for name="ext" dev="tmpfs" ino=3130 scontext=u:r:vold:s0 tcontext=u:object_r:mnt_ext_file:s0 tclass=dir permissive=1
      avc: denied { add_name } for name="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" scontext=u:r:vold:s0 tcontext=u:object_r:mnt_ext_file:s0 tclass=dir permissive=1
      avc: denied { create } for name="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" scontext=u:r:vold:s0 tcontext=u:object_r:mnt_ext_file:s0 tclass=dir permissive=1
      avc: denied { setattr } for name="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" dev="tmpfs" ino=7243 scontext=u:r:vold:s0 tcontext=u:object_r:mnt_ext_file:s0 tclass=dir permissive=1
      avc: denied { mounton } for path="/mnt/ext/57f8f4bc-abf4-655f-bf67-946fc0f9f25b" dev="tmpfs" ino=7243 scontext=u:r:vold:s0 tcontext=u:object_r:mnt_ext_file:s0 tclass=dir permissive=1
      
      avc: denied { getattr } for path="/mnt/ext" dev="tmpfs" ino=3130 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:mnt_ext_file:s0 tclass=dir permissive=1
      
      avc: denied { setattr } for name="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" dev="tmpfs" ino=4471 scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir permissive=1
      avc: denied { getattr } for path="/mnt/expand/57f8f4bc-abf4-655f-bf67-946fc0f9f25b/media" dev="dm-0" ino=145153 scontext=u:r:vold:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
      
      avc: denied { rmdir } for name="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" dev="tmpfs" ino=6380 scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir permissive=1
      
      avc: denied { create } for name="tmp" scontext=u:r:vold:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=1
      avc: denied { setattr } for name="tmp" dev="dm-0" ino=72578 scontext=u:r:vold:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=1
      
      Bug: 19993667
      Change-Id: I73c98b36e7c066f21650a9e16ea82c5a0ef3d6c5
      73d9c2a9
  11. Apr 06, 2015
    • Andres Morales's avatar
      SELinux permissions for gatekeeper TEE proxy · e207986e
      Andres Morales authored
      sets up:
      - execute permissions
      - binder permission (system_server->gatekeeper->keystore)
      - prevents dumpstate and shell from finding GK binder service
      - neverallow rules for prohibited clients
      
      Change-Id: I1817933a91de625db469a20c7a4c8e2ca46efa1e
      e207986e
    • dcashman's avatar
      Assign app_api_service attribute to services. · 4cdea7fc
      dcashman authored
      Assign the alarm, appwidget, assetatlas, audio, backup and batterystats services
      the appropriate service access levels and move into enforcing.
      
      Bug: 18106000
      Change-Id: If3210bb25f3076edfdb6eec36ef6521ace1bd8d7
      4cdea7fc
  12. Apr 03, 2015
    • dcashman's avatar
      Assign app_api_service attribute to services. · b075338d
      dcashman authored
      Move accessibility, account, appops and activity services into enforcing with
      app_api_service level of access, with additional grants to mediaserver and
      isolated app.
      
      Bug: 18106000
      Change-Id: I1d5a79b9223026415f1690e8e9325ec4c270e3dd
      b075338d
  13. Apr 01, 2015
    • dcashman's avatar
      Remove obsolete system_server auditallow logging. · 513d77b5
      dcashman authored
      system_server no longer has universal service_manager_type permissions and so no
      longer needs the auditallow rules therewith associated.
      
      Change-Id: I1e6584c120f6fc464a4bf6b377d9d7ea90441477
      513d77b5
    • dcashman's avatar
      Record observed service accesses. · 8af4e9cb
      dcashman authored
      Get ready to switch system_server service lookups into enforcing.
      
      Bug: 18106000
      Change-Id: Iefd4b2eee6cdd680f5ab423d15cc72a2a30e27cf
      8af4e9cb
  14. Mar 31, 2015
    • Chad Brubaker's avatar
      Add keystore add_auth · 8927772c
      Chad Brubaker authored
      This is for the new addAuthToken keystore method from
      I7f7647d9a36ea453ec6d62fc84087ca8f76e53dd. These tokens will be used to
      authorize keymaster operations. The tokens are HMAC'd and so shouldn't
      be fakeable but this is still limited to system_server only.
      
      Change-Id: I3ff46b676ecac8a878d3aa0a25ba9a8b0c5e1f47
      8927772c
    • Jeff Sharkey's avatar
      Updated policy for external storage. · f063f461
      Jeff Sharkey authored
      An upcoming platform release is redesigning how external storage
      works.  At a high level, vold is taking on a more active role in
      managing devices that dynamically appear.
      
      This change also creates further restricted domains for tools doing
      low-level access of external storage devices, including sgdisk
      and blkid.  It also extends sdcardd to be launchable by vold, since
      launching by init will eventually go away.
      
      For compatibility, rules required to keep AOSP builds working are
      marked with "TODO" to eventually remove.
      
      Slightly relax system_server external storage rules to allow calls
      like statfs().  Still neverallow open file descriptors, since they
      can cause kernel to kill us.
      
      Here are the relevant violations that this CL is designed to allow:
      
      avc: denied { search } for name="user" dev="tmpfs" ino=7441 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
      avc: denied { getattr } for path="/mnt/user/0" dev="tmpfs" ino=6659 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
      avc: denied { write } for name="user" dev="tmpfs" ino=6658 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
      avc: denied { add_name } for name="10" scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
      avc: denied { create } for name="10" scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
      avc: denied { setattr } for name="10" dev="tmpfs" ino=11348 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
      avc: denied { search } for name="/" dev="tmpfs" ino=3131 scontext=u:r:zygote:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { getattr } for path="/storage" dev="tmpfs" ino=6661 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { getattr } for path="/storage/self" dev="tmpfs" ino=6659 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
      avc: denied { getattr } for path="/storage" dev="tmpfs" ino=6661 scontext=u:r:untrusted_app:s0:c522,c768 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { getattr } for path="/storage/self" dev="tmpfs" ino=11348 scontext=u:r:untrusted_app:s0:c522,c768 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
      avc: denied { getattr } for path="/storage" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { read } for name="/" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { open } for name="/" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { search } for name="/" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { write } for name="data" dev="tmpfs" ino=11979 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { add_name } for name="com.google.android.music" scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { create } for name="com.google.android.music" scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { use } for path="socket:[8297]" dev="sockfs" ino=8297 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fd
      avc: denied { read write } for path="socket:[8297]" dev="sockfs" ino=8297 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=netlink_kobject_uevent_socket
      avc: denied { read } for path="pipe:[8298]" dev="pipefs" ino=8298 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fifo_file
      avc: denied { write } for path="pipe:[8298]" dev="pipefs" ino=8298 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fifo_file
      avc: denied { mounton } for path="/storage/emulated" dev="tmpfs" ino=8913 scontext=u:r:sdcardd:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { getattr } for path="/storage" dev="tmpfs" ino=7444 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { getattr } for path="/storage/self/primary" dev="tmpfs" ino=7447 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_file:s0 tclass=lnk_file
      avc: denied { read } for name="primary" dev="tmpfs" ino=7447 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_file:s0 tclass=lnk_file
      avc: denied { getattr } for path="/mnt/user" dev="tmpfs" ino=7441 scontext=u:r:system_server:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
      avc: denied { read } for name="disk:179,128" dev="tmpfs" ino=3224 scontext=u:r:sgdisk:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
      avc: denied { open } for path="/dev/block/vold/disk:179,128" dev="tmpfs" ino=3224 scontext=u:r:sgdisk:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
      avc: denied { getattr } for path="/dev/block/vold/disk:179,128" dev="tmpfs" ino=3224 scontext=u:r:sgdisk:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
      avc: denied { read } for name="/" dev="fuse" ino=0 scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
      avc: denied { open } for path="/storage/public:81F3-13EC" dev="fuse" ino=0 scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
      avc: denied { write } for name="data" dev="fuse" ino=2 scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
      avc: denied { add_name } for name="com.google.android.googlequicksearchbox" scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
      avc: denied { create } for name="com.google.android.googlequicksearchbox" scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
      avc: denied { getattr } for path="/dev/block/vold/public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
      avc: denied { read } for name="public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
      avc: denied { open } for path="/dev/block/vold/public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
      avc: denied { ioctl } for path="/dev/block/vold/public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
      avc: denied { use } for path="pipe:[3264]" dev="pipefs" ino=3264 scontext=u:r:sgdisk:s0 tcontext=u:r:vold:s0 tclass=fd
      avc: denied { use } for path="pipe:[3264]" dev="pipefs" ino=3264 scontext=u:r:sgdisk:s0 tcontext=u:r:vold:s0 tclass=fd
      avc: denied { search } for name="block" dev="tmpfs" ino=2494 scontext=u:r:sgdisk:s0 tcontext=u:object_r:block_device:s0 tclass=dir
      avc: denied { use } for path="pipe:[4200]" dev="pipefs" ino=4200 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fd
      avc: denied { use } for path="pipe:[4200]" dev="pipefs" ino=4200 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fd
      avc: denied { search } for name="/" dev="tmpfs" ino=3131 scontext=u:r:sdcardd:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      avc: denied { search } for name="media_rw" dev="tmpfs" ino=3127 scontext=u:r:sdcardd:s0 tcontext=u:object_r:mnt_media_rw_file:s0 tclass=dir
      avc: denied { getattr } for path="pipe:[3648]" dev="pipefs" ino=3648 scontext=u:r:blkid:s0 tcontext=u:r:vold:s0 tclass=fifo_file
      avc: denied { use } for path="/dev/pts/12" dev="devpts" ino=15 scontext=u:r:fsck:s0 tcontext=u:r:vold:s0 tclass=fd
      avc: denied { use } for path="/dev/pts/12" dev="devpts" ino=15 scontext=u:r:fsck:s0 tcontext=u:r:vold:s0 tclass=fd
      avc: denied { use } for path="pipe:[4182]" dev="pipefs" ino=4182 scontext=u:r:fsck:s0 tcontext=u:r:vold:s0 tclass=fd
      
      Change-Id: Idf3b8561baecf7faa603fac5ababdcc5708288e1
      f063f461
  15. Mar 27, 2015
  16. Mar 12, 2015
    • Nick Kralevich's avatar
      Revert "allow system_server to set kernel scheduling priority" · cd14eb44
      Nick Kralevich authored
      Periodically, SELinux denials of the form:
      
        type=1400 audit(0.0:8574): avc: denied { setsched } for comm="system_server" scontext=u:r:system_server:s0 tcontext=u:r:kernel:s0 tclass=process permissive=0
      
      are being generated. These denials come from system_server and other
      processes. There's no reason why system_server should be calling
      sched_setscheduler() on a kernel thread.
      
      Current belief is that these SELinux denials are a bug in the kernel,
      and are being inappropriately triggered.
      
      Revert 2d1650f4. The original reason
      for accepting this change was to see if it would fix bug 18085992.
      Unfortunately, even after the commit, the bug was still present.
      The change had no impact on the bug.
      
      Don't inappropriately grant system_server the ability to minipulate
      the scheduling priority of kernel threads.
      
      This reverts commit 2d1650f4.
      
      Change-Id: I59bdf26ad247a02b741af2fa58a18e7e83ef44d8
      cd14eb44
  17. Mar 11, 2015
  18. Mar 09, 2015
    • dcashman's avatar
      Only allow system_server to send commands to zygote. · 8f81dcad
      dcashman authored
      Add neverallow rules to ensure that zygote commands are only taken from
      system_server.
      
      Also remove the zygote policy class which was removed as an object manager in
      commit: ccb3424639821b5ef85264bc5836451590e8ade7
      
      Bug: 19624279
      
      Change-Id: I1c925d7facf19b3953b5deb85d992415344c4c9f
      8f81dcad
    • Nick Kralevich's avatar
      system_server: allow handling app generated unix_stream_sockets · 0560e75e
      Nick Kralevich authored
      Allow system server to handle already open app unix_stream_sockets.
      This is needed to support system_server receiving a socket
      created using socketpair(AF_UNIX, SOCK_STREAM) and
      socketpair(AF_UNIX, SOCK_SEQPACKET). Needed for future Android
      functionality.
      
      Addresses the following denial:
      
        type=1400 audit(0.0:9): avc: denied { read write } for path="socket:[14911]" dev="sockfs" ino=14911 scontext=u:r:system_server:s0 tcontext=u:r:platform_app:s0:c512,c768 tclass=unix_stream_socket permissive=0
      
      Bug: 19648474
      Change-Id: I4644e318aa74ada4d98b7f49a41d13a9b9584f39
      0560e75e
  19. Mar 05, 2015
    • Nick Kralevich's avatar
      Eliminate CAP_SYS_MODULE from system_server · 92b10ddb
      Nick Kralevich authored
      Right now, the system_server has the CAP_SYS_MODULE capability.  This allows the
      system server to install kernel modules.  Effectively, system_server is one
      kernel module load away from full root access.
      
      Most devices don't need this capability. Remove this capability from
      the core SELinux policy. For devices which require this capability,
      they can add it to their device-specific SELinux policy without making
      any framework code changes.
      
      In particular, most Nexus devices ship with monolithic kernels, so this
      capability isn't needed on those devices.
      
      Bug: 7118228
      Change-Id: I7f96cc61da8b2476f45ba9570762145778d68cb3
      92b10ddb
  20. Mar 03, 2015
    • dcashman's avatar
      Record observed system_server servicemanager service requests. · 23f33615
      dcashman authored
      Also formally allow dumpstate access to all services and grant system_server
      access to address the following non-system_server_service entries:
      
      avc:  granted  { find } for service=drm.drmManager scontext=u:r:system_server:s0 tcontext=u:object_r:drmserver_service:s0 tclass=service_manager
      avc:  granted  { find } for service=nfc scontext=u:r:system_server:s0 tcontext=u:object_r:nfc_service:s0 tclass=service_manager
      
      Bug: 18106000
      Change-Id: Iad16b36acf44bce52c4824f8b53c0e7731c25602
      23f33615
  21. Feb 25, 2015
    • Nick Kralevich's avatar
      Revert /proc/net related changes · 5cf3994d
      Nick Kralevich authored
      Revert the tightening of /proc/net access. These changes
      are causing a lot of denials, and I want additional time to
      figure out a better solution.
      
      Addresses the following denials (and many more):
      
        avc: denied { read } for comm="SyncAdapterThre" name="stats" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="facebook.katana" name="iface_stat_fmt" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="IntentService[C" name="if_inet6" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="dumpstate" name="iface_stat_all" dev="proc" ino=X scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      This reverts commit 0f0324cc
      and commit 99940d1a
      
      Bug: 9496886
      Bug: 19034637
      Change-Id: I436a6e3638ac9ed49afbee214e752fe2b0112868
      5cf3994d
  22. Jan 30, 2015
    • Nick Kralevich's avatar
      system_server: neverallow dex2oat exec · 361cdaff
      Nick Kralevich authored
      system_server should never be executing dex2oat. This is either
      a bug (for example, bug 16317188), or represents an attempt by
      system server to dynamically load a dex file, something we don't
      want to allow.
      
      This change adds a compile time assertion which will detect
      if an allow rule granting this access is ever added.
      No new rules are added or deleted as a result of this change.
      This neverallow rule is automatically enforced via CTS.
      
      Bug: 16317188
      Change-Id: Id783e05d9f48d48642dbb89d9c78be4aae8af70c
      361cdaff
  23. Jan 17, 2015
    • dcashman's avatar
      Record service accesses. · 566e8fe2
      dcashman authored
      Reduce logspam and record further observed service connections.
      
      Bug: 18106000
      Change-Id: I9a57e4bb8f1c8e066861719fb208c691498842a8
      566e8fe2
  24. Jan 15, 2015
    • dcashman's avatar
      Remove known system_server service accesses from auditing. · c631ede7
      dcashman authored
      Address observed  audit logs of the form:
      granted  { find } for service=XXX scontext=u:r:YYY:s0:c512,c768 tcontext=u:object_r:XXX_service:s0 tclass=service_manager
      
      in order to record existing relationships with services.
      
      Bug: 18106000
      Change-Id: I99a68f329c17ba67ebf3b87729b8405bdc925ef4
      c631ede7
  25. Jan 14, 2015
    • Nick Kralevich's avatar
      remove /proc/net read access from domain.te · 99940d1a
      Nick Kralevich authored
      SELinux domains wanting read access to /proc/net need to
      explicitly declare it.
      
      TODO: fixup the ListeningPortsTest cts test so that it's not
      broken.
      
      Bug: 9496886
      Change-Id: Ia9f1214348ac4051542daa661d35950eb271b2e4
      99940d1a
    • dcashman's avatar
      Make system_server_service an attribute. · 4a89cdfa
      dcashman authored
      Temporarily give every system_server_service its own
      domain in preparation for splitting it and identifying
      special services or classes of services.
      
      Change-Id: I81ffbdbf5eea05e0146fd7fd245f01639b1ae0ef
      4a89cdfa
  26. Dec 15, 2014
    • dcashman's avatar
      Restrict service_manager find and list access. · cd82557d
      dcashman authored
      All domains are currently granted list and find service_manager
      permissions, but this is not necessary.  Pare the permissions
      which did not trigger any of the auditallow reporting.
      
      Bug: 18106000
      Change-Id: Ie0ce8de2af8af2cbe4ce388a2dcf4534694c994a
      cd82557d
  27. Nov 19, 2014
Loading