Skip to content
Snippets Groups Projects
  1. Dec 07, 2016
    • Nick Kralevich's avatar
      Add TCSETS to unpriv_tty_ioctls · 240f50e8
      Nick Kralevich authored
      Addresses the following denial:
      
      avc: denied { ioctl } for comm="top" path="/dev/pts/0" dev="devpts"
      ino=3 ioctlcmd=5402 scontext=u:r:shell:s0 tcontext=u:object_r:devpts:s0
      tclass=chr_file permissive=0
      
      Bug: 33073072
      Bug: 7530569
      Test: policy compiles.
      Change-Id: If9178d29f2295be46bb118df00ebf73a6ebc9f81
      240f50e8
  2. Nov 23, 2016
  3. 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
  4. Sep 13, 2016
    • Jeff Vander Stoep's avatar
      Define and group ppp socket ioctls · 3650ea9b
      Jeff Vander Stoep authored
      Needed for legacy VPN access.
      
      Note that ioctl whitelisting only uses the type and command fields
      of the ioctl so only the last two bytes are necessary, thus 0x40047438
      and 0x7438 are treated the same.
      
      Bug: 30154346
      Change-Id: I45bdc77ab666e05707729a114d933900655ba48b
      3650ea9b
  5. 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
  6. Jul 15, 2016
    • Jeff Vander Stoep's avatar
      Define and group ppp socket ioctls · cbde7f9f
      Jeff Vander Stoep authored
      Needed for legacy VPN access.
      
      Note that ioctl whitelisting only uses the type and command fields
      of the ioctl so only the last two bytes are necessary, thus 0x40047438
      and 0x7438 are treated the same.
      
      Bug: 30154346
      Change-Id: I45bdc77ab666e05707729a114d933900655ba48b
      cbde7f9f
  7. Jun 14, 2016
    • Nick Kralevich's avatar
      Add SIOCGSTAMP SIOCGSTAMPNS to unpriv_sock_ioctls · 92e79e22
      Nick Kralevich authored
      Per "man socket":
      
        SIOCGSTAMP
        Return a struct timeval with the receive timestamp of the last packet
        passed to the user. This is useful for accurate round trip time
        measurements. See setitimer(2) for a description of struct timeval.
        This ioctl should only be used if the socket option SO_TIMESTAMP is
        not set on the socket. Otherwise, it returns the timestamp of the last
        packet that was received while SO_TIMESTAMP was not set, or it fails
        if no such packet has been received, (i.e., ioctl(2) returns -1 with
        errno set to ENOENT).
      
      Addresses the following denial:
      
      avc: denied { ioctl } for comm=6E6574776F726B5F74687265616420
      path="socket:[42934]" dev="sockfs" ino=42934 ioctlcmd=8906
      scontext=u:r:untrusted_app:s0:c512,c768
      tcontext=u:r:untrusted_app:s0:c512,c768 tclass=udp_socket permissive=0
      
      Bug: 29333189
      Change-Id: I916a695fa362cf1cf6759629c7f6101e9f657e7d
      92e79e22
  8. Apr 26, 2016
    • Jeff Vander Stoep's avatar
      Whitelist additional unix socket ioctl · 81b7675e
      Jeff Vander Stoep authored
      TIOCGWINSZ = 0x00005413
      
      avc: denied { ioctl } for comm="ls" path="socket:[362628]" dev="sockfs" ino=362628 ioctlcmd=5413 scontext=u:r:shell:s0 tcontext=u:r:adbd:s0 tclass=unix_stream_socket permissive=0
      
      Bug: 28171804
      Change-Id: I460e2469730d0cd90d714f30803ef849317d4be7
      81b7675e
  9. Apr 15, 2016
    • Jeff Vander Stoep's avatar
      Further restrict socket ioctls available to apps · 32333536
      Jeff Vander Stoep authored
      (cherry picked from commit 6ba383c5)
      
      Restrict unix_dgram_socket and unix_stream_socket to a whitelist.
      Disallow all ioctls for netlink_selinux_socket and netlink_route_socket.
      
      Neverallow third party app use of all ioctls other than
      unix_dgram_socket, unix_stream_socket, netlink_selinux_socket,
      netlink_route_socket, tcp_socket, udp_socket and rawip_socket.
      
      Bug: 28171804
      Change-Id: Icfe3486a62fc2fc2d2abd8d4030a5fbdd0ab30ab
      32333536
  10. Apr 13, 2016
  11. Feb 22, 2016
  12. Jan 08, 2016
    • Jeff Vander Stoep's avatar
      add SIOCGIFINDEX to list of unprivileged socket ioctls · c4a93a6c
      Jeff Vander Stoep authored
      Addresses
      avc: denied { ioctl } for path="socket:[69748]" dev="sockfs" ino=69748
      ioctlcmd=8933 scontext=u:r:untrusted_app:s0:c512,c768
      tcontext=u:r:untrusted_app:s0:c512,c768 tclass=udp_socket
      
      Change-Id: Iee3821ade9dc044fa03705902923ed18c91425dd
      c4a93a6c
  13. Jan 05, 2016
  14. Jan 04, 2016
    • Jeff Vander Stoep's avatar
      Reduce socket ioctl perms · cbaa2b7d
      Jeff Vander Stoep authored
      Reduce the socket ioctl commands available to untrusted/isolated apps.
      Neverallow accessing sensitive information or setting of network parameters.
      Neverallow access to device private ioctls i.e. device specific
      customizations as these are a common source of driver bugs.
      
      Define common ioctl commands in ioctl_defines.
      
      Bug: 26267358
      Change-Id: Ic5c0af066e26d4cb2867568f53a3e65c5e3b5a5d
      cbaa2b7d
  15. Dec 11, 2015
    • Jeff Vander Stoep's avatar
      Migrate to upstream policy version 30 · 3a0ce49b
      Jeff Vander Stoep authored
      Grant untrusted_app and isolated_app unpriv_sock_perms, neverallow
      priv_sock_perms to disallow access to MAC address and ESSID.
      
      Change-Id: Idac3b657a153e7d7fdc647ff34b876a325d759b3
      3a0ce49b
  16. Dec 08, 2015
  17. Jun 05, 2015
    • Jeff Vander Stoep's avatar
      restrict app access to socket ioctls · de9b5301
      Jeff Vander Stoep authored
      Create a macro of unprivileged ioctls including
      - All common socket ioctls except MAC address
      - All wireless extensions ioctls except get/set ESSID
      - Some commonly used tty ioctls
      
      Bug: 21657002
      Change-Id: Ib08be9cb70d08c1fa2c8bddbae519e7c2df5293c
      de9b5301
Loading