Skip to content
Snippets Groups Projects
  1. Dec 05, 2016
    • Jeff Sharkey's avatar
      Rules for new installd Binder interface. · e160d14e
      Jeff Sharkey authored
      Most of this CL mirrors what we've already done for the "netd" Binder
      interface, while sorting a few lists alphabetically.
      
      Migrating installd to Binder will allow us to get rid of one of
      the few lingering text-based command protocols, improving system
      maintainability and security.
      
      Test: builds, boots
      Bug: 13758960, 30944031
      Change-Id: I59b89f916fd12e22f9813ace6673be38314c97b7
      e160d14e
    • Max's avatar
      /dev/port does not seem to be used, adding in rules to confirm. · c27c23fb
      Max authored
      Only init and ueventd have any access to /dev/port, and neither should
      have any use for it. As it stands, leaving port in just represents
      additional attack surface with no useful functionality, so it should be
      removed if possible, not only from Pixel devices, but from all Android
      devices.
      
      Test: The phone boots successfully
      
      Bug:33301618
      Change-Id: Iedc51590f1ffda02444587d647889ead9bdece3f
      c27c23fb
  2. Nov 16, 2016
    • Nick Kralevich's avatar
      shell.te: revoke syslog(2) access to shell user · c9630dc6
      Nick Kralevich authored
      external/toybox commit a583afc812cf7be74ebab72294c8df485908ff04 started
      having dmesg use /dev/kmsg, which is unreadable to the unprivileged
      shell user. Revoke syslog(2) to the shell user for consistency.
      
      The kernel dmesg log is a source of kernel pointers, which can leak
      kASLR information from the kernel. Restricting access to kernel
      information will make attacks against Android more difficult. Having
      said that, dmesg information is still available from "adb bugreport", so
      this change doesn't completely shutdown kernel info leaks.
      
      This change essentially reverts us to the state we were in between Nov 8
      2011 and May 27 2014. During that almost 3 year period, the unprivileged
      shell user was unable to access dmesg, and there was only one complaint
      during that time.
      
      References:
      * https://android.googlesource.com/platform/system/core/+/f9557fb
      * https://android.googlesource.com/platform/system/sepolicy/+/f821b5a
      
      TODO: Further unify /dev/kmsg permissions with syslog_read permissions.
      
      Test: policy compiles, no dmesg output
      Change-Id: Icfff6f765055bdbbe85f302b781aed2568ef532f
      c9630dc6
  3. Nov 01, 2016
    • Felipe Leme's avatar
      Added permissions for the dumpstate service. · b5f5931e
      Felipe Leme authored
      - Allow dumpstate to create the dumpservice service.
      - Allow System Server and Shell to find that service.
      - Don't allow anyone else to create that service.
      - Don't allow anyone else to find that service.
      
      BUG: 31636879
      Test: manual verification
      Change-Id: I642fe873560a2b123e6bafde645467d45a5f5711
      b5f5931e
  4. Oct 06, 2016
    • dcashman's avatar
      Split general policy into public and private components. · cc39f637
      dcashman authored
      Divide policy into public and private components.  This is the first
      step in splitting the policy creation for platform and non-platform
      policies.  The policy in the public directory will be exported for use
      in non-platform policy creation.  Backwards compatibility with it will
      be achieved by converting the exported policy into attribute-based
      policy when included as part of the non-platform policy and a mapping
      file will be maintained to be included with the platform policy that
      maps exported attributes of previous versions to the current platform
      version.
      
      Eventually we would like to create a clear interface between the
      platform and non-platform device components so that the exported policy,
      and the need for attributes is minimal.  For now, almost all types and
      avrules are left in public.
      
      Test: Tested by building policy and running on device.
      
      Change-Id: Idef796c9ec169259787c3f9d8f423edf4ce27f8c
      cc39f637
  5. Aug 08, 2016
  6. Aug 05, 2016
    • Daniel Micay's avatar
      restrict access to timing information in /proc · 5423db6e
      Daniel Micay authored
      These APIs expose sensitive information via timing side channels. This
      leaves access via the adb shell intact along with the current uses by
      dumpstate, init and system_server.
      
      The /proc/interrupts and /proc/stat files were covered in this paper:
      
      https://www.lightbluetouchpaper.org/2016/07/29/yet-another-android-side-channel/
      
      The /proc/softirqs, /proc/timer_list and /proc/timer_stats files are
      also relevant.
      
      Access to /proc has been greatly restricted since then, with untrusted
      apps no longer having direct access to these, but stricter restrictions
      beyond that would be quite useful.
      
      Change-Id: Ibed16674856569d26517e5729f0f194b830cfedd
      5423db6e
  7. Jun 07, 2016
  8. Jun 03, 2016
  9. Jun 01, 2016
  10. Apr 28, 2016
  11. Apr 19, 2016
    • mukesh agrawal's avatar
      allow system server to set log.tag.WifiHAL · e651f6f4
      mukesh agrawal authored
      On eng and userdebug builds (only), allow system server
      to change the value of log.tag.WifiHAL. WifiStateMachine
      will set this property to 'D' by default. If/when a user
      enables "Developer options -> Enable Wi-Fi Verbose Logging",
      WifiStateMachine change log.tag.WifiHAL to 'V'.
      
      BUG=27857554
      TEST=manual (see below)
      
      Test detail
      1. on user build:
         $ adb shell setprop log.tag.WifiHAL V
         $ adb shell getprop log.tag.WifiHAL
         <blank line>
         $ adb bugreport | grep log.tag.WifiHAL
         <11>[  141.918517] init: avc:  denied  { set } for property=log.tag.WifiHAL pid=4583 uid=2000 gid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:wifi_log_prop:s0 tclass=property_service permissive=0
         <11>[  141.918566] init: sys_prop: permission denied uid:2000  name:log.tag.WifiHAL
      2. on userdebug build:
         $ adb shell getprop log.tag.WifiHAL
         $ <blank line>
         $ adb shell setprop log.tag.WifiHAL V
         $ adb shell getprop log.tag.WifiHAL
         V
      3. on userdebug build with modified WifiStateMachine:
         $ adb shell getprop log.tag.WifiHAL
         D
      
      Change-Id: I9cdd52a2b47a3dd1065262ea8c329130b7b044db
      e651f6f4
    • mukesh agrawal's avatar
      limit shell's access to log.* properties · 84cfde22
      mukesh agrawal authored
      Restrict the ability of the shell to set the log.*
      properties. Namely: only allow the shell to set
      such properities on eng and userdebug builds.
      
      The shell (and other domains) can continue to
      read log.* properties on all builds.
      
      While there: harmonize permissions for log.* and
      persist.log.tag. Doing so introduces two changes:
      - log.* is now writable from from |system_app|. This
        mirrors the behavior of persist.log.tag, which is
        writable to support "Developer options" ->
        "Logger buffer sizes" -> "Off".
        (Since this option is visible on user builds, the
        permission is enabled for all builds.)
      - persist.log.tag can now be set from |shell| on
        userdebug_or_eng().
      
      BUG=28221972
      TEST=manual (see below)
      
      Testing details
      - user build (log.tag)
        $ adb shell setprop log.tag.foo V
        $ adb shell getprop log.tag
        <blank line>
        $ adb bugreport | grep log.tag.foo
        [  146.525836] init: avc:  denied  { set } for property=log.tag.foo pid=4644 uid=2000 gid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:log_prop:s0 tclass=property_service permissive=0
        [  146.525878] init: sys_prop: permission denied uid:2000  name:log.tag.foo
      - userdebug build (log.tag)
        $ adb shell getprop log.tag.foo
        <blank line>
        $ adb shell setprop log.tag.foo V
        $ adb shell getprop log.tag.foo
        V
      - user build (persist.log.tag)
        $ adb shell getprop | grep log.tag
        <no match>
        - Developer options -> Logger buffer sizes -> Off
        $ adb shell getprop | grep log.tag
        [persist.log.tag]: [Settings]
        [persist.log.tag.snet_event_log]: [I]
      
      Change-Id: Idf00e7a623723a7c46bf6d01e386aeca92b2ad75
      84cfde22
  12. Apr 13, 2016
  13. Mar 31, 2016
    • Daniel Rosenberg's avatar
      Allow access to media_rw_data_file for now. · d25d57a3
      Daniel Rosenberg authored
      With sdcardfs, we no longer have a separate sdcardd acting as
      an intermediate between the outside world and /data/media.
      Unless we modify sdcardfs to change contexts, we need these.
      Added for: adbd, kernel, mediaserver, and shell
      
      Remove this patch if sdcardfs is updated to change the
      secontext of fs accesses.
      
      Bug: 27915475
      Bug: 27937873
      
      Change-Id: I25edcfc7fb8423b3184db84040bda790a1042724
      d25d57a3
    • Daniel Rosenberg's avatar
      Allow shell and adbd access to media_rw_data_file for now. · bb90999e
      Daniel Rosenberg authored
      With sdcardfs, we no longer have a separate sdcardd acting as
      an intermediate between the outside world and /data/media.
      Unless we modify sdcardfs to change contexts, we need these.
      
      Remove this patch if sdcardfs is updated to change the
      secontext of fs accesses.
      
      Bug: 27925072
      Change-Id: I3ad37c0f12836249c83042bdc1111b6360f22b3c
      bb90999e
  14. Mar 02, 2016
  15. Feb 24, 2016
  16. Jan 25, 2016
    • Jeff Vander Stoep's avatar
      app: connect to adbd · 2fdeab37
      Jeff Vander Stoep authored
      Permission to connect to adb was removed from untrusted_app when
      the domain_deprecated attribute was removed. Add it back to support
      debugging of apps. Grant to all apps as eventually
      domain_deprecated will be removed from everything.
      
      Bug: 26458796
      Change-Id: I4356e6d011094cdb6829210dd0eec443b21f8496
      2fdeab37
  17. Jan 13, 2016
  18. Jan 06, 2016
  19. Jan 05, 2016
    • dcashman's avatar
      Add sysfs_batteryinfo label. · a31755fa
      dcashman authored
      Shell user needs to be able to get current device battery_level via
      /sys/class/power_supply/battery/capacity.  Create a global label and
      corresponding policy for accessing this.  Rely on each device to label
      the appropriate sysfs entry.
      
      Bug: 26219114
      Change-Id: I2c5ef489a9db2fdf7bbd5afd04278214b814351c
      a31755fa
    • Jeff Vander Stoep's avatar
      DO NOT MERGE: Further restrict access to socket ioctl commands · 57531cac
      Jeff Vander Stoep authored
      Remove untrusted/isolated app access to device private commands.
      
      Only allow shell user to access unprivileged socket ioctl commands.
      
      Bug: 26324307
      Bug: 26267358
      Change-Id: Iddf1171bc05c7600e0292f925d18d748f13a98f2
      57531cac
    • Jeff Vander Stoep's avatar
      expand scope of priv_sock_ioctls neverallows · a8d89c31
      Jeff Vander Stoep authored
      From self to domain
      
      Change-Id: I97aeea67a6b66bc307715a050cf7699e5be9715e
      a8d89c31
    • Jeff Vander Stoep's avatar
      shell: Reduce socket ioctl perms · 89e379e9
      Jeff Vander Stoep authored
      Only allow shell to access the same subset of ioctl commands as
      untrusted_app. This reduces the attack surface of the kernel
      available to a local attacker.
      
      Bug: 26324307
      Bug: 26267358
      Change-Id: Ib8ecb9546af5fb480d2622149d4e00ec50cd4cde
      89e379e9
  20. 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
  21. Dec 22, 2015
  22. Dec 16, 2015
  23. 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
  24. Dec 08, 2015
  25. Dec 04, 2015
    • Felipe Leme's avatar
      Increase communication surface between dumpstate and Shell: · 83fd8a54
      Felipe Leme authored
      - Add a new 'dumpstate' context for system properties. This context
        will be used to share state between dumpstate and Shell. For example,
        as dumpstate progresses, it will update a system property, which Shell
        will use to display the progress in the UI as a system
        notification. The user could also rename the bugreport file, in which
        case Shell would use another system property to communicate such
        change to dumpstate.
      - Allow Shell to call 'ctl.bugreport stop' so the same system
        notification can be used to stop dumpstate.
      
      BUG: 25794470
      
      Change-Id: I74b80bda07292a91358f2eea9eb8444caabc5895
      83fd8a54
    • Nick Kralevich's avatar
      shell.te: Allow read access to system_file · 29b9532a
      Nick Kralevich authored
      Certain tests depend on the ability to examine directories
      in /system. Allow it to the shell user.
      
      Addresses the following denials:
      
        avc: denied { read } for name="egl" dev="dm-1" ino=104 scontext=u:r:shell:s0 tcontext=u:object_r:system_file:s0 tclass=dir permissive=0
      
      Bug: 26020967
      Bug: 26023420
      Change-Id: I509d921e159e99164c85fae9e8b2982a47573d14
      29b9532a
  26. Dec 03, 2015
  27. Dec 02, 2015
Loading