Skip to content
Snippets Groups Projects
  1. Jun 08, 2017
    • Bartosz Fabianowski's avatar
      Revert "SELinux policy for secure persistent netd storage" · 06486796
      Bartosz Fabianowski authored
      This broke the build on master. See b/17613910#comment17
      for details.
      
      This reverts commit ef1fd98b.
      
      Change-Id: I11f7d463061a9b6340c11827135586266e26f016
      06486796
    • Joel Scherpelz's avatar
      SELinux policy for secure persistent netd storage · ef1fd98b
      Joel Scherpelz authored
      This is used to persist RFC 7217 stable secrets across device reboots.
      
      Test: as follows
          - Manually tested that stable_secret is generated on first use and
            persists until reset of user data partition (factory reset).
          - Tested that "adb shell getprop" was denied access to
            persist.netd.stable_secret after running "adb unroot".
      Bug: 17613910
      
      Change-Id: I4dad00fb189d697aceaffae49ad63987c7e45054
      ef1fd98b
  2. May 15, 2017
    • Jeff Vander Stoep's avatar
      Move domain_deprecated into private policy · 76aab82c
      Jeff Vander Stoep authored
      This attribute is being actively removed from policy. Since
      attributes are not being versioned, partners must not be able to
      access and use this attribute. Move it from private and verify in
      the logs that rild and tee are not using these permissions.
      
      Bug: 38316109
      Test: build and boot Marlin
      Test: Verify that rild and tee are not being granted any of these
            permissions.
      Change-Id: I31beeb5bdf3885195310b086c1af3432dc6a349b
      76aab82c
  3. Apr 14, 2017
    • Jeff Vander Stoep's avatar
      restore permissions to /vendor for non-treble devices · f627e558
      Jeff Vander Stoep authored
      Relabeling /vendor and /system/vendor to vendor_file removed
      previously granted permissions. Restore these for non-treble devices.
      
      Addresses:
      avc: denied { execute_no_trans } for pid=2944 comm="dumpstate"
      path="/system/vendor/bin/wpa_cli" dev="mmcblk0p10" ino=1929
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:vendor_file:s0
      tclass=file
      
      And potentially some other bugs that have yet to surface.
      
      Bug: 37105075
      Test: build Fugu
      Change-Id: I8e7bd9c33819bf8206f7c110cbce72366afbcef8
      f627e558
  4. Apr 05, 2017
    • Nick Kralevich's avatar
      Fix lock logspam and remove domain_deprecated rule · 4a580cca
      Nick Kralevich authored
      Remove system_file:file { lock ioctl } from domain_deprecated. The only
      domains triggering this were dex2oat and netd, which are fixed in this
      change.
      
      Addresses the following logspam similar to:
      
        avc: granted { lock } for comm="iptables"
        path="/system/etc/xtables.lock" dev="sda22" ino=3745
        scontext=u:r:netd:s0 tcontext=u:object_r:system_file:s0 tclass=file
      
        avc: granted { lock } for comm="dex2oat"
        path="/system/framework/arm/boot-okhttp.art" dev="dm-0" ino=1295
        scontext=u:r:dex2oat:s0 tcontext=u:object_r:system_file:s0 tclass=file
      
      Test: device boots and no obvious problems.
      Bug: 28760354
      Bug: 36879751
      Change-Id: Iac851c0e49a52ce4000fdfe16e68c17ff819693f
      4a580cca
  5. Mar 30, 2017
  6. Mar 23, 2017
  7. Feb 27, 2017
    • Nick Kralevich's avatar
      netd.te: drop dccp_socket support · 5251ad1a
      Nick Kralevich authored
      No SELinux domains can create dccp_socket instances, so it doesn't make
      any sense to allow netd to minipulate already-open dccp sockets.
      
      Bug: 35784697
      Test: policy compiles.
      Change-Id: I189844462cbab58ed58c24fbad6a392f6b035815
      5251ad1a
  8. Jan 26, 2017
    • William Roberts's avatar
      te_macros: introduce add_service() macro · 606d2fd6
      William Roberts authored
      
      Introduce the add_service() macro which wraps up add/find
      permissions for the source domain with a neverallow preventing
      others from adding it. Only a particular domain should
      add a particular service.
      
      Use the add_service() macro to automatically add a neverallow
      that prevents other domains from adding the service.
      
      mediadrmserver was adding services labeled mediaserver_service.
      Drop the add permission as it should just need the find
      permission.
      
      Additionally, the macro adds the { add find } permission which
      causes some existing neverallow's to assert. Adjust those
      neverallow's so "self" can always find.
      
      Test: compile and run on hikey and emulator. No new denials were
      found, and all services, where applicable, seem to be running OK.
      
      Change-Id: Ibbd2a5304edd5f8b877bc86852b0694732be993c
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      606d2fd6
  9. 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
  10. 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
  11. Sep 21, 2016
  12. Sep 12, 2016
    • Christopher Wiley's avatar
      Add back fowner capability to netd · 28029706
      Christopher Wiley authored
      This addresses error messages like:
      
      11-30 18:00:15.196  6917  6917 W Binder:6596_2: type=1400 audit(0.0:46):
      avc: denied { fowner } for capability=3 scontext=u:r:netd:s0
      tcontext=u:r:netd:s0 tclass=capability permissive=0
      
      11-30 18:00:15.200  6596  6917 E /system/bin/netd:
      android::WriteStringToFile fchmod failed: Operation not permitted
      
      11-30 18:00:15.200  6596  6917 E Netd    : failed to write to
      /data/misc/net/rt_tables (Operation not permitted)
      
      Bug: 31147892
      Change-Id: Id11704f8e2b8c08db92de374ed44913b70d6ae66
      28029706
  13. 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
  14. Sep 10, 2016
  15. Sep 09, 2016
  16. Sep 07, 2016
  17. Aug 29, 2016
  18. Aug 26, 2016
    • Christopher Wiley's avatar
      SEPolicy to start hostapd via init · d29c1a0a
      Christopher Wiley authored
      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 8a6c5f85)
      d29c1a0a
    • Christopher Wiley's avatar
      Define explicit label for wlan sysfs fwpath · 97db27d8
      Christopher Wiley authored
      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 7d13dd80)
      97db27d8
  19. Aug 02, 2016
  20. Jul 13, 2016
    • Christopher Wiley's avatar
      SEPolicy to start hostapd via init · 8a6c5f85
      Christopher Wiley authored
      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
      8a6c5f85
  21. Jul 01, 2016
    • Christopher Wiley's avatar
      Define explicit label for wlan sysfs fwpath · 7d13dd80
      Christopher Wiley authored
      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
      7d13dd80
  22. Jun 15, 2016
    • Jeff Vander Stoep's avatar
      Enforce ioctl command whitelisting on all sockets · c71c6622
      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
      c71c6622
  23. Jun 14, 2016
    • dcashman's avatar
      Keep pre-existing sysfs write permissions. · 17cfd3fc
      dcashman authored
      Commit: b144ebab added the sysfs_usb
      type and granted the read perms globally, but did not add write
      permissions for all domains that previously had them.  Add the ability
      to write to sysfs_usb for all domains that had the ability to write to
      those files previously (sysfs).
      
      Address denials such as:
      type=1400 audit(1904.070:4): avc:  denied  { write } for  pid=321 comm="ueventd" name="uevent" dev="sysfs" ino=1742 scontext=u:r:ueventd:s0 tcontext=u:object_r:sysfs_usb:s0 tclass=file permissive=0
      
      Bug: 28417852
      Change-Id: I4562ea73f2158ebefba74b58ca572f2176d1b849
      17cfd3fc
  24. Jun 06, 2016
  25. Apr 19, 2016
  26. Apr 13, 2016
    • Lorenzo Colitti's avatar
      selinux changes for DNS metrics. · 71d6ddc3
      Lorenzo Colitti authored
      1. Allow the system server to create the dns_listener service.
      2. Allow netd to use said service.
      
      Change-Id: Ic6394d7b2bdebf1c4d6cf70a79754a4996e943e2
      71d6ddc3
  27. 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
  28. Mar 02, 2016
  29. Feb 24, 2016
  30. Feb 22, 2016
  31. 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
  32. Feb 16, 2016
    • Lorenzo Colitti's avatar
      Allow netd to use NETLINK_SOCK_DIAG. · 71a6a3ef
      Lorenzo Colitti authored
      This is needed to kill sockets using the new SOCK_DESTROY
      operation instead of using SIOCKILLADDR.
      
      Bug: 26976388
      
      (cherry picked from commit b38e2790)
      
      Change-Id: Id80c6278f19f9fd20fe8d4fca72f84bff9249ed8
      71a6a3ef
    • Lorenzo Colitti's avatar
      Allow netd to use NETLINK_SOCK_DIAG. · b38e2790
      Lorenzo Colitti authored
      This is needed to kill sockets using the new SOCK_DESTROY
      operation instead of using SIOCKILLADDR.
      
      Bug: 26976388
      Change-Id: I01a63a754726a0e9fb68be48b76df4dc47752edb
      b38e2790
  33. Jan 15, 2016
Loading