Commit graph

385 commits

Author SHA1 Message Date
Colin Cross
776751ad79 am 8c4b1539: am f9873987: am 5954ecb8: Merge "Allow more characters in partition name links"
* commit '8c4b153911e399f00fdf0ed4e39782d0d49396d6':
  Allow more characters in partition name links
2013-07-22 15:45:42 -07:00
Colin Cross
f987398723 am 5954ecb8: Merge "Allow more characters in partition name links"
* commit '5954ecb87b8c77425d8cc766c0cc798957a07a7d':
  Allow more characters in partition name links
2013-07-22 15:40:55 -07:00
Johan Redestig
93ca79b445 Allow more characters in partition name links
We have several partitions with underscores in their names
which would not be properly linked in:
/dev/block/platform/msm_sdcc.1/by-name/

With this change more characters (_-.) are allowed in
partition name links. Also, any other character is
replaced with '_' so the resulting link names have the
same length as the partition name.

Change-Id: I746566c03db98b10326c755692362d2c10e528ae
2013-07-18 10:06:01 +02:00
Nick Kralevich
f29c533c49 init: call restorecon on /sys
Not all files on /sys are not getting labeled properly. Fix them.

Change-Id: I9dcff76354e7f50d41f1b6e702836cfbbc149278
2013-07-15 13:10:02 -07:00
Ken Sumrall
a76baaabe5 Add swapon_all to init's builtin commands
For enabling swap devices found in the fstab file

Change-Id: Iec4fd4d208df3d7a161a90d95f8606e8b516334a
2013-07-09 18:42:09 -07:00
Nick Kralevich
4838aa1b7b init: allow disabling selinux via a kernel command line
Create a new "androidboot.selinux" option, to control how userspace
handles SELinux. This kernel command line can have three options:

* disabled
* permissive
* enforcing

"disabled" completely disables userspace support for SELinux. No
policy is ever loaded, nor is the SELinux filesystem /sys/fs/selinux
ever mounted.

"permissive" loads the SELinux policy, but puts SELinux into
permissive mode. SELinux policy violations are logged, but not rejected.

"enforcing", the default, loads the SELinux policy, and places
SELinux into enforcing mode. Policy violations are rejected.

This change addresses post review comments for change
b710ed21de .

Change-Id: I912583db8e6a0e9c63380de32ad8ffc47a8a440f
2013-06-28 12:05:07 -07:00
Nick Kralevich
cbc76fcadb Merge "init: move SELinux into enforcing mode." 2013-06-25 21:08:56 +00:00
Nick Kralevich
b710ed21de init: move SELinux into enforcing mode.
When init starts up, immediately put SELinux into enforcing mode.

This is currently a no-op. We currently have everything in the
unconfined domain, so this should not break anything.
(if it does, I'll roll it back immediately)

If the kernel doesn't have SELinux support compiled in, then
don't try loading a policy and continue without SELinux protections.

Change-Id: Id0279cf82c545ea0f7090137b7566a5bc3ddd641
2013-06-25 11:23:29 -07:00
Colin Cross
25383a5da2 am 372d668a: am 39021a48: am 83ada447: Merge changes Ib54f39fd,I7e36edd8
* commit '372d668a279934ff3b2ec2f07a76fe2f351789d5':
  init: Retain traditional restart behavior for critical and oneshot services.
  init: Safely restart services to avoid race conditions.
2013-06-25 05:59:40 -07:00
Colin Cross
b1e3bb2798 am b1a9f8cf: resolved conflicts for merge of b6c60285 to stage-aosp-master
* commit 'b1a9f8cf4b15a861ab998a4c5f0c69068f22c62a':
  init: move initial property area allocation into bionic
  property_service: make /dev/__properties__ readable
2013-06-24 17:22:56 -07:00
Colin Cross
b1a9f8cf4b resolved conflicts for merge of b6c60285 to stage-aosp-master
Change-Id: I5afba55b668065499fa28369cf217d4f5eafab4a
2013-06-24 17:19:43 -07:00
Colin Cross
b6c6028594 Merge changes Ieb94caab,I762da21e
* changes:
  init: move initial property area allocation into bionic
  property_service: make /dev/__properties__ readable
2013-06-25 00:07:54 +00:00
Colin Cross
372d668a27 am 39021a48: am 83ada447: Merge changes Ib54f39fd,I7e36edd8
* commit '39021a48a0e0687c654423acd5a4c99a1d79440d':
  init: Retain traditional restart behavior for critical and oneshot services.
  init: Safely restart services to avoid race conditions.
2013-06-24 15:27:43 -07:00
Colin Cross
39021a48a0 am 83ada447: Merge changes Ib54f39fd,I7e36edd8
* commit '83ada447aed69dfcd0a88e952eced8db1e4d6584':
  init: Retain traditional restart behavior for critical and oneshot services.
  init: Safely restart services to avoid race conditions.
2013-06-24 15:24:57 -07:00
Colin Cross
83ada447ae Merge changes Ib54f39fd,I7e36edd8
* changes:
  init: Retain traditional restart behavior for critical and oneshot services.
  init: Safely restart services to avoid race conditions.
2013-06-24 22:23:32 +00:00
Greg Hackmann
2baad52520 init: move initial property area allocation into bionic
bionic's __system_property_add() now expands the property area as needed
by mapping in more pages.  Rather than duplicate the mapping code, move
it inside bionic and have bionic's __system_property_area_init() set up
the first page.

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit f14eef0c3c)

Change-Id: Ieb94caab1527c71f2155efe3795490b0ea215a29
2013-06-19 12:26:31 -07:00
Nick Kralevich
26f2d2f519 property_service: make /dev/__properties__ readable
Currently, system properties are passed via the environment
variable ANDROID_PROPERTY_WORKSPACE and a file descriptor passed
from parent to child. This is insecure for setuid executables,
as the environment variable can be changed by the caller.

Make the /dev/__properties__ file accessible, so an app can
get properties directly from the file, rather than relying on
environment variables.

Preserve the environment variable for compatibility with pre-existing
apps.

Bug: 8045561

(cherry picked from commit 7ece0a862c)

Change-Id: I762da21ef4075f288745efed0ec7d16c2b71303c
2013-06-19 12:26:28 -07:00
Greg Hackmann
f14eef0c3c init: move initial property area allocation into bionic
bionic's __system_property_add() now expands the property area as needed
by mapping in more pages.  Rather than duplicate the mapping code, move
it inside bionic and have bionic's __system_property_area_init() set up
the first page.

Change-Id: If9917d5f775c1a82eb89be55b84635395145ca49
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2013-06-18 16:37:54 -07:00
Colin Cross
44d1f3c703 am 99c1a416: resolved conflicts for merge of 95a41f6b to stage-aosp-master
* commit '99c1a4168ba792437f298d31cd4631ff01661476':
  init: fix copying boot properties
  toolbox: hide property implementation from watchprops
  init: verify size of property buffers passed to property_get
  init: move the system property writer implementation
  init: switch property_get to use __system_property_get
2013-06-17 18:24:39 -07:00
Colin Cross
99c1a4168b resolved conflicts for merge of 95a41f6b to stage-aosp-master
Change-Id: Icfae29edf989fb43a7f0b8bda188a9807f76a3b9
2013-06-17 18:19:28 -07:00
Colin Cross
5e484e9c43 init: fix copying boot properties
The previous patch "init: verify size of property buffers passed
to property_get" incorrectly modified one of the callers,
resulting in ro.serialno, ro.bootmode, ro.baseband, and
ro.bootloader always being set to their default values.

Bug: 9469860

(cherry picked from commit 67e3663fc9)

Change-Id: Ia7b337e1fab6e334729f47ee1269e6c736615177
2013-06-17 16:58:14 -07:00
Colin Cross
a5a860ef20 init: verify size of property buffers passed to property_get
Verify that the buffer passed as the value parameter to property_get
is always big enough.

(cherry picked from commit 88ac54a4e8)

Change-Id: Iacc2b42bfe4069e0bfcbb1c48474f30126a93139
2013-06-17 16:58:02 -07:00
Colin Cross
993b6ceeb0 init: move the system property writer implementation
Move the system property writer implementation into bionic to keep
it next to the reader implementation and allow for better testing.

(cherry picked from commit 9f5af63501)

Change-Id: Idf6100d1d0170751acd5163a22597912bff480f0
2013-06-17 16:57:49 -07:00
Colin Cross
1a6f4c3bf2 init: switch property_get to use __system_property_get
(cherry picked from commit 2deedfe0b1)

Change-Id: If3fba2cc1dd5c167b0924ddfe42dbe2e6387208a
2013-06-17 16:57:32 -07:00
Colin Cross
67e3663fc9 init: fix copying boot properties
The previous patch "init: verify size of property buffers passed
to property_get" incorrectly modified one of the callers,
resulting in ro.serialno, ro.bootmode, ro.baseband, and
ro.bootloader always being set to their default values.

Bug: 9469860
Change-Id: Id45bd8dd657e8d61f4cfaf7e6b2559d2bfd05181
2013-06-17 16:20:08 -07:00
Colin Cross
88ac54a4e8 init: verify size of property buffers passed to property_get
Verify that the buffer passed as the value parameter to property_get
is always big enough.

Change-Id: Ie5b6fcd94bb908215cfd55d0c9b07f717ddb70b1
2013-06-17 12:44:35 -07:00
Colin Cross
9f5af63501 init: move the system property writer implementation
Move the system property writer implementation into bionic to keep
it next to the reader implementation and allow for better testing.

Change-Id: I9026e604109e30546b2849b60cab2e7e5ff00ba5
2013-06-17 12:44:35 -07:00
Colin Cross
2deedfe0b1 init: switch property_get to use __system_property_get
Change-Id: I4fc0502a1a5b331087618a4d2e3d90948743d7bd
2013-06-17 12:44:35 -07:00
Ajay Dudani
fd914ee94c am 05a52055: am 76c58893: Free file handle for /firmware/image after use
* commit '05a52055661701c20f71124161798fdea8ea2982':
  Free file handle for /firmware/image after use
2013-06-14 09:11:34 -07:00
Ajay Dudani
05a5205566 am 76c58893: Free file handle for /firmware/image after use
* commit '76c5889325c2ada5dda07fd9af20a4a485978538':
  Free file handle for /firmware/image after use
2013-06-14 08:36:02 -07:00
Ajay Dudani
76c5889325 Free file handle for /firmware/image after use
Change-Id: Id59e25486b45dffc87a89a961970a6e8128a5237
2013-06-13 13:18:12 -07:00
Colin Cross
e9ab162f30 init: prevent action being added to the action_queue twice
Property triggers may cause an action to be queued twice, resulting
in a loop in the action queue.  Keep actions that are not on the queue
in the list_empty state (act->qlist->next == act->qlist), and only
add them to the list if they are in that state.

Bug: 8335133
Change-Id: I3a3ec18176cf19cbaa3a45220a03c7560eacfe79
2013-06-10 14:16:00 -07:00
Matthew Xie
17775724b8 am 5cb9a02b: am 7e723498: Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-dev
* commit '5cb9a02b0322c18b48eb9ce261502c3b830c113c':
  Add permission for bluetooth app in non-primary users
2013-05-22 10:41:26 -07:00
Matthew Xie
5cb9a02b03 am 7e723498: Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-dev
* commit '7e72349865db83d62f98eec8bca4b170712fe0e0':
  Add permission for bluetooth app in non-primary users
2013-05-22 10:38:44 -07:00
Matthew Xie
7e72349865 Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-dev 2013-05-22 17:36:53 +00:00
Matthew Xie
40a91a2884 Add permission for bluetooth app in non-primary users
bug 8954114
Change-Id: Id6a42f5a5beefa22c3cc8eecfb39a2222017a3b4
2013-05-22 10:00:23 -07:00
gcondra@google.com
a022ce7c80 am 8f6adcfc: am 49be2407: Revert "Add logic to fixup file contexts after a policy update."
* commit '8f6adcfcc55414cc07c18fe47d7c4314da148544':
  Revert "Add logic to fixup file contexts after a policy update."
2013-05-20 16:35:35 -07:00
gcondra@google.com
1e47a74668 am 253e91b4: am 477e35d6: Revert "Add persistent property for SELinux enforcment status."
* commit '253e91b4ffb631b188fdac0c1624786103471f05':
  Revert "Add persistent property for SELinux enforcment status."
2013-05-20 16:35:35 -07:00
gcondra@google.com
acef650dbc am 43329bc1: am 8a387870: Revert "Reload policy after setting up the data partition."
* commit '43329bc1c99c0f5f3670a8aaab39e54df34819a1':
  Revert "Reload policy after setting up the data partition."
2013-05-20 16:35:34 -07:00
gcondra@google.com
104c33992f am f5410f2b: am 3d32cd93: Revert "Remove /system from the dirs to relabel."
* commit 'f5410f2bde6fd5295cad36e3ba3efba0beb92780':
  Revert "Remove /system from the dirs to relabel."
2013-05-20 16:35:34 -07:00
gcondra@google.com
9a8cb3abf8 am b9866649: am 52351300: Revert "Add a version check for SELinux policy on device."
* commit 'b9866649e24d7b6eedcaf2e03ffc605a3417537d':
  Revert "Add a version check for SELinux policy on device."
2013-05-20 16:35:33 -07:00
gcondra@google.com
8f6adcfcc5 am 49be2407: Revert "Add logic to fixup file contexts after a policy update."
* commit '49be240735a06f44e1d91aa51dd299779ad36d96':
  Revert "Add logic to fixup file contexts after a policy update."
2013-05-20 15:52:28 -07:00
gcondra@google.com
253e91b4ff am 477e35d6: Revert "Add persistent property for SELinux enforcment status."
* commit '477e35d6d56c7fe9b2305becdf3ed4f590ddfbd6':
  Revert "Add persistent property for SELinux enforcment status."
2013-05-20 15:52:28 -07:00
gcondra@google.com
43329bc1c9 am 8a387870: Revert "Reload policy after setting up the data partition."
* commit '8a3878700eb9cd8ecf495cd01f15face5c3879c8':
  Revert "Reload policy after setting up the data partition."
2013-05-20 15:52:27 -07:00
gcondra@google.com
f5410f2bde am 3d32cd93: Revert "Remove /system from the dirs to relabel."
* commit '3d32cd938746215e5fa9b1a3c3b78903e043ae73':
  Revert "Remove /system from the dirs to relabel."
2013-05-20 15:52:27 -07:00
gcondra@google.com
b9866649e2 am 52351300: Revert "Add a version check for SELinux policy on device."
* commit '52351300d156826bf22c493828571f45a1cea16a':
  Revert "Add a version check for SELinux policy on device."
2013-05-20 15:52:26 -07:00
repo sync
49be240735 Revert "Add logic to fixup file contexts after a policy update."
This reverts commit ebcf93e3bf.
2013-05-17 12:48:34 -07:00
repo sync
477e35d6d5 Revert "Add persistent property for SELinux enforcment status."
This reverts commit b89bdfde42.
2013-05-17 12:48:18 -07:00
repo sync
8a3878700e Revert "Reload policy after setting up the data partition."
This reverts commit fee250d27a.
2013-05-17 12:47:04 -07:00
repo sync
3d32cd9387 Revert "Remove /system from the dirs to relabel."
This reverts commit 3d4d07b2fa.
2013-05-17 12:46:31 -07:00