Commit Graph

20381 Commits

Author SHA1 Message Date
Nick Kralevich cb2202f614 Merge "fs_config: remove setuid bit from librank" am: 0380d49024
am: dee5c24927

* commit 'dee5c24927754c7a3213a3118f53cb119f00ad85':
  fs_config: remove setuid bit from librank
2015-11-30 14:57:05 +00:00
Nick Kralevich dee5c24927 Merge "fs_config: remove setuid bit from librank"
am: 0380d49024

* commit '0380d49024a408c726d3336551840381a6fbff45':
  fs_config: remove setuid bit from librank
2015-11-30 14:54:41 +00:00
Nick Kralevich 0380d49024 Merge "fs_config: remove setuid bit from librank" 2015-11-30 14:53:20 +00:00
Nick Kralevich 3e6356834f fs_config: remove setuid bit from librank
Anyone wanting to call /system/xbin/librank can execute "su"
beforehand. There's no need for it to be setuid root.

Bug: 25739721
Change-Id: Ie3d68701397d21e901bf1ec17b4b4a9f12128d2d
2015-11-27 18:08:22 -08:00
Mark Salyzyn 255dd638c3 liblog: resolve deadlocks (part deux) am: f280b020b1
am: 836a4f3a9d

* commit '836a4f3a9d0243af007a85522225b5acd1b0a633':
  liblog: resolve deadlocks (part deux)
2015-11-26 01:13:17 +00:00
Mark Salyzyn 836a4f3a9d liblog: resolve deadlocks (part deux)
am: f280b020b1

* commit 'f280b020b1230377deabe44bafb0b2bd2fb4876b':
  liblog: resolve deadlocks (part deux)
2015-11-26 00:07:06 +00:00
Mark Salyzyn f280b020b1 liblog: resolve deadlocks (part deux)
(cherry pick from commit 2d2e0a5c5e)

Although ever present, an increased regression introduced with
commit b6bee33182 (liblog: logd:
support logd.timestamp = monotonic).

A signal handler can interrupt in locked context, if log is written
in the signal handler, we are in deadlock. To reduce the contention
and chances for this problem separate out timestamp lock from is
loggable lock to reduce contention situations. Provide a best-guess
response if lock would fail in timestamp path.

Use a common lock() inline within each module, with a comment speaking
to the issues surrounding calling a function that has a mutex within
a signal handler.

ToDo: Hold off signals temporarily in mainline, restart when unblock.
      Can not use pthread_sigmask(SIG_BLOCK,,) as it breaks AtCmd.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 25563384
Change-Id: I47e2c87c988c3e359eb9eef129c6a3a08e9eedef
2015-11-25 13:52:09 -08:00
Steve Fung 0f9d883ef8 Merge "crash_reporter: Use cacerts_google" am: 2e012ef3bf am: 2e7f3dd769
am: 1ca2413e6d

* commit '1ca2413e6dc5c50b5b86e3ae74214aa8e9263d2f':
  crash_reporter: Use cacerts_google
2015-11-24 21:25:31 +00:00
Steve Fung 1ca2413e6d Merge "crash_reporter: Use cacerts_google" am: 2e012ef3bf
am: 2e7f3dd769

* commit '2e7f3dd7693eee5c58bcd37a3247fae072934a83':
  crash_reporter: Use cacerts_google
2015-11-24 21:21:53 +00:00
Steve Fung 2e7f3dd769 Merge "crash_reporter: Use cacerts_google"
am: 2e012ef3bf

* commit '2e012ef3bf3dfa5cb5d36318ef0f8d948608d584':
  crash_reporter: Use cacerts_google
2015-11-24 21:17:41 +00:00
Steve Fung 2e012ef3bf Merge "crash_reporter: Use cacerts_google" 2015-11-24 21:13:12 +00:00
Josh Gao 2af172be26 Merge changes I36b66fc5,I0561affb am: 166e716851 am: 8e82180c83
am: d9a3f0b65f

* commit 'd9a3f0b65f7d60f7e70226baaf5cf04540946347':
  libcutils: turn on -Werror on Win32, fix resulting build break.
  libcutils: add prefix to local variables in Android.mk.
2015-11-24 20:24:17 +00:00
Josh Gao d9a3f0b65f Merge changes I36b66fc5,I0561affb am: 166e716851
am: 8e82180c83

* commit '8e82180c83eb89069716fb790ed0f006e469be1c':
  libcutils: turn on -Werror on Win32, fix resulting build break.
  libcutils: add prefix to local variables in Android.mk.
2015-11-24 20:20:44 +00:00
Josh Gao 8e82180c83 Merge changes I36b66fc5,I0561affb
am: 166e716851

* commit '166e716851a11f1c2280b211fe00017e1eb2c3b5':
  libcutils: turn on -Werror on Win32, fix resulting build break.
  libcutils: add prefix to local variables in Android.mk.
2015-11-24 20:17:30 +00:00
Josh Gao 166e716851 Merge changes I36b66fc5,I0561affb
* changes:
  libcutils: turn on -Werror on Win32, fix resulting build break.
  libcutils: add prefix to local variables in Android.mk.
2015-11-24 20:12:08 +00:00
Josh Gao 1175d0fdb0 libcutils: turn on -Werror on Win32, fix resulting build break.
Mingw doesn't provide strndup or strtok_r used in str_parms.c, resulting in
-Wimplicit-function-declaration being emitted for the Windows build.
None of the consumers of str_parms.c appear to be compiled for Windows,
so we can just remove it from the Windows build.

Change-Id: I36b66fc54ed261d38f5294bc8662ddb2db4fe64f
2015-11-24 09:35:45 -08:00
Chih-hung Hsieh f3930bf786 Merge "Add explicit cast to shut off clang warnings." am: f091dfe010 am: 8893c66d35
am: baec2d25f6

* commit 'baec2d25f6ce1a6a4a2cdf00a6ccbb3deca22bcc':
  Add explicit cast to shut off clang warnings.
2015-11-24 17:19:54 +00:00
Chih-hung Hsieh baec2d25f6 Merge "Add explicit cast to shut off clang warnings." am: f091dfe010
am: 8893c66d35

* commit '8893c66d35a9e1691c8001817b1e9c33d2bf0a47':
  Add explicit cast to shut off clang warnings.
2015-11-24 17:16:47 +00:00
Chih-hung Hsieh 8893c66d35 Merge "Add explicit cast to shut off clang warnings."
am: f091dfe010

* commit 'f091dfe01079293c0a98afd4fe6d5df7bfd85c7f':
  Add explicit cast to shut off clang warnings.
2015-11-24 17:13:44 +00:00
Chih-hung Hsieh f091dfe010 Merge "Add explicit cast to shut off clang warnings." 2015-11-24 17:08:20 +00:00
Josh Gao 9e86f8e036 libcutils: add prefix to local variables in Android.mk.
Change-Id: I0561affbcc306c20f8aa87beb2d9728a9bb79f5e
2015-11-24 08:45:07 -08:00
Nick Kralevich 7ebc944935 Merge "init: Don\'t ignore setsockcreatecon errors" am: 07cb69415a am: 17c0edc6ee
am: 42bf3e893e

* commit '42bf3e893e8097c24aac9b0072756febb7bc2c50':
  init: Don't ignore setsockcreatecon errors
2015-11-24 03:05:29 +00:00
Nick Kralevich 42bf3e893e Merge "init: Don\'t ignore setsockcreatecon errors" am: 07cb69415a
am: 17c0edc6ee

* commit '17c0edc6eea2470e628c6c209bc66f02c3ed2ec5':
  init: Don't ignore setsockcreatecon errors
2015-11-24 02:58:14 +00:00
Nick Kralevich 17c0edc6ee Merge "init: Don\'t ignore setsockcreatecon errors"
am: 07cb69415a

* commit '07cb69415a478a96c33bffc44bff49d035f51afc':
  init: Don't ignore setsockcreatecon errors
2015-11-24 02:44:57 +00:00
Steve Fung 5acccc682d crash_reporter: Use cacerts_google
Use /system/etc/security/cacerts_google as the default certificates
directory.  If the crash_reporter.full_certs property is set to 1,
use the full /system/etc/security/cacerts directory.  This
property can be set in a target's product.mk, if they decide to
configure crash_reporter with a crash_server not covered by the
cacerts_google subset of certificates.

Bug: 25798318
Change-Id: I617c3d13b74af8d9577823a8f1a61f8375bcb504
2015-11-23 17:55:11 -08:00
Nick Kralevich 07cb69415a Merge "init: Don't ignore setsockcreatecon errors" 2015-11-24 01:18:12 +00:00
Nick Kralevich 83ccb1c76b init: Don't ignore setsockcreatecon errors
The init language supports setting the creation context of a socket
as the 6th argument to the socket keyword. For example, in the
following service, the context associated with the netd socket
is u:r:netd:s0

service netd /system/bin/netd
    class main
    socket netd stream 0660 root system u:r:netd:s0
    socket dnsproxyd stream 0660 root inet
    socket mdns stream 0660 root system
    socket fwmarkd stream 0660 root inet

The 6 argument form of the socket statement is rarely if ever used,
since the init code supplies a sensible default.

Currently, there's no error checking on the value supplied as
the 6th argument. For example, if you have the following socket
statement:

  socket netd stream 0660 root system graphics

a socket will attempt to get created with an invalid "graphics"
context. When setsockcreatecon fails, it retains the default socket
creation context, which for init is u:r:init:s0. This results in a
socket being created which is in an unexpected context.

Check the return value from the setsockcreatecon() call. If an
invalid context is specified, return early and don't subsequently
attempt to create the socket with the default context.

Bug: 25851205
Change-Id: Ic66cd6f7efe3897fb247b587ddeac5d35e1602b7
2015-11-23 17:09:49 -08:00
Todd Kennedy 0a2733582d Create new ephemeral app directory
Bug: 25119046
Change-Id: Ie005430700a73ef1ba492dae4101419a41da4071
2015-11-23 15:24:13 -08:00
Paul Lawrence 8d6338340d Encrypt on reboot
Change encryption to happen after a reboot, not before. This
removes the problem whereby if data cannot be unmounted, we cannot
encrypt.

Bug: 25426629

Change-Id: Icb2ec6cf330b5cc45b7e944c858a314f983fcaa4
2015-11-23 09:09:38 -08:00
Chih-Hung Hsieh 2858ba18e7 Add explicit cast to shut off clang warnings.
* The literals are signed negative int and got warnings about
  .... cannot be narrowed to type uint64_t [-Wc++11-narrowing]

Change-Id: I88c2fc328dfe5c7e2f9ade32bcba273e4a74a84c
2015-11-23 09:07:16 -08:00
Elliott Hughes cc65c3b9f8 Fix "adb sync" (and "adb push") error reporting.
This patch ensures that we read any error response from the server if the
server closes the connection. Unfortunately, that's not sufficient to ensure
that we always see the server's error message --- sometimes the data just
gets thrown away because we keep writing without reading. Setting SO_LINGER
avoids this.

Bug: http://b/25230872
Change-Id: I96c019cc72bd139198de79bf29e6536cc462c20f
2015-11-20 22:01:06 -08:00
Elliott Hughes e68e3f458c Merge "Move SendLargeFile into SyncConnection." am: ddf41f1ad0 am: 49f4f575f9
am: d88988970c

* commit 'd88988970c72434eda97319882436b40fe348a6b':
  Move SendLargeFile into SyncConnection.
2015-11-21 01:55:27 +00:00
Elliott Hughes d88988970c Merge "Move SendLargeFile into SyncConnection." am: ddf41f1ad0
am: 49f4f575f9

* commit '49f4f575f9ba35264dd98f8b1b9d1c4d71f75f30':
  Move SendLargeFile into SyncConnection.
2015-11-21 01:51:53 +00:00
Elliott Hughes 49f4f575f9 Merge "Move SendLargeFile into SyncConnection."
am: ddf41f1ad0

* commit 'ddf41f1ad0bc5fbe4a09fbcfde74492a51a705cf':
  Move SendLargeFile into SyncConnection.
2015-11-21 01:48:14 +00:00
Elliott Hughes ddf41f1ad0 Merge "Move SendLargeFile into SyncConnection." 2015-11-21 01:44:08 +00:00
Elliott Hughes 6aab58c499 Move SendLargeFile into SyncConnection.
Just a trivial refactor. Code change comes later.

Change-Id: If9e509a8c44649e5be4daaca57972939b037b8db
2015-11-20 17:35:17 -08:00
Chih-hung Hsieh 4f73f9e6a0 Merge "Add explicit cast to shut off clang warnings." am: 79cfba55e9 am: 7a2aa9d26d
am: 25f9b5c836

* commit '25f9b5c83629e99ca5314071b82e0fa16f40aa13':
  Add explicit cast to shut off clang warnings.
2015-11-20 20:40:46 +00:00
Chih-hung Hsieh 25f9b5c836 Merge "Add explicit cast to shut off clang warnings." am: 79cfba55e9
am: 7a2aa9d26d

* commit '7a2aa9d26d2c0f7fb37e733137938285e36dda72':
  Add explicit cast to shut off clang warnings.
2015-11-20 20:38:22 +00:00
Chih-hung Hsieh 7a2aa9d26d Merge "Add explicit cast to shut off clang warnings."
am: 79cfba55e9

* commit '79cfba55e9d1ff72930f2c10dd5805864baf4276':
  Add explicit cast to shut off clang warnings.
2015-11-20 20:35:13 +00:00
Chih-hung Hsieh 79cfba55e9 Merge "Add explicit cast to shut off clang warnings." 2015-11-20 20:30:10 +00:00
Elliott Hughes 159b455fcb Merge "Avoid SIGPIPE in adb." am: 8c5511c692 am: 1146ae0205
am: bd9a852e10

* commit 'bd9a852e10c7af3f2eddd6c3b9401849b792a808':
  Avoid SIGPIPE in adb.
2015-11-20 20:28:48 +00:00
Elliott Hughes bd9a852e10 Merge "Avoid SIGPIPE in adb." am: 8c5511c692
am: 1146ae0205

* commit '1146ae0205f249ef6b380b362b524d8efbe2e961':
  Avoid SIGPIPE in adb.
2015-11-20 20:26:23 +00:00
Elliott Hughes 1146ae0205 Merge "Avoid SIGPIPE in adb."
am: 8c5511c692

* commit '8c5511c692eaf3a9239be68dcc8650162933bd10':
  Avoid SIGPIPE in adb.
2015-11-20 20:22:05 +00:00
Elliott Hughes 8c5511c692 Merge "Avoid SIGPIPE in adb." 2015-11-20 20:18:01 +00:00
Chih-Hung Hsieh caa8810c64 Add explicit cast to shut off clang warnings.
* The literals are signed int type and got warnings about
  .... cannot be narrowed to type int16_t [-Wc++11-narrowing]

Change-Id: I156d8e456c70840953aebb24739f94256248b810
2015-11-20 10:21:55 -08:00
Elliott Hughes 65433da1cb Avoid SIGPIPE in adb.
We're now able to send packets faster than the device can handle them,
meaning that sometimes we're several packets through before the device
says "hey, wait, I can't write" and closes the connection. At best this
led to us reporting that we couldn't sync because "Connection reset";
at worst we'd get SIGPIPE because we were still streaming to a connection
that had already been closed.

This change renames adb_main adb_server_main, and moves the ignoring of
SIGPIPE into adb_commandline so it applies to both client and server (but
not adbd).

This change doesn't address the "wrong error message" part of the problem,
but at least it means you'll get *an* error message.

Bug: http://b/25230872
Change-Id: Ic60e4d13ed03fdcdf0d5cbc97201ebd1097c16ed
2015-11-20 09:42:23 -08:00
Sergio Giro 43f13d0d68 Merge "libutils: fix cache removal when callback invalidates the key" am: b0df9dca7c am: e483305e47
am: a96cd36afb

* commit 'a96cd36afbff682e24365092dd85bbe9c9165afc':
  libutils: fix cache removal when callback invalidates the key
2015-11-20 17:17:38 +00:00
Sergio Giro a96cd36afb Merge "libutils: fix cache removal when callback invalidates the key" am: b0df9dca7c
am: e483305e47

* commit 'e483305e4736787c5395d2d20b2be1d17d573ee7':
  libutils: fix cache removal when callback invalidates the key
2015-11-20 17:15:02 +00:00
Sergio Giro e483305e47 Merge "libutils: fix cache removal when callback invalidates the key"
am: b0df9dca7c

* commit 'b0df9dca7ca4d7ea2506f42e8b7ad720099401f6':
  libutils: fix cache removal when callback invalidates the key
2015-11-20 17:12:41 +00:00
Sergio Giro b0df9dca7c Merge "libutils: fix cache removal when callback invalidates the key" 2015-11-20 17:09:10 +00:00