Skip to content
Snippets Groups Projects
  1. May 05, 2014
    • Nick Kralevich's avatar
    • Stephen Smalley's avatar
      Escape dot (.) when it is intended to be literal. · 812f7d90
      Stephen Smalley authored
      
      Otherwise it is treated as a regex and matches any character.
      
      Change-Id: I9e23f01b0e104d3ef57993fd1a3d9a5b13201910
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      812f7d90
    • Nick Kralevich's avatar
      allow untrusted_app to write to MMS files · 1545b606
      Nick Kralevich authored
      Commit 3fbc536d allowed untrusted
      app to read radio data files passed via binder, but didn't allow
      write access. Write access is needed when sending MMS messages.
      
      Steps to reproduce:
      1) have some photos on the device
      2) Launch messaging app
      3) Attach a MMS (Picture, capture video, capture picture, audio recording etc..)
      4) Send
      
      EXPECTED RESULTS:
      No crash
      
      OBSERVED RESULTS:
      - Messaging crashes on sending MMS
      - messages are stuck in sending state
      
      Additional details:
        05-05 10:14:01.196  2457  2457 W Binder_3: type=1400 audit(0.0:20): avc:  denied  { write } for  path="/data/data/com.android.providers.telephony/app_parts/PART_1399310041183_temp.jpg" dev="mmcblk0p23" ino=604417 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
        05-05 10:14:01.202 27809 28219 E JavaBinder: !!! FAILED BINDER TRANSACTION !!!
        05-05 10:14:01.203 27809 28219 E PduPersister: Failed to open Input/Output stream.
        05-05 10:14:01.203 27809 28219 E PduPersister: java.io.FileNotFoundException: Failed opening content provider: content://mms/part/4
        05-05 10:14:01.203 27809 28219 E PduPersister:        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:966)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at android.content.ContentResolver.openOutputStream(ContentResolver.java:674)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at android.content.ContentResolver.openOutputStream(ContentResolver.java:650)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at com.google.android.mms.pdu.PduPersister.persistData(PduPersister.java:837)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at com.google.android.mms.pdu.PduPersister.persistPart(PduPersister.java:761)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at com.google.android.mms.pdu.PduPersister.persist(PduPersister.java:1398)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at com.android.mms.data.WorkingMessage.createDraftMmsMessage(WorkingMessage.java:1577)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at com.android.mms.data.WorkingMessage.sendMmsWorker(WorkingMessage.java:1431)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at com.android.mms.data.WorkingMessage.access$700(WorkingMessage.java:82)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at com.android.mms.data.WorkingMessage$2.run(WorkingMessage.java:1228)
        05-05 10:14:01.203 27809 28219 E PduPersister:        at java.lang.Thread.run(Thread.java:818)
        05-05 10:14:01.221 27809 28219 E AndroidRuntime: FATAL EXCEPTION: WorkingMessage.send MMS
        05-05 10:14:01.221 27809 28219 E AndroidRuntime: Process: com.android.mms, PID: 27809
        05-05 10:14:01.221 27809 28219 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getLastPathSegment()' on a null object reference
        05-05 10:14:01.221 27809 28219 E AndroidRuntime:      at android.content.ContentUris.parseId(ContentUris.java:85)
        05-05 10:14:01.221 27809 28219 E AndroidRuntime:      at com.android.mms.model.SlideshowModel.finalResize(SlideshowModel.java:691)
        05-05 10:14:01.221 27809 28219 E AndroidRuntime:      at com.android.mms.data.WorkingMessage.sendMmsWorker(WorkingMessage.java:1448)
        05-05 10:14:01.221 27809 28219 E AndroidRuntime:      at com.android.mms.data.WorkingMessage.access$700(WorkingMessage.java:82)
        05-05 10:14:01.221 27809 28219 E AndroidRuntime:      at com.android.mms.data.WorkingMessage$2.run(WorkingMessage.java:1228)
        05-05 10:14:01.221 27809 28219 E AndroidRuntime:      at java.lang.Thread.run(Thread.java:818)
        05-05 10:14:01.222   659  5253 W ActivityManager:   Force finishing activity com.android.mms/.ui.ComposeMessageActivity
      
      Bug: 14562421
      Change-Id: Iba6914eeec4bf0c8c04ee83584327a4824c0a9a9
      1545b606
    • dcashman's avatar
      Merge "Remove specifycapabilities permission." · f6e3586c
      dcashman authored
      f6e3586c
  2. May 03, 2014
    • dcashman's avatar
      Remove specifycapabilities permission. · c4db82cf
      dcashman authored
      specifycapabilities is no longer specified by the zygote userspace manager.
      It was removed in commit: 42a4bb5730266f80585e67262c73505d0bfffbf8.  Remove
      this permission from policy.
      
      Change-Id: I866a25b590a375a68de6eec9af1b3ef779889985
      c4db82cf
  3. May 01, 2014
    • Ruchi Kandoi's avatar
      ueventd: Adds permission to ueventd to access sysfs file · 0a333759
      Ruchi Kandoi authored
      
      Need this for changing max_cpufreq for the low power mode.
      
      Denials:
      type=1400 audit(1398818907.151:48): avc:  denied  { relabelfrom } for
      pid=129 comm="ueventd" name="scaling_max_freq" dev="sysfs" ino=19866
      scontext=u:r:ueventd:s0 tcontext=u:object_r:sysfs:s0 tclass=file
      
      type=1400 audit(118521.050:11): avc:  denied  { setattr } for  pid=130
      comm="ueventd" name="scaling_min_freq" dev="sysfs" ino=9178
      scontext=u:r:ueventd:s0 tcontext=u:object_r:sysfs_devices_system_cpu:s0
      tclass=file
      
      Change required for Change-Id: Ibe0b4aaf3db555ed48e89a7fcd0c5fd3a18cf233
      
      Change-Id: I93feee65b1535ac048acf3bc7fba9f5d1bdb2bd2
      Signed-off-by: default avatarRuchi Kandoi <kandoiruchi@google.com>
      0a333759
    • Stephen Smalley's avatar
      Make the untrusted_app domain enforcing. · 3a4eb96b
      Stephen Smalley authored
      
      Change-Id: I4811da972f7e23ef86e04d05400169422fbaca35
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      3a4eb96b
    • Narayan Kamath's avatar
      Merge "Change zygote sepolicy whitelist." · 99499dc0
      Narayan Kamath authored
      99499dc0
    • Narayan Kamath's avatar
      Change zygote sepolicy whitelist. · 3a06a72c
      Narayan Kamath authored
      Allow the zygote to create instruction set specific
      directories under /data/dalvik-cache and to change their owner
      to the system UID.
      
      These subdirectories are required in order to support
      instruction set specific dex caches on devices that support
      multiple instruction sets. We can't ask init to create these
      directories for us, because init doesn't have any knowledge
      about the list of runtime instruction sets the device supports.
      
      The owner needs to be system because the package manager (running
      in the system_server) is allowed to manipulate files under this
      directory.
      
      (cherry picked from commit 032e5b0a)
      
      Change-Id: I3a85e8a6b4eed003a93490e7b93a4fd68c41a361
      3a06a72c
  4. Apr 30, 2014
    • Nick Kralevich's avatar
      Allow shell debugfs read access · 0e06c137
      Nick Kralevich authored
      Developers should be able to use systrace with user builds.
      This requires read access to /sys/kernel/debug/tracing/trace,
      otherwise the following error occurs:
      
        $ atrace
        capturing trace... done
        TRACE:
        error opening /sys/kernel/debug/tracing/trace: Permission denied (13)
      
      with the following SELinux denial:
      
        <4>[   79.830542] type=1400 audit(11940551.039:8): avc:  denied  { read } for  pid=1156 comm="atrace" name="trace" dev="debugfs" ino=3024 scontext=u:r:shell:s0 tcontext=u:object_r:debugfs:s0 tclass=file
      
      At least on the kernel I've tested this on, debugfs doesn't support
      setting SELinux file labels. Grant read access to all of debugfs to
      work around this limitation.
      
      Bug: 13904660
      Change-Id: Ib58e98972c5012e9b34fec9e0a6094641638cd9a
      0e06c137
  5. Apr 26, 2014
  6. Apr 21, 2014
  7. Apr 18, 2014
    • Nick Kralevich's avatar
      Merge "Allow vold to access keymaster" · 5bbdb533
      Nick Kralevich authored
      5bbdb533
    • Stephen Smalley's avatar
      Audit accesses on unlabeled files. · 25628434
      Stephen Smalley authored
      
      To see whether we can safely remove these allow rules on unlabeled files
      since we now have restorecon_recursive /data in init.rc to fully relabel
      legacy userdata partitions, audit all accesses on such files.
      
      Exclude the init domain since it performs the restorecon_recursive /data
      and therefore will read unlabeled directories, stat unlabeled files,
      and relabel unlabeled directories and files on upgrade.  init may also
      create/write unlabeled files in /data prior to the restorecon_recursive
      /data being called.
      
      Exclude the kernel domain for search on unlabeled:dir as this happens
      during cgroup filesystem initialization in the kernel as a side effect
      of populating the cgroup directory during the superblock initialization
      before SELinux has set the label on the root directory.
      
      Change-Id: Ieb5d807f529db9a4bf3e6c93e6b37c9648c04633
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      25628434
  8. Apr 16, 2014
    • Nick Kralevich's avatar
      Allow surfaceflinger to make binder call to bootanim · fd352f11
      Nick Kralevich authored
      When SurfaceFlinger -- or any BufferQueue consumer -- releases a buffer, the
      BufferQueue calls back into the producer side in case the producer cares.
      This results in a notification from surfaceflinger to bootanim.
      
      This callback started in d1c103655533321b5c74fbefff656838a8196153.
      
      Addresses the following denial:
      
      6.164348   type=1400 audit(1397612702.010:5): avc:  denied  { call } for  pid=128 comm="surfaceflinger" scontext=u:r:surfaceflinger:s0 tcontext=u:r:bootanim:s0 tclass=binder
      
      Change-Id: I6f2d62a3ed81fde45150d2ae3ff05822bfda33fe
      fd352f11
    • Nick Kralevich's avatar
      Merge "Label /dev/usb-ffs/adb functionfs" · d434d601
      Nick Kralevich authored
      d434d601
  9. Apr 15, 2014
    • Nick Kralevich's avatar
      Label /dev/usb-ffs/adb functionfs · 77cc0550
      Nick Kralevich authored
      Newer adbd versions use functionfs instead of a custom adb usb gadget.
      Make sure the functionfs filesystem is properly labeled, and that adbd
      has access to the functionfs files.
      
      Once labeled, this addresses the following denials:
      
      <12>[   16.127191] type=1400 audit(949060866.189:4): avc:  denied  { read write } for  pid=223 comm="adbd" name="ep0" dev="functionfs" ino=5489 scontext=u:r:adbd:s0 tcontext=u:object_r:functionfs:s0 tclass=file
      <12>[   16.127406] type=1400 audit(949060866.189:5): avc:  denied  { open } for  pid=223 comm="adbd" path="/dev/usb-ffs/adb/ep0" dev="functionfs" ino=5489 scontext=u:r:adbd:s0 tcontext=u:object_r:functionfs:s0 tclass=file
      <12>[  377.366011] type=1400 audit(949061227.419:16): avc:  denied  { ioctl } for  pid=225 comm="adbd" path="/dev/usb-ffs/adb/ep2" dev="functionfs" ino=5564 scontext=u:r:adbd:s0 tcontext=u:object_r:functionfs:s0 tclass=file
      
      Change-Id: Iee8b522e48b4d677fd12f7c83dbc7ffbc9543ad2
      77cc0550
    • Nick Kralevich's avatar
      Allow system_server pstore access. · 3f3d6ffb
      Nick Kralevich authored
      pstore contains /sys/fs/pstore/console-ramoops, which is the
      replacement for /proc/last_kmsg. Both files are read by system_server
      on startup. Allow access.
      
      Addresses the following denials:
      
      <12>[   53.836838] type=1400 audit(949060020.909:19): avc:  denied  { search } for  pid=1233 comm="Thread-119" name="/" dev="pstore" ino=10296 scontext=u:r:system_server:s0 tcontext=u:object_r:pstorefs:s0 tclass=dir
      <12>[   53.856546] type=1400 audit(949060020.909:20): avc:  denied  { getattr } for  pid=1233 comm="Thread-119" path="/sys/fs/pstore/console-ramoops" dev="pstore" ino=10297 scontext=u:r:system_server:s0 tcontext=u:object_r:pstorefs:s0 tclass=file
      <12>[   53.878425] type=1400 audit(949060020.909:21): avc:  denied  { read } for  pid=1233 comm="Thread-119" name="console-ramoops" dev="pstore" ino=10297 scontext=u:r:system_server:s0 tcontext=u:object_r:pstorefs:s0 tclass=file
      <12>[   53.898476] type=1400 audit(949060020.909:22): avc:  denied  { open } for  pid=1233 comm="Thread-119" path="/sys/fs/pstore/console-ramoops" dev="pstore" ino=10297 scontext=u:r:system_server:s0 tcontext=u:object_r:pstorefs:s0 tclass=file
      
      Change-Id: I7307da751961b242e68adb319da9c00192e77bbb
      3f3d6ffb
  10. Apr 14, 2014
  11. Apr 12, 2014
  12. Apr 10, 2014
    • jaejyn.shin's avatar
      pstore file system labeling · 318e0c9c
      jaejyn.shin authored
      pstore(persistent store) have been applied since kernel 3.5
      We need to label the pstore-fs in order to use Android with kernel 3.5 or upper version.
      My kernel version is 3.10 and I got the below denial log when I ran the "df" command on the adb shell.
      
      type=1400 msg=audit(1388540540.220:18): avc: denied { getattr } for pid=7296 comm="df" name="/" dev="pstore" ino=7703 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=filesystem
      
      And the below log is also shown during booting
      
      type=1400 msg=audit(1388539193.750:4): avc: denied { mount } for pid=2844 comm="mount" name="/" dev="pstore" ino=11393 scontext=u:r:init_shell:s0 tcontext=u:object_r:unlabeled:s0 tclass=filesystem
      
      Change-Id: Iaba543d44565c4f20a77a95b9573a628bbd3fd34
      318e0c9c
  13. Apr 09, 2014
    • Stephen Smalley's avatar
      Define a type for /data/dalvik-cache/profiles. · 19c50903
      Stephen Smalley authored
      
      I9b8e59e3bd7df8a1bf60fa7ffd376a24ba0eb42f added a profiles
      subdirectory to /data/dalvik-cache with files that must be
      app-writable.  As a result, we have denials such as:
      W/Profiler( 3328): type=1400 audit(0.0:199): avc:  denied  { write } for  name="com.google.android.setupwizard" dev="mmcblk0p28" ino=106067 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file
      W/Profiler( 3328): type=1300 audit(0.0:199): arch=40000028 syscall=322 per=800000 success=yes exit=33 a0=ffffff9c a1=b8362708 a2=20002 a3=0 items=1 ppid=194 auid=4294967295 uid=10019 gid=10019 euid=10019 suid=10019 fsuid=10019 egid=10019 sgid=10019 fsgid=10019 tty=(none) ses=4294967295 exe="/system/bin/app_process" subj=u:r:untrusted_app:s0 key=(null)
      W/auditd  (  286): type=1307 audit(0.0:199):  cwd="/"
      W/auditd  (  286): type=1302 audit(0.0:199): item=0 name="/data/dalvik-cache/profiles/com.google.android.setupwizard" inode=106067 dev=b3:1c mode=0100664 ouid=1012 ogid=50019 rdev=00:00 obj=u:object_r:dalvikcache_data_file:s0
      
      We do not want to allow untrusted app domains to write to the
      existing type on other /data/dalvik-cache files as that could be used
      for code injection into another app domain, the zygote or the system_server.
      So define a new type for this subdirectory.  The restorecon_recursive /data
      in init.rc will fix the labeling on devices that already have a profiles
      directory created.  For correct labeling on first creation, we also need
      a separate change to installd under the same change id.
      
      Bug: 13927667
      Change-Id: I4857d031f9e7e60d48b8c72fcb22a81b3a2ebaaa
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      19c50903
  14. Apr 08, 2014
  15. Apr 07, 2014
  16. Apr 04, 2014
    • Nick Kralevich's avatar
    • Stephen Smalley's avatar
      Coalesce shared_app, media_app, release_app into untrusted_app. · 9ba844fe
      Stephen Smalley authored
      
      This change folds the shared_app, media_app, and release_app
      domains into untrusted_app, reducing the set of app domains down
      to just distinct domains for the fixed UID apps (e.g. system_app, bluetooth,
      nfc, radio), a single domain for apps signed by the platform key
      (platform_app), and a single domain for all other apps (untrusted_app).
      Thus, SELinux only distinguishes when already distinguished by a predefined
      Android ID (AID) or by the platform certificate (which get the signature-only
      Android permissions and thus may require special OS-level accesses).
      
      It is still possible to introduce specific app domains for specific
      apps by adding signer and package stanzas to mac_permissions.xml,
      but this can be done on an as-needed basis for specialized apps that
      require particular OS-level permissions outside the usual set.
      
      As there is now only a single platform app domains, get rid of the
      platformappdomain attribute and platform_app_domain() macro.  We used
      to add mlstrustedsubject to those domains but drop this since we are not
      using MLS in AOSP presently; we can revisit which domains need it if/when
      we use MLS.
      
      Since we are dropping the shared, media, and release seinfo entries from
      seapp_contexts, drop them from mac_permissions.xml as well.  However,
      we leave the keys.conf entries in case someone wants to add a signer
      entry in the future for specific apps signed by those keys to
      mac_permissions.xml.
      
      Change-Id: I877192cca07360c4a3c0ef475f016cc273e1d968
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      9ba844fe
    • Stephen Smalley's avatar
      Treat seinfo=default name=<anything> as an error. · f4fa7567
      Stephen Smalley authored
      
      check_app already checks for usage of name= entries
      in seapp_contexts with no seinfo= specification to
      link it back to a signer in mac_permissions.xml.
      However, one can avoid this error by specifying
      a seinfo=default which merely matches the default
      stanza of mac_permissions.xml without actually ensuring
      that it is tied to a specific certificate.  Catch
      that error case too.
      
      Change-Id: If33cf21501e8bfee44d31c92b6341dfa583552b2
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      f4fa7567
    • Nick Kralevich's avatar
    • Nick Kralevich's avatar
      label app_process64 as zygote_exec · 6bf9bbc8
      Nick Kralevich authored
      ... otherwise zygote 64 won't run in the correct SELinux domain.
      
      Bug: 13647418
      Change-Id: Iada2bf26623784535b70647c472f69b735b8f4fc
      6bf9bbc8
  17. Apr 03, 2014
  18. Apr 02, 2014
    • Nick Kralevich's avatar
      888d283c
    • Stephen Smalley's avatar
      Drop dontaudit sys_admin rule from rild. · 997d4a18
      Stephen Smalley authored
      
      Old Android kernels (e.g. kernel/goldfish android-2.6.29 commit 2bda29)
      fell back to a CAP_SYS_ADMIN check even before checking uids if the cgroup
      subsystem did not define its own can_attach handler.  This doesn't appear
      to have ever been the case of mainline, and is not true of the 3.4 Android
      kernels.  So we no longer need to dontaudit sys_admin to avoid log noise.
      
      Change-Id: I2faade6665a4adad91472c95f94bd922a449b240
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      997d4a18
    • Stephen Smalley's avatar
      Drop dontaudit sys_admin rule from installd. · 016e6365
      Stephen Smalley authored
      
      Old Android kernels (e.g. kernel/goldfish android-2.6.29 commit 2bda29)
      fell back to a CAP_SYS_ADMIN check even before checking uids if the cgroup
      subsystem did not define its own can_attach handler.  This doesn't appear
      to have ever been the case of mainline, and is not true of the 3.4 Android
      kernels.  So we no longer need to dontaudit sys_admin to avoid log noise.
      
      Change-Id: I3822600a06c242764a94f9b67d9fcd6f599d3453
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      016e6365
  19. Apr 01, 2014
  20. Mar 28, 2014
    • Stephen Smalley's avatar
      Move shell entry up with other platform UID entries. · 6d8fa695
      Stephen Smalley authored
      
      This is a trivial change to seapp_contexts to force a relabel
      of /data/data directories by PMS/installd by yielding a
      different hash value for comparison against /data/system/seapp_hash.
      This change does not alter any actual app process or data directory
      labeling decisions.  The seapp_contexts entries are sorted upon
      loading by libselinux to match the precedence rules described
      in the comment header, so ordering in this file should not matter.
      
      This should not be merged before the code changes with the same Change-Id.
      
      Change-Id: Ie440cba2c96f0907458086348197e1506d31c1b6
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      6d8fa695
Loading