Skip to content
Snippets Groups Projects
  1. May 12, 2014
    • Nick Kralevich's avatar
      Revisit kernel setenforce · abae8a9b
      Nick Kralevich authored
      Kernel userspace helpers may be spawned running in the kernel
      SELinux domain. Those userspace helpers shouldn't be able to turn
      SELinux off.
      
      This change revisits the discussion in
      https://android-review.googlesource.com/#/c/71184/
      
      At the time, we were debating whether or not to have an allow rule,
      or a dontaudit rule. Both have the same effect, as at the time we
      switch to enforcing mode, the kernel is in permissive and the operation
      will be allowed.
      
      Change-Id: If335a5cf619125806c700780fcf91f8602083824
      abae8a9b
  2. May 09, 2014
  3. May 08, 2014
    • Stephen Smalley's avatar
      Drop rw access to unlabeled files. · e69a32a1
      Stephen Smalley authored
      
      Should no longer be required due to restorecon_recursive of /data
      by init.rc (covers everything outside of /data/data) and due to
      restorecon_recursive of /data/data by installd (covers /data/data
      directories).
      
      Move the neverallow rule on relabelto to the neverallow section.
      We could potentially drop this altogether, along with the relabelto_domain
      macro and its callers, since its motivation was to provide some
      safeguard in spite of allowing relabelfrom to unlabeled files for
      all domains and this change removes relabelfrom.
      
      unconfined still retains rw access to unlabeled, as do specific domains
      that are explicitly allowed it.
      
      Change-Id: Ied84f8b4b1a0896c1b9f7d783b7463ce09d4807b
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      e69a32a1
  4. Apr 18, 2014
    • 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
  5. 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
  6. Mar 10, 2014
    • Stephen Smalley's avatar
      Deduplicate neverallow rules on selinuxfs operations. · 853ffaad
      Stephen Smalley authored
      
      We already have neverallow rules for all domains about
      loading policy, setting enforcing mode, and setting
      checkreqprot, so we can drop redundant ones from netd and appdomain.
      Add neverallow rules to domain.te for setbool and setsecparam
      and exclude them from unconfined to allow fully eliminating
      separate neverallow rules on the :security class from anything
      other than domain.te.
      
      Change-Id: I0122e23ccb2b243f4c5376893e0c894f01f548fc
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      853ffaad
  7. Mar 06, 2014
  8. Mar 05, 2014
    • Stephen Smalley's avatar
      Address system_server denials. · 3dad7b61
      Stephen Smalley authored
      
      Label /proc/sysrq-trigger and allow access.
      Label /dev/socket/mtpd and allow access.
      
      Resolves denials such as:
      avc:  denied  { getattr } for  pid=12114 comm="Binder_2" path="socket:[219779]" dev="sockfs" ino=219779 scontext=u:r:untrusted_app:s0 tcontext=u:r:system_server:s0 tclass=tcp_socket
      
      avc:  denied  { call } for  pid=1007 comm="Binder_8" scontext=u:r:system_server:s0 tcontext=u:r:su:s0 tclass=binder
      
      avc:  denied  { write } for  pid=1024 comm="watchdog" name="sysrq-trigger" dev="proc" ino=4026533682 scontext=u:r:system_server:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      avc:  denied  { write } for  pid=11567 comm="LegacyVpnRunner" name="mtpd" dev="tmpfs" ino=36627 scontext=u:r:system_server:s0 tcontext=u:object_r:socket_device:s0 tclass=sock_file
      
      avc:  denied  { ptrace } for  pid=10924 comm=5369676E616C2043617463686572 scontext=u:r:system_server:s0 tcontext=u:r:system_server:s0 tclass=process
      
      avc:  denied  { sigkill } for  pid=26077 comm="NativeCrashRepo" scontext=u:r:system_server:s0 tcontext=u:r:zygote:s0 tclass=process
      
      avc:  denied  { write } for  pid=1024 comm="android.bg" scontext=u:r:system_server:s0 tcontext=u:r:system_server:s0 tclass=netlink_socket
      
      avc:  denied  { getattr } for  pid=473 comm="FinalizerDaemon" path="socket:[11467]" dev="sockfs" ino=11467 scontext=u:r:system_server:s0 tcontext=u:r:mediaserver:s0 tclass=tcp_socket
      
      avc:  denied  { getattr } for  pid=473 comm="FinalizerDaemon" path="socket:[12076]" dev="sockfs" ino=12076 scontext=u:r:system_server:s0 tcontext=u:r:mediaserv
      er:s0 tclass=udp_socket
      
      avc:  denied  { getopt } for  pid=473 comm="FinalizerDaemon" laddr=192.168.159.172 lport=51576 faddr=93.127.173.40 fport=554 scontext=u:r:system_server:s0 tcontext=u:r:mediaserver:s0 tclass=tcp_socket
      
      avc:  denied  { getopt } for  pid=473 comm="FinalizerDaemon" lport=15658 scontext=u:r:system_server:s0 tcontext=u:r:mediaserver:s0 tclass=udp_socket
      
      avc:  denied  { read write } for  pid=21384 comm="rtsp" path="socket:[443742]"
      dev="sockfs" ino=443742 scontext=u:r:system_server:s0 tcontext=u:r:mediaserver:s
      0 tclass=tcp_socket
      
      avc:  denied  { read write } for  pid=21384 comm="rtsp" path="socket:[444842]" dev="sockfs" ino=444842 scontext=u:r:system_server:s0 tcontext=u:r:mediaserver:s0 tclass=udp_socket
      
      avc:  denied  { setopt } for  pid=1326 comm="Binder_9" lport=16216 scontext=u:r:system_server:s0 tcontext=u:r:mediaserver:s0 tclass=udp_socket
      
      avc:  denied  { setopt } for  pid=1676 comm="Binder_6" laddr=192.168.156.130 lport=51044 faddr=74.125.214.81 fport=554 scontext=u:r:system_server:s0 tcontext=u:r:mediaserver:s0 tclass=tcp_socket
      
      avc:  denied  { getattr } for  pid=10915 comm="system_server" path="/dev/mdm" dev="tmpfs" ino=7484 scontext=u:r:system_server:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file
      
      avc:  denied  { read } for  pid=10915 comm="system_server" name="mdm" dev="tmpfs" ino=7484 scontext=u:r:system_server:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file
      
      avc:  denied  { unlink } for  pid=14866 comm="system_server" name="wallpaper" dev="mmcblk0p9" ino=285715 scontext=u:r:system_server:s0 tcontext=u:object_r:wallpaper_file:s0 tclass=file
      
      avc:  denied  { getattr } for  pid=12114 comm="Binder_2" path="socket:[219779]" dev="sockfs" ino=219779 scontext=u:r:untrusted_app:s0 tcontext=u:r:system_server:s0 tclass=tcp_socket
      
      avc:  denied  { getopt } for  pid=32300 comm="Binder_1" laddr=::ffff:127.0.0.1 lport=4939 faddr=::ffff:127.0.0.1 fport=53318 scontext=u:r:untrusted_app:s0 tcontext=u:r:system_server:s0 tclass=tcp_socket
      
      avc:  denied  { read write } for  pid=10840 comm="pool-17-thread-" path="socket:[205990]" dev="sockfs" ino=205990 scontext=u:r:untrusted_app:s0 tcontext=u:r:system_server:s0 tclass=tcp_socket
      
      avc:  denied  { write } for  pid=20817 comm="dumpsys" path="/mnt/shell/emulated/0/aupt-output/bugreport-2014-02-22-11-17-16.txt.tmp" dev="fuse" ino=3100784040 scontext=u:r:system_server:s0 tcontext=u:object_r:sdcard_internal:s0 tclass=file
      
      Change-Id: I481ac26667b487031a5d3317b0a028a027a8e641
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      3dad7b61
  9. 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
  10. Feb 24, 2014
  11. Feb 19, 2014
    • Nick Kralevich's avatar
      initial policy for uncrypt. · 96eeb1ec
      Nick Kralevich authored
      Add initial support for uncrypt, started via the
      pre-recovery service in init.rc. On an encrypted device,
      uncrypt reads an OTA zip file on /data, opens the underlying
      block device, and writes the unencrypted blocks on top of the
      encrypted blocks. This allows recovery, which can't normally
      read encrypted partitions, to reconstruct the OTA image and apply
      the update as normal.
      
      Add an exception to the neverallow rule for sys_rawio. This is
      needed to support writing to the raw block device.
      
      Add an exception to the neverallow rule for unlabeled block devices.
      The underlying block device for /data varies between devices
      within the same family (for example, "flo" vs "deb"), and the existing
      per-device file_context labeling isn't sufficient to cover these
      differences. Until I can resolve this problem, allow access to any
      block devices.
      
      Bug: 13083922
      Change-Id: I7cd4c3493c151e682866fe4645c488b464322379
      96eeb1ec
  12. Feb 12, 2014
  13. Feb 11, 2014
  14. 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
  15. Feb 03, 2014
  16. Jan 30, 2014
    • Stephen Smalley's avatar
      Remove MAC capabilities from unconfined domains. · 04ee5dfb
      Stephen Smalley authored
      
      Linux defines two capabilities for Mandatory Access Control (MAC)
      security modules, CAP_MAC_OVERRIDE (override MAC access restrictions)
      and CAP_MAC_ADMIN (allow MAC configuration or state changes).
      SELinux predates these capabilities and did not originally use them,
      but later made use of CAP_MAC_ADMIN as a way to control the ability
      to set security context values unknown to the currently loaded
      SELinux policy on files.  That facility is used in Linux for e.g.
      livecd creation where a file security context that is being set
      on a generated filesystem is not known to the build host policy.
      Internally, files with such labels are treated as having the unlabeled
      security context for permission checking purposes until/unless the
      context is later defined through a policy reload.
      
      CAP_MAC_OVERRIDE is never checked by SELinux, so it never needs
      to be allowed.  CAP_MAC_ADMIN is only checked if setting an
      unknown security context value; the only legitimate use I can see
      in Android is the recovery console, where a context may need to be set
      on /system that is not defined in the recovery policy.
      
      Remove these capabilities from unconfined domains, allow
      mac_admin for the recovery domain, and add neverallow rules.
      
      Change-Id: Ief673e12bc3caf695f3fb67cabe63e68f5f58150
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      04ee5dfb
  17. Jan 23, 2014
    • Nick Kralevich's avatar
      Support running adbd in the su domain. · 7d0f955e
      Nick Kralevich authored
      When adbd runs as root, it transitions into the
      su domain. Add the various rules to support this.
      
      This is needed to run the adbd and shell domains in
      enforcing on userdebug / eng devices without breaking
      developer workflows.
      
      Change-Id: Ib33c0dd2dd6172035230514ac84fcaed2ecf44d6
      7d0f955e
  18. Jan 16, 2014
    • Stephen Smalley's avatar
      Drop legacy device types. · d9b8ef43
      Stephen Smalley authored
      
      powervr_device is obsoleted by the more general gpu_device.
      akm_device and accelerometer_device are obsoleted by the more
      general sensors_device.
      
      We could also drop the file_contexts entries altogether and
      take them to device-specific policy (in this case, they all
      came from crespo, so that is obsolete for master).
      
      Change-Id: I63cef43b0d66bc99b80b64655416cc050f443e7d
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      d9b8ef43
  19. Jan 09, 2014
    • Stephen Smalley's avatar
      Remove domain init:unix_stream_socket connectto permission. · 39fd7818
      Stephen Smalley authored
      
      We do not want to permit connecting to arbitrary unconfined services
      left running in the init domain.  I do not know how this was originally
      triggered and thus cannot test that it is fixed.  Possible causes:
      - another service was left running in init domain, e.g. dumpstate,
      - there was a socket entry for the service in the init.rc file
      and the service was launched via logwrapper and therefore init did
      not know how to label the socket.
      
      The former should be fixed.  The latter can be solved either by
      removing use of logwrapper or by specifying the socket context
      explicitly in the init.rc file now.
      
      Change-Id: I09ececaaaea2ccafb7637ca08707566c1155a298
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      39fd7818
    • Stephen Smalley's avatar
      Allow access to unlabeled socket and fifo files. · 91c290b8
      Stephen Smalley authored
      
      Just use notdevfile_class_set to pick up all non-device file classes.
      
      Change-Id: Ib3604537ccfc25da67823f0f2b5d70b84edfaadf
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      91c290b8
    • Stephen Smalley's avatar
      Remove unlabeled execute access from domain, add to appdomain. · 959fdaaa
      Stephen Smalley authored
      
      Otherwise all domains can create/write files that are executable
      by all other domains.  If I understand correctly, this should
      only be necessary for app domains executing content from legacy
      unlabeled userdata partitions on existing devices and zygote
      and system_server mappings of dalvikcache files, so only allow
      it for those domains.
      
      If required for others, add it to the individual
      domain .te file, not for all domains.
      
      Change-Id: I6f5715eb1ecf2911e70772b9ab4e531feea18819
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      959fdaaa
  20. Jan 08, 2014
  21. Jan 07, 2014
  22. Jan 04, 2014
    • Nick Kralevich's avatar
      Don't allow zygote init:binder call · a730e50b
      Nick Kralevich authored
      init can't handle binder calls. It's always incorrect
      to allow init:binder call, and represents a binder call
      to a service without an SELinux domain. Adding this
      allow rule was a mistake; the dumpstate SELinux domain didn't
      exist at the time this rule was written, and dumpstate was
      running under init's domain.
      
      Add a neverallow rule to prevent the reintroduction of
      this bug.
      
      Change-Id: I78d35e675fd142d880f15329471778c18972bf50
      a730e50b
  23. Jan 03, 2014
    • Stephen Smalley's avatar
      Address adb backup/restore denials. · c4021ceb
      Stephen Smalley authored
      
      Resolves the following denials seen during an adb backup and restore
      sequence.
      
      <5>[   90.247039] type=1400 audit(1388759567.693:16): avc:  denied  { getopt } for  pid=3503 comm="Thread-149" scontext=u:r:system_server:s0 tcontext=u:r:adbd:s0 tclass=unix_stream_socket
      <5>[   90.249176] type=1400 audit(1388759567.703:17): avc:  denied  { getopt } for  pid=2334 comm="app_process" scontext=u:r:shell:s0 tcontext=u:r:adbd:s0 tclass=unix_stream_socket
      
      Change-Id: I1f6f90f29eecc32ee692764b04b812988f099cde
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      c4021ceb
  24. Jan 02, 2014
    • Stephen Smalley's avatar
      Remove execmem permission from domain, add to appdomain. · ad7df7bb
      Stephen Smalley authored
      
      execmem permission controls the ability to make an anonymous
      mapping executable or to make a private file mapping writable
      and executable.  Remove this permission from domain (i.e.
      all domains) by default, and add it explicitly to app domains.
      It is already allowed in other specific .te files as required.
      There may be additional cases in device-specific policy where
      it is required for proprietary binaries.
      
      Change-Id: I902ac6f8cf2e93d46b3a976bc4dabefa3905fce6
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      ad7df7bb
  25. Dec 18, 2013
    • Stephen Smalley's avatar
      Confine shell domain in -user builds only. · 712ca0a4
      Stephen Smalley authored
      
      Confine the domain for an adb shell in -user builds only.
      The shell domain in non-user builds is left permissive.
      init_shell (shell spawned by init, e.g.  console service)
      remains unconfined by this change.
      Introduce a shelldomain attribute for rules common to all shell
      domains, assign it to the shell types, and add shelldomain.te for
      its rules.
      
      Change-Id: I01ee2c7ef80b61a9db151abe182ef9af7623c461
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      712ca0a4
  26. Dec 13, 2013
    • Nick Kralevich's avatar
      Label /data/misc/zoneinfo · 7466f9b6
      Nick Kralevich authored
      And allow any SELinux domain to read these timezone
      related files.
      
      Addresses the following denial:
      <5>[    4.746399] type=1400 audit(3430294.470:7): avc:  denied  { open } for  pid=197 comm="time_daemon" name="tzdata" dev="mmcblk0p28" ino=618992 scontext=u:r:time:s0 tcontext=u:object_r:system_data_file:s0 tclass=file
      
      Change-Id: Iff32465e62729d7aad8c79607848d89ce0aede86
      7466f9b6
  27. Dec 09, 2013
    • Stephen Smalley's avatar
      Restrict ptrace access by debuggerd and unconfineddomain. · 95e0842e
      Stephen Smalley authored
      
      Remove init, ueventd, watchdogd, healthd and adbd from the set of
      domains traceable by debuggerd.  bionic/linker/debugger.cpp sets up
      handlers for all dynamically linked programs in Android but this
      should not apply for statically linked programs.
      
      Exclude ptrace access from unconfineddomain.
      
      Prohibit ptrace access to init via neverallow.
      
      Change-Id: I70d742233fbe40cb4d1772a4e6cd9f8f767f2c3a
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      95e0842e
  28. Dec 06, 2013
    • Stephen Smalley's avatar
      Allow kernel domain, not init domain, to set SELinux enforcing mode. · fea6e66f
      Stephen Smalley authored
      As per the discussion in:
      https://android-review.googlesource.com/#/c/71184/
      
      
      
      init sets the enforcing mode in its code prior to switching to
      the init domain via a setcon command in the init.rc file.  Hence,
      the setenforce permission is checked while still running in the
      kernel domain.  Further, as init has no reason to ever set the
      enforcing mode again, we do not need to allow setenforce to the
      init domain and this prevents reverting to permissive
      mode via an errant write by init later.  We could technically
      dontaudit the kernel setenforce access instead since the first
      call to setenforce happens while still permissive (and thus we
      never need to allow it in policy) but we allow it to more accurately
      represent what is possible.
      
      Change-Id: I70b5e6d8c99e0566145b9c8df863cc8a34019284
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      fea6e66f
    • Nick Kralevich's avatar
      Revert "Allow kernel domain, not init domain, to set SELinux enforcing mode." · 9e8b8d9f
      Nick Kralevich authored
      The build is broken. Reverting temporarily to fix breakage.
      
      libsepol.check_assertion_helper: neverallow on line 4758 violated by allow init kernel:security { setenforce };
      Error while expanding policy
      make: *** [out/target/product/mako/obj/ETC/sepolicy_intermediates/sepolicy] Error 1
      make: *** Waiting for unfinished jobs....
      
      
      This reverts commit bf12e225.
      
      Change-Id: I78a05756d8ce3c7d06e1d9d27e6135f4b352bb85
      9e8b8d9f
    • Stephen Smalley's avatar
      Allow kernel domain, not init domain, to set SELinux enforcing mode. · bf12e225
      Stephen Smalley authored
      As per the discussion in:
      https://android-review.googlesource.com/#/c/71184/
      
      
      
      init sets the enforcing mode in its code prior to switching to
      the init domain via a setcon command in the init.rc file.  Hence,
      the setenforce permission is checked while still running in the
      kernel domain.  Further, as init has no reason to ever set the
      enforcing mode again, we do not need to allow setenforce to the
      init domain and this prevents reverting to permissive
      mode via an errant write by init later.  We could technically
      dontaudit the kernel setenforce access instead since the first
      call to setenforce happens while still permissive (and thus we
      never need to allow it in policy) but we allow it to more accurately
      represent what is possible.
      
      Change-Id: I617876c479666a03167b8fce270c82a8d45c7cc6
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      bf12e225
    • Stephen Smalley's avatar
      Restrict the ability to set usermodehelpers and proc security settings. · 7adb999e
      Stephen Smalley authored
      
      Limit the ability to write to the files that configure kernel
      usermodehelpers and security-sensitive proc settings to the init domain.
      Permissive domains can also continue to set these values.
      
      The current list is not exhaustive, just an initial set.
      Not all of these files will exist on all kernels/devices.
      Controlling access to certain kernel usermodehelpers, e.g. cgroup
      release_agent, will require kernel changes to support and cannot be
      addressed here.
      
      Expected output on e.g. flo after the change:
      ls -Z /sys/kernel/uevent_helper /proc/sys/fs/suid_dumpable /proc/sys/kernel/core_pattern /proc/sys/kernel/dmesg_restrict /proc/sys/kernel/hotplug /proc/sys/kernel/kptr_restrict /proc/sys/kernel/poweroff_cmd /proc/sys/kernel/randomize_va_space /proc/sys/kernel/usermodehelper
      -rw-r--r-- root     root              u:object_r:usermodehelper:s0 uevent_helper
      -rw-r--r-- root     root              u:object_r:proc_security:s0 suid_dumpable
      -rw-r--r-- root     root              u:object_r:usermodehelper:s0 core_pattern
      -rw-r--r-- root     root              u:object_r:proc_security:s0 dmesg_restrict
      -rw-r--r-- root     root              u:object_r:usermodehelper:s0 hotplug
      -rw-r--r-- root     root              u:object_r:proc_security:s0 kptr_restrict
      -rw-r--r-- root     root              u:object_r:usermodehelper:s0 poweroff_cmd
      -rw-r--r-- root     root              u:object_r:proc_security:s0 randomize_va_space
      -rw------- root     root              u:object_r:usermodehelper:s0 bset
      -rw------- root     root              u:object_r:usermodehelper:s0 inheritable
      
      Change-Id: I3f24b4bb90f0916ead863be6afd66d15ac5e8de0
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      7adb999e
  29. Dec 05, 2013
    • Robert Craig's avatar
      Drop tegra specific label from policy. · b2547644
      Robert Craig authored
      This label was originally used for Motorola
      Xoom devices. nvmap is the tegra gpu memory
      manager and the various nvhost drivers are
      for tegra graphics related functionality,
      i.e. display serial interface, image signal
      processor, or media processing stuff.
      
      Only grouper and tilapia presently need this
      policy.
      
      Change-Id: I2a7000f69abf3185724d88d428e8237e0ca436ec
      b2547644
  30. Dec 02, 2013
  31. Nov 08, 2013
  32. Nov 06, 2013
Loading