Skip to content
Snippets Groups Projects
  1. Aug 16, 2017
    • Tianjie Xu's avatar
      Allow update_verifier to write to kmsg · d499e914
      Tianjie Xu authored
      Denial message:
      avc: denied { write } for pid=640 comm="update_verifier" name="kmsg"
      dev="tmpfs" ino=13951 scontext=u:r:update_verifier:s0
      tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0
      
      Bug: 64713327
      Test: update_verifier logs successfully during boot time.
      Change-Id: I421b1e6660239e5ffc624e504f5945d400510407
      d499e914
  2. Aug 11, 2017
    • Josh Gao's avatar
      Add /dev/kmsg_debug. · 94e2a921
      Josh Gao authored
      Add /dev/kmsg_debug on userdebug devices, to allow crash_dump to log
      crashes to dmesg when logd isn't up yet (or is the one crashing).
      
      Bug: http://b/36574794
      Test: stop tombstoned; crasher; dmesg
      Change-Id: I6ffe11bc613e88198893e82712719522b74fe1be
      94e2a921
    • Nick Kralevich's avatar
      Validate no-cross-domain /proc/PID access · 7a463809
      Nick Kralevich authored
      Android uses hidepid=2 to restrict visibility to other /proc entries on
      the system. This helps preserve user, application, and system
      confidentiality by preventing unauthorized access to application metadata,
      and addresses attacks such as
      http://www.cs.ucr.edu/~zhiyunq/pub/sec14_android_activity_inference.pdf
      
      Ensure the SELinux (weaker) equivalent is being enforced by adding
      neverallow compile time assertions.
      
      TODO: The "shell" user runs as both an Android application, as well as
      spawned via adb shell. This was a mistake. We should separate out the
      "shell" Android app into it's own SELinux domain. For now, exclude the
      shell from this assertion. (The shell Android app is covered by
      hidepid=2, so there's no leaking of data, but still, it's over
      privileged today and should be cleaned up.
      
      Bug: 23310674
      Test: policy compiles. Compile time assertion only.
      Change-Id: I0e1a6506b2719aabf7eb8127f046c4ada947ba90
      7a463809
  3. Aug 02, 2017
  4. Aug 01, 2017
    • Manoj Gupta's avatar
      Fix static analyzer warnings. · 3cdd4a4b
      Manoj Gupta authored
      Fix the following warnings:
      
      system/sepolicy/tools/sepolicy-analyze/neverallow.c:346:9: warning:
      Potential leak of memory pointed to by '__s1'
      system/sepolicy/tools/sepolicy-analyze/neverallow.c:346:9: warning:
      Potential leak of memory pointed to by 'id'
      system/sepolicy/tools/sepolicy-analyze/neverallow.c:364:13: warning:
      Potential leak of memory pointed to by 'classperms'
      system/sepolicy/tools/sepolicy-analyze/neverallow.c:364:13: warning:
      Potential leak of memory pointed to by 'node'
      
      Bug: b/27101951
      Test:Warnings are gone.
      Change-Id: Ib9b2e0b9f19950b4b764d438ee58340e6c022ef5
      3cdd4a4b
  5. Jul 31, 2017
    • Ruchi Kandoi's avatar
      Allow nfc application to set nfc property · df964950
      Ruchi Kandoi authored
      type=1400 audit(1501520483.066:14): avc: denied { write } for pid=3330
      comm=4173796E635461736B202331 name="property_service" dev="tmpfs"
      ino=10749 scontext=u:r:nfc:s0 tcontext=u:object_r:property_socket:s0
      tclass=sock_file permissive=0
      
      Test: No sepolicy denials
      Bug: 64010793
      Change-Id: I8d73e8e19cd4d0a8c61f1f184820c53e5cc2b6d6
      df964950
  6. Jul 28, 2017
    • Jeff Vander Stoep's avatar
      system_server: allow writing to timerslack_ns · 5c41d40e
      Jeff Vander Stoep authored
      The only file in /proc/<pid>/ that is world writeable is
      /proc/<pid>/timerslack_ns so granting selinux write permission to
      a process's /proc/<pid>/ file only allows writing to timerslack_ns
      (unless the process is running as system UID).
      
      Addresses denials such as:
      avc: denied { write } for comm="Binder:1117_2" name="timerslack_ns"
      dev="proc" ino=27908 scontext=u:r:system_server:s0
      tcontext=u:r:priv_app:s0 tclass=file permissive=1
      
      Bug: 30675296
      Test: build
      Change-Id: I2cee8ce73a0dc05d771881c36da2fde5411859fb
      5c41d40e
    • Treehugger Robot's avatar
      Merge "domain_deprecated is dead" · f1b06df3
      Treehugger Robot authored
      f1b06df3
    • Jeff Vander Stoep's avatar
      domain_deprecated is dead · b5da252e
      Jeff Vander Stoep authored
      long live domain.te!
      
      Remove all references.
      
      Bug: 28760354
      Test: build
      Merged-In: I99953ecc7d275fdbe8e56d8f47a27d1f9e1cc09a
      Change-Id: I99953ecc7d275fdbe8e56d8f47a27d1f9e1cc09a
      b5da252e
    • Tim Kryger's avatar
      Merge "Fix selinux denials during bugreport" · bfbe96ac
      Tim Kryger authored
      bfbe96ac
  7. Jul 27, 2017
    • Tim Kryger's avatar
      Fix selinux denials during bugreport · b7e1f2dd
      Tim Kryger authored
      
      avc: denied { read } for pid=1704 comm="top" name="stat" dev="proc" ino=4026532297 scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_stat:s0 tclass=file permissive=0
      avc: denied { read } for pid=1636 comm="dumpstate" name="lcd-backlight" dev="sysfs" ino=16592 scontext=u:r:dumpstate:s0 tcontext=u:object_r:sysfs_leds:s0 tclass=lnk_file permissive=0
      avc: denied { call } for pid=2230 comm="dumpsys" scontext=u:r:dumpstate:s0 tcontext=u:r:installd:s0 tclass=binder permissive=0
      avc: denied { create } for pid=1700 comm="ip" scontext=u:r:dumpstate:s0 tcontext=u:r:dumpstate:s0 tclass=netlink_xfrm_socket permissive=0
      
      Bug: 62410287
      Bug: 35350306
      Change-Id: I65be3678c64214ebeb544e0e155bce88b21adf02
      Signed-off-by: default avatarTim Kryger <tkryger@google.com>
      b7e1f2dd
    • Jeff Vander Stoep's avatar
      domain_deprecated: remove sysfs rules · 275f6dd5
      Jeff Vander Stoep authored
      Clean up the remaining granted permissions in domain_deprecated.
      
      avc: granted { read open } for comm="uncrypt"
      path="/sys/firmware/devicetree/base/firmware/android/fstab/compatible"
      dev="sysfs" ino=17591 scontext=u:r:uncrypt:s0
      tcontext=u:object_r:sysfs:s0 tclass=file
      avc: granted { getattr } for comm="uncrypt"
      path="/sys/firmware/devicetree/base/firmware/android/compatible"
      dev="sysfs" ino=17583 scontext=u:r:uncrypt:s0
      tcontext=u:object_r:sysfs:s0 tclass=file
      
      vc: granted { read open } for comm="update_engine"
      path="/sys/firmware/devicetree/base/firmware/android/fstab" dev="sysfs"
      ino=17258 scontext=u:r:update_engine:s0 tcontext=u:object_r:sysfs:s0
      tclass=dir
      avc: granted { getattr } for comm="update_engine"
      path="/sys/firmware/devicetree/base/firmware/android/fstab/compatible"
      dev="sysfs" ino=17259 scontext=u:r:update_engine:s0
      tcontext=u:object_r:sysfs:s0 tclass=file
      
      Bug: 28760354
      Test: build
      Change-Id: Id318ce84894c1001361923f5205de093a15c1e6a
      275f6dd5
    • Jeffrey Vander Stoep's avatar
    • Jeff Vander Stoep's avatar
      netd: relax binder neverallow rules for hwservices · 07c650eb
      Jeff Vander Stoep authored
      Relax neverallow rule restricting binder access to/from netd so that
      netd can export hwbinder services to vendor components.
      
      Continue to disallow app access to netd via binder.
      
      Bug: 36682246
      Test: build
      Change-Id: I8e558ea1add6c36b966ec1da204062ea82df3f3f
      07c650eb
    • Joel Galenson's avatar
      Move file labeling to genfs_contexts. · 27c0aa7a
      Joel Galenson authored
      This should improve performance, as file_contexts is slower than
      genfs_contexts.
      
      Bug: 62413700
      Test: Built, flashed, and booted Sailfish.  Verified that the
      files have the correct context and that wifi, web, and atrace work.
      
      Merged-In: Ia28707ec565a0792bc882fbffe9e8ab9968535f5
      Change-Id: I9546f3af3c95e3443684ae4764881b69987611ef
      27c0aa7a
  8. Jul 26, 2017
    • Treehugger Robot's avatar
      5a30eadc
    • Treehugger Robot's avatar
      825173e3
    • Jeff Vander Stoep's avatar
      cgroup: allow associate to tmpfs · 5dcaa67b
      Jeff Vander Stoep authored
      Allows groups to be mounted at /dev/memcg
      
      Addresses:
      avc: denied { associate } for comm="init" name="memcg"
      scontext=u:object_r:cgroup:s0 tcontext=u:object_r:tmpfs:s0
      tclass=filesystem permissive=0
      
      Bug: 64067152
      Test: build
      Change-Id: Ic8f641e841fe09c8f7fd487ed67cf0ab4860a1cc
      5dcaa67b
    • Jeff Vander Stoep's avatar
      system_server: read symlinks in /cache · a4cada74
      Jeff Vander Stoep authored
      type=1400 audit(0.0:6): avc: denied { read } for comm="Thread-5"
      name="cache" dev="dm-0" ino=13 scontext=u:r:system_server:s0
      tcontext=u:object_r:cache_file:s0 tclass=lnk_file permissive=0
      
      Bug: 64067152
      Test: build
      Change-Id: Ie90c0343a834aa87b7ded41f503e05d9b63b3244
      a4cada74
    • Jeff Vander Stoep's avatar
      domain_deprecated: remove proc access · c15d54ef
      Jeff Vander Stoep authored
      Remove "granted" logspam. Grante the observed permissions to the
      individual processes that need them and remove the permission from
      domain_deprecated.
      
      avc: granted { read open } for comm="ndroid.settings"
      path="/proc/version" dev="proc" ino=4026532081
      scontext=u:r:system_app:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { getattr } for comm=4173796E635461736B202332
      path="/proc/pagetypeinfo" dev="proc" ino=4026532129
      scontext=u:r:system_app:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      avc: granted { read open } for comm="uncrypt" path="/proc/cmdline"
      dev="proc" ino=4026532072 scontext=u:r:uncrypt:s0
      tcontext=u:object_r:proc:s0 tclass=file
      
      avc: granted { read open } for comm="update_engine"
      path="/proc/sys/kernel/random/boot_id" dev="proc" ino=15852829
      scontext=u:r:update_engine:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      avc: granted { read open } for comm="tiveportallogin"
      path="/proc/vmstat" dev="proc" ino=4026532130
      scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:proc:s0
      tclass=file
      
      This change is specifically not granting the following since it
      should not be allowed:
      avc: granted { read open } for comm="crash_dump64"
      path="/proc/filesystems" dev="proc" ino=4026532416
      scontext=u:r:dex2oat:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { read } for comm="crash_dump64" name="filesystems"
      dev="proc" ino=4026532416 scontext=u:r:dex2oat:s0
      tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { getattr } for comm="crash_dump64"
      path="/proc/filesystems" dev="proc" ino=4026532416
      scontext=u:r:dex2oat:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      Bug: 64032843
      Bug: 28760354
      Test: build
      Change-Id: Ib309e97b6229bdf013468dca34f606c0e8da96d0
      c15d54ef
  9. Jul 25, 2017
  10. Jul 24, 2017
    • Torne (Richard Coles)'s avatar
      Allow shared_relro to connect to activity_service. · 75a41c59
      Torne (Richard Coles) authored
      The comment in the policy implied this was already the case, but it
      wasn't actually being used and appears to have been removed. This will
      now be required by a framework change, so actually add the rule to allow
      it.
      
      Bug: 19061358
      Test: verify that WebViewLoader process doesn't die from selinux denial
      Change-Id: Ib1ed9138a83660ae343e0b665cdfadccdd0c6c97
      75a41c59
    • Jeff Vander Stoep's avatar
      Move domain_deprecated into private policy · 7c34e83f
      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.
      Merged-In: I31beeb5bdf3885195310b086c1af3432dc6a349b
      Change-Id: I31beeb5bdf3885195310b086c1af3432dc6a349b
      (cherry picked from commit 76aab82c)
      7c34e83f
    • Sandeep Patil's avatar
      Make sure all public types are defined regardless of build variants · 83f8cde4
      Sandeep Patil authored
      
      The types need to be exported so userdebug system.img
      can still build the policy with a user vendor.img at boot time.
      All permissions and attributes for these types are still kept under
      conditional userdebug_or_eng macro
      
      Bug: 37433251
      Test: Boot sailfish-user build with generic_arm64_ab system.img on
            sailfish and make sure sepolicy compilation succeeds
      
      Change-Id: I98e8428c414546dfc74641700d4846edcf9355b1
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      (cherry picked from commit 35e308cf)
      83f8cde4
  11. Jul 23, 2017
    • Jeff Vander Stoep's avatar
      domain_deprecate: remove system_data_file access · 2b75437d
      Jeff Vander Stoep authored
      scontext=installd
      avc: granted { getattr } for comm="Binder:1153_7" path="/data/user/0"
      dev="sda13" ino=1097730 scontext=u:r:installd:s0
      tcontext=u:object_r:system_data_file:s0 tclass=lnk_file
      
      scontext=runas
      avc: granted { getattr } for comm="run-as" path="/data/user/0"
      dev="sda35" ino=942082 scontext=u:r:runas:s0
      tcontext=u:object_r:system_data_file:s0 tclass=lnk_file
      
      scontext=vold
      avc: granted { getattr } for comm="vold" path="/data/data" dev="sda45"
      ino=12 scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
      tclass=lnk_file
      avc: granted { read } for comm="secdiscard"
      name="3982c444973581d4.spblob" dev="sda45" ino=4620302
      scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
      tclass=file
      
      Bug: 28760354
      Test: Build
      Change-Id: Id16c43090675572af35f1ad9defd4c368abc906b
      2b75437d
  12. Jul 20, 2017
    • Josh Gao's avatar
      crash_dump_fallback: allow writing to system_server pipes. · 3c9b9197
      Josh Gao authored
      Allow mediacodec/mediaextractor to write to system_server pipes during
      ANR dumps.
      
      Addresses the following denials:
      avc: denied { write } for comm="mediaextractor" path="pipe:[1177610]" dev="pipefs" ino=1177610 scontext=u:r:mediaextractor:s0 tcontext=u:r:system_server:s0 tclass=fifo_file permissive=0
      avc: denied { write } for comm="omx@1.0-service" path="pipe:[1175808]" dev="pipefs" ino=1175808 scontext=u:r:mediacodec:s0 tcontext=u:r:system_server:s0 tclass=fifo_file permissive=0
      
      Bug: http://b/63801592
      Test: treehugger
      Change-Id: I944b1fa76c70402607ccd903be17dbddeaa73201
      3c9b9197
  13. Jul 19, 2017
  14. Jul 18, 2017
  15. Jul 16, 2017
    • Tianjie Xu's avatar
      Allow update_engine to read postinstall_mnt_dir · 8f687053
      Tianjie Xu authored
      The denial message:
      update_engine: type=1400 audit(0.0:15213): avc: denied { getattr } for
      path="/postinstall" dev="dm-0" ino=38 scontext=u:r:update_engine:s0
      tcontext=u:object_r:postinstall_mnt_dir:s0 tclass=dir permissive=0
      
      update_engine: type=1400 audit(0.0:15214): avc: denied { sys_rawio } for
      capability=17 scontext=u:r:update_engine:s0 tcontext=u:r:update_engine:s0
      tclass=capability permissive=0
      
      auditd  : type=1400 audit(0.0:15213): avc: denied { getattr } for
      comm="update_engine" path="/postinstall" dev="dm-0" ino=38
      scontext=u:r:update_engine:s0 tcontext=u:object_r:postinstall_mnt_dir:s0
      tclass=dir permissive=0
      
      update_engine: [0428/070905:ERROR:utils.cc(716)] Error stat'ing /postinstall: Permission denied
      
      Bug: 37760573
      Test: apply an update and UE reads postinstall_mnt_dir without denial.
      Change-Id: I55506f5e8544233f60ccf7c1df846c9c93946a25
    • Lorenzo Colitti's avatar
      Explicitly allow netd to take the iptables lock. · 9273c1bb
      Lorenzo Colitti authored
      This was previously relying on domain_deprecated rules deleted in
      change I588a1e7ea7ef984907b79a5a391efb2dcd6e6431.
      
      Bug: 28760354
      Test: unbreaks networking on AOSP bullhead
      Change-Id: I873e1f08f72104dee7509e45b1db0b284ca56085
      9273c1bb
  16. Jul 13, 2017
  17. Jul 12, 2017
Loading