Commit graph

11799 commits

Author SHA1 Message Date
Elliott Hughes
0feae044f0 am 46adfa69: Merge "init: Add support "&&" operator in property triggers"
* commit '46adfa69b689bc9f9e15c87275839f233a404582':
  init: Add support "&&" operator in property triggers
2015-02-03 00:36:42 +00:00
Elliott Hughes
46adfa69b6 Merge "init: Add support "&&" operator in property triggers" 2015-02-03 00:22:26 +00:00
Badhri Jagan Sridharan
0b41512a2e init: Add support "&&" operator in property triggers
"&&" operator can now be used to test the validity
of two of more properties.

For example:

on property:test.a=1 && property:test.b=1
    setprop test.c 1

The above stub sets the test.c to 1 only when
both test.a=1 and test.b=1

(cherry-pick of 162f7d797c67019a7a3f08c3b0f0ffc91d548ddc.)

Change-Id: I72c19f7aa92231372a416193618ee6c7fd368141
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
2015-02-02 16:21:05 -08:00
Nick Kralevich
2e748d0bc3 am a73774e6: Merge "Add O_CLOEXEC to lots of open() calls."
* commit 'a73774e62e09c8e27039d3f8a5f1f842a0df740a':
  Add O_CLOEXEC to lots of open() calls.
2015-02-02 22:57:12 +00:00
Nick Kralevich
a73774e62e Merge "Add O_CLOEXEC to lots of open() calls." 2015-02-02 22:47:21 +00:00
Nick Kralevich
45a884f85f Add O_CLOEXEC to lots of open() calls.
and other related fixups.

Change-Id: Ia88fb37a07ff6777d00c49800081f5a519c0c78d
2015-02-02 14:37:22 -08:00
Nick Kralevich
cdff10e383 am 520ca3e1: Merge "builtins.c: Don\'t require file open() for chmod/chown"
* commit '520ca3e13a134386762c3fc754a8bc2e51af3c2f':
  builtins.c: Don't require file open() for chmod/chown
2015-02-02 22:10:52 +00:00
Nick Kralevich
520ca3e13a Merge "builtins.c: Don't require file open() for chmod/chown" 2015-02-02 22:03:52 +00:00
Nick Kralevich
bc60954fae builtins.c: Don't require file open() for chmod/chown
42a9349dc4 modified init's
builtin chmod, chown, and mkdir calls to avoid following
symlinks. This addressed a number of attacks we were seeing
at the time where poorly written init scripts were following
attacker supplied symlinks resulting in rooting vulnerabilities.

To avoid race conditions, the previous implementation only ran
fchown / fchmod on file descriptors opened with open(O_NOFOLLOW).
Unfortunately, unlike the normal "chown" or "chmod" calls, this
requires read or write access to the underlying file. This
isn't ideal, as opening some files may have side effects, or
init may not have permission to open certain files (such as when
SELinux is enabled).

Instead of using open(O_NOFOLLOW) + fchown(), use lchown() instead.
As before, the target of the symlink won't be modified by chown.
This also supports setting the ownership of symlinks.

Instead of using open(O_NOFOLLOW) + fchmod(), use
fchmodat(AT_SYMLINK_NOFOLLOW) instead. As before, the target of the
symlink won't be modified by chmod.

This change will continue to ensure that chown/chmod/mkdir doesn't
follow symlinks, without requiring init to open every file in
read-only or read-write mode.

This change depends on bionic commit I1eba0cdb2c509d9193ceecf28f13118188a3cfa7

Addresses the following mako/occam SELinux denial:

  audit(1422770408.951:6): avc:  denied  { write } for  pid=1 comm="init" name="smd7" dev="tmpfs" ino=7207 scontext=u:r:init:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file

Change-Id: I14fde956784d65c44e7aa91dd7eea9a004df3081
2015-02-02 13:45:21 -08:00
Elliott Hughes
5a2c206425 am 88342c99: Merge "The bsddroid project has been dead since 2010."
* commit '88342c99a1a8aa6a104ade72938f538d4469c7e3':
  The bsddroid project has been dead since 2010.
2015-02-02 19:44:38 +00:00
Elliott Hughes
88342c99a1 Merge "The bsddroid project has been dead since 2010." 2015-02-02 19:29:23 +00:00
Dmitriy Ivanov
bbbe988539 am 7cb19579: Merge "Add close_file flag to OpenArchiveFd()"
* commit '7cb19579bc22bf38e15b970f801f8065d629611d':
  Add close_file flag to OpenArchiveFd()
2015-02-02 19:14:17 +00:00
Dmitriy Ivanov
7cb19579bc Merge "Add close_file flag to OpenArchiveFd()" 2015-02-02 18:48:29 +00:00
Elliott Hughes
506aea4361 The bsddroid project has been dead since 2010.
And even if it wasn't, they should probably keep this stuff in their own
repository.

Change-Id: If9fa2e47ee2700098d8a99f6986f7e89fc6dfdf3
2015-01-31 11:24:14 -08:00
Nick Kralevich
e1f62802f6 am d07555db: Merge "ensure /data/tombstones exists on all Android devices"
* commit 'd07555dba01d64011b0d611dd6d3b197b216c163':
  ensure /data/tombstones exists on all Android devices
2015-01-31 07:49:28 +00:00
Nick Kralevich
d07555dba0 Merge "ensure /data/tombstones exists on all Android devices" 2015-01-31 02:06:46 +00:00
Dmitriy Ivanov
40b52b2c88 Add close_file flag to OpenArchiveFd()
* We should be able to keep fd alive after CloseArchive()

Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
2015-01-30 17:57:13 -08:00
Nick Kralevich
0359d778a5 ensure /data/tombstones exists on all Android devices
/data/tombstones is referenced by core platform code, but is not
guaranteed to exist on all Android devices. Move the directory
creation out of device specific files and into the core
init.rc file.

Bug: https://code.google.com/p/android/issues/detail?id=93207
Change-Id: I94ae5199a6a32c4fe555ca994fc4a8345e0c9690
2015-01-30 17:38:06 -08:00
Elliott Hughes
977e23397a am 6b1d8632: Merge "Add missing includes."
* commit '6b1d86322eb300e65539eadc24a65f76a49997b9':
  Add missing includes.
2015-01-30 21:22:09 +00:00
Elliott Hughes
6b1d86322e Merge "Add missing includes." 2015-01-30 06:24:20 +00:00
Elliott Hughes
3d74d7a739 Add missing includes.
Change-Id: Iaa130c0a7eb2cbc0c8486546e5b622661b6d9e23
2015-01-29 21:31:23 -08:00
Elliott Hughes
3a8064c5cf am 0114e124: Merge "Add ps --ppid."
* commit '0114e1243ad25cbb43dec33a3b0b267fe624fbfe':
  Add ps --ppid.
2015-01-30 04:17:01 +00:00
Elliott Hughes
0114e1243a Merge "Add ps --ppid." 2015-01-30 04:03:40 +00:00
Elliott Hughes
b5fc3132ee Add ps --ppid.
Needed for a libcore test.

Change-Id: Ia21ecf5f7bd8be7f1882d0014d7949d40f6841a5
2015-01-29 17:20:47 -08:00
Dan Albert
73bdc3cd42 am d170bb03: Merge "Remove fastbootd."
* commit 'd170bb035dc652b7e350ab7ccca0b1ffa332054e':
  Remove fastbootd.
2015-01-29 23:01:39 +00:00
Dan Albert
d170bb035d Merge "Remove fastbootd." 2015-01-29 22:48:19 +00:00
Dan Albert
71b99df503 Remove fastbootd.
Change-Id: I23240c7690763f8718c82cb0e8ffdcfa58d02629
2015-01-29 10:37:25 -08:00
Paul Lawrence
116d81ae27 am 07dcb12e: Merge changes If22008be,Id0049ce6
* commit '07dcb12e3ee7b7a6f959ae531ffe87f038786730':
  Make encryption configurable
  Provide a way to select force encryption from vendor partition
2015-01-28 21:21:29 +00:00
Paul Lawrence
07dcb12e3e Merge changes If22008be,Id0049ce6
* changes:
  Make encryption configurable
  Provide a way to select force encryption from vendor partition
2015-01-28 21:14:09 +00:00
Elliott Hughes
2e14f61731 am 06b4e982: Merge "Add missing <malloc.h> and <string.h> includes."
* commit '06b4e9826a33ddbdbddf7e74076ac29f9450414a':
  Add missing <malloc.h> and <string.h> includes.
2015-01-28 19:57:27 +00:00
Elliott Hughes
06b4e9826a Merge "Add missing <malloc.h> and <string.h> includes." 2015-01-28 19:46:59 +00:00
Paul Lawrence
36d0eaecd7 Make encryption configurable
Delay mounting encryptable but unencrypted volumes until we can
check the ro.vold.forceencrypt flag, then optionally encrypt.

Requires matching vold change from
    https://googleplex-android-review.git.corp.google.com/#/c/615309/

Bug: 18764230
Change-Id: If22008be8de6a4f3216b349f81ace49be1730314
2015-01-28 11:41:53 -08:00
Paul Lawrence
2f7ee6b7dd Provide a way to select force encryption from vendor partition
This allows a vendor to force encryption on devices via a vendor
partition flag:

ro.vold.forceencryption 1

Bug: 18764230
Change-Id: Id0049ce64e34e4f6f96e593aadd70c277ac131c8
2015-01-28 11:41:35 -08:00
Elliott Hughes
a744b05984 Add missing <malloc.h> and <string.h> includes.
Change-Id: Ia41756e607663d056e7d2fdd7ecbec7e5841a913
2015-01-28 11:37:57 -08:00
Sami Tolvanen
42f058f7e8 am 9c4c5a6e: Merge "Verify token length before adb signs it"
* commit '9c4c5a6ed934490ba0fcce661594975a6f4c2c89':
  Verify token length before adb signs it
2015-01-28 14:43:10 +00:00
Sami Tolvanen
9c4c5a6ed9 Merge "Verify token length before adb signs it" 2015-01-28 14:32:52 +00:00
Elliott Hughes
0e90714ae7 am a034362b: Merge "Make server port option work on windows"
* commit 'a034362be4dc69d3432d7587089d371dc871e811':
  Make server port option work on windows
2015-01-28 03:45:32 +00:00
Elliott Hughes
a034362be4 Merge "Make server port option work on windows" 2015-01-28 03:29:06 +00:00
Elliott Hughes
13aa2a4e32 am 9e376744: Merge "adb: tracing: don\'t make strings if runtime tracing is disabled"
* commit '9e376744d39c8fee2f8da4f693e3bc74291f7a45':
  adb: tracing: don't make strings if runtime tracing is disabled
2015-01-28 00:17:31 +00:00
Elliott Hughes
9e376744d3 Merge "adb: tracing: don't make strings if runtime tracing is disabled" 2015-01-28 00:05:58 +00:00
Spencer Low
0de77ffec6 adb: tracing: don't make strings if runtime tracing is disabled
If tracing was not enabled (the ADB_TRACE environment variable was not
set specially), writex() and readx() would still call dump_hex() which
would construct hex tracing strings, which would be immediately
discarded and not printed (because tracing is not enabled).

The fix is to only call dump_hex() if ADB_TRACING evalutes to true, the
same way that dump_packet() is only called if ADB_TRACING evaluates to
true.

Change-Id: I1651680da344389475ebdeea77ba1982960d5764
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-01-27 15:42:14 -08:00
Yabin Cui
631965a32e am e862350b: Merge "Kill HAVE_PTHREADS."
* commit 'e862350bb2eb3d3eda526da7f3b6d5c2dd40a445':
  Kill HAVE_PTHREADS.
2015-01-27 22:45:14 +00:00
Yabin Cui
e862350bb2 Merge "Kill HAVE_PTHREADS." 2015-01-27 22:33:28 +00:00
Yabin Cui
4a6e5a3b64 Kill HAVE_PTHREADS.
Bug: 19083585
Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
2015-01-27 14:23:22 -08:00
Elliott Hughes
a3029782d4 am c6091d6b: Merge "adb: Win32: set socket buffer sizes properly"
* commit 'c6091d6bfd1c74df7f5352b3de2b3dbdd64a98bd':
  adb: Win32: set socket buffer sizes properly
2015-01-27 18:33:49 +00:00
Elliott Hughes
c6091d6bfd Merge "adb: Win32: set socket buffer sizes properly" 2015-01-27 18:17:40 +00:00
Sami Tolvanen
7b9c20d3b2 Verify token length before adb signs it
Currently, a host running adb will sign a token of any length passed
to it by a device, effectively acting as a signing oracle. If the
ADB_VENDOR_KEYS environment variable is used to specify an additional
key to use, this behavior is not only unexpected, but probably also
unwanted. Further discussion can be found from this thread:

  http://www.metzdowd.com/pipermail/cryptography/2015-January/024423.html

This change adds a check to ensure token length matches TOKEN_SIZE
before it's signed, which prevents an attacker from signing longer
messages.

Change-Id: I7b2cc1f051941bf9b66e1c02980850bede501793
2015-01-27 17:19:35 +00:00
Spencer Low
f055c193b8 adb: Win32: set socket buffer sizes properly
On Windows, adb_socket_setbufsize() was taking a file descriptor value
from the compatibility layer in sysdeps_win32.c (namely, an index into
the _win32_fhs array) and passing it to the Winsock setsockopt() call,
which wants a Winsock SOCKET handle. Basically, adb_socket_setbufsize()
was passing `fd` instead of `_fh_from_int(fd)->fh_socket`, resulting in
adb effectively setting a socket buffer size on a random socket in the
process.

The fix is to introduce adb_setsockopt() which just calls setsockopt()
on non-Win32, and which uses the Winsock SOCKET handle on Win32. The
change also moves Win32 disable_tcp_nagle() to a header and adds an
extra sanity check to adb_shutdown().

Change-Id: I4354e818d27538f7ff5b0e70b28bdb6300e1b98b
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-01-26 21:56:26 -08:00
Dan Albert
40c6d42034 am a76f057a: Merge "Protect from eng vs userdebug build breaks."
* commit 'a76f057af81b7a03c9c18af0bcb763f7e7f03fbf':
  Protect from eng vs userdebug build breaks.
2015-01-27 02:23:38 +00:00
Dan Albert
72760253f0 am fe685787: Merge "Fix userdebug build."
* commit 'fe68578716290d93fd42005622adade8d345de3c':
  Fix userdebug build.
2015-01-27 02:18:48 +00:00