Commit graph

3334 commits

Author SHA1 Message Date
dcashman
43b8bc53ab resolved conflicts for merge of 47bd7300 to lmp-dev-plus-aosp
Change-Id: I9631fb1774893d2eeccd7f1f5a867cb5dd98d53d
2014-09-09 13:56:05 -07:00
dcashman
47bd7300a5 Add support for factory reset protection.
Address the following denials:
<12>[  417.732129] type=1400 audit(365340.189:47): avc: denied { read } for pid=1737 comm="Binder_2" name="mmcblk0p18" dev="tmpfs" ino=12406 scontext=u:r:system_server:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=0
<12>[  417.882126] type=1400 audit(365340.339:48): avc: denied { read } for pid=1737 comm="Binder_2" name="mmcblk0p18" dev="tmpfs" ino=12406 scontext=u:r:system_server:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=0

Bug: 16710840
Change-Id: I8cb5b4b17dffe14f0bf05d63eb8f6ab8d5c09f53
2014-09-08 14:27:45 -07:00
Nick Kralevich
1ed3ec8596 am 5fc825c9: sdcardd: grant unmount
* commit '5fc825c91715ad0b983b42986e93070eb7ce333d':
  sdcardd: grant unmount
2014-09-04 22:20:49 +00:00
Nick Kralevich
5fc825c917 sdcardd: grant unmount
If the sdcard daemon is restarted (crash or otherwise), one of the first
things it attempts to do is umount the previously mounted /mnt/shell/emulated
fuse filesystem, which is denied by SELinux with the following denial:

  sdcard  : type=1400 audit(0.0:6997): avc: denied { unmount } for scontext=u:r:sdcardd:s0 tcontext=u:object_r:fuse:s0 tclass=filesystem permissive=0

Allow the operation.

Steps to reproduce:

  1) adb shell into the device and su to root
  2) run "kill -9 [PID OF SDCARD]

Expected:

  sdcard daemon successfully restarts without error message.

Actual:

  SELinux denial above, plus attempts to mount a new filesystem
  on top of the existing filesystem.

(cherrypicked from commit abfd427a32)

Bug: 17383009
Change-Id: I386bfc98e2b5b32b1d11408f7cfbd6e3c1af68f4
2014-09-04 13:40:06 -07:00
Nick Kralevich
59755451b6 am abfd427a: sdcardd: grant unmount
* commit 'abfd427a3226a8bb696e5e5b9239f5445a680f6c':
  sdcardd: grant unmount
2014-09-04 20:12:33 +00:00
Nick Kralevich
abfd427a32 sdcardd: grant unmount
If the sdcard daemon is restarted (crash or otherwise), one of the first
things it attempts to do is umount the previously mounted /mnt/shell/emulated
fuse filesystem, which is denied by SELinux with the following denial:

  sdcard  : type=1400 audit(0.0:6997): avc: denied { unmount } for scontext=u:r:sdcardd:s0 tcontext=u:object_r:fuse:s0 tclass=filesystem permissive=0

Allow the operation.

Steps to reproduce:

  1) adb shell into the device and su to root
  2) run "kill -9 [PID OF SDCARD]

Expected:

  sdcard daemon successfully restarts without error message.

Actual:

  SELinux denial above, plus attempts to mount a new filesystem
  on top of the existing filesystem.

Bug: 17383009
Change-Id: I386bfc98e2b5b32b1d11408f7cfbd6e3c1af68f4
2014-09-04 11:04:23 -07:00
Mark Salyzyn
3d879d4872 am bcdff890: logd: permit app access to clear logs
* commit 'bcdff890304e694c09bf0a4a90fb76a82434fa57':
  logd: permit app access to clear logs
2014-09-03 05:07:37 +00:00
Stephen Smalley
3f0ce9e096 am 018e9402: Prohibit reading of untrusted symlinks via neverallow.
* commit '018e9402c656c20289ea382dc72f958aa7e054d1':
  Prohibit reading of untrusted symlinks via neverallow.
2014-09-02 21:26:08 +00:00
Stephen Smalley
018e9402c6 Prohibit reading of untrusted symlinks via neverallow.
Change-Id: Id669fa1850edf2adee230e71bca2278f215e39f4
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-09-02 17:05:44 -04:00
Mark Salyzyn
e6c865e1b6 am 60f0be84: logd: permit app access to clear logs
* commit '60f0be84c0cf3a895c6b95ee8387b71e1b0c6d83':
  logd: permit app access to clear logs
2014-09-01 18:52:16 +00:00
Mark Salyzyn
bcdff89030 logd: permit app access to clear logs
I/auditd(19949): type=1400 audit(0.0:71): avc:  denied  { write } for  comm="logcat" name="logd" dev="tmpfs" ino=5924 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:logd_socket:s0 tclass=sock_file

(cherry picked from 60f0be84c0)

Bug: 17323719
Change-Id: Id8399195196ffad884eef98030d544c68ed0596f
2014-09-01 18:39:26 +00:00
Mark Salyzyn
60f0be84c0 logd: permit app access to clear logs
I/auditd(19949): type=1400 audit(0.0:71): avc:  denied  { write } for  comm="logcat" name="logd" dev="tmpfs" ino=5924 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:logd_socket:s0 tclass=sock_file

Bug: 17323719
Change-Id: Id8399195196ffad884eef98030d544c68ed0596f
2014-09-01 18:33:29 +00:00
Robin Lee
f9ea564a9e am de08be8a: Allow system reset_uid, sync_uid, password_uid
* commit 'de08be8aa006c313e5025ba5f032abf786a39f71':
  Allow system reset_uid, sync_uid, password_uid
2014-08-29 23:55:15 +00:00
Robin Lee
de08be8aa0 Allow system reset_uid, sync_uid, password_uid
Permits the system server to change keystore passwords for users other
than primary.

Bug: 16233206
Change-Id: I7941707ca66ac25bd122fd22e5e0f639e7af697e
2014-08-29 23:48:07 +01:00
Brian Carlstrom
35651b33ae am 372d0df7: Remove system_server create access from /data/dalvik-cache
* commit '372d0df796389e2f6295a394492585ed64f0ceca':
  Remove system_server create access from /data/dalvik-cache
2014-08-29 18:49:03 +00:00
Brian Carlstrom
bd6d1f385b am 09eae908: Remove system_server create access from /data/dalvik-cache
* commit '09eae90890d4a2545358b8ba104e1f2a46df1408':
  Remove system_server create access from /data/dalvik-cache
2014-08-29 11:39:57 +00:00
Brian Carlstrom
09eae90890 Remove system_server create access from /data/dalvik-cache
Bug: 16875245

(cherry picked from commit 372d0df796)

Change-Id: I38fa14226ab94df2029ca60d3c8898f46c1824c7
2014-08-28 21:36:27 -07:00
Brian Carlstrom
372d0df796 Remove system_server create access from /data/dalvik-cache
Bug: 16875245
Change-Id: I2487a80896a4a923fb1fa606f537df9f6ad4220a
2014-08-28 21:15:38 -07:00
dcashman
2fd17bc8c1 am 67d58acb: Merge "Add permissive domains check to sepolicy-analyze." into lmp-dev
* commit '67d58acb9b8d28dddeb9670e9801962b6fd7dcfd':
  Add permissive domains check to sepolicy-analyze.
2014-08-28 03:37:40 +00:00
dcashman
67d58acb9b Merge "Add permissive domains check to sepolicy-analyze." into lmp-dev 2014-08-27 23:56:55 +00:00
Nick Kralevich
5a4e67c6ef am 28b26bcf: support kernel writes to external SDcards
* commit '28b26bcf42e12add8a3f431555ea9c1005216357':
  support kernel writes to external SDcards
2014-08-27 22:42:09 +00:00
dcashman
c30dd63f56 Add permissive domains check to sepolicy-analyze.
Also enable global reading of kernel policy file. Motivation for this is to
allow read access to the kernel version of the binary selinux policy.

Bug: 17288791

Change-Id: I1eefb457cea1164a8aa9eeb7683b3d99ee56ca99
2014-08-27 14:54:48 -07:00
Nick Kralevich
e829ec3da0 am 4c6b1350: support kernel writes to external SDcards
* commit '4c6b13508d1786a3a835ba5427f37e963c2c7506':
  support kernel writes to external SDcards
2014-08-27 19:54:24 +00:00
Nick Kralevich
28b26bcf42 support kernel writes to external SDcards
The kernel, when it creates a loop block device, starts a new
kernel thread "loop0" (drivers/block/loop.c). This kernel thread,
which performs writes on behalf of other processes, needs read/write
privileges to the sdcard. Allow it.

Steps to reproduce:
0) Get device with external, removable sdcard
1) Run: "adb install -s foo.apk"

Expected:

  APK installs successfully.

Actual:

  APK fails to install. Error message:

    Vold  E  Failed to write superblock (I/O error)
    loop0  W  type=1400 audit(0.0:3123): avc: denied { read } for path="/mnt/secure/asec/smdl1645334795.tmp.asec" dev="mmcblk1p1" ino=528 scontext=u:r:kernel:s0 tcontext=u:object_r:vfat:s0 tclass=file permissive=0
    PackageHelper  E  Failed to create secure container smdl1645334795.tmp
    DefContainer  E  Failed to create container smdl1645334795.tmp

Bug: 17158723

(cherry picked from commit 4c6b13508d)

Change-Id: Iea727ac7958fc31d85a037ac79badbe9c85693bd
2014-08-27 12:38:27 -07:00
Nick Kralevich
4c6b13508d support kernel writes to external SDcards
The kernel, when it creates a loop block device, starts a new
kernel thread "loop0" (drivers/block/loop.c). This kernel thread,
which performs writes on behalf of other processes, needs read/write
privileges to the sdcard. Allow it.

Steps to reproduce:
0) Get device with external, removable sdcard
1) Run: "adb install -s foo.apk"

Expected:

  APK installs successfully.

Actual:

  APK fails to install. Error message:

    Vold  E  Failed to write superblock (I/O error)
    loop0  W  type=1400 audit(0.0:3123): avc: denied { read } for path="/mnt/secure/asec/smdl1645334795.tmp.asec" dev="mmcblk1p1" ino=528 scontext=u:r:kernel:s0 tcontext=u:object_r:vfat:s0 tclass=file permissive=0
    PackageHelper  E  Failed to create secure container smdl1645334795.tmp
    DefContainer  E  Failed to create container smdl1645334795.tmp

Bug: 17158723
Change-Id: I4aa86e372cc55348f6b8becfa17bd4da583925d4
2014-08-27 12:13:28 -07:00
dcashman
c6f9d44ddf am 711895db: Allow appdomain read perms on apk_data_files.
* commit '711895db2897bc5d001899eb5e0f931c79a1ad3f':
  Allow appdomain read perms on apk_data_files.
2014-08-27 18:17:10 +00:00
dcashman
711895db28 Allow appdomain read perms on apk_data_files.
Address:
type=1400 audit(0.0:103): avc: denied { read } for name="arm" dev="mmcblk0p28" ino=195471 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir

Bug: 16204150
Change-Id: I8bf0172b26b780c110c0d95c691785143acd7dd2
2014-08-27 10:22:02 -07:00
dcashman
0812ac4891 am 85f255b8: DO NOT MERGE. Allow debuggerd read access to shared_relro files.
* commit '85f255b8e6a30f7e40fd70bccf51d8138be5d0ba':
  DO NOT MERGE. Allow debuggerd read access to shared_relro files.
2014-08-26 15:39:01 +00:00
Nick Kralevich
106050f8e8 am 0d3f7ddc: remove appdomain\'s ability to examine all of /proc
* commit '0d3f7ddc70572382edec58841b3d6262abf49f49':
  remove appdomain's ability to examine all of /proc
2014-08-25 20:44:04 +00:00
Nick Kralevich
0d3f7ddc70 remove appdomain's ability to examine all of /proc
Remove the CTS specific rule which allows appdomain processes
to view /proc entries for the rest of the system. With this change,
an SELinux domain will only be able to view it's own /proc
entries, e.g. untrusted_app can only view /proc entries for other
untrusted_app, system_app can only view /proc entries for other
system_apps, etc.

/proc contains sensitive information, and we want to avoid
leaking this information between app security domains.

Bug: 17254920
Change-Id: I59da37dde00107a5ab123df3b79a84afa855339f
2014-08-25 12:55:19 -07:00
Nick Kralevich
eb8e3d60c9 am 92d1aa19: Merge "assert that no domain can set default properties"
* commit '92d1aa1982a05a370ec15edbf61f4b7c257df18c':
  assert that no domain can set default properties
2014-08-25 18:03:24 +00:00
Nick Kralevich
92d1aa1982 Merge "assert that no domain can set default properties" 2014-08-25 15:40:47 +00:00
Nick Kralevich
99aa03dce3 assert that no domain can set default properties
Add a neverallow rule (compile time assertion) that no SELinux domain
other than init can set default_prop. default_prop is assigned to a
property when no more specific label exists for that property.

This ensures that all properties are labeled properly, and that
no-one (other than init) gets access to unknown properties.

Change-Id: If279960f23737e263d4d1b5face7b5c49cda7ae7
2014-08-22 15:08:39 -07:00
dcashman
641caa0c91 am b8b4f43c: Merge "Add permissive domains check to sepolicy-analyze."
* commit 'b8b4f43ce3e68257af411a6dd53e80b895b8f3c4':
  Add permissive domains check to sepolicy-analyze.
2014-08-22 21:14:11 +00:00
Nick Kralevich
99e3573076 am 65feafce: tighten up neverallow rules for init binder operations
* commit '65feafce6c72ded001619e4f6b975de095941acd':
  tighten up neverallow rules for init binder operations
2014-08-22 21:14:10 +00:00
dcashman
b8b4f43ce3 Merge "Add permissive domains check to sepolicy-analyze." 2014-08-22 20:54:35 +00:00
dcashman
9793ea7aa6 Add permissive domains check to sepolicy-analyze.
Also enable global reading of kernel policy file. Motivation for this is to
allow read access to the kernel version of the binary selinux policy.

Change-Id: I1eefb457cea1164a8aa9eeb7683b3d99ee56ca99
2014-08-22 11:54:35 -07:00
Nick Kralevich
65feafce6c tighten up neverallow rules for init binder operations
Init never uses binder, so allowing binder related operations
for init never makes sense. Disallow all binder opertions for
init.

This change expands on commit a730e50bd9,
disallowing any init binder operation, not just call operations, which
may be accidentally added by blindly running audit2allow.

Change-Id: I12547a75cf68517d54784873846bdadcb60c5112
2014-08-21 16:26:23 -07:00
dcashman
4fe7c92051 am cd10eb95: Allow debuggerd read access to shared_relro files.
* commit 'cd10eb955090f76847c27c2a621f3f8abc80bbc3':
  Allow debuggerd read access to shared_relro files.
2014-08-19 21:00:20 +00:00
dcashman
85f255b8e6 DO NOT MERGE. Allow debuggerd read access to shared_relro files.
Addresses the following denial when debuggerd attempts to stat Webview mmap'd
shared relro files on process crash.  Full read permissions may not be necessary:

W/debuggerd(  185): type=1400 audit(0.0:97): avc: denied { search } for name="shared_relro" dev="mmcblk0p28" ino=618955 scontext=u:r:debuggerd:s0 tcontext=u:object_r:shared_relro_file:s0 tclass=dir

Bug: 17101854
Change-Id: I11eea85668ba033c554e5aab99b70a454fb75164
2014-08-19 13:51:41 -07:00
dcashman
cd10eb9550 Allow debuggerd read access to shared_relro files.
Addresses the following denial when debuggerd attempts to stat Webview mmap'd
shared relro files on process crash.  Full read permissions may not be necessary:

W/debuggerd(  185): type=1400 audit(0.0:97): avc: denied { search } for name="shared_relro" dev="mmcblk0p28" ino=618955 scontext=u:r:debuggerd:s0 tcontext=u:object_r:shared_relro_file:s0 tclass=dir

Bug: 17101854
Change-Id: I11eea85668ba033c554e5aab99b70a454fb75164
2014-08-18 17:09:38 -07:00
Stephen Smalley
fd8aafd656 am 9a725b28: Allow init to restorecon sysfs files.
* commit '9a725b284eb523668a4d0d05027b9f6344d3253e':
  Allow init to restorecon sysfs files.
2014-08-15 22:04:02 +00:00
Stephen Smalley
9a725b284e Allow init to restorecon sysfs files.
The boot-time restorecon_recursive("/sys") occurs while still in
the kernel domain, but init.rc files may nonetheless perform
restorecon_recursive of parts of /sys created later and therefore
require this permission.   Required for:
https://android-review.googlesource.com/#/c/101800/

Change-Id: I68dc2c6019a1f9deae3eec5c2f068365ce2372e5
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-08-15 14:34:39 -07:00
Daniel Cashman
1ce845c0c3 am 302f59aa: Merge "Allow init to restorecon sysfs files."
* commit '302f59aaf026365b7560c317a14ff04152d69935':
  Allow init to restorecon sysfs files.
2014-08-15 21:18:20 +00:00
Daniel Cashman
302f59aaf0 Merge "Allow init to restorecon sysfs files." 2014-08-15 19:21:42 +00:00
dcashman
a3ff156dc4 resolved conflicts for merge of 4ddc6eb3 to lmp-dev-plus-aosp
Change-Id: I0ba9180cd0f3b2059259787dc35adc6c21bab947
2014-08-07 12:03:25 -07:00
dcashman
bef36c0d6f am a20409bc: Merge "Allow untrusted_app access to temporary apk files."
* commit 'a20409bc6f33be0b6683a7b6e4a28cce3e05f29a':
  Allow untrusted_app access to temporary apk files.
2014-08-07 17:20:35 +00:00
Daniel Cashman
6d5845d7f2 am c15432df: Merge "Allow dumpstate to dump backtraces of certain native processes."
* commit 'c15432dfbcf0e509cfefd019857b7707be18909b':
  Allow dumpstate to dump backtraces of certain native processes.
2014-08-07 15:22:16 +00:00
Alex Light
174babc7a1 am feedd3c6: Make system use patchoat to relocate during runtime.
* commit 'feedd3c62178d3c6413e467a98da3b708dd1f5f1':
  Make system use patchoat to relocate during runtime.
2014-08-07 05:37:53 +00:00
dcashman
a20409bc6f Merge "Allow untrusted_app access to temporary apk files." 2014-08-06 23:49:29 +00:00