Skip to content
Snippets Groups Projects
  1. Dec 05, 2016
    • Nick Kralevich's avatar
      Revert "ueventd.te: auditallow device:chr_file" · e78fa1bf
      Nick Kralevich authored
      Broke the dragon build:
      
      libsepol.report_failure: neverallow on line 304 of system/sepolicy/public/domain.te (or line 8638 of policy.conf) violated by allow kernel device:chr_file { create setattr };
      libsepol.check_assertions: 1 neverallow failures occurred
      Error while expanding policy
      
      This reverts commit ed0b4eb3.
      
      Change-Id: I5d55ab59ed72ce7c19a10ddbb374f9f3b3fae4fd
      e78fa1bf
    • Nick Kralevich's avatar
      ueventd.te: auditallow device:chr_file · ed0b4eb3
      Nick Kralevich authored
      By default, files created in /dev are labeled with the "device" label
      unless a different label has been assigned. The direct use of this
      generic label is discouraged (and in many cases neverallowed) because
      rules involving this label tend to be overly broad and permissive.
      
      Today, generically labeled character devices can only be opened, read,
      or written to by init and ueventd.
      
        $ sesearch --allow -t device -c chr_file -p open,read,write out/target/product/marlin/root/sepolicy
        allow init device:chr_file { setattr read lock getattr write ioctl open append };
        allow ueventd device:chr_file { read lock getattr write ioctl open append };
      
      this is enforced by the following SELinux neverallow rule (compile time
      assertion + CTS test):
      
        neverallow { domain -init -ueventd } device:chr_file { open read write };
      
      Start auditallowing ueventd access to /dev character device files with the
      default SELinux label. This doesn't appear to be used, but let's prove it.
      While ueventd is expected to create files in /dev, it has no need to open
      most of the files it creates.
      
      Note, however, that because ueventd has mknod + setfscreate permissions,
      a malicious or compromised ueventd can always create a device node under
      an incorrect label, and gain access that way.
      
      The goal of this change is to prove that no process other than init are
      accessing generically labeled files in /dev.
      
      While I'm here, tighten up the compile time assertion for
      device:chr_file to include more permissions.
      
      Test: policy compiles + device boots with no granted messages.
      Change-Id: Ic98b0ddc631b49b09e58698d9f40738ccedd1fd0
      ed0b4eb3
    • Max's avatar
      /dev/port does not seem to be used, adding in rules to confirm. · c27c23fb
      Max authored
      Only init and ueventd have any access to /dev/port, and neither should
      have any use for it. As it stands, leaving port in just represents
      additional attack surface with no useful functionality, so it should be
      removed if possible, not only from Pixel devices, but from all Android
      devices.
      
      Test: The phone boots successfully
      
      Bug:33301618
      Change-Id: Iedc51590f1ffda02444587d647889ead9bdece3f
      c27c23fb
    • Daniel Micay's avatar
      auditallow priv_app app_data_file execution · 758e6b36
      Daniel Micay authored
      In general, apps shouldn't be executing data from their writable data
      directories. Allowing this is a security risk and use cases for this are
      almost always anti-patterns where saner alternatives are available such
      as using one of the standard systems for shipping libraries (extracted
      by the package manager or aligned/uncompressed in the apk) or using the
      existing package system to handle plugins. It's reasonable for the
      untrusted_app domain to have this (not just for backwards compatibility)
      for priv_app should be held to a higher standard.
      
      Ideally, untrusted apps would be able to opt-in to disabling this and
      then the default could then be switched at a new API level. It could do
      more than just hardening apps not requiring it by having documentation
      explain the risks and offer alternatives to reduce 'legitimate' use. The
      base system could disable it for all of the bundled untrusted apps.
      
      Change-Id: I4efcfaf01c6b6c33c39e98c22a1934e8892e2147
      758e6b36
  2. Dec 04, 2016
  3. Dec 03, 2016
    • Ray Essick's avatar
      Allow access to mediaanalytics service · 090f4a4d
      Ray Essick authored
      media framework analytics are gathered in a separate service.
      define a context for this new service, allow various
      media-related services and libraries to access this new service.
      
      Bug: 30267133
      Test: ran media CTS, watched for selinux denials.
      Change-Id: I5aa5aaa5aa9e82465b8024f87ed32d6ba4db35ca
      090f4a4d
  4. Dec 02, 2016
    • Robert Sesek's avatar
      Allow webview_zygote to stat /sys/kernel/debug/tracing/trace_marker. · 5af7c660
      Robert Sesek authored
      Test: m
      Test: angler boots
      
      Bug: 21643067
      Change-Id: I7530120385766506405a318caac8ef143e71cce7
      5af7c660
    • Jeff Sharkey's avatar
      Allow system_server to measure emulated stats. · 17c675b3
      Jeff Sharkey authored
      Historically we pushed all system_server SD card interactions through
      DefaultContainerService to avoid holding open FDs, but it's safe to
      measure disk usage for internal emulated storage when looking
      directly at /data/media, since there is no risk of unsafe ejection.
      
      These rule changes give us just enough access to measure statistics.
      
      avc: denied { getattr } for path="/data/media/0/DCIM/.thumbnails" dev="sda35" ino=589892 scontext=u:r:system_server:s0 tcontext=u:object_r:media_rw_data_file:s0:c512,c768 tclass=dir permissive=1
      avc: denied { open } for path="/data/media/0/DCIM/.thumbnails" dev="sda35" ino=589892 scontext=u:r:system_server:s0 tcontext=u:object_r:media_rw_data_file:s0:c512,c768 tclass=dir permissive=1
      avc: denied { read } for name="0" dev="sda35" ino=589827 scontext=u:r:system_server:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
      
      Test: builds, boots, and access allowed
      Bug: 33298975
      Change-Id: I9748608a5c1169d542e763c5a8f79c4f26f7a382
      17c675b3
  5. 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
    • Max's avatar
      Added an auditallow rule to track vold remounting filesystems. · 314d8c58
      Max authored
      Vold shouldn't have this selinux permission, so this will be left in for
      a few weeks to keep track of if removing it would be an issue to any
      other processes. If not, then a follow-up CL will remove both the rule
      and the auditallow
      
      Test: This CL is a test in itself, auditallow rules shouldn't change
      behavior of SELinux policy by themselves
      Bug: 26901147
      Change-Id: Ib076448863bd54278df59a3b514c9e877eb22ee5
      314d8c58
  6. Nov 29, 2016
  7. Nov 28, 2016
    • Nick Kralevich's avatar
      Add directory read permissions to certain domains. · 49e35884
      Nick Kralevich authored
      Addresses the following denials and auditallows:
      
      avc: denied { read } for pid=561 comm="hwservicemanage" name="hw"
      dev="dm-0" ino=1883 scontext=u:r:hwservicemanager:s0
      tcontext=u:object_r:system_file:s0 tclass=dir permissive=0
      
      avc: denied { read } for pid=748 comm="gatekeeperd" name="hw" dev="dm-0"
      ino=1883 scontext=u:r:gatekeeperd:s0 tcontext=u:object_r:system_file:s0
      tclass=dir permissive=0
      
      avc: granted { read open } for pid=735 comm="fingerprintd"
      path="/system/lib64/hw" dev="dm-0" ino=1883 scontext=u:r:fingerprintd:s0
      tcontext=u:object_r:system_file:s0 tclass=dir
      
      Test: no denials on boot
      Change-Id: Ic363497e3ae5078e564d7195f3739a654860a32f
      49e35884
    • William Roberts's avatar
      zygote: drop braces on single item rule · 96385a75
      William Roberts authored
      
      commit 221938cb
      introduces a fix that uses braces around a single item.
      This is not within the normal style of no brace around
      a single item. Drop the braces.
      
      Change-Id: Ibeee1e682c0face97f18d5e5177be13834485676
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      96385a75
    • Nick Kralevich's avatar
      Remove "eng" macro · d070b671
      Nick Kralevich authored
      Never used.
      
      Test: policy compiles.
      Change-Id: I0ce6c46bb05925a4b3eda83531b28f873b0c9b99
      d070b671
  8. Nov 27, 2016
  9. Nov 26, 2016
    • Nick Kralevich's avatar
      Remove domain_deprecated from some domains. · 0fa81a27
      Nick Kralevich authored
      No denials showing up in collected audit logs.
      
      Bug: 28760354
      Test: Device boots
      Test: No unexpected denials in denial collection logs.
      Change-Id: I5a0d4f3c51d296bfa04e71fc226a01dcf5b5b508
      0fa81a27
    • Nick Kralevich's avatar
      Delete more from domain_deprecated.te · 06da58b9
      Nick Kralevich authored
      No unexpected usages.
      
      Bug: 28760354
      Test: Device boots
      Test: No unexpected denials in denial collection logs.
      Change-Id: I43226fd0b8103afb1b25b1eb21445c04bc79954e
      06da58b9
    • Nick Kralevich's avatar
      system_server: Delete system_file:file execute_no_trans; · 55e86a3a
      Nick Kralevich authored
      auditallow has been in place since Apr 2016
      (f84b7981) and no SELinux denials have
      been generated / collected. Remove unused functionality.
      
      Test: Device boots with no problems.
      Test: no SELinux denials of this type collected.
      Bug: 28035297
      Change-Id: I52414832abb5780a1645a4df723c6f0c758eb5e6
      55e86a3a
  10. Nov 23, 2016
  11. Nov 22, 2016
    • Tao Bao's avatar
      recovery.te: Allow writing to sysfs_devices_system_cpu. · ee7960c0
      Tao Bao authored
      recovery (update_binary) may need to set up cpufreq during an update.
      
      avc:  denied  { write } for  pid=335 comm="update_binary" name="scaling_max_freq" dev="sysfs" ino=7410 scontext=u:r:recovery:s0 tcontext=u:object_r:sysfs_devices_system_cpu:s0 tclass=file permissive=0
      
      Bug: 32463933
      Test: Build a recovery image and apply an OTA package that writes to
            /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq.
      
      Change-Id: Ia90af9dd15e162dd94bcd4722b66aa296e3058c5
      ee7960c0
    • Nick Kralevich's avatar
      neverallow some /proc file reads · 0b7506ff
      Nick Kralevich authored
      Lock in the gains we've made so far in restricting access to generically
      labeled /proc files. There's more we can do here, but let's avoid
      inadvertent regressions.
      
      Test: policy compiles. Only compile time assertions added.
      Bug: 26813932
      Change-Id: If354c2ddc1c59beed7f0eb4bcbd3f0d9971c3b8a
      0b7506ff
  12. Nov 21, 2016
    • Nick Kralevich's avatar
      access_vectors: Remove unused permission definitions · 11dc03e5
      Nick Kralevich authored
      Description stolen from
      https://github.com/torvalds/linux/commit/42a9699a9fa179c0054ea3cf5ad3cc67104a6162
      
      Remove unused permission definitions from SELinux.
      Many of these were only ever used in pre-mainline
      versions of SELinux, prior to Linux 2.6.0.  Some of them
      were used in the legacy network or compat_net=1 checks
      that were disabled by default in Linux 2.6.18 and
      fully removed in Linux 2.6.30.
      
      Permissions never used in mainline Linux:
      file swapon
      filesystem transition
      tcp_socket { connectto newconn acceptfrom }
      node enforce_dest
      unix_stream_socket { newconn acceptfrom }
      
      Legacy network checks, removed in 2.6.30:
      socket { recv_msg send_msg }
      node { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }
      netif { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }
      
      Test: policy compiles and no boot errors (marlin)
      Change-Id: Idaef2567666f80db39c3e3cee70e760e1dac73ec
      11dc03e5
    • Connor O'Brien's avatar
      Add permissions for hal_boot · 12443b7a
      Connor O'Brien authored
      
      The service running the boot control HAL needs the permissions
      provided by the boot_control_hal attribute. update_engine and
      update_verifier still also need these permissions in order
      to successfully call the new HAL in pass-through mode, but also
      need permission to call the new service.
      
      Bug: 31864052
      Test: Built and confirmed no permission denials.
      Change-Id: I2a6fdd5cf79b9e461d7cc14bd5b7abd6481ed911
      Signed-off-by: default avatarConnor O'Brien <connoro@google.com>
      12443b7a
    • Jorge Lucangeli Obes's avatar
      Add WITH_DEXPREOPT_PIC to 'with_dexpreopt' SELinux macro. · 28994347
      Jorge Lucangeli Obes authored
      |WITH_DEXPREOPT_PIC = false| will still cause code to be loaded from
      /data.
      
      Bug: 32970029
      Test: On HiKey and Marlin:
      Test: Add |WITH_DEXPREOPT_PIC = false|, see SELinux denial.
      Test: Apply this CL, no SELinux denials.
      Change-Id: I0a1d39eeb4d7f75d84c1908b879d9ea1ccffba74
      28994347
    • Nick Kralevich's avatar
      Collapse urandom_device into random_device · 5eadcb8c
      Nick Kralevich authored
      urandom_device and random_device have the exact same security
      properties. Collapse them into one type.
      
      Test: device boots and /dev/urandom is labeled correctly.
      Change-Id: I12da30749291bc5e37d99bc9422bb86cb58cec41
      5eadcb8c
  13. Nov 20, 2016
    • Nick Kralevich's avatar
      domain_deprecated.te: delete stale permissions · f2de0752
      Nick Kralevich authored
      auditallows have been in place for quite a while now, and nothing has
      triggered. Let's do some cleanup!
      
      Bug: 28760354
      Test: device boots and no new denials
      Test: SELinux denials collection has seen no instances of these
            permissions
      Change-Id: I9293f8d8756c9db6307e344c32cd11b9e0183e7f
      f2de0752
    • Daniel Micay's avatar
      only permit text relocations in untrusted_app · dc083f59
      Daniel Micay authored
      The other domains either don't have the same backwards compatibility
      issues (isolated_app) or are privileged components that are pretty much
      part of the platform and can be expected to meet a higher standard.
      
      It would be possible to expose a build option for disabling the ART JIT,
      allowing conditional removal of execmem from some of these domains too
      (ones not ever using the WebView, until that's always in isolated_app).
      
      Bug: 20013628
      Change-Id: Ic22513157fc8b958b2a3d60381be0c07b5252fa5
      dc083f59
  14. Nov 18, 2016
    • Jorge Lucangeli Obes's avatar
      Use with_dexpreopt macro for zygote execute permissions. · 84db84e6
      Jorge Lucangeli Obes authored
      When WITH_DEXPREOPT is set, the zygote does not need to execute
      dalvikcache_data_file objects.
      
      Bug: 32970029
      Test: Add policy line inside macro, build with and without WITH_DEXPREOPT.
      Test: HiKey builds, boots, no zygote denials.
      Change-Id: I4dace93e8044267232f0f26cfe427fc250d351fb
      84db84e6
    • dcashman's avatar
      Move hal_light to attribute. · 3319d5ee
      dcashman authored
      HAL policy defines how the platform and a given HAL interact, but not how the
      HAL is implemented.  This policy should be represented as an attribute that all
      processes implementing the HAL can include.
      
      Bug: 32123421
      Test: Builds.
      Change-Id: I17e5612c0835773c28e14f09e2ce7bdc3f210c15
      3319d5ee
    • Connor O'Brien's avatar
      Revert "Move boot_control_hal attribute to hal_boot domain" · 394ed93d
      Connor O'Brien authored
      This reverts commit 1f329465.
      
      Bug: 32973182
      Change-Id: Ic0277b38b0249710a4f1fc362e777f3880ff096b
      394ed93d
  15. Nov 17, 2016
    • Max's avatar
      Removed a duplicate rule. · ca04f9b3
      Max authored
      Test: Device boots
      Change-Id: I151c5fb6f56850eaa215e1a917ac9ad609dbdd4a
      ca04f9b3
  16. Nov 16, 2016
    • Nick Kralevich's avatar
      shell.te: revoke syslog(2) access to shell user · c9630dc6
      Nick Kralevich authored
      external/toybox commit a583afc812cf7be74ebab72294c8df485908ff04 started
      having dmesg use /dev/kmsg, which is unreadable to the unprivileged
      shell user. Revoke syslog(2) to the shell user for consistency.
      
      The kernel dmesg log is a source of kernel pointers, which can leak
      kASLR information from the kernel. Restricting access to kernel
      information will make attacks against Android more difficult. Having
      said that, dmesg information is still available from "adb bugreport", so
      this change doesn't completely shutdown kernel info leaks.
      
      This change essentially reverts us to the state we were in between Nov 8
      2011 and May 27 2014. During that almost 3 year period, the unprivileged
      shell user was unable to access dmesg, and there was only one complaint
      during that time.
      
      References:
      * https://android.googlesource.com/platform/system/core/+/f9557fb
      * https://android.googlesource.com/platform/system/sepolicy/+/f821b5a
      
      TODO: Further unify /dev/kmsg permissions with syslog_read permissions.
      
      Test: policy compiles, no dmesg output
      Change-Id: Icfff6f765055bdbbe85f302b781aed2568ef532f
      c9630dc6
  17. Nov 15, 2016
    • Alex Deymo's avatar
      Move boot_control_hal attribute to hal_boot domain · 1f329465
      Alex Deymo authored
      Grant boot_control_hal permissions to the hal_boot service;
      update_engine and update_verifier can call that service rather
      than using those permissions themselves.
      
      Bug: 31864052
      Test: `bootctl set-active-boot-slot 1`
      Change-Id: I5188bc32e7933d4a0f5135b3246df119d3523d69
      1f329465
    • Nick Kralevich's avatar
      exclude su from app auditallow · e0d5c532
      Nick Kralevich authored
      su is an appdomain, and as such, any auditallow statements applicable to
      appdomain also apply to su. However, su is never enforced, so generating
      SELinux denials for such domains is pointless. Exclude su from
      ion_device auditallow rules.
      
      Addresses the following auditallow spam:
      
        avc: granted { ioctl } for comm="screencap" path="/dev/ion" dev="tmpfs"
        ino=10230 ioctlcmd=4906 scontext=u:r:su:s0
        tcontext=u:object_r:ion_device:s0 tclass=chr_file
      
      Test: policy compiles
      Change-Id: I2e783624b9e53ad365669bd6f2d4db40da475a16
      e0d5c532
    • Nick Kralevich's avatar
      isolated_app: allow access to pre-opened sdcard FDs · c121735f
      Nick Kralevich authored
      Allow isolated apps to read/write/append/lock already open sdcard
      file descriptors passed to it by normal app processes. isolated_apps are
      used by processes like Google drive when handling untrusted content.
      
      Addresses the following denial:
      
        audit(0.0:1508): avc: denied { read } for
        path="/storage/emulated/0/Download/02-corejava.pdf" dev="fuse" ino=310
        scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:fuse:s0
        tclass=file permissive=0
      
      This partially reverts the tightening added in
      ce4b5eea.
      
      Add a TODO to consider removing isolated_apps ability to write or append
      to files on the sdcard. This limits the damage that can occur should the
      isolated_app process be compromised.
      
      Bug: 32896414
      Test: Policy compiles. Rule add only, so no possibility of breakage.
      Change-Id: Ia128569608fc9c872c90e6c380106b7c81eb7b6f
      c121735f
    • Daichi Hirono's avatar
      Allow apps to search appfuse mount point and open a file on appfuse mount point. · 4c7044e0
      Daichi Hirono authored
      Bug: 29970149
      Test: None
      Change-Id: I59f49f3bf20d93effde5e1a9a3c1ed64fbecb7a8
      4c7044e0
  18. Nov 14, 2016
    • Chad Brubaker's avatar
      Allow ephemeral apps network connections · 4abf491a
      Chad Brubaker authored
      Test: Verify that HTTP and HTTPS connections from ephemeral apps do not
      cause denials.
      Change-Id: I0ce25602906e63ec55d5b5869445f2aec10900cb
      4abf491a
    • Chia-I Wu's avatar
      Add sepolicy for hwcomposer HAL · fb08872a
      Chia-I Wu authored
      Allow SurfaceFlinger to call into IComposer, and vice versa for
      IComposerCallback.
      
      Specifically,
      
      hwbinder_use(...) for
      avc: denied { call } for scontext=u:r:hal_graphics_composer:s0 tcontext=u:r:hwservicemanager:s0 tclass=binder permissive=1
      avc: denied { transfer } for scontext=u:r:hal_graphics_composer:s0 tcontext=u:r:hwservicemanager:s0 tclass=binder permissive=1
      
      binder_call(..., surfaceflinger) for
      avc: denied { call } for scontext=u:r:hal_graphics_composer:s0 tcontext=u:r:surfaceflinger:s0 tclass=binder permissive=1
      
      allow ... gpu_device:chr_file rw_file_perms for
      avc: denied { read write } for name="kgsl-3d0" dev="tmpfs" ino=14956 scontext=u:r:hal_graphics_composer:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=1
      avc: denied { open } for path="/dev/kgsl-3d0" dev="tmpfs" ino=14956 scontext=u:r:hal_graphics_composer:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=1
      avc: denied { ioctl } for path="/dev/kgsl-3d0" dev="tmpfs" ino=14956 ioctlcmd=940 scontext=u:r:hal_graphics_composer:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=1
      
      allow ... ion_device:chr_file r_file_perms for
      avc: denied { ioctl } for path="/dev/ion" dev="tmpfs" ino=15014 ioctlcmd=4900 scontext=u:r:hal_graphics_composer:s0 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=1
      
      allow ... graphics_device ... for
      avc: denied { ioctl } for path="/dev/graphics/fb0" dev="tmpfs" ino=15121 ioctlcmd=5380 scontext=u:r:hal_graphics_composer:s0 tcontext=u:object_r:graphics_device:s0 tclass=chr_file permissive=1
      
      allow ... ...:fd use for
      avc: denied { use } for path="anon_inode:dmabuf" dev="anon_inodefs" ino=12794 scontext=u:r:hal_graphics_composer:s0 tcontext=u:r:hal_graphics_allocator_service:s0 tclass=fd permissive=1
      avc: denied { use } for path="anon_inode:sync_fence" dev="anon_inodefs" ino=12794 scontext=u:r:hal_graphics_composer:s0 tcontext=u:r:bootanim:s0 tclass=fd permissive=1
      avc: denied { use } for path="anon_inode:sync_fence" dev="anon_inodefs" ino=12794 scontext=u:r:hal_graphics_composer:s0 tcontext=u:r:surfaceflinger:s0 tclass=fd permissive=1
      avc: denied { use } for path="anon_inode:sync_fence" dev="anon_inodefs" ino=12794 scontext=u:r:hal_graphics_composer:s0 tcontext=u:r:platform_app:s0:c512,c768 tclass=fd permissive=1
      
      binder_call(surfaceflinger, ...) for
      avc: denied { call } for scontext=u:r:surfaceflinger:s0 tcontext=u:r:hal_graphics_composer:s0 tclass=binder permissive=1
      avc: denied { transfer } for scontext=u:r:surfaceflinger:s0 tcontext=u:r:hal_graphics_composer:s0 tclass=binder permissive=1
      avc: denied { use } for path="anon_inode:sync_fence" dev="anon_inodefs" ino=12794 ioctlcmd=3e02 scontext=u:r:surfaceflinger:s0 tcontext=u:r:hal_graphics_composer:s0 tclass=fd permissive=1
      avc: denied { use } for path="anon_inode:sync_fence" dev="anon_inodefs" ino=12794 scontext=u:r:surfaceflinger:s0 tcontext=u:r:hal_graphics_composer:s0 tclass=fd permissive=1
      
      allow bootanim ...:fd use for
      avc: denied { use } for path="anon_inode:sync_fence" dev="anon_inodefs" ino=11947 scontext=u:r:bootanim:s0 tcontext=u:r:hal_graphics_composer:s0 tclass=fd permissive=1
      
      Bug: 32021609
      Test: make bootimage
      Change-Id: I036cdbebf0c619fef7559f294f1865f381b17588
      fb08872a
    • Chia-I Wu's avatar
      Add sepolicy for gralloc-alloc HAL · dd958e5a
      Chia-I Wu authored
      Allow SurfaceFlinger to call into IAllocator, and allow everyone to access
      IAllocator's fd.
      
      Specifically,
      
      hwbinder_use(...) for
      avc: denied { call } for scontext=u:r:hal_graphics_allocator:s0 tcontext=u:r:hwservicemanager:s0 tclass=binder permissive=1
      avc: denied { transfer } for scontext=u:r:hal_graphics_allocator:s0 tcontext=u:r:hwservicemanager:s0 tclass=binder permissive=1
      
      allow ... ion_device:chr_file r_file_perms for
      avc: denied { read } for name="ion" dev="tmpfs" ino=15014 scontext=u:r:hal_graphics_allocator:s0 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=1
      avc: denied { open } for path="/dev/ion" dev="tmpfs" ino=15014 scontext=u:r:hal_graphics_allocator:s0 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=1
      avc: denied { ioctl } for path="/dev/ion" dev="tmpfs" ino=15014 ioctlcmd=4900 scontext=u:r:hal_graphics_allocator:s0 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=1
      
      allow ... gpu_device:chr_file rw_file_perms; for
      avc: denied { read write } for name="kgsl-3d0" dev="tmpfs" ino=14956 scontext=u:r:hal_graphics_allocator:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=1
      avc: denied { open } for path="/dev/kgsl-3d0" dev="tmpfs" ino=14956 scontext=u:r:hal_graphics_allocator:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=1
      avc: denied { ioctl } for path="/dev/kgsl-3d0" dev="tmpfs" ino=14956 ioctlcmd=940 scontext=u:r:hal_graphics_allocator:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=1
      
      binder_call(surfaceflinger, ...) for
      avc: denied { call } for scontext=u:r:surfaceflinger:s0 tcontext=u:r:hal_graphics_allocator:s0 tclass=binder permissive=1
      
      allow ... ...:fd use for
      avc: denied { use } for path="anon_inode:dmabuf" dev="anon_inodefs" ino=12794 scontext=u:r:surfaceflinger:s0 tcontext=u:r:hal_graphics_allocator:s0 tclass=fd permissive=1
      
      Bug: 32021161
      Test: make bootimage
      Change-Id: Ie7700142313407ac438c43dd1a85544dc4c67f13
      dd958e5a
Loading