Skip to content
Snippets Groups Projects
  1. Nov 23, 2016
  2. Nov 22, 2016
    • Treehugger Robot's avatar
    • 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
    • Nick Kralevich's avatar
      label /bugreports · d314376d
      Nick Kralevich authored
      /data/bugreports is moving to /bugreports
      
      Bug: 27262109
      Bug: 27204904
      Bug: 32799236
      Test: new symlink is in /bugreports and is labeled correctly
      Change-Id: Ib6a492fba8388bf43debad28cfc851679f8c6151
      d314376d
  3. 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
    • Treehugger Robot's avatar
    • 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
  4. 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
  5. Nov 18, 2016
  6. Nov 17, 2016
  7. 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
  8. 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
    • Treehugger Robot's avatar
      Merge "exclude su from app auditallow" · 747c69f4
      Treehugger Robot authored
      747c69f4
    • 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
  9. Nov 14, 2016
    • Treehugger Robot's avatar
      41301ab7
    • Connor O'Brien's avatar
      35324445
    • 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
  10. Nov 12, 2016
  11. Nov 11, 2016
    • Nick Kralevich's avatar
      property.te: delete security_prop · ee751c33
      Nick Kralevich authored
      This property is never used.
      
      Test: policy compiles
      Change-Id: I43ace92950e1221754db28548031fbbfc0437d7a
      ee751c33
    • Treehugger Robot's avatar
      Merge "property.te: sort entries" · 7da34af8
      Treehugger Robot authored
      7da34af8
    • Robert Sesek's avatar
      Add the "webview_zygote" domain. · dc43f7cd
      Robert Sesek authored
      The webview_zygote is a new unprivileged zygote and has its own sockets for
      listening to fork requests. However the webview_zygote does not run as root
      (though it does require certain capabilities) and only allows dyntransition to
      the isolated_app domain.
      
      Test: m
      Test: angler boots
      
      Bug: 21643067
      Change-Id: I89a72ffe6dcb983c4a44048518efd7efb7ed8e83
      dc43f7cd
    • Nick Kralevich's avatar
      property.te: sort entries · 26c6d726
      Nick Kralevich authored
      Sort the entries in property.te. This will make it slightly easier to
      read, and avoids merge conflicts by discouraging the common practice of
      adding entries to the bottom of this file.
      
      Test: policy compiles.
      Change-Id: I87ae96b33156dba73fb7eafc0f9a2a961b689853
      26c6d726
  12. Nov 10, 2016
    • Jason Monk's avatar
      Add persist.vendor.overlay. to properties · 0e1cbf56
      Jason Monk authored
      Allow the system_server to change. Allow the zygote to read it as well.
      
      Test: Have system_server set a property
      Change-Id: Ie90eec8b733fa7193861026a3a6e0fb0ba5d5318
      0e1cbf56
  13. Nov 09, 2016
  14. Nov 08, 2016
    • Nick Kralevich's avatar
      Revert "Restore system_server ioctl socket access." · 58305da9
      Nick Kralevich authored
      The underlying ioctl denial was fixed in device-specific policy.
      It's not needed in core policy.
      
      A search of SELinux denials shows no reported denials, other than the
      ones showing up on marlin.
      
      This reverts commit ec3285cd.
      
      (cherrypicked from commit 863ce3e7)
      
      Test: AndroiTS GPS Test app shows GPS data, no SELinux denials.
      Bug: 32290392
      Change-Id: I1ba7bad43a2cdd7cdebbe1c8543a71eee765621d
      58305da9
    • Nick Kralevich's avatar
      profman/debuggerd: allow libart_file:file r_file_perms · 364fd197
      Nick Kralevich authored
      Addresses the following auditallow spam:
      
      avc: granted { read open } for comm="profman"
      path="/system/lib/libart.so" dev="dm-0" ino=1368 scontext=u:r:profman:s0
      tcontext=u:object_r:libart_file:s0 tclass=file
      
      avc: granted { read open } for comm="debuggerd64"
      path="/system/lib64/libart.so" dev="dm-0" ino=1897
      scontext=u:r:debuggerd:s0 tcontext=u:object_r:libart_file:s0 tclass=file
      
      avc: granted { getattr } for comm="debuggerd64"
      path="/system/lib64/libart.so" dev="dm-0" ino=1837
      scontext=u:r:debuggerd:s0 tcontext=u:object_r:libart_file:s0 tclass=file
      
      Test: Policy compiles. Not a tightening of rules.
      Change-Id: I501b0a6a343c61b3ca6283647a18a9a15deddf2a
      364fd197
    • Polina Bondarenko's avatar
      sepolicy: Add policy for thermal HIDL service · 9785f2ad
      Polina Bondarenko authored
      Bug: 32022261
      Test: manual
      Change-Id: I664a3b5c37f6a3a36e4e5beb91b384a9599c83f8
      9785f2ad
Loading