Commit graph

11527 commits

Author SHA1 Message Date
Mark Salyzyn
d45d36e011 liblog: Instrument logging of logd write drops
- If logger system is prostrated, send an event message with the
  liblog tag from the associated UID and PID with a count of
  dropped messages once logging is resumed.
- Added to the README a description of the error return values.
- Describe in the README the appropriate mitigations for dropped
  messages.
- If the caller sees this message, then
  /proc/sys/net/unix/max_dgram_qlen is likely too small

Change-Id: Iaf387b9e5e1b6aa93bebc7481f9e8353732e3229
2015-03-04 13:21:41 -08:00
Mark Salyzyn
29eb57066c logd: use <endian.h>
Change-Id: Iba843c054ea4fbe1a26c7821b5613fdb5e8001a1
2015-03-04 13:21:41 -08:00
Mark Salyzyn
4487c605ea Merge changes I0ec0fe3e,I9e5fccba
* changes:
  liblog: logprint use <endian.h>
  private: Add event payload structures to android_logger.h
2015-03-04 21:21:13 +00:00
Mark Salyzyn
66bfc5ccbd liblog: logprint use <endian.h>
Change-Id: I0ec0fe3e954f6f04964d58e57c817d28057b630b
2015-03-04 12:48:04 -08:00
Mark Salyzyn
fa1c063feb private: Add event payload structures to android_logger.h
- common android_event_header_t
- android_event_int_t ANDROID_TYPE_INT payload
- android_log_event_int_t single ANDROID_TYPE_INT event
- android_event_long_t ANDROID_TYPE_LONG payload
- android_log_event_long_t single ANDROID_TYPE_LONG event
- android_event_string_t ANDROID_TYPE_STRING payload
- android_log_event_string_t single ANDROID_TYPE_STRING event

Change-Id: I9e5fccba38e3f230c2c4ec7dec51ed110c460f95
2015-03-04 12:48:04 -08:00
Sami Tolvanen
8ee42f9c50 Merge "Add init support for dm-verity logging mode" 2015-03-04 20:42:09 +00:00
Sami Tolvanen
a88fb24ab4 Merge "Add fs_mgr support for dm-verity modes" 2015-03-04 20:41:49 +00:00
Sami Tolvanen
8ff0190835 Add init support for dm-verity logging mode
Add a built-in command for loading verity state. If dm-verity
will be started in logging mode, trigger verity-logging.

Needs changes from
  Ibb82953594d234f81ad21c40f524190b88e4ac8f

Change-Id: I5af4918f2f14fdd4d07f51c55837e08111fd3748
2015-03-04 03:07:47 +00:00
Sami Tolvanen
51bf11ad95 Add fs_mgr support for dm-verity modes
Add support for dm-verity modes and storing persistent state in
a location specified by the following properties:

  ro.verity.state.location
  ro.verity.state.offset

If these properties do not exist, dm-verity is always loaded in
EIO mode. If the properties do exist, but the location does not
have valid state data, dm-verity is loaded in RESTART mode. The
mode is updated to LOGGING if a dm-verity triggered restart has
occurred.

Change-Id: Ibb82953594d234f81ad21c40f524190b88e4ac8f
2015-03-04 03:07:35 +00:00
Sami Tolvanen
fbb3f8ca49 Merge "Set underlying block device RO when enabling verity" 2015-02-28 00:40:11 +00:00
Nick Kralevich
6864e67390 Merge "More SOCK_CLOEXEC" 2015-02-27 21:44:36 +00:00
Mark Salyzyn
f33c3bc960 Merge "init: drop dontpanic & apanic initialization" 2015-02-27 19:28:52 +00:00
Mark Salyzyn
1eaba37aae init: drop dontpanic & apanic initialization
Bug: 19050686
Bug: 19525200
Change-Id: Id81abe3b44283b439390b42db7a9da23748dee0a
2015-02-27 07:03:01 -08:00
Sami Tolvanen
214f33b8c0 Set underlying block device RO when enabling verity
Currently, when verity is set up on a block device, the underlying
device is still accessible directly. Change the existing function
fs_set_blk_ro visible to other fs_mgr modules, change the behavior
to match the comment above the function definition, and call it to
disable write access to the block device when setting up verity.

Bug: 18609347
Change-Id: I7884175df15f9161174788d74d20a08e4cd472ca
2015-02-27 11:28:34 +00:00
Nick Kralevich
6d3cddb2e2 More SOCK_CLOEXEC
Change-Id: I3e18f34d08a6443aaf55d7c91c27867840ac1773
2015-02-26 13:32:52 -08:00
Mark Salyzyn
be9712156b Merge "logcat: add pstore read" 2015-02-26 17:23:24 +00:00
Mark Salyzyn
ae19b63168 Merge "liblog: add pstore read" 2015-02-26 17:23:15 +00:00
Mark Salyzyn
7c975ac3a4 logcat: add pstore read
Used to pull the Android log messages after a reboot.
A companion to the pstore console logs. Adding the -L
flag triggers this behavior.

Change-Id: Icce2dc00bcbb26975bea604420c6be397869e804
2015-02-26 07:22:15 -08:00
Mark Salyzyn
6eef417119 liblog: add pstore read
Used to pull the Android log messages after a reboot. Adding
an ANDROID_LOG_PSTORE flag to the mode parameter in calls to
android_logger_list_alloc() and android_logger_list_alloc_time().
The side effects are that android_logger_clear() and
android_logger_list_read() will react with the user space
pstore driver. Forms a companion to the pstore console logs.

Change-Id: I7bb07b87b3bf73f059a21af3f810af37c7715b6d
2015-02-26 06:37:35 -08:00
Nick Kralevich
895623e5ca Merge "check if uid=0 before attempting remount" 2015-02-26 00:28:43 +00:00
Nick Kralevich
268eb4f384 check if uid=0 before attempting remount
If "adb remount" is done without having done "adb root" first,
scary looking SELinux denials are emitted before the operation
eventually fails. Avoid the scary looking messages by refusing
remount attempts if we're not running with privileges.

Change-Id: I298621251a10e38345ef77875003a97c8b5a0270
2015-02-25 16:27:31 -08:00
Nick Kralevich
7bb72b73b0 Merge "seclabel use on services out of system partition" 2015-02-26 00:23:19 +00:00
Mark Salyzyn
da26197873 Merge "logcat: Add -D print dividers flag" 2015-02-25 23:34:47 +00:00
Dan Albert
a2fc0f86a1 Merge "Test readx/writex (now renamed)." 2015-02-25 23:11:06 +00:00
Dan Albert
cc731cc767 Test readx/writex (now renamed).
Renamed readx/writex to ReadFdExactly/WriteFdExactly respectively.
These read/write a full fixed-size buffer. If the whole buffer cannot
be read/written, these functions return an error.

Rename write_string to WriteStringFully.

Move the TEMP_FAILURE_RETRY definition in sysdeps.h out of the
!Windows section. It seems Windows won't actually interrupt a call,
but it's easier to just define it than to #ifdef each call.

Change-Id: Ia8ddffa2a52764a2f9a281c96c937660e002b9b9
2015-02-25 15:07:57 -08:00
Mark Salyzyn
7b30ff8d87 logcat: Add -D print dividers flag
Permits a single thread to collect several log buffer and
to separate them out into named buckets by keying off the
dividers ---------

Change-Id: I5a92c67383a73ea566cb9b9732d26d88d9c41c66
2015-02-25 23:03:40 +00:00
Dan Albert
a035d5003e Merge "Remove _(GNU|XOPEN)_SOURCE makefile cruft." 2015-02-25 19:11:14 +00:00
Dan Albert
7fd821e907 Remove _(GNU|XOPEN)_SOURCE makefile cruft.
None of the functions that require these are used.

Change-Id: I10cffab127795b94340131f8737f7924b9138f9e
2015-02-25 11:08:21 -08:00
Dan Albert
948ae1b935 Merge "Add some basic tests to adb." 2015-02-25 19:06:39 +00:00
Dan Albert
055f1aa4ff Add some basic tests to adb.
Change-Id: I946b5b1e5650540db3b4f75892214c4218b3baf3
2015-02-25 10:57:26 -08:00
Elliott Hughes
a82f2b2590 Merge "Support "fastboot reboot bootloader"." 2015-02-25 18:43:04 +00:00
Dan Albert
d75d6c91d2 Merge "Fix the mac build." 2015-02-25 18:27:41 +00:00
Dan Albert
dc0f8ecb24 Fix the mac build.
Change-Id: Ieb6f2650ce5f39f1d8c938d0ca8cbec459d8e2fd
2015-02-25 10:26:17 -08:00
Mark Salyzyn
110166c1db Merge "liblog: introduce ANDROID_LOG_* flags" 2015-02-25 18:07:02 +00:00
Elliott Hughes
ca85df0662 Support "fastboot reboot bootloader".
This matches the more general adb syntax, though the fastboot
protocol doesn't support rebooting into the recovery image.

Change-Id: I6d93d4c63d4a9b81c71e681e7a7bf76867fba019
2015-02-25 10:02:00 -08:00
Mark Salyzyn
2d3f38a6b8 liblog: introduce ANDROID_LOG_* flags
Move away from using POSIX open(2) flags and introduce ANDROID_LOG_* flags to
replace them. Add security by preventing random mode flags from getting into
underlying POSIX calls. ANDROID_LOG_* flags overlap POSIX O_* flag definitions.

Change-Id: Ib32bb64c287e8bf150be62242e1ba46bb37839fc
2015-02-25 17:44:18 +00:00
Dan Albert
72bf2a7100 Merge "Move transport declarations into transport.h." 2015-02-25 05:33:35 +00:00
Dan Albert
7664901a35 Move transport declarations into transport.h.
There are a few cloexec issues in here as an added bonus.

Change-Id: I1699d719d733f47878bdba0454230cf5ab6a60b6
2015-02-24 21:30:22 -08:00
Dan Albert
f5f9dd5721 Merge "Add .clang-format file." 2015-02-25 02:06:15 +00:00
Dan Albert
103c1be03f Add .clang-format file.
Not going to format the whole world just yet, but this helps for `git
clang-format`.

Change-Id: I482819419647e4c752d3b044bde8d637e1fae1e5
2015-02-24 16:56:39 -08:00
Dan Albert
5329d3fd54 Merge "Add a project wide clang switch." 2015-02-25 00:20:39 +00:00
Dan Albert
9697ce520d Add a project wide clang switch.
I'll probably make this the default soon, but I'm not brave enough to
do that without checking the recovery image first.

Change-Id: I9cde687b08a588e3797645a308f381e4ec553447
2015-02-24 15:54:34 -08:00
Elliott Hughes
70385f3017 Merge "Remove the emulator special case from the "adb root" code." 2015-02-24 23:53:55 +00:00
Dan Albert
17f267905b Merge "Make Python tests only check the current device." 2015-02-24 22:45:08 +00:00
Dan Albert
b2e57b738f Make Python tests only check the current device.
In practice testing all connected devices is a pain, since it's
probably each device is running a different build. It would probably
make sense to just move this functionality up into a higher level test
runner (which could just live in main).

Also rename test_devices to test_shell, since it doesn't really test
`adb devices`.

Change-Id: Ie96d3e83b30acfac4e3bcbd9821690c0ad4d2f7e
2015-02-24 14:36:03 -08:00
Mark Salyzyn
5526a897d3 Merge "init: grab-bootchart.sh: run bootchart and display results" 2015-02-24 22:30:49 +00:00
Dan Albert
d6e9a1f5a3 Merge "Fix Mac build." 2015-02-24 22:28:54 +00:00
Dan Albert
fdf8722491 Fix Mac build.
Prior to https://android-review.googlesource.com/#/c/134253/ the
makefile had assumed !Windows was the same as Linux, so the Mac was
actually getting all the Linux sources as well. I mistakenly didn't
add fdevent.cpp to the Darwin sources in that change.

Change-Id: I4e12a394e9a2baf7c1e3c711a01a6b5fccbf79d9
2015-02-24 14:27:33 -08:00
Elliott Hughes
abd6773b41 Remove the emulator special case from the "adb root" code.
The emulator is essential an "eng" build, so the regular properties
should suffice.

Change-Id: Id63b3918f9b0b04b0d887ed886535b9976a9cc85
2015-02-24 14:10:51 -08:00
Dan Albert
a63b7d595b Merge "Fix Windows SDK build." 2015-02-24 22:09:58 +00:00