Skip to content
Snippets Groups Projects
  1. Mar 02, 2016
  2. Feb 24, 2016
  3. Feb 19, 2016
  4. Feb 05, 2016
    • dcashman's avatar
      Allow domain to read proc dirs. · abf31acb
      dcashman authored
      Ability to read all of proc was placed in domain_deprecated with the
      intention of reducing information leaking from proc.  Many processes try
      to read proc dirs, though.  Allow this with the belief that information
      leakage is from the proc files themselves rather than dir structure.
      
      Address the following denial:
      avc: denied { read } for name="/" dev="proc" ino=1 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=dir permissive=0
      
      Bug: 26833472
      Change-Id: I975ae022c093e1cf80de21487dc11e49f938e5a3
      abf31acb
    • Nick Kralevich's avatar
      Replace "neverallow domain" by "neverallow *" · 35a14514
      Nick Kralevich authored
      Modify many "neverallow domain" rules to be "neverallow *" rules
      instead. This will catch more SELinux policy bugs where a label
      is assigned an irrelevant rule, as well as catch situations where
      a domain attribute is not assigned to a process.
      
      Change-Id: I5b83a2504c13b384f9dff616a70ca733b648ccdf
      35a14514
    • Andreas Gampe's avatar
      Selinux: introduce policy for OTA preopt · 47ebae1a
      Andreas Gampe authored
      Add permissions to dex2oat, introduce otapreopt binary and otadexopt
      service.
      
      Bug: 25612095
      Change-Id: I80fcba2785e80b2931d7d82bb07474f6cd0099f7
      47ebae1a
  5. Feb 04, 2016
  6. Jan 29, 2016
  7. Jan 27, 2016
    • Jeff Vander Stoep's avatar
      domain: grant write perms to cgroups · be0616ba
      Jeff Vander Stoep authored
      Was moved to domain_deprecated. Move back to domain.
      
      Files in /acct/uid/*/tasks are well protected by unix permissions.
      No information is leaked with write perms.
      
      Change-Id: I8017e906950cba41ce350bc0892a36269ade8d53
      be0616ba
  8. Jan 26, 2016
    • SimHyunYong's avatar
      Using r_dir_file macro in domain.te · 093ea6fb
      SimHyunYong authored
      r_dir_file(domain, self)
      
      allow domain self:dir r_dir_perms;
      allow domain self:lnk_file r_file_perms;
      allow domain self:file r_file_perms;
      
      te_macros
      define(`r_dir_file', `
      allow $1 $2:dir r_dir_perms;
      allow $1 $2:{ file lnk_file } r_file_perms;
      ')
      
      Change-Id: I7338f63a1eaa8ca52cd31b51ce841e3dbe46ad4f
      093ea6fb
  9. Jan 25, 2016
    • Jeff Vander Stoep's avatar
      domain: allow dir search in selinuxfs · 45517a75
      Jeff Vander Stoep authored
      Domain is already allowed to stat selinuxfs, it also needs
      dir search.
      
      Addresses:
      avc: denied { search } for name="/" dev="selinuxfs" ino=1 scontext=u:r:watchdogd:s0 tcontext=u:object_r:selinuxfs:s0 tclass=dir
      
      Change-Id: I3e5bb96e905db480a2727038f80315d9544e9c07
      45517a75
  10. Jan 22, 2016
    • dcashman's avatar
      Allow access to /dev/ion and proc_net dir. · 8666bf25
      dcashman authored
      Address the following:
      01-21 13:35:41.147  5896  5896 W ndroid.music:ui: type=1400 audit(0.0:22): avc: denied { read } for name="ion" dev="tmpfs" ino=1237 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=0
      01-21 13:35:41.152  5896  5896 E qdmemalloc: open_device: Failed to open ion device - Permission denied
      01-21 13:35:41.152  5896  5896 E qdgralloc: Could not mmap handle 0x7f827d7260, fd=55 (Permission denied)
      01-21 13:35:41.152  5896  5896 E qdgralloc: gralloc_register_buffer: gralloc_map failed
      
      and
      
      01-22 08:58:47.667  7572  7572 W Thread-23: type=1400 audit(0.0:186): avc: denied { search } for name="xt_qtaguid" dev="proc" ino=4026535741 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=dir permissive=0
      01-22 08:58:47.671  7498  7572 I qtaguid : Untagging socket 68 failed errno=-13
      01-22 08:58:47.671  7498  7572 W NetworkManagementSocketTagger: untagSocket(68) failed with errno -13
      
      Change-Id: Id4e253879fe0f6daadd04d148a257a10add68d38
      8666bf25
  11. Jan 21, 2016
    • dcashman's avatar
      Allow domains to stat filesystems. · fcea7263
      dcashman authored
      Address the following denials:
      01-21 12:44:53.704  4595  4595 W ndroid.calendar: type=1400 audit(0.0:21): avc: denied { getattr } for name="/" dev="dm-0" ino=2 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:labeledfs:s0 tclass=filesystem permissive=0
      01-21 12:45:23.177  5544  5544 W roid.music:main: type=1400 audit(0.0:46): avc: denied { getattr } for name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=filesystem permissive=0
      7618 W .android.chrome: type=1400 audit(0.0:413): avc: denied { getattr } for path="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
      
      01-21 12:44:53.709  4595  4595 D AndroidRuntime: Shutting down VM
      01-21 12:44:53.727  4595  4595 E AndroidRuntime: FATAL EXCEPTION: main
      01-21 12:44:53.727  4595  4595 E AndroidRuntime: Process: com.google.android.calendar, PID: 4595
      01-21 12:44:53.727  4595  4595 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.android.syncadapters.calendar.timely.TimelyProvider: java.lang.IllegalArgumentException: Invalid path: /data
      01-21 12:44:53.727  4595  4595 E AndroidRuntime: 	at android.app.ActivityThread.installProvider(ActivityThread.java:5550)
      ...
      
      Change-Id: I0e9d65438d031e19c9abc5dca8969ed4356437a0
      fcea7263
  12. Jan 07, 2016
    • dcashman's avatar
      Allow domain to read symlinks in /sys. · cee72924
      dcashman authored
      Address the following denial:
      avc: denied { read } for name="battery" dev="sysfs" ino=17945 scontext=u:r:shell:s0 tcontext=u:object_r:sysfs:s0 tclass=lnk_file permissive=0
      
      Bug: 26219114
      Change-Id: I862b40a6514bffaa455dd7f06368acf9bcdc4782
      cee72924
  13. Jan 04, 2016
    • Felipe Leme's avatar
      Creates a new permission for /cache/recovery · 549ccf77
      Felipe Leme authored
      This permission was created mostly for dumpstate (so it can include
      recovery files on bugreports when an OTA fails), but it was applied to
      uncrypt and recovery as well (since it had a wider access before).
      
      Grant access to cache_recovery_file where we previously granted access
      to cache_file. Add auditallow rules to determine if this is really
      needed.
      
      BUG: 25351711
      Change-Id: I07745181dbb4f0bde75694ea31b3ab79a4682f18
      549ccf77
  14. Dec 24, 2015
    • Daichi Hirono's avatar
      Add new rules for appfuse. · a20802dd
      Daichi Hirono authored
      The new rules are used to allow to mount FUSE file system for priv-app.
      
      Change-Id: I5ce2d261be501e2b3fef09b7666f1e5d1cddbe52
      a20802dd
  15. Dec 23, 2015
    • Nick Kralevich's avatar
      undeprecate /proc/cpuinfo, more shell permissions · f8f937a1
      Nick Kralevich authored
      Access to /proc/cpuinfo was moved to domain_deprecated in commit
      6e3506e1. Restore access to everyone.
      
      Allow the shell user to stat() /dev, and vfsstat() /proc and other
      labeled filesystems such as /system and /data.
      
      Access to /proc/cpuinfo was explicitly granted to bootanim, but is no
      longer required after moving it back to domain.te. Delete the redundant
      entry.
      
      Commit 4e2d2245 restored access to
      /sys/devices/system/cpu for all domains, but forgot to remove the
      redundant entry from bootanim.te. Cleanup the redundant entry.
      
      Addresses the following denials:
      
        avc: denied { getattr } for pid=23648 comm="bionic-unit-tes" name="/" dev="proc" ino=1 scontext=u:r:shell:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
        avc: denied { read } for name="cpuinfo" dev="proc" ino=4026533615 scontext=u:r:shell:s0 tcontext=u:object_r:proc_cpuinfo:s0 tclass=file permissive=0
        avc: denied { getattr } for pid=23713 comm="bionic-unit-tes" path="/dev" dev="tmpfs" ino=11405 scontext=u:r:shell:s0 tcontext=u:object_r:device:s0 tclass=dir permissive=0
        avc: denied { getattr } for name="/" dev="mmcblk0p30" ino=2 scontext=u:r:shell:s0 tcontext=u:object_r:labeledfs:s0 tclass=filesystem permissive=0
      
      Bug: 26295417
      Change-Id: Ia85ac91cbd43235c0f8fe0aebafffb8046cc77ec
      f8f937a1
  16. Dec 18, 2015
    • Nick Kralevich's avatar
      neverallow debugfs access · 96b1c9ca
      Nick Kralevich authored
      Don't allow access to the generic debugfs label. Instead, force
      relabeling to a more specific type. system_server and dumpstate
      are excluded from this until I have time to fix them.
      
      Tighten up the neverallow rules for untrusted_app. It should never
      be reading any file on /sys/kernel/debug, regardless of the label.
      
      Change-Id: Ic7feff9ba3aca450f1e0b6f253f0b56c7918d0fa
      96b1c9ca
  17. Dec 14, 2015
    • Nick Kralevich's avatar
      label /sys/kernel/debug/tracing and remove debugfs write · fe12b616
      Nick Kralevich authored
      Start labeling the directory /sys/kernel/debug/tracing. The files
      in this directory need to be writable to the shell user.
      
      Remove global debugfs:file write access. This was added in the days
      before we could label individual debugfs files.
      
      Change-Id: I79c1fcb63b4b9b903dcabd99b6b25e201fe540a3
      fe12b616
  18. Dec 10, 2015
    • Nick Kralevich's avatar
      Restore sysfs_devices_system_cpu to domain.te · 4e2d2245
      Nick Kralevich authored
      Lots of processes access CPU information. This seems to be triggered
      by libraries loaded into every Android process. Allow the access.
      
      Addresses the following denials:
      
      adbd    : type=1400 audit(0.0:3): avc: denied { search } for name="cpu" dev="sysfs" ino=32 scontext=u:r:adbd:s0 tcontext=u:object_r:sysfs_devices_system_cpu:s0 tclass=dir permissive=1
      adbd    : type=1400 audit(0.0:4): avc: denied { read } for name="online" dev="sysfs" ino=34 scontext=u:r:adbd:s0 tcontext=u:object_r:sysfs_devices_system_cpu:s0 tclass=file permissive=1
      adbd    : type=1400 audit(0.0:5): avc: denied { open } for path="/sys/devices/system/cpu/online" dev="sysfs" ino=34 scontext=u:r:adbd:s0 tcontext=u:object_r:sysfs_devices_system_cpu:s0 tclass=file permissive=1
      adbd    : type=1400 audit(0.0:6): avc: denied { getattr } for path="/sys/devices/system/cpu/online" dev="sysfs" ino=34 scontext=u:r:adbd:s0 tcontext=u:object_r:sysfs_devices_system_cpu:s0 tclass=file permissive=1
      
      Change-Id: Ie7bfae53bdf670028db724d2720447ead42bad35
      4e2d2245
  19. Dec 08, 2015
    • Nick Kralevich's avatar
      Remove property read access for non-core properties · 5a570a4b
      Nick Kralevich authored
      Instead of allowing global read access to all properties,
      only allow read access to the properties which are part of
      core SELinux policy. Device-specific policies are no longer
      readable by default and need to be granted in device-specific
      policy.
      
      Grant read-access to any property where the person has write
      access. In most cases, anyone who wants to write a property
      needs read access to that property.
      
      Change-Id: I2bd24583067b79f31b3bb0940b4c07fc33d09918
      5a570a4b
    • Nick Kralevich's avatar
      Add initial debugfs labeling support and label /sys/kernel/debug/tracing/trace_marker · 44826cb5
      Nick Kralevich authored
      Add initial support for labeling files on /sys/kernel/debug.
      The kernel support was added in https://android-review.googlesource.com/122130
      but the userspace portion of the change was never completed until now.
      
      Start labeling the file /sys/kernel/debug/tracing/trace_marker . This
      is the trace_marker file, which is written to by almost all processes
      in Android. Allow global write access to this file.
      
      This change should be submitted at the same time as the system/core
      commit with the same Change-Id as this patch.
      
      Change-Id: Id1d6a9ad6d0759d6de839458890e8cb24685db6d
      44826cb5
  20. Dec 03, 2015
    • Tom Cherry's avatar
      Support fine grain read access control for properties · 949d7cbc
      Tom Cherry authored
      Properties are now broken up from a single /dev/__properties__ file into
      multiple files, one per property label.  This commit provides the
      mechanism to control read access to each of these files and therefore
      sets of properties.
      
      This allows full access for all domains to each of these new property
      files to match the current permissions of /dev/__properties__.  Future
      commits will restrict the access.
      
      Bug: 21852512
      
      Change-Id: Ie9e43968acc7ac3b88e354a0bdfac75b8a710094
      949d7cbc
  21. Nov 28, 2015
    • Nick Kralevich's avatar
      Remove domain_deprecated from adbd and shell · 8ca19368
      Nick Kralevich authored
      The extra permissions are not needed. Delete them.
      
      This change also adds read permission for /data/misc/zoneinfo
      back to all domains. libc refernces this directory for timezone
      related files, and it feels dangerous and of little value to
      try to restrict access. In particular, this causes problems when the
      shell user attempts to run "ls -la" to show file time stamps in
      the correct timezone.
      
      Bug: 25433265
      Change-Id: I666bb460e440515151e3bf46fe2e0ac0e7c99f46
      8ca19368
  22. Nov 25, 2015
  23. Nov 19, 2015
    • Jeff Vander Stoep's avatar
      Move some perms back to domain · aef68b77
      Jeff Vander Stoep authored
      libselinux stats selinuxfs, as does every process that links against
      libselinux such as toolbox. grant:
         allow domain selinuxfs:filesystem getattr;
      
      domain is already granted:
         allow domain self:dir r_dir_perms;
         allow domain self:lnk_file r_file_perms;
         allow domain self:{ fifo_file file } rw_file_perms;
      To make these possible, also grant:
         allow domain proc:dir search;
      
      Change-Id: Ife6cfa2124c9d61bf908ac89a8444676acdb4259
      aef68b77
    • David Zeuthen's avatar
      DO NOT MERGE Move update_engine policy to AOSP. · 500a598e
      David Zeuthen authored
      The update_engine daemon from Brillo is expected to be used also in
      Android so move its selinux policy to AOSP.
      
      Put update_engine in the whitelist (currently only has the recovery
      there) allowing it to bypass the notallow for writing to partititions
      labeled as system_block_device.
      
      Also introduce the misc_block_device dev_type as update_engine in some
      configurations may need to read/write the misc partition. Start
      migrating uncrypt to use this instead of overly broad
      block_device:blk_file access.
      
      Bug: 23186405
      Test: Manually tested with Brillo build.
      
      Change-Id: Icf8cdb4133d4bbdf14bacc6c0fa7418810ac307a
      (cherry picked from commit a10f789d)
      500a598e
  24. Nov 16, 2015
  25. Nov 09, 2015
  26. Oct 29, 2015
    • Nick Kralevich's avatar
      Create a new SELinux type for /data/nativetest · e9d261ff
      Nick Kralevich authored
      1) Don't use the generic "system_data_file" for the files in /data/nativetest.
      Rather, ensure it has it's own special label. This allows us to distinguish
      these files from other files in SELinux policy.
      
      2) Allow the shell user to execute files from /data/nativetest, on
      userdebug or eng builds only.
      
      3) Add a neverallow rule (compile time assertion + CTS test) that nobody
      is allowed to execute these files on user builds, and only the shell user
      is allowed to execute these files on userdebug/eng builds.
      
      Bug: 25340994
      Change-Id: I3e292cdd1908f342699d6c52f8bbbe6065359413
      e9d261ff
  27. Oct 28, 2015
    • Nick Kralevich's avatar
      Update text relocation neverallow assertions · 89424bf9
      Nick Kralevich authored
      1) Don't allow any SELinux domain to attempt to perform a text
      relocation on a file from the /system partition. It's not supported
      and should never be attempted.
      
      2) Completely block any non-app SELinux domains from using text
      relocations, regardless of the source.
      
      Bug: 20013628
      Change-Id: I82573398d0d5586264a717a1e400a3dbc7793fe3
      89424bf9
  28. Oct 14, 2015
    • Jeff Vander Stoep's avatar
      Add priv_app domain to global seapp_context · ee9c0b5f
      Jeff Vander Stoep authored
      Assign priviliged apps not signed with the platform key to the priv_app
      domain.
      
      Bug: 22033466
      Change-Id: Idf7fbe7adbdc326835a179b554f96951b69395bc
      ee9c0b5f
    • William Roberts's avatar
      neverallow: domain:file execute and entrypoint · f25304ee
      William Roberts authored
      
      Occasionally, files get labeled with the domain type rather
      than the executable file type. This can work if the author
      uses domain_auto_trans() versus init_daemon_domain(). This
      will cause a lot of issues and is typically not what the
      author intended.
      
      Another case where exec on domain type might occur, is if
      someone attempts to execute a /proc/pid file, this also
      does not make sense.
      
      To prevent this, we add a neverallow.
      
      Change-Id: I39aff58c8f5a2f17bafcd2be33ed387199963b5f
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      f25304ee
  29. Oct 10, 2015
  30. Oct 07, 2015
    • Nick Kralevich's avatar
      delete procrank SELinux domain. · 9e6effa1
      Nick Kralevich authored
      Simplify SELinux policy by deleting the procrank SELinux domain.
      procrank only exists on userdebug/eng builds, and anyone wanting
      to run procrank can just su to root.
      
      Bug: 18342188
      Change-Id: I71adc86a137c21f170d983e320ab55be79457c16
      9e6effa1
    • David Zeuthen's avatar
      Move update_engine policy to AOSP. · a10f789d
      David Zeuthen authored
      The update_engine daemon from Brillo is expected to be used also in
      Android so move its selinux policy to AOSP.
      
      Put update_engine in the whitelist (currently only has the recovery
      there) allowing it to bypass the notallow for writing to partititions
      labeled as system_block_device.
      
      Also introduce the misc_block_device dev_type as update_engine in some
      configurations may need to read/write the misc partition. Start
      migrating uncrypt to use this instead of overly broad
      block_device:blk_file access.
      
      Bug: 23186405
      Test: Manually tested with Brillo build.
      
      Change-Id: Icf8cdb4133d4bbdf14bacc6c0fa7418810ac307a
      a10f789d
  31. Oct 06, 2015
    • Nick Kralevich's avatar
      remove "allow vold block_device:blk_file create_file_perms;" · 7e86e19d
      Nick Kralevich authored
      vold hasn't use the generic "block_device" label since
      commit 273d7ea4 (Sept 2014), and
      the auditallow statement in vold hasn't triggered since that time.
      
      Remove the rule which allows vold access to the generic block_device
      label, and remove the vold exception.
      
      Thanks to jorgelo for reminding me about this.
      
      Change-Id: Idd6cdc20f5be9a40c5c8f6d43bbf902a475ba1c9
      7e86e19d
Loading