Skip to content
Snippets Groups Projects
  1. Jan 06, 2015
  2. Jan 05, 2015
    • Nick Kralevich's avatar
      init.te: remove unactionable auditallow statements · 30707a45
      Nick Kralevich authored
      Commit 0d08d472 added two auditallow
      statements. The intented purpose of the auditallow statement was:
      
        auditallow accesses by init to files
        and character devices left in the generic device type so we can monitor
        what is being left there, although it is not necessarily a problem unless
        the file or device should be accessible to others.
      
      As currently written, the auditallow rules aren't actionable. It's not
      a problem by itself for init to access a /dev file or chr_file.
      Rather, we care about when other domains access such files.
      
      Currently, this generates a number of (expected) audit statements on
      boot, which causes unnecessary confusion and makes people believe
      that something is broken.
      
      Remove the unactionable auditallow statements.
      
      Change-Id: Ibfe33976505a7dc3f8d15c9eb203c044a39da426
      30707a45
    • Nick Kralevich's avatar
      uncrypt: fix OTAs · eb4e2ab1
      Nick Kralevich authored
      uncrypt needs to be able to read OTA files in GMS core's home
      directory, which is protected with MLS. Mark uncrypt as an
      mlstrustedsubject so that it can read the files.
      
      Addresses the following denial (and probably others):
      
        uncrypt : type=1400 audit(0.0:27): avc: denied { getattr } for path="/data/data/com.google.android.gms" dev="mmcblk0p30" ino=81970 scontext=u:r:uncrypt:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir
      
      Remove the auditallow line for uncrypt. Per dd053a9b,
      the auditallow line was added to confirm that uncrypt was actually
      accessing the userdata block device. The access to the userdata block
      device is definitely occurring, and auditing it doesn't add any value.
      Remove the auditing.
      
      Eliminates the following unnecessary audit lines:
      
        avc: granted { write } for pid=2449 comm="uncrypt" name="mmcblk0p31" dev="tmpfs" ino=10404 scontext=u:r:uncrypt:s0 tcontext=u:object_r:userdata_block_device:s0 tclass=blk_file
        avc: granted { write open } for pid=2449 comm="uncrypt" path="/dev/block/mmcblk0p31" dev="tmpfs" ino=10404 scontext=u:r:uncrypt:s0 tcontext=u:object_r:userdata_block_device:s0 tclass=blk_file
      
      Tighten up userdata block access to write-only. uncrypt never reads
      directly from the block device.
      
      Testing:
      
        1) Create the file /cache/recovery/command with a line like:
        --update_package=/data/data/com.google.android.gms/foo.zip
        2) Create the file /data/data/com.google.android.gms/foo.zip
        (contents not important)
        3) Run "setprop ctl.start pre-recovery"
      
      Expected: No SELinux denials.
      Actual: SELinux denials
      
      Bug: 18875451
      Change-Id: I62c7f06313afb2535b0de8be3c16d9d33879dd5d
      eb4e2ab1
    • Nick Kralevich's avatar
    • Nick Kralevich's avatar
      22477045
  3. 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
  4. Dec 24, 2014
    • Nick Kralevich's avatar
      init: allow rootfs symlink removal · 8809341c
      Nick Kralevich authored
      On the Nexus 9, init.rc creates the /vendor -> /system/vendor
      symlink, then a bit later removes the symlink, creates a
      proper directory, and mounts /vendor on the directory.
      
      The current permissive SELinux policy doesn't allow init to
      remove the /vendor symlink, which eventually causes the following
      errors:
      
        avc:  denied  { unlink } for  pid=136 comm="init" name="vendor" dev="rootfs" ino=6454 scontext=u:r:init:s0 tcontext=u:object_r:rootfs:s0 tclass=lnk_file permissive=1
        fs_mgr: Failed to mount an un-encryptable or wiped partition on/dev/block/platform/sdhci-tegra.3/by-name/VNR at /vendor options: (null) error: Too many symbolic links encountered
      
      There was an attempt to reorder some of these operations so
      we didn't have to create / delete the symlink, but it
      doesn't seem to have gone well.
      https://android.googlesource.com/platform/system/core/+/f67d6bd3c0fb41d167c675b9d2b5d377b6f38a74
      
      Change-Id: I4d01661d4228e44e18465fe16ce4a70fe2a83042
      8809341c
  5. Dec 23, 2014
  6. Dec 22, 2014
    • dcashman's avatar
      bfa2baa4
    • dcashman's avatar
      Allow shell domain to use system_server_service. · 403d8fee
      dcashman authored
      Shell domain needs to be able to access system_server_services, e.g.
      when running the pm command. Addresses the following denials:
      
      10-07 00:59:26.901   178   178 E SELinux : avc:  denied  { find } for service=user scontext=u:r:shell:s0 tcontext=u:object_r:system_server_service:s0 tclass=service_manager
      10-07 00:59:26.903   178   178 E SELinux : avc:  denied  { find } for service=package scontext=u:r:shell:s0 tcontext=u:object_r:system_server_service:s0 tclass=service_manager
      
      Change-Id: I4cc2f31809a2615ba781e2ecfe2ca7d6f5226b73
      403d8fee
  7. Dec 20, 2014
    • William Roberts's avatar
      Allow overiding FORCE_PERMISSIVE_TO_UNCONFINED · 754f5ea7
      William Roberts authored
      It's beneficial to be able to overide this in a device makefile
      if you need to get the domains into an unconfined state to keep
      the logs from filling up on kernel entries without having to add
      rules into device specific policy.
      
      Change-Id: I7778be01256ac601f247e4d6e12573d0d23d12a1
      754f5ea7
    • Nick Kralevich's avatar
      toolbox: remove permissive_or_unconfined() · db5242a7
      Nick Kralevich authored
      No obvious denials on flounder, the only device where swap
      is used.
      
      Change-Id: I5747ad2fd267cb71cbc1f69ffaec6b1e7db9ec1f
      db5242a7
    • Nick Kralevich's avatar
      allow toolbox block_device:dir search · 0bc6c80f
      Nick Kralevich authored
      needed to get to the swap device.
      
      Addresses the following denial:
      
        avc:  denied  { search } for  pid=149 comm="mkswap" name="block" dev="tmpfs" ino=9947 scontext=u:r:toolbox:s0 tcontext=u:object_r:block_device:s0 tclass=dir permissive=0
      
      Change-Id: I0c897540f1c7950738622a013121a050a1f32b2f
      0bc6c80f
    • Nick Kralevich's avatar
      bluetooth: allow sending bugreports via bluetooth · 9819a6cb
      Nick Kralevich authored
      Bluetooth can receive bugreport data for beaming to another device.
      This comes across as an open file descriptor. Allow bluetooth access
      to bugreports.
      
      Addresses the following denial:
      
        avc: denied { read } for path="/data/data/com.android.shell/files/bugreports/bugreport-2014-12-19-15-35-32.txt" dev="dm-0" ino=662738 scontext=u:r:bluetooth:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0
      
      Change-Id: I7be2ce2e0e48323c1e8f932be17b434b89daf085
      9819a6cb
    • Nick Kralevich's avatar
      toolbox: android_fork_execvp_ext() requires getattr ioctl · d94b78c9
      Nick Kralevich authored
      Addresses the following denials:
      
        avc:  denied  { getattr } for  pid=148 comm="mkswap" path="/dev/pts/0" dev="devpts" ino=3 scontext=u:r:toolbox:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=1
        avc:  denied  { ioctl } for  pid=148 comm="mkswap" path="/dev/pts/0" dev="devpts" ino=3 scontext=u:r:toolbox:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=1
      
      Change-Id: I88c88493cd5f523b5b26a8028b421b3565aa5751
      d94b78c9
  8. Dec 18, 2014
  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. Dec 12, 2014
  11. Dec 11, 2014
    • Stephen Smalley's avatar
      Allow fcntl F_SETLK on sockets. · 2c759185
      Stephen Smalley authored
      
      Addresses denials such as:
      type=1400 : avc: denied { lock } for comm="PushCheckSendS" path="socket:[1834573]" dev="sockfs" ino=X scontext=u:r:untrusted_app:s0 tcontext=u:r:untrusted_app:s0 tclass=tcp_socket
      
      Change-Id: Idbf6120cca9df634e2f8a876fd1cd836551e5ad7
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      2c759185
  12. Dec 10, 2014
  13. Dec 09, 2014
  14. Dec 05, 2014
  15. Dec 02, 2014
  16. Dec 01, 2014
    • William Roberts's avatar
      Fix sepolicy-analyze build with different toolchains · 47c14611
      William Roberts authored
      host C: sepolicy-analyze <= external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c
      external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c: In function 'usage':
      external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c:30:5: error: 'for' loop initial declarations are only allowed in C99 mode
      external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c:30:5: note: use option -std=c99 or -std=gnu99 to compile your code
      make: *** [out/host/linux-x86/obj/EXECUTABLES/sepolicy-analyze_intermediates/sepolicy-analyze.o] Error 1
      
      Change-Id: I9222e447b032d051c251c9718e2b8d5ffb9e9c35
      47c14611
  17. Nov 26, 2014
    • dcashman's avatar
      Remove entropy from service_contexts. · 69636551
      dcashman authored
      Commit: 9287e0dd272b85b475e33bcbd7d868517a0f98f9 removed the registration
      of EntropyMixer with servicemanager, so it no longer needs a context.
      
      Bug: 18106000
      
      Cherry-pick of commit: 7cfef98c
      
      Change-Id: I9aeb35e7ffde75090f4234ea193514fb883b1425
      69636551
  18. Nov 18, 2014
  19. Nov 13, 2014
    • William Roberts's avatar
      Remove network shell script · f330f375
      William Roberts authored
      This seems to not really being used, especially considering
      that the init.rc does not have a oneshot service for it, and its
      not using the build_policy() and other things to even make it
      configurable.
      
      Change-Id: I964f94b30103917ed39cf5d003564de456b169a5
      f330f375
  20. Nov 12, 2014
  21. Nov 10, 2014
    • Nick Kralevich's avatar
      f19cca3e
    • Stephen Smalley's avatar
      Allow init to chown/chmod character devices. · 1c16abd3
      Stephen Smalley authored
      
      init.rc files can potentially chown/chmod any character device, so
      allow it for everything except for kmem (prohibited by neverallow).
      While we could whitelist each of the device types, doing so would also
      require device-specific changes for the device-specific types and
      may be difficult to maintain.
      
      Resolves (permissive) denials such as:
      avc:  denied  { read } for  pid=1 comm="init" name="ttySAC0" dev="tmpfs" ino=4208 scontext=u:r:init:s0 tcontext=u:object_r:hci_attach_dev:s0 tclass=chr_file permissive=1
      
      avc:  denied  { open } for  pid=1 comm="init" name="ttySAC0" dev="tmpfs" ino=4208 scontext=u:r:init:s0 tcontext=u:object_r:hci_attach_dev:s0 tclass=chr_file permissive=1
      
      avc:  denied  { setattr } for  pid=1 comm="init" name="ttySAC0" dev="tmpfs" ino=4208 scontext=u:r:init:s0 tcontext=u:object_r:hci_attach_dev:s0 tclass=chr_file permissive=1
      
      avc:  denied  { read } for  pid=1 comm="init" name="smd7" dev="tmpfs" ino=6181 scontext=u:r:init:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file
      
      avc:  denied  { open } for  pid=1 comm="init" name="smd7" dev="tmpfs" ino=6181 scontext=u:r:init:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file
      
      avc:  denied  { read } for  pid=1 comm="init" name="wcnss_wlan" dev="tmpfs" ino=7475 scontext=u:r:init:s0 tcontext=u:object_r:wlan_device:s0 tclass=chr_file
      
      avc:  denied  { open } for  pid=1 comm="init" name="wcnss_wlan" dev="tmpfs" ino=7475 scontext=u:r:init:s0 tcontext=u:object_r:wlan_device:s0 tclass=chr_file
      
      avc:  denied  { setattr } for  pid=1 comm="init" name="wcnss_wlan" dev="tmpfs" ino=7475 scontext=u:r:init:s0 tcontext=u:object_r:wlan_device:s0 tclass=chr_file
      
      Change-Id: If8d14e9e434fab645d43db12cc1bdbfd3fc5d354
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      1c16abd3
  22. Nov 08, 2014
    • Nick Kralevich's avatar
      allow run-as to access /data/local/tmp · dd8571aa
      Nick Kralevich authored
      Otherwise denials like the following occur:
      
      avc: denied { write } for path="/data/local/tmp/foo" dev="dm-0" ino=325769 scontext=u:r:runas:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file
      avc: denied { read } for path="/data/local/tmp/foo" dev="dm-0" ino=325769 scontext=u:r:runas:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file
      
      Steps to reproduce:
      
      $ run-as com.google.android.talk id > /data/local/tmp/id.out
      $ run-as com.google.android.talk cat < /data/local/tmp/id.out
      
      Change-Id: I68a7b804336a3d5776dcc31622f1279380282030
      dd8571aa
  23. Nov 07, 2014
Loading