Skip to content
Snippets Groups Projects
  1. Feb 24, 2017
  2. Jan 20, 2017
    • Alex Klyubin's avatar
      Grant rild and gatekeeperd access to hwservicemanager · 7f468994
      Alex Klyubin authored
      In my commit f41d89eb I forgot to
      switch rild and gatekeeperd rules from explicitly associating these
      domains with the hal_telephony and hal_gatekeeper to using the
      hal_impl_domain macro. As a result, the recent commit
      a2519226 inadvertently revoked
      HwBinder access from rild and gatekeeperd.
      
      This commit fixes the issue by switching rild and gatekeeperd to the
      hal_impl_domain macro.
      
      Test: "sepolicy-analyze out/target/product/bullhead/root/sepolicy attribute haldomain"
            now lists rild and gatekeeperd
      Test: "sepolicy-analyze out/target/product/bullhead/root/sepolicy attribute hal_telephony"
            still lists rild
      Test: "sepolicy-analyze out/target/product/bullhead/root/sepolicy attribute hal_gatekeeper"
            still lists gatekeeperd
      Bug: 34180936
      Bug: 34470443
      Change-Id: I7949556f58c36811205d5ea3ee78ea5708e95b45
      7f468994
  3. Jan 18, 2017
    • Max Bires's avatar
      Removing setprop permissions from rild. · 8aef51e7
      Max Bires authored
      There were some auditallow rules left around in rild.te that had logs
      showing nothing was triggering them. Thus the rules they were auditing
      could be removed, as that's clear indication there's no use for them.
      Having rules around that aren't being used does nothing except increase
      attack surface and bloat sepolicy, and so should always be removed if
      possible.
      
      Test: The device boots
      Change-Id: I906ffc493807fbae90593548d478643cda4864eb
      8aef51e7
  4. Dec 27, 2016
  5. Dec 04, 2016
  6. Nov 30, 2016
    • Nick Kralevich's avatar
      domain_deprecated.te: remove /proc/net access · dd649da8
      Nick Kralevich authored
      Remove /proc/net access to domain_deprecated. Add it to domains where it
      was missing before.
      
      Other than these domains, SELinux denial monitoring hasn't picked up any
      denials related to /proc/net
      
      Bug: 28760354
      Test: Device boots
      Test: No unexpected denials in denial collection logs.
      Change-Id: Ie5bfa4bc0070793c1e8bf3b00676fd31c08d426a
      dd649da8
  7. Oct 06, 2016
    • dcashman's avatar
      Split general policy into public and private components. · cc39f637
      dcashman authored
      Divide policy into public and private components.  This is the first
      step in splitting the policy creation for platform and non-platform
      policies.  The policy in the public directory will be exported for use
      in non-platform policy creation.  Backwards compatibility with it will
      be achieved by converting the exported policy into attribute-based
      policy when included as part of the non-platform policy and a mapping
      file will be maintained to be included with the platform policy that
      maps exported attributes of previous versions to the current platform
      version.
      
      Eventually we would like to create a clear interface between the
      platform and non-platform device components so that the exported policy,
      and the need for attributes is minimal.  For now, almost all types and
      avrules are left in public.
      
      Test: Tested by building policy and running on device.
      
      Change-Id: Idef796c9ec169259787c3f9d8f423edf4ce27f8c
      cc39f637
  8. Sep 11, 2016
    • Jeff Vander Stoep's avatar
      Enforce ioctl command whitelisting on all sockets · bff98015
      Jeff Vander Stoep authored
      Remove the ioctl permission for most socket types. For others, such as
      tcp/udp/rawip/unix_dgram/unix_stream set a default unprivileged whitelist
      that individual domains may extend (except where neverallowed like
      untrusted_app). Enforce via a neverallowxperm rule.
      
      Change-Id: I15548d830f8eff1fd4d64005c5769ca2be8d4ffe
      bff98015
  9. Sep 10, 2016
  10. Aug 29, 2016
  11. May 17, 2016
    • Christopher Wiley's avatar
      Fix rild policy to accomodate minijail · e3327427
      Christopher Wiley authored
      Fix denials related to lack of setgid and setpcap priviledges.
      These were introduced when minijail was used to do sandboxing.
      
      Bug: 28178548
      Change-Id: I85fd4abbe55258de61d20d827baf59bbca0679e7
      Test: rild no longer crash loops
      e3327427
  12. May 12, 2016
  13. 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
  14. Dec 04, 2015
  15. Nov 03, 2015
    • Jeff Vander Stoep's avatar
      Create attribute for moving perms out of domain · d22987b4
      Jeff Vander Stoep authored
      Motivation: Domain is overly permissive. Start removing permissions
      from domain and assign them to the domain_deprecated attribute.
      Domain_deprecated and domain can initially be assigned to all
      domains. The goal is to not assign domain_deprecated to new domains
      and to start removing domain_deprecated where it is not required or
      reassigning the appropriate permissions to the inheriting domain
      when necessary.
      
      Bug: 25433265
      Change-Id: I8b11cb137df7bdd382629c98d916a73fe276413c
      d22987b4
  16. Aug 25, 2015
    • Stephen Smalley's avatar
      Only allow toolbox exec where /system exec was already allowed. · a3c97a76
      Stephen Smalley authored
      
      When the toolbox domain was introduced, we allowed all domains to exec it
      to avoid breakage.  However, only domains that were previously allowed the
      ability to exec /system files would have been able to do this prior to the
      introduction of the toolbox domain.  Remove the rule from domain.te and add
      rules to all domains that are already allowed execute_no_trans to system_file.
      Requires coordination with device-specific policy changes with the same Change-Id.
      
      Change-Id: Ie46209f0412f9914857dc3d7c6b0917b7031aae5
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      a3c97a76
  17. May 07, 2015
    • William Roberts's avatar
      Replace unix_socket_connect() and explicit property sets with macro · 2f5a6a96
      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.
      
      (cherrypicked from commit 625a3526)
      
      Change-Id: I630ba0178439c935d08062892990d43a3cc1239e
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@linux.intel.com>
      2f5a6a96
    • 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
  18. Jun 23, 2014
    • Stephen Smalley's avatar
      Align SELinux property policy with init property_perms. · fee49159
      Stephen Smalley authored
      
      Introduce a net_radio_prop type for net. properties that can be
      set by radio or system.
      Introduce a system_radio_prop type for sys. properties that can be
      set by radio or system.
      Introduce a dhcp_prop type for properties that can be set by dhcp or system.
      Drop the rild_prop vs radio_prop distinction; this was an early
      experiment to see if we could separate properties settable by rild
      versus other radio UID processes but it did not pan out.
      
      Remove the ability to set properties from unconfineddomain.
      Allow init to set any property.  Allow recovery to set ctl_default_prop
      to restart adbd.
      
      Change-Id: I5ccafcb31ec4004dfefcec8718907f6b6f3e0dfd
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      fee49159
  19. May 23, 2014
    • Nick Kralevich's avatar
      Introduce wakelock_use() · 8599e34b
      Nick Kralevich authored
      Introduce wakelock_use(). This macro declares that a domain uses
      wakelocks.
      
      Wakelocks require both read-write access to files in /sys/power, and
      CAP_BLOCK_SUSPEND. This macro helps ensure that both capabilities and
      file access are granted at the same time.
      
      Still TODO: fix device specific wakelock use.
      
      Change-Id: Ib98ff374a73f89e403acd9f5e024988f59f08115
      8599e34b
  20. Apr 02, 2014
    • Stephen Smalley's avatar
      Drop dontaudit sys_admin rule from rild. · 997d4a18
      Stephen Smalley authored
      
      Old Android kernels (e.g. kernel/goldfish android-2.6.29 commit 2bda29)
      fell back to a CAP_SYS_ADMIN check even before checking uids if the cgroup
      subsystem did not define its own can_attach handler.  This doesn't appear
      to have ever been the case of mainline, and is not true of the 3.4 Android
      kernels.  So we no longer need to dontaudit sys_admin to avoid log noise.
      
      Change-Id: I2faade6665a4adad91472c95f94bd922a449b240
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      997d4a18
  21. Mar 18, 2014
  22. Mar 13, 2014
    • Stephen Smalley's avatar
      Audit attempts by rild to create/write to system_data_file. · 64c0ff00
      Stephen Smalley authored
      
      Audit attempts by rild to create/write to system_data_file
      with avc:  granted messages so that we can identify any such
      instances and put such directories/files into radio_data_file or
      some other type and then remove these rules.
      
      Change-Id: Ice20fed1733a3f4208d541a4baaa8b6c6f44fbb0
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      64c0ff00
    • Nick Kralevich's avatar
      rild: move to enforcing · 599e71a9
      Nick Kralevich authored
      Move the rild domain into SELinux enforcing mode. This will
      start enforcing SELinux rules; security policy violations will
      return EPERM.
      
      Change-Id: Iadb51616ecf6f56148ce076d47f04511810de94c
      599e71a9
  23. Feb 25, 2014
    • Stephen Smalley's avatar
      Move qemud and /dev/qemu policy bits to emulator-specific sepolicy. · 0296b943
      Stephen Smalley authored
      
      Change-Id: I620d4aef84a5d4565abb1695db54ce1653612bce
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      0296b943
    • Stephen Smalley's avatar
      Clean up socket rules. · 16011320
      Stephen Smalley authored
      
      Replace * or any permission set containing create with
      create_socket_perms or create_stream_socket_perms.
      
      Add net_domain() to all domains using network sockets and
      delete rules already covered by domain.te or net.te.
      
      For netlink_route_socket, only nlmsg_write needs to be separately
      granted to specific domains that are permitted to modify the routing
      table.   Clarification:  read/write permissions are just ability to
      perform read/recv() or write/send() on the socket, whereas nlmsg_read/
      nlmsg_write permissions control ability to observe or modify the
      underlying kernel state accessed via the socket.
      See security/selinux/nlmsgtab.c in the kernel for the mapping of
      netlink message types to nlmsg_read or nlmsg_write.
      
      Delete legacy rule for b/12061011.
      
      This change does not touch any rules where only read/write were allowed
      to a socket created by another domain (inherited across exec or
      received across socket or binder IPC).  We may wish to rewrite some or all
      of those rules with the rw_socket_perms macro but that is a separate
      change.
      
      Change-Id: Ib0637ab86f6d388043eff928e5d96beb02e5450e
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      16011320
  24. Jan 11, 2014
    • Nick Kralevich's avatar
      Support forcing permissive domains to unconfined. · 623975fa
      Nick Kralevich authored
      Permissive domains are only intended for development.
      When a device launches, we want to ensure that all
      permissive domains are in, at a minimum, unconfined+enforcing.
      
      Add FORCE_PERMISSIVE_TO_UNCONFINED to Android.mk. During
      development, this flag is false, and permissive domains
      are allowed. When SELinux new feature development has been
      frozen immediately before release, this flag will be flipped
      to true. Any previously permissive domains will move into
      unconfined+enforcing.
      
      This will ensure that all SELinux domains have at least a
      minimal level of protection.
      
      Unconditionally enable this flag for all user builds.
      
      Change-Id: I1632f0da0022c80170d8eb57c82499ac13fd7858
      623975fa
  25. Dec 05, 2013
    • Robert Craig's avatar
      Fix new rild denials. · aa376831
      Robert Craig authored
      Denials seen on hammerhead but seem
      appropriate for general policy.
      
      <5>[ 8.339347] type=1400 audit(3731546.390:17): avc: denied { ioctl } for pid=314 comm="rild" path="socket:[7996]" dev="sockfs" ino=7996 scontext=u:r:rild:s0 tcontext=u:r:rild:s0 tclass=socket
      <5>[ 8.339065] type=1400 audit(3731546.390:16): avc: denied { create } for pid=314 comm="rild" scontext=u:r:rild:s0 tcontext=u:r:rild:s0 tclass=socket
      <5>[ 11.232121] type=1400 audit(3731549.289:22): avc: denied { read } for pid=620 comm="rild" scontext=u:r:rild:s0 tcontext=u:r:rild:s0 tclass=socket
      
      Change-Id: Ieaca5360afbb44d5da21c7c24bdd5e7c5758f0a2
      aa376831
  26. Nov 13, 2013
  27. Oct 21, 2013
    • Nick Kralevich's avatar
      Move unconfined domains out of permissive mode. · 353c72e3
      Nick Kralevich authored
      This change removes the permissive line from unconfined
      domains. Unconfined domains can do (mostly) anything, so moving
      these domains into enforcing should be a no-op.
      
      The following domains were deliberately NOT changed:
      1) kernel
      2) init
      
      In the future, this gives us the ability to tighten up the
      rules in unconfined, and have those tightened rules actually
      work.
      
      When we're ready to tighten up the rules for these domains,
      we can:
      
      1) Remove unconfined_domain and re-add the permissive line.
      2) Submit the domain in permissive but NOT unconfined.
      3) Remove the permissive line
      4) Wait a few days and submit the no-permissive change.
      
      For instance, if we were ready to do this for adb, we'd identify
      a list of possible rules which allow adbd to work, re-add
      the permissive line, and then upload those changes to AOSP.
      After sufficient testing, we'd then move adb to enforcing.
      We'd repeat this for each domain until everything is enforcing
      and out of unconfined.
      
      Change-Id: If674190de3262969322fb2e93d9a0e734f8b9245
      353c72e3
  28. Oct 03, 2013
  29. May 20, 2013
    • repo sync's avatar
      Make all domains unconfined. · 77d4731e
      repo sync authored
      This prevents denials from being generated by the base policy.
      Over time, these rules will be incrementally tightened to improve
      security.
      
      Change-Id: I4be1c987a5d69ac784a56d42fc2c9063c402de11
      77d4731e
  30. May 15, 2013
  31. May 03, 2013
  32. Apr 26, 2013
  33. Apr 05, 2013
  34. Apr 04, 2013
  35. Mar 27, 2013
    • Robert Craig's avatar
      Various policy updates. · 65d4f44c
      Robert Craig authored
      
      Assortment of policy changes include:
       * Bluetooth domain to talk to init and procfs.
       * New device node domains.
       * Allow zygote to talk to its executable.
       * Update system domain access to new device node domains.
       * Create a post-process sepolicy with dontaudits removed.
       * Allow rild to use the tty device.
      
      Change-Id: Ibb96b590d0035b8f6d1606cd5e4393c174d10ffb
      Signed-off-by: default avatarrpcraig <rpcraig@tycho.ncsc.mil>
      65d4f44c
  36. Mar 22, 2013
    • William Roberts's avatar
      Split internal and external sdcards · c195ec31
      William Roberts authored
      Two new types are introduced:
      sdcard_internal
      sdcard_external
      
      The existing type of sdcard, is dropped and a new attribute
      sdcard_type is introduced.
      
      The boolean app_sdcard_rw has also been changed to allow for
      controlling untrusted_app domain to use the internal and external
      sdcards.
      
      Change-Id: Ic7252a8e1703a43cb496413809d01cc6cacba8f5
      c195ec31
Loading