Skip to content
Snippets Groups Projects
  1. Jun 26, 2014
    • Riley Spahn's avatar
      Adding policies for KeyStore MAC. · 1196d2a5
      Riley Spahn authored
      Add keystore_key class and an action for each action supported
      by keystore. Add policies that replicate the access control that
      already exists in keystore. Add auditallow rules for actions
      not known to be used frequently. Add macro for those domains
      wishing to access keystore.
      
      Change-Id: Iddd8672b9e9b72b45ee208e6eda608cc9dc61edc
      1196d2a5
  2. Jun 17, 2014
    • Stephen Smalley's avatar
      Eliminate some duplicated rules. · 00b180df
      Stephen Smalley authored
      
      As reported by sepolicy-analyze -D -P /path/to/sepolicy.
      No semantic difference reported by sediff between the policy
      before and after this change.
      
      Deduplication of selinuxfs read access resolved by taking the
      common rules to domain.te (and thereby getting rid of the
      selinux_getenforce macro altogether).
      
      Change-Id: I4de2f86fe2efe11a167e8a7d25dd799cefe482e5
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      00b180df
  3. Mar 12, 2014
  4. Mar 06, 2014
  5. Feb 28, 2014
    • Nick Kralevich's avatar
      allow wpa_cli to work. · 673acce9
      Nick Kralevich authored
      With wpa_supplicant in enforcing, wpa_cli doesn't work.
      
      Denial:
      
      type=1400 audit(1390597866.260:59): avc:  denied  { write } for  pid=3410 comm="wpa_supplicant" name="wpa_ctrl_4852-1" dev="mmcblk0p28" ino=618993 scontext=u:r:wpa:s0 tcontext=u:object_r:wifi_data_file:s0 tclass=sock_file
      
      After I9e35cc93abf89ce3594860aa3193f84a3b42ea6e and
      I51b09c5e40946673a38732ea9f601b2d047d3b62, the /data/misc/wifi/sockets
      directory is labeled properly. This change allows the communication
      between the su domain and wpa.
      
      Steps to reproduce:
        Start wifi (so wpa_supplicant will run)
        Start wpa_cli - it will hand
        $ adb root
        $ adb shell
        # wpa_cli -g @android:wpa_wlan0
      
      Bug: 12721629
      Change-Id: I03170acc155ad122c5197baaf590d17fc1ace6a5
      673acce9
    • Stephen Smalley's avatar
      Label /data/misc/wifi/sockets with wpa_socket. · 23c65b5c
      Stephen Smalley authored
      
      This will ensure that any sockets created in this directory
      will default to wpa_socket unless a type_transition is defined.
      Define a type transition for system_server to keep its separate
      system_wpa_socket type assigned for its socket.  Allow wpa
      to create and unlink sockets in the directory.  We leave the
      already existing rules for wifi_data_file in place for compatibility
      with existing devices that have wifi_data_file on /data/misc/wifi/sockets.
      
      Change-Id: I9e35cc93abf89ce3594860aa3193f84a3b42ea6e
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      23c65b5c
  6. Feb 25, 2014
    • 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
  7. Feb 21, 2014
    • Stephen Smalley's avatar
      Ensure that /data/misc/wifi/sockets is always labeled wpa_socket. · 7ade68d7
      Stephen Smalley authored
      
      It appears that wpa_supplicant tries to rmdir /data/misc/wifi/sockets
      and re-create it at times, so make sure that it remains labeled correctly
      when re-created in this manner via a name-based type transition rule.
      Do the same for hostapd as it also has permissions for creating/removing
      this directory.
      
      <5>[83921.800071] type=1400 audit(1392997522.105:26): avc:  denied  { rmdir } for  pid=3055 comm="wpa_supplicant" name="sockets" dev="mmcblk0p28" ino=618957 scontext=u:r:wpa:s0 tcontext=u:object_r:wpa_socket:s0 tclass=dir
      
      We no longer need the type_transition for sock_file as it will inherit
      the type from the parent directory which is set via restorecon_recursive
      /data/misc/wifi/sockets or via type_transition, so drop it.
      
      Change-Id: Iffa61c426783eb03205ba6964c624c6ecea32630
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      7ade68d7
  8. Feb 04, 2014
    • Nick Kralevich's avatar
      allow wpa_cli to work. · ba1a7315
      Nick Kralevich authored
      With wpa_supplicant in enforcing, wpa_cli doesn't work.
      
      Denial:
      
      type=1400 audit(1390597866.260:59): avc:  denied  { write } for  pid=3410 comm="wpa_supplicant" name="wpa_ctrl_4852-1" dev="mmcblk0p28" ino=618993 scontext=u:r:wpa:s0 tcontext=u:object_r:wifi_data_file:s0 tclass=sock_file
      
      After I9e35cc93abf89ce3594860aa3193f84a3b42ea6e and
      I51b09c5e40946673a38732ea9f601b2d047d3b62, the /data/misc/wifi/sockets
      directory is labeled properly. This change allows the communication
      between the su domain and wpa.
      
      Steps to reproduce:
        Start wifi (so wpa_supplicant will run)
        Start wpa_cli - it will hand
        $ adb root
        $ adb shell
        # wpa_cli -g @android:wpa_wlan0
      
      Bug: 12721629
      Change-Id: I03170acc155ad122c5197baaf590d17fc1ace6a5
      ba1a7315
    • Stephen Smalley's avatar
      Label /data/misc/wifi/sockets with wpa_socket. · 418e2abd
      Stephen Smalley authored
      
      This will ensure that any sockets created in this directory
      will default to wpa_socket unless a type_transition is defined.
      Define a type transition for system_server to keep its separate
      system_wpa_socket type assigned for its socket.  Allow wpa
      to create and unlink sockets in the directory.  We leave the
      already existing rules for wifi_data_file in place for compatibility
      with existing devices that have wifi_data_file on /data/misc/wifi/sockets.
      
      Change-Id: I9e35cc93abf89ce3594860aa3193f84a3b42ea6e
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      418e2abd
  9. Jan 14, 2014
  10. 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
  11. Nov 13, 2013
  12. 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
  13. 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
  14. May 15, 2013
  15. May 08, 2013
  16. May 07, 2013
    • repo sync's avatar
      Add temporary policy for wpa_supplicant. · fb076f8b
      repo sync authored
      This allows wpa_supplicant to interact with the sockets created
      for it by init. Eventually we'll want those to be properly
      labelled, but allow until then.
      
      Change-Id: I33fcd22173a8d47bbc4ada8d6aa62b4d159cbb15
      fb076f8b
  17. May 06, 2013
  18. Aug 10, 2012
  19. Jan 04, 2012
Loading