Skip to content
Snippets Groups Projects
  1. May 18, 2018
  2. Apr 30, 2018
  3. Apr 13, 2018
    • Wale Ogunwale's avatar
      Finalizing P SDK · 49b79029
      Wale Ogunwale authored
      Bug: 77588754
      Test: builds
      Change-Id: I61ceb438cd532584847ddd55c0eeaefebdcfa51c
      49b79029
  4. Apr 06, 2018
    • Alan Stokes's avatar
      Installd doesn't need to create cgroup files. · 8e8c1093
      Alan Stokes authored
      cgroupfs doesn't allow files to be created, so this can't be needed.
      
      Also remove redundant neverallow and dontaudit rules. These are now
      more broadly handled by domain.te.
      
      Bug: 74182216
      
      Test: Denials remain silenced.
      
      Change-Id: If7eb0e59f567695d987272a2fd36dbc251516e9f
      8e8c1093
  5. Mar 16, 2018
    • padarshr's avatar
      Init: Enable init to relabel symlinks for recovery_block_device. · ecab4010
      padarshr authored
      Allow init the ability to relabel recovery block devices. In the case
      where we have recovery as a chain partition, due to its presence in
      early mount node, init, in first stage itself would require relabel
      permissions for the restorecon operation on recovery block device.
      
      Bug: 73642793
      Test: On bootup, recovery partition gets the appropriate se-label.
            Perform OTA on non-A/B device with recovery as chain partition,
            now the recovery partition gets upgraded successfully, now that
            it has the correct se-label.
      
      Change-Id: I370c510320e78ab78c9c55573073415b4983d0f6
      Merged-In: I370c510320e78ab78c9c55573073415b4983d0f6
      (cherry picked from commit bc14ee3c)
      ecab4010
  6. Feb 27, 2018
    • Alan Stokes's avatar
      Allow init to create & write to vibrator/trigger. · 5a570606
      Alan Stokes authored
      The write is here: https://android.googlesource.com/platform/system/core/+/master/rootdir/init.rc#257.
      
      Denials (on a device with the sysfs_vibrator label properly applied):
      denied { write } for name="vibrator" dev="sysfs" ino=49613 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_vibrator:s0 tclass=dir
      denied { write } for name="trigger" dev="sysfs" ino=49620 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_vibrator:s0 tclass=file
      denied { open } for path="/sys/devices/<redacted>/vibrator/trigger" dev="sysfs" ino=49620 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_vibrator:s0 tclass=file
      
      Bug: b/72643420
      Test: Device boots, denials gone
      
      Change-Id: Ib50d9a8533303daccb1330685e3204bea3fbd8a8
      5a570606
  7. Feb 22, 2018
    • Sandeep Patil's avatar
      Add label for kernel test files and executables · 34e35e9e
      Sandeep Patil authored
      
      This required for kernel to do loopback mounts on filesystem
      images created by the kernel system call tests in LTP.
      
      Add a corresponding neverallow to stop all domains from accessing
      the location at /data/local/tmp/ltp.
      
      Bug: 73220071
      Test: Boot sailfish successfully
      Test: run vts-kernel -m VtsKernelLtp -t syscalls.fchown04
      
      Change-Id: I73f5f14017e22971fc246a05751ba67be4653bca
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      34e35e9e
  8. Feb 05, 2018
    • Carmen Jackson's avatar
      Use a whitelisting strategy for tracefs. · 2c8ca45d
      Carmen Jackson authored
      This changes tracefs files to be default-enabled in debug mode, but
      default-disabled with specific files enabled in user mode.
      
      Bug: 64762598
      Test: Successfully took traces in user mode.
      
      Change-Id: I572ea22253e0c1e42065fbd1d2fd7845de06fceb
      2c8ca45d
  9. Jan 24, 2018
    • Joel Galenson's avatar
      Fix init error trying to access file. · cf391269
      Joel Galenson authored
      Init tries to write /proc/sys/vm/min_free_order_shift but fails due to
      a SELinux denial.  This gives the file a new label and gives init the
      ability to write it.
      
      Test: Build and booted Sailfish (a couple of days ago).
      Change-Id: Ic93862b85c468afccff2019d84b927af9ed2a84d
      cf391269
  10. Jan 08, 2018
  11. Jan 03, 2018
  12. Jan 02, 2018
    • Chenbo Feng's avatar
      sepolicy: Allow mount cgroupv2 and bpf fs · 254ad0da
      Chenbo Feng authored
      Some necessary sepolicy rule changes for init process to create directory,
      mount cgroupv2 module and mount bpf filesystem. Also allow netd to create
      and pin bpf object as files and read it back from file under the
      directory where bpf filesystem is mounted.
      
      Test: bpf maps show up under /sys/fs/bpf/
      Change-Id: I579d04f60d7e20bd800d970cd28cd39fda9d20a0
      254ad0da
  13. Dec 20, 2017
    • Tri Vo's avatar
      init: tighten sysfs_type permissions · 55039509
      Tri Vo authored
      Removes open, read, setattr permissions to sysfs_type.
      Adds explicit permissions to:
      sysfs_dt_firmware_android
      sysfs_vibrator
      sysfs_wake_lock
      
      Bug: 65643247
      Test: walleye boots without denials to sysfs_type.
      Change-Id: I2e344831655c2c8e8e48b07ecce6a2704f2a206a
      55039509
  14. Dec 13, 2017
    • Tom Cherry's avatar
      Add /dev/__properties__/property_info · 8b5433a9
      Tom Cherry authored
      Allow init to create a serialized property_info file and allow all
      processes to read it.
      
      Bug: 36001741
      Test: boot bullhead, walleye using property_info
      
      Change-Id: Ie51d4c0f0221b128dd087029c811fda15b4d7093
      8b5433a9
  15. Dec 06, 2017
    • Tri Vo's avatar
      init: remove open, read, write access to 'sysfs' type. · 0e3235f4
      Tri Vo authored
      Add write access to:
      sysfs_android_usb
      sysfs_leds
      sysfs_power
      sysfs_zram
      
      Add setattr access to:
      sysfs_android_usb
      sysfs_devices_system_cpu
      sysfs_lowmemorykiller
      sysfs_power
      sysfs_leds
      sysfs_ipv4
      
      Bug: 70040773
      Bug: 65643247
      Change-Id: I68e2e796f5599c9d281897759c8d8eef9363559a
      Test: walleye boots with no denials from init to sysfs.
      0e3235f4
  16. Dec 01, 2017
  17. Nov 30, 2017
    • Joel Galenson's avatar
      Allow init to create /dev/event-log-tags. · 0975d730
      Joel Galenson authored
      Now that creating a symlink automatically sets its context,
      init needs permission to create this file.
      
      Bug: 69965807
      Test: Booted device and tested wifi and camera.
      Change-Id: I41f5ca8f4d877312c9b2a909001fe9cd80c3d458
      0975d730
  18. Nov 21, 2017
    • Benjamin Gordon's avatar
      sepolicy: Add rules for non-init namespaces · 9b2e0cbe
      Benjamin Gordon authored
      In kernel 4.7, the capability and capability2 classes were split apart
      from cap_userns and cap2_userns (see kernel commit
      8e4ff6f228e4722cac74db716e308d1da33d744f). Since then, Android cannot be
      run in a container with SELinux in enforcing mode.
      
      This change applies the existing capability rules to user namespaces as
      well as the root namespace so that Android running in a container
      behaves the same on pre- and post-4.7 kernels.
      
      This is essentially:
        1. New global_capability_class_set and global_capability2_class_set
           that match capability+cap_userns and capability2+cap2_userns,
           respectively.
        2. s/self:capability/self:global_capability_class_set/g
        3. s/self:capability2/self:global_capability2_class_set/g
        4. Add cap_userns and cap2_userns to the existing capability_class_set
           so that it covers all capabilities.  This set was used by several
           neverallow and dontaudit rules, and I confirmed that the new
           classes are still appropriate.
      
      Test: diff new policy against old and confirm that all new rules add
            only cap_userns or cap2_userns;
            Boot ARC++ on a device with the 4.12 kernel.
      Bug: crbug.com/754831
      
      Change-Id: I4007eb3a2ecd01b062c4c78d9afee71c530df95f
      9b2e0cbe
  19. Nov 08, 2017
    • Tri Vo's avatar
      init: label /proc dependencies and remove access to proc · 84e181bc
      Tri Vo authored
      New types and files labeled with them:
      1. proc_abi:
        /proc/sys/abi/swp
      
      2. proc_dirty:
        /proc/sys/vm/dirty_background_ratio
        /proc/sys/vm/dirty_expire_centisecs
      
      3. proc_diskstats:
        /proc/diskstats
      
      4. proc_extra_free_kbytes:
        /proc/sys/vm/extra_free_kbytes
      
      5. proc_hostname:
        /proc/sys/kernel/domainname
        /proc/sys/kernel/hostname
      
      6. proc_hung_task:
        /proc/sys/kernel/hung_task_timeout_secs
      
      7. proc_max_map_count:
        /proc/sys/vm/max_map_count
      
      8. proc_panic:
        /proc/sys/kernel/panic_on_oops
      
      9. proc_sched:
        /proc/sys/kernel/sched_child_runs_first
        /proc/sys/kernel/sched_latency_ns
        /proc/sys/kernel/sched_rt_period_us
        /proc/sys/kernel/sched_rt_runtime_us
        /proc/sys/kernel/sched_tunable_scaling
        /proc/sys/kernel/sched_wakeup_granularity_ns
      
      10. proc_uptime:
        /proc/uptime
      
      Files labeled with already existing types:
      1. proc_perf:
        /proc/sys/kernel/perf_event_paranoid
      
      2. proc_sysrq:
        /proc/sys/kernel/sysrq
      
      3. usermodehelper:
        /proc/sys/kernel/core_pipe_limit
      
      Changes to init domain:
      1. Removed access to files with 'proc' label.
      2. Added access to newly introduced types + proc_kmsg.
      
      Bug: 68949041
      Test: walleye boots without denials from u:r:init:s0.
      Test: system/core/init/grab-bootchart.sh does not trigger denials from
      u:r:init:s0
      Change-Id: If1715c3821e277679c320956df33dd273e750ea2
      84e181bc
    • Tri Vo's avatar
      init: refactor access to proc_* labels. · fa8f67b2
      Tri Vo authored
      Bug: 68949041
      Test: device builds, boots, no denials from init.
      
      Change-Id: Iedefac8d70512fd614ca06117f42a7887f6ab649
      fa8f67b2
    • Luis Hector Chavez's avatar
      Allow callers of uevent_kernel_*() access to /proc/sys/kernel/overflowuid · 640e595a
      Luis Hector Chavez authored
      Bug: 62378620
      Test: Android in Chrome OS can call uevent_kernel_recv() and not fail
            with EIO.
      Test: bullhead networking still works
      
      Change-Id: I4dd5d2148ee1704c4fa23d7fd82d1ade19b58cbd
      640e595a
  20. Oct 24, 2017
  21. Sep 28, 2017
  22. Sep 26, 2017
  23. Sep 21, 2017
    • Tri Vo's avatar
      Explicitly label vold dependecies in /proc · 9bf6a953
      Tri Vo authored
      1. Labeled:
      /proc/cmdline -> proc_cmdline
      
      2. Removed access to proc label from vold domain.
      
      3. Added access proc_cmdline to these domains:
      init, kernel, vold
      
      4. Also, added proc_drop_caches access to vold.
      
      Bug: 66497047
      Test: device boots without selinux denials to new labels
      Change-Id: Ic88d11b7e56b07c0e8bd874e7f72788922a218e3
      9bf6a953
  24. Sep 19, 2017
    • Tri Vo's avatar
      Explicitly label system_server's dependencies in /proc · 8c2323d3
      Tri Vo authored
      Labeled:
      /proc/asound/cards -> proc_asound_cards
      /proc/loadavg -> proc_loadavg
      /proc/pagetypeinfo -> proc_pagetypeinfo
      /proc/version -> proc_version
      /proc/vmallocinfo -> proc_vmallocinfo
      
      system_server: added access to all new types  and removed access to proc label.
      init: added access to proc_version.
      dumpstate: added access to proc_pagetypeinfo, proc_version,
      proc_vmallocinfo.
      hal_audio: added access to proc_asound_cards.
      all_untrusted_apps: extended neverallow rule to include new labels.
      
      Bug: 65980789
      Test: device boots without selinux denials to the newly introduced
      labels.
      Test: "adb shell dumpstate" throws no violations to new labels.
      Change-Id: Ic60facd3d4776e38d5e3ba003d06ada4e52c7dca
      8c2323d3
  25. Sep 18, 2017
  26. Sep 06, 2017
    • Tao Bao's avatar
      Allow init to relabelto to misc_block_device. · 28fde232
      Tao Bao authored
      avc:  denied  { relabelto } for  pid=1 comm="init" name="misc" dev="tmpfs" ino=3855 scontext=u:r:init:s0 tcontext=u:object_r:misc_block_device:s0 tclass=lnk_file
      
      If misc partition is used during early mount, it will carry a label of
      tmpfs (instead of block_device), which will fail restorecon with the
      above denial.
      
      Bug: 65378733
      Test: Build and flash a target that uses misc in early mount. No longer
            observe the above denial.
      Change-Id: I44cd43dbd2a8a4f9f423ebc8ac0dd046b167ef72
      28fde232
  27. 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
  28. Jul 27, 2017
    • 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
  29. Jul 12, 2017
    • Jeff Vander Stoep's avatar
      create separate usermodehelper type for sysfs · ece21859
      Jeff Vander Stoep authored
      Prevent files in /proc from incorrectly having sysfs_type attribute.
      
      Rework neverallows so that ueventd has write access to all of
      /sys which it needs to handle uevents.
      
      Bug: 63147833
      Test: Build. Flash angler, verify files are correctly labeled and no
          new denials are in the logs.
      
      Change-Id: Ib94d44e78cee0e83e2ac924f1c72e611e8e73558
      ece21859
  30. Jun 27, 2017
    • Josh Gao's avatar
      Add /dev/kmsg_debug. · 3458ec13
      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).
      
      (Originally commited in a015186f)
      Bug: 36574794
      Bug: 62101480
      Test: Builds and boots.
      Change-Id: I249e11291c58fee77098dec3fd3271ea23363ac9
      3458ec13
  31. Jun 19, 2017
    • Tom Cherry's avatar
      Add getpgid to system_service and init · d5f0aba0
      Tom Cherry authored
      In libprocessgroup, we want to only send signals once to processes,
      particularly for SIGTERM.  We must send the signal both to all
      processes within a POSIX process group and a cgroup.  To ensure that
      we do not duplicate the signals being sent, we check the processes in
      the cgroup to see if they're in the POSIX process groups that we're
      killing.  If they are, we skip sending a second signal.  This requires
      getpgid permissions, hence this SELinux change.
      
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:untrusted_app_25:s0:c512,c768 tclass=process permissive=1
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:untrusted_app_25:s0:c512,c768 tclass=process permissive=1
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:system_app:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:system_app:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:zygote:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:zygote:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:system_server:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:system_server:s0 tclass=process permissive=1
      
      Bug: 37853905
      Bug: 62418791
      Test: Boot, kill zygote, reboot
      Change-Id: Ib6c265dbaac8833c47145ae28fb6594ca8545570
      (cherry picked from commit c59eb4d8)
      d5f0aba0
  32. Jun 14, 2017
  33. Jun 13, 2017
    • Tom Cherry's avatar
      Add getpgid to system_service and init · c59eb4d8
      Tom Cherry authored
      In libprocessgroup, we want to only send signals once to processes,
      particularly for SIGTERM.  We must send the signal both to all
      processes within a POSIX process group and a cgroup.  To ensure that
      we do not duplicate the signals being sent, we check the processes in
      the cgroup to see if they're in the POSIX process groups that we're
      killing.  If they are, we skip sending a second signal.  This requires
      getpgid permissions, hence this SELinux change.
      
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:untrusted_app_25:s0:c512,c768 tclass=process permissive=1
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:untrusted_app_25:s0:c512,c768 tclass=process permissive=1
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:system_app:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:system_app:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:zygote:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:zygote:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:system_server:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:system_server:s0 tclass=process permissive=1
      
      Bug: 37853905
      Bug: 62418791
      Test: Boot, kill zygote, reboot
      Change-Id: Ib6c265dbaac8833c47145ae28fb6594ca8545570
      c59eb4d8
    • Tim Murray's avatar
      sepolicy: fix support for lmkd · 527f64e6
      Tim Murray authored
      Allow lmkd to access /dev/memcg once again.
      
      Test: lmkd can access memcg
      bug 36588803
      
      Change-Id: Ia57dbbc3987d8858c932103c4e546cbb88893207
      527f64e6
  34. Jun 07, 2017
    • Joel Galenson's avatar
      Move file labeling to genfs_contexts. · 7fa51593
      Joel Galenson authored
      This should improve performance, as file_contexts is slower than
      genfs_contexts.
      
      Bug: 62413700
      Test: Built, flashed, and booted Marlin.  Verified that some of the
      files have the correct context.
      Change-Id: Ia28707ec565a0792bc882fbffe9e8ab9968535f5
      7fa51593
  35. May 26, 2017
Loading