Skip to content
Snippets Groups Projects
  1. Apr 06, 2015
    • Andres Morales's avatar
      SELinux permissions for gatekeeper TEE proxy · e207986e
      Andres Morales authored
      sets up:
      - execute permissions
      - binder permission (system_server->gatekeeper->keystore)
      - prevents dumpstate and shell from finding GK binder service
      - neverallow rules for prohibited clients
      
      Change-Id: I1817933a91de625db469a20c7a4c8e2ca46efa1e
      e207986e
    • Nick Kralevich's avatar
      dumpstate: allow df on /storage/emulated · c24d90cb
      Nick Kralevich authored
      dumpstate runs "df" on all mounted filesystems. Allow dumpstate
      to access /storage/emulated so df works.
      
      Addresses the following denial:
      
        avc: denied { search } for pid=4505 comm="df" name="/" dev="tmpfs" ino=6207 scontext=u:r:dumpstate:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
      
      Change-Id: I99dac8321b19952e37c0dd9d61a680a27beb1ae8
      c24d90cb
  2. Mar 31, 2015
    • Kazuki Nakayama's avatar
      Allow dumpstate to read symlink under dalvik-cache · 9103c975
      Kazuki Nakayama authored
      This fixes the following policy violation:
      avc: denied { read } pid=30295 comm="app_process"
      tcontext=u:object_r:dalvikcache_data_file:s0
      scontext=u:r:dumpstate:s0 tclass=lnk_file
      permissive=0 ppid=26813 pcomm="dumpstate"
      pgid=26813 pgcomm="dumpstate"
      
      See 0e32726 in app.te for a symmetrical
      change.
      
      Change-Id: Iecbccd5fd0046ec193f08b26f9db618dee7a80c1
      9103c975
  3. Mar 03, 2015
    • dcashman's avatar
      Record observed system_server servicemanager service requests. · 23f33615
      dcashman authored
      Also formally allow dumpstate access to all services and grant system_server
      access to address the following non-system_server_service entries:
      
      avc:  granted  { find } for service=drm.drmManager scontext=u:r:system_server:s0 tcontext=u:object_r:drmserver_service:s0 tclass=service_manager
      avc:  granted  { find } for service=nfc scontext=u:r:system_server:s0 tcontext=u:object_r:nfc_service:s0 tclass=service_manager
      
      Bug: 18106000
      Change-Id: Iad16b36acf44bce52c4824f8b53c0e7731c25602
      23f33615
  4. Feb 25, 2015
    • Nick Kralevich's avatar
      Revert /proc/net related changes · 5cf3994d
      Nick Kralevich authored
      Revert the tightening of /proc/net access. These changes
      are causing a lot of denials, and I want additional time to
      figure out a better solution.
      
      Addresses the following denials (and many more):
      
        avc: denied { read } for comm="SyncAdapterThre" name="stats" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="facebook.katana" name="iface_stat_fmt" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="IntentService[C" name="if_inet6" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="dumpstate" name="iface_stat_all" dev="proc" ino=X scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      This reverts commit 0f0324cc
      and commit 99940d1a
      
      Bug: 9496886
      Bug: 19034637
      Change-Id: I436a6e3638ac9ed49afbee214e752fe2b0112868
      5cf3994d
  5. Feb 04, 2015
    • Christopher Ferris's avatar
      Dumpstate runs the same from shell as service. · 5ec38c49
      Christopher Ferris authored
      Without this change, any selinux warning you might get when running
      dumpstate from init do not show up when running from the shell
      as root. This change makes them run the same.
      
      Change-Id: I6b74e0f6f48f47952a2dbe7728b1853008f60dbb
      5ec38c49
  6. Jan 20, 2015
    • Christopher Ferris's avatar
      Allow debuggerd to redirect requests. · b51c4dd3
      Christopher Ferris authored
      On 64 bit systems, all requests will first go to the 64 bit debuggerd
      which will redirect to the 32 bit debuggerd if necessary. This avoids
      any permissions problems where a java process needs to be able to
      read the elf data for executables. Instead the permissions are granted
      to debuggerd instead.
      
      Also remove the permissions to read the /system/bin executables from
      dumpstate since they aren't necessary any more.
      
      Bug: https://code.google.com/p/android/issues/detail?id=97024
      Change-Id: I80ab1a177a110aa7381c2a4b516cfe71ef2a4808
      b51c4dd3
  7. Jan 14, 2015
    • Nick Kralevich's avatar
      remove /proc/net read access from domain.te · 99940d1a
      Nick Kralevich authored
      SELinux domains wanting read access to /proc/net need to
      explicitly declare it.
      
      TODO: fixup the ListeningPortsTest cts test so that it's not
      broken.
      
      Bug: 9496886
      Change-Id: Ia9f1214348ac4051542daa661d35950eb271b2e4
      99940d1a
    • dcashman's avatar
      Make system_server_service an attribute. · 4a89cdfa
      dcashman authored
      Temporarily give every system_server_service its own
      domain in preparation for splitting it and identifying
      special services or classes of services.
      
      Change-Id: I81ffbdbf5eea05e0146fd7fd245f01639b1ae0ef
      4a89cdfa
  8. Dec 30, 2014
    • dcashman's avatar
      Allow dumpstate and shell to list services. · 0780f30c
      dcashman authored
      Addresses the following denials:
      avc:  denied  { list } for service=NULL scontext=u:r:shell:s0 tcontext=u:r:servicemanager:s0 tclass=service_manager
      avc:  denied  { list } for service=NULL scontext=u:r:dumpstate:s0 tcontext=u:r:servicemanager:s0 tclass=service_manager
      
      Bug: 18864737
      Change-Id: I72bd2cd9663f1df9410c2139411038fa997bf1b4
      0780f30c
  9. Dec 15, 2014
    • dcashman's avatar
      Restrict service_manager find and list access. · cd82557d
      dcashman authored
      All domains are currently granted list and find service_manager
      permissions, but this is not necessary.  Pare the permissions
      which did not trigger any of the auditallow reporting.
      
      Bug: 18106000
      Change-Id: Ie0ce8de2af8af2cbe4ce388a2dcf4534694c994a
      cd82557d
  10. Sep 15, 2014
  11. Sep 13, 2014
    • Christopher Ferris's avatar
      Allow dumpstate to read /system/bin executables. · e7d13673
      Christopher Ferris authored
      On 64 bit systems, it's necessary to read the /system/bin executables
      elf header to determine if it's a 32 bit or 64 bit executable to
      contact the correct debuggerd service.
      
      Bug: 17487122
      
      (cherry picked from commit 04f3d790)
      
      Change-Id: Ib7835ffac1811a5aef54a250689287c1666720ef
      e7d13673
    • Christopher Ferris's avatar
      Allow dumpstate to read /system/bin executables. · 04f3d790
      Christopher Ferris authored
      On 64 bit systems, it's necessary to read the /system/bin executables
      elf header to determine if it's a 32 bit or 64 bit executable to
      contact the correct debuggerd service.
      
      Bug: 17487122
      Change-Id: Ica78aa54e5abbb051924166c6808b79b516274fe
      04f3d790
  12. Aug 01, 2014
    • Stephen Smalley's avatar
      Allow dumpstate to dump backtraces of certain native processes. · 77a236c9
      Stephen Smalley authored
      
      The list of processes comes from frameworks/native/cmds/dumpstate/utils.c.
      dumpstate calls dump_backtrace_to_file() for each such process, which
      asks debuggerd to dump the backtrace.
      
      Resolves denials such as:
       avc:  denied  { dump_backtrace } for  scontext=u:r:dumpstate:s0 tcontext=u:r:surfaceflinger:s0 tclass=debuggerd
       avc:  denied  { dump_backtrace } for  scontext=u:r:dumpstate:s0 tcontext=u:r:drmserver:s0 tclass=debuggerd
       avc:  denied  { dump_backtrace } for  scontext=u:r:dumpstate:s0 tcontext=u:r:mediaserver:s0 tclass=debuggerd
       avc:  denied  { dump_backtrace } for  scontext=u:r:dumpstate:s0 tcontext=u:r:sdcardd:s0 tclass=debuggerd
      
      Change-Id: Idbfb0fef0aac138073b7217b7dbad826a1193098
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      77a236c9
  13. Jul 25, 2014
    • Nick Kralevich's avatar
      Resync lmp-dev-plus-aosp with master · d065f048
      Nick Kralevich authored
      A DO NOT MERGE change merged from lmp-dev to lmp-dev-plus-aosp.
      This is expected, but it's causing unnecessary merge conflicts
      when handling AOSP contributions.
      
      Resolve those conflicts.
      
      This is essentially a revert of bf696327
      for lmp-dev-plus-aosp only.
      
      Change-Id: Icc66def7113ab45176ae015f659cb442d53bce5c
      d065f048
  14. Jul 24, 2014
  15. Jul 23, 2014
  16. Jul 18, 2014
  17. Jul 08, 2014
  18. Jun 25, 2014
    • Nick Kralevich's avatar
      dumpstate: transition into vdc domain · c0d14767
      Nick Kralevich authored
      dumpstate uses vdc to collect asec lists and do a vold dump.
      Force a transition into the vdc domain when this occurs.
      
      Addresses the following denial:
      
        <4>[ 1099.623572] type=1400 audit(1403716545.565:7): avc: denied { execute } for pid=6987 comm="dumpstate" name="vdc" dev="mmcblk0p8" ino=222 scontext=u:r:dumpstate:s0 tcontext=u:object_r:vdc_exec:s0 tclass=file permissive=0
      
      Change-Id: I4bd9f3ad83480f8c9f9843ffe136295c582f96fe
      c0d14767
  19. Jun 10, 2014
    • Nick Kralevich's avatar
      dumpstate: allow pstore access · 3561abf8
      Nick Kralevich authored
      Dumpstate reads from /sys/fs/pstore/console-ramoops when generating
      a bug report. Allow it.
      
      Addresses the following denials:
        <12>[ 2187.362750] type=1400 audit(1402346777.139:9): avc: denied { search } for pid=4155 comm="dumpstate" name="/" dev="pstore" ino=9954 scontext=u:r:dumpstate:s0 tcontext=u:object_r:pstorefs:s0 tclass=dir permissive=1
        <12>[ 2187.363025] type=1400 audit(1402346777.139:10): avc: denied { getattr } for pid=4155 comm="dumpstate" path="/sys/fs/pstore/console-ramoops" dev="pstore" ino=9955 scontext=u:r:dumpstate:s0 tcontext=u:object_r:pstorefs:s0 tclass=file permissive=1
        <12>[ 2187.363185] type=1400 audit(1402346777.139:11): avc: denied { read } for pid=4155 comm="dumpstate" name="console-ramoops" dev="pstore" ino=9955 scontext=u:r:dumpstate:s0 tcontext=u:object_r:pstorefs:s0 tclass=file permissive=1
        <12>[ 2187.363321] type=1400 audit(1402346777.139:12): avc: denied { open } for pid=4155 comm="dumpstate" path="/sys/fs/pstore/console-ramoops" dev="pstore" ino=9955 scontext=u:r:dumpstate:s0 tcontext=u:object_r:pstorefs:s0 tclass=file permissive=1
      
      (cherry picked from commit a8281adf)
      
      Change-Id: I4f90ebfbc0627227a18fa74e86d1e459a393c14a
      3561abf8
  20. Jun 09, 2014
    • Nick Kralevich's avatar
      dumpstate: allow pstore access · a8281adf
      Nick Kralevich authored
      Dumpstate reads from /sys/fs/pstore/console-ramoops when generating
      a bug report. Allow it.
      
      Addresses the following denials:
        <12>[ 2187.362750] type=1400 audit(1402346777.139:9): avc: denied { search } for pid=4155 comm="dumpstate" name="/" dev="pstore" ino=9954 scontext=u:r:dumpstate:s0 tcontext=u:object_r:pstorefs:s0 tclass=dir permissive=1
        <12>[ 2187.363025] type=1400 audit(1402346777.139:10): avc: denied { getattr } for pid=4155 comm="dumpstate" path="/sys/fs/pstore/console-ramoops" dev="pstore" ino=9955 scontext=u:r:dumpstate:s0 tcontext=u:object_r:pstorefs:s0 tclass=file permissive=1
        <12>[ 2187.363185] type=1400 audit(1402346777.139:11): avc: denied { read } for pid=4155 comm="dumpstate" name="console-ramoops" dev="pstore" ino=9955 scontext=u:r:dumpstate:s0 tcontext=u:object_r:pstorefs:s0 tclass=file permissive=1
        <12>[ 2187.363321] type=1400 audit(1402346777.139:12): avc: denied { open } for pid=4155 comm="dumpstate" path="/sys/fs/pstore/console-ramoops" dev="pstore" ino=9955 scontext=u:r:dumpstate:s0 tcontext=u:object_r:pstorefs:s0 tclass=file permissive=1
      
      Change-Id: Ia20b7a03ed8e0c61b023eea93415a50af82e1bbf
      a8281adf
    • Nick Kralevich's avatar
      dumpstate: allow gpu_device access · b2ed044f
      Nick Kralevich authored
      dumpstate calls screencap to take a screenshot. screencap
      requires the ability to access the gpu device. Allow it.
      
      Bug: 15514427
      Change-Id: Iad8451b6108786653146de471f6be2d26b0e3297
      b2ed044f
    • Nick Kralevich's avatar
      Make dumpstate domain enforcing. · a1cd65b8
      Nick Kralevich authored
      Change-Id: I74bf300c1b80e94e5acf9ba00ab443dfabad7408
      a1cd65b8
  21. May 09, 2014
  22. Feb 25, 2014
    • Stephen Smalley's avatar
      Clean up socket rules. · 16011320
      Stephen Smalley authored
      
      Replace * or any permission set containing create with
      create_socket_perms or create_stream_socket_perms.
      
      Add net_domain() to all domains using network sockets and
      delete rules already covered by domain.te or net.te.
      
      For netlink_route_socket, only nlmsg_write needs to be separately
      granted to specific domains that are permitted to modify the routing
      table.   Clarification:  read/write permissions are just ability to
      perform read/recv() or write/send() on the socket, whereas nlmsg_read/
      nlmsg_write permissions control ability to observe or modify the
      underlying kernel state accessed via the socket.
      See security/selinux/nlmsgtab.c in the kernel for the mapping of
      netlink message types to nlmsg_read or nlmsg_write.
      
      Delete legacy rule for b/12061011.
      
      This change does not touch any rules where only read/write were allowed
      to a socket created by another domain (inherited across exec or
      received across socket or binder IPC).  We may wish to rewrite some or all
      of those rules with the rw_socket_perms macro but that is a separate
      change.
      
      Change-Id: Ib0637ab86f6d388043eff928e5d96beb02e5450e
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      16011320
  23. Feb 05, 2014
  24. Feb 04, 2014
    • Mark Salyzyn's avatar
      sepolicy: Add write_logd, read_logd & control_logd · 8ed750e9
      Mark Salyzyn authored
      - Add write_logd, read_logd and control_logd macros added along
        with contexts for user space logd.
      - Specify above on domain wide, or service-by-service basis
      - Add logd rules.
      - deprecate access_logcat as unused.
      - 'allow <domain> zygote:unix_dgram_socket write;' rule added to
        deal with fd inheritance. ToDo: investigate means to allow
        references to close, and reopen in context of application
        or call setsockcreatecon() to label them in child context.
      
      Change-Id: I35dbb9d5122c5ed9b8c8f128abf24a871d6b26d8
      8ed750e9
  25. Jan 29, 2014
  26. Jan 11, 2014
    • Nick Kralevich's avatar
      Support forcing permissive domains to unconfined. · 623975fa
      Nick Kralevich authored
      Permissive domains are only intended for development.
      When a device launches, we want to ensure that all
      permissive domains are in, at a minimum, unconfined+enforcing.
      
      Add FORCE_PERMISSIVE_TO_UNCONFINED to Android.mk. During
      development, this flag is false, and permissive domains
      are allowed. When SELinux new feature development has been
      frozen immediately before release, this flag will be flipped
      to true. Any previously permissive domains will move into
      unconfined+enforcing.
      
      This will ensure that all SELinux domains have at least a
      minimal level of protection.
      
      Unconditionally enable this flag for all user builds.
      
      Change-Id: I1632f0da0022c80170d8eb57c82499ac13fd7858
      623975fa
  27. Jan 07, 2014
  28. Jan 06, 2014
    • Nick Kralevich's avatar
      Allow dumpstate to write shell files · bfa3cd51
      Nick Kralevich authored
      Allow the bugreport service to create files in
      /data/data/com.android.shell/files/bugreports/bugreport .
      
      Addresses the following denials:
      
      <5>[31778.629368] type=1400 audit(1388876199.162:230): avc:  denied  { write } for  pid=19092 comm="dumpstate" name="bugreports" dev="mmcblk0p28" ino=1565709 scontext=u:r:dumpstate:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir
      <5>[31778.629493] type=1400 audit(1388876199.162:231): avc:  denied  { add_name } for  pid=19092 comm="dumpstate" name="bugreport-2014-01-04-14-56-39.txt.tmp" scontext=u:r:dumpstate:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir
      <5>[31778.629622] type=1400 audit(1388876199.162:232): avc:  denied  { create } for  pid=19092 comm="dumpstate" name="bugreport-2014-01-04-14-56-39.txt.tmp" scontext=u:r:dumpstate:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file
      <5>[31778.629779] type=1400 audit(1388876199.162:233): avc:  denied  { write open } for  pid=19092 comm="dumpstate" name="bugreport-2014-01-04-14-56-39.txt.tmp" dev="mmcblk0p28" ino=1566628 scontext=u:r:dumpstate:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file
      <5>[31778.629977] type=1400 audit(1388876199.162:234): avc:  denied  { getattr } for  pid=19092 comm="dumpstate" path="/data/data/com.android.shell/files/bugreports/bugreport-2014-01-04-14-56-39.txt.tmp" dev="mmcblk0p28" ino=1566628 scontext=u:r:dumpstate:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file
      
      Change-Id: I080613e8a2c989a7b50fde914271967a814c4ff4
      bfa3cd51
  29. Dec 16, 2013
    • Nick Kralevich's avatar
      initial dumpstate domain · 09e6abd9
      Nick Kralevich authored
      Add the necessary rules to support dumpstate.
      Start off initially in permissive until it has more testing.
      
      Dumpstate is triggered by running "adb bugreport"
      
      Change-Id: Ic17a60cca1f6f40daa4f2c51e9ad6009ef36cfbd
      09e6abd9
Loading