Commit graph

968 commits

Author SHA1 Message Date
Tom Cherry
265f525e21 Remove ANDROID_PROPERTY_WORKSPACE
Bug 23290008

Change-Id: I95babe735444ada10c67594ace700cae5d1ec0b3
2015-12-04 14:11:02 -08:00
Tom Cherry
6036114f93 Abort if __system_property_area_init fails
If __system_property_area_init() fails, there is a fundamental issue
with the system and we should abort from init.

Bug: 21852512
Change-Id: I05d7978ba3bcc347027a6d9443de7cdd229033d2
2015-12-02 11:29:12 -08:00
Sami Tolvanen
90f52df257 Set up dm-verity in EIO mode instead of logging mode
If the device is corrupted, set up dm-verity in EIO mode instead of
logging mode. This prevents corrupted blocks from being returned to
user space. Note that restart mode is used by default and a warning
will be displayed to the user after corruption is first detected.

Bug: 19277516
Change-Id: I38966d73eb814836bc34b4bad1192583e5010b36
2015-12-02 14:38:01 +00:00
Tom Cherry
e36a85cdcc restorecon /property_contexts
/property_contexts exists before selinux policies are loaded, so we must
restorecon before other processes can access it

Bug: 21852512
Change-Id: Ie983caac635eb928ab19eea996a5625f3673de39
2015-12-01 17:47:35 -08: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
Nick Kralevich
2d8f1d4c47 Merge "Enable hidepid=2 on /proc" 2015-11-09 20:05:22 +00:00
Nick Kralevich
c39ba5ae32 Enable hidepid=2 on /proc
Add the following mount options to the /proc filesystem:

  hidepid=2,gid=3009

This change blocks /proc access unless you're in group 3009
(aka AID_READPROC).

Please see
  https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.txt
for documentation on the hidepid option.

hidepid=2 is preferred over hidepid=1 since it leaks less information
and doesn't generate SELinux ptrace denials when trying to access
/proc without being in the proper group.

Add AID_READPROC to processes which need to access /proc entries for
other UIDs.

Bug: 23310674
Change-Id: I22bb55ff7b80ff722945e224845215196f09dafa
2015-11-09 09:08:46 -08:00
Rom Lemarchand
1dcf325844 init: skip "name" DT entry
DTs have a standard "name" entry which is not to be
turned into an android property, so skip it.

Change-Id: I79f6638b4123358c8d80510c1666cf5d4561160e
2015-11-08 17:51:50 -08:00
Daniel Cashman
27ff12443d Merge "init/adb: correct static lib dependencies for libselinux"
am: 38aee48fc6

* commit '38aee48fc695c25e15435e4ef235c8bc2e0afde9':
  init/adb: correct static lib dependencies for libselinux
2015-10-22 23:12:22 +00:00
Daniel Cashman
38aee48fc6 Merge "init/adb: correct static lib dependencies for libselinux" 2015-10-22 23:03:51 +00:00
William Roberts
bd2d961cc2 init/adb: correct static lib dependencies for libselinux
Now that libselinux uses libpackagelistparser, in order
for libpackagelistparser to be properly statically linked
liblog must come after libselinux for all the liblog
references to be defined in libpackagelistparser which
is included in libselinux. This patch corrects that order.

Change-Id: I7aee10c9395310919779ed2463aab6b2f8b380cc
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-10-22 15:21:26 -07:00
Dan Willemsen
eea68c6f98 Merge "Remove __DATE__/__TIME__ from init and debuggerd"
am: 512b0e60b4

* commit '512b0e60b4fb33ec5535c1784a99a27539787790':
  Remove __DATE__/__TIME__ from init and debuggerd
2015-10-22 22:00:20 +00:00
Dan Willemsen
30622bbb20 Remove __DATE__/__TIME__ from init and debuggerd
Keeping these means that every build has different init and debuggerd
binaries, even if the source was the same. So OTAs that don't touch
these sources would still need to update the binaries.

Both of these messages are only informational, so can be safely removed.
Bootchart already encodes build-specific information from the system
properties.

Bug: 24204119
Change-Id: I7ebd65a20a3e031e7528c9f741616e20b3cd7446
2015-10-22 13:12:18 -07:00
Sami Tolvanen
234aedfaf1 am b8cc70a9: Merge "Error correction: Use libfec in fs_mgr"
* commit 'b8cc70a94bcbf7b920465d92da6889f0db6d6fa5':
  Error correction: Use libfec in fs_mgr
2015-10-16 05:53:55 +00:00
Sami Tolvanen
99e3a927e8 Error correction: Use libfec in fs_mgr
Use libfec to read and parse verity metadata to protect against data
corruption.

Bug: 21893453
Change-Id: I3a3543e0d999316707302b3be8735a7133d22946
2015-10-14 22:12:04 +01:00
Sami Tolvanen
415f1bdcbf am 4bd3148e: Merge "Revert "Error correction: Use libfec in fs_mgr""
* commit '4bd3148e0f509efb75256a01959c9c1af9ffa845':
  Revert "Error correction: Use libfec in fs_mgr"
2015-10-14 19:52:24 +00:00
Sami Tolvanen
0923453462 Revert "Error correction: Use libfec in fs_mgr"
This reverts commit 3de3a0f351.

Change-Id: I1f121cbc4431b8d8ff146eab29832a8dda1eb8ba
2015-10-14 19:46:16 +00:00
Sami Tolvanen
81ef65827c am a2cfddd3: Merge "Error correction: Use libfec in fs_mgr"
* commit 'a2cfddd37e950ed75d72e6a968d7be974aac405f':
  Error correction: Use libfec in fs_mgr
2015-10-14 16:40:33 +00:00
Sami Tolvanen
3de3a0f351 Error correction: Use libfec in fs_mgr
Use libfec to read and parse verity metadata to protect against data
corruption.

Bug: 21893453
Change-Id: Ieee6a1441e2f68148ba635235216e36c69b13db1
2015-10-13 15:53:25 +01:00
Nick Kralevich
545b7c9e39 am 2fb90dc8: Merge changes from topic \'userspace-audit\'
* commit '2fb90dc8b2b590e674c5e433e8bf3d3f08a887c8':
  debuggerd: audit pid, uid and gid on SE Linux denial
  property_service: log pid,uid and gid of setprop client
2015-10-10 20:11:08 +00:00
Nick Kralevich
2fb90dc8b2 Merge changes from topic 'userspace-audit'
* changes:
  debuggerd: audit pid, uid and gid on SE Linux denial
  property_service: log pid,uid and gid of setprop client
2015-10-10 20:07:24 +00:00
Elliott Hughes
17ac480df2 am 55793400: Merge "init shouldn\'t call DumpState by default."
* commit '55793400f20e5160eaab6c85e5df621f48373ec2':
  init shouldn't call DumpState by default.
2015-10-09 21:30:35 +00:00
Elliott Hughes
1946d3bca8 init shouldn't call DumpState by default.
The cost of generating and throwing away a bunch of stuff that no one
normally sees is high enough to be worth avoiding.

Here's AOSP ToT on N9...

 init: (Parsing /system/etc/init/atrace.rc took 0.0112s.)
 init: (Parsing /system/etc/init/bootanim.rc took 0.0094s.)
 init: (Parsing /system/etc/init/crash_reporter.rc took 0.0103s.)
 init: (Parsing /system/etc/init/debuggerd.rc took 0.0090s.)
 init: (Parsing /system/etc/init/debuggerd64.rc took 0.0085s.)
 init: (Parsing /system/etc/init/drmserver.rc took 0.0078s.)
 init: (Parsing /system/etc/init/dumpstate.rc took 0.0073s.)
 init: (Parsing /system/etc/init/gatekeeperd.rc took 0.0063s.)
 init: (Parsing /system/etc/init/installd.rc took 0.0067s.)
 init: (Parsing /system/etc/init/keystore.rc took 0.0060s.)
 init: (Parsing /system/etc/init/lmkd.rc took 0.0060s.)
 init: (Parsing /system/etc/init/logcatd.rc took 0.0059s.)
 init: (Parsing /system/etc/init/logd.rc took 0.0068s.)
 init: (Parsing /system/etc/init/mdnsd.rc took 0.0057s.)
 init: (Parsing /system/etc/init/mediaserver.rc took 0.0064s.)
 init: (Parsing /system/etc/init/metrics_daemon.rc took 0.0063s.)
 init: (Parsing /system/etc/init/mtpd.rc took 0.0055s.)
 init: (Parsing /system/etc/init/netd.rc took 0.0066s.)
 init: (Parsing /system/etc/init/perfprofd.rc took 0.0057s.)
 init: (Parsing /system/etc/init/racoon.rc took 0.0054s.)
 init: (Parsing /system/etc/init/rild.rc took 0.0061s.)
 init: (Parsing /system/etc/init/servicemanager.rc took 0.0063s.)
 init: (Parsing /system/etc/init/surfaceflinger.rc took 0.0061s.)
 init: (Parsing /system/etc/init/uncrypt.rc took 0.0068s.)
 init: (Parsing /system/etc/init/vdc.rc took 0.0065s.)
 init: (Parsing /system/etc/init/vold.rc took 0.0063s.)

0.0112+0.0094+0.0103+0.0090+0.0085+0.0078+0.0073+0.0063+0.0067+0.0060+
0.0060+0.0059+0.0068+0.0057+0.0064+0.0063+0.0055+0.0066+0.0057+0.0054+
0.0061+0.0063+0.0061+0.0068+0.0065+0.0063 = 0.1809

And here it is again with the logging disabled:

 init: (Parsing /system/etc/init/atrace.rc took 0.0021s.)
 init: (Parsing /system/etc/init/bootanim.rc took 0.0006s.)
 init: (Parsing /system/etc/init/crash_reporter.rc took 0.0007s.)
 init: (Parsing /system/etc/init/debuggerd.rc took 0.0004s.)
 init: (Parsing /system/etc/init/debuggerd64.rc took 0.0005s.)
 init: (Parsing /system/etc/init/drmserver.rc took 0.0005s.)
 init: (Parsing /system/etc/init/dumpstate.rc took 0.0005s.)
 init: (Parsing /system/etc/init/gatekeeperd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/installd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/keystore.rc took 0.0013s.)
 init: (Parsing /system/etc/init/lmkd.rc took 0.0006s.)
 init: (Parsing /system/etc/init/logcatd.rc took 0.0013s.)
 init: (Parsing /system/etc/init/logd.rc took 0.0007s.)
 init: (Parsing /system/etc/init/mdnsd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/mediaserver.rc took 0.0009s.)
 init: (Parsing /system/etc/init/metrics_daemon.rc took 0.0008s.)
 init: (Parsing /system/etc/init/mtpd.rc took 0.0011s.)
 init: (Parsing /system/etc/init/netd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/perfprofd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/racoon.rc took 0.0005s.)
 init: (Parsing /system/etc/init/rild.rc took 0.0005s.)
 init: (Parsing /system/etc/init/servicemanager.rc took 0.0005s.)
 init: (Parsing /system/etc/init/surfaceflinger.rc took 0.0005s.)
 init: (Parsing /system/etc/init/uncrypt.rc took 0.0005s.)
 init: (Parsing /system/etc/init/vdc.rc took 0.0005s.)
 init: (Parsing /system/etc/init/vold.rc took 0.0006s.)

0.0021+0.0006+0.0007+0.0004+0.0005+0.0005+0.0005+0.0005+0.0005+0.0013+
0.0006+0.0013+0.0007+0.0005+0.0009+0.0008+0.0011+0.0005+0.0005+0.0005+
0.0005+0.0005+0.0005+0.0005+0.0005+0.0006 = 0.0181

It's less than a second, but one problem is that the cost of the current
dumping is proportional to the number of init.rc files, so the more
cleanly you factor things, the more it would cost.

Change-Id: Id96f59e7d0b082d8cfdba4bdbff43a922ba4eeee
2015-10-09 14:03:14 -07:00
William Roberts
d7aea443d9 property_service: log pid,uid and gid of setprop client
When auditing setprop denials, it is often unclear of who the process is
in a multi-process domain. To help identify the invoker, log the pid, uid,
and gid of the caller.

Before:
avc:  denied  { set } for property=wifi.xxx ...

After:
avc:  denied  { set } for property=wifi.xxx pid=30691 uid=123 gid=345 ...

Change-Id: I5cdcb3d18fbd52e0987b5e1497b9f6620c6c742a
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-10-05 11:39:56 -07:00
Yasuhiro Matsuda
4bc228e317 am f656b683: am ada7fa06: Merge "Fix perfboot.py to work with the recent change."
* commit 'f656b683a6a09dd2ed2934de2e1d5c2044c1fbe2':
  Fix perfboot.py to work with the recent change.
2015-09-16 02:58:28 +00:00
Yasuhiro Matsuda
f656b683a6 am ada7fa06: Merge "Fix perfboot.py to work with the recent change."
* commit 'ada7fa063e4d8e2b8014a138bdf58d7729ce0ee9':
  Fix perfboot.py to work with the recent change.
2015-09-16 02:49:31 +00:00
Yasuhiro Matsuda
6ee194013a Fix perfboot.py to work with the recent change.
device.shell() was changed to return a (stdout, stderr) tuple in
the following CL.

https://android-review.googlesource.com/170420

This CL fixes perfboot.py to work with the return value.

Change-Id: I85d72fc63c1f96257fb19c3051482991a7b4049d
2015-09-15 14:00:10 +09:00
Tom Cherry
a2bdc2d91e am f23ef77f: am 4aa9dbab: Merge "init: Update readme.txt to reflect recent changes to init."
* commit 'f23ef77ffe4700221bc47c70ea1b7f1473d0d902':
  init: Update readme.txt to reflect recent changes to init.
2015-09-02 19:48:22 +00:00
Tom Cherry
f23ef77ffe am 4aa9dbab: Merge "init: Update readme.txt to reflect recent changes to init."
* commit '4aa9dbab6f78a1acae02d39b96fa572fbfc7b6ed':
  init: Update readme.txt to reflect recent changes to init.
2015-09-02 19:37:35 +00:00
Tom Cherry
3be66edc59 init: Update readme.txt to reflect recent changes to init.
Updates are as follows:

A detailed explanation of event triggers and property triggers
including how they can now be used

A new section describing .rc files, their locations, and the
intentions for each of these locations

A new section describing the import keyword and how it is not a
command but rather its own section

Removal of deprecated or incorrect text

Change-Id: If0a37375ac92a857900f3303ada4ba742360daff
2015-09-01 15:32:33 -07:00
Tom Cherry
af20a7cb12 resolved conflicts for merge of cda81d01 to mnc-dr-dev-plus-aosp
Change-Id: I747b279bc49f9f82b8f8859c49b3fc2a4e3b4977
2015-09-01 15:30:56 -07:00
Tom Cherry
cda81d01c6 am 54c70ca1: Merge "init: Use classes for parsing and clean up memory allocations"
* commit '54c70ca15660529466b5b4e091209a20a3e75dff':
  init: Use classes for parsing and clean up memory allocations
2015-09-01 21:42:01 +00:00
Tom Cherry
b7349902a9 init: Use classes for parsing and clean up memory allocations
Create a Parser class that uses multiple SectionParser interfaces to
handle parsing the different sections of an init rc.

Create an ActionParser and ServiceParser that implement SectionParser
and parse the sections corresponding to Action and Service
classes.

Remove the legacy keyword structure and replace it with std::map's
that map keyword -> (minimum args, maximum args, function pointer) for
Commands and Service Options.

Create an ImportParser that implements SectionParser and handles the
import 'section'.

Clean up the unsafe memory handling of the Action class by using
std::unique_ptr.

Change-Id: Ic5ea5510cb956dbc3f78745a35096ca7d6da7085
2015-09-01 12:26:02 -07:00
Tom Cherry
25c22bb9e7 am 08a6775f: am 2d8be6c2: Merge "init: import init rc scripts from file systems after mount_all"
* commit '08a6775f8cdadf48e7b5f4f4d710180fda43b2b6':
  init: import init rc scripts from file systems after mount_all
2015-08-21 21:47:03 +00:00
Tom Cherry
d64bf33890 am 08a6775f: am 2d8be6c2: Merge "init: import init rc scripts from file systems after mount_all"
* commit '08a6775f8cdadf48e7b5f4f4d710180fda43b2b6':
  init: import init rc scripts from file systems after mount_all
2015-08-21 21:44:37 +00:00
Tom Cherry
c7676b5037 am 54b22ca2: am ff5be396: Merge changes from topic \'init-rc-breakup\'
* commit '54b22ca2488e4901265c99a42b5c5e0725a99199':
  init: Queue Triggers instead of Actions
  bundle init.rc contents with its service
2015-08-21 18:24:18 +00:00
Tom Cherry
60eb73ed6a am 54b22ca2: am ff5be396: Merge changes from topic \'init-rc-breakup\'
* commit '54b22ca2488e4901265c99a42b5c5e0725a99199':
  init: Queue Triggers instead of Actions
  bundle init.rc contents with its service
2015-08-21 18:20:22 +00:00
Tom Cherry
b8dd0272e5 init: import init rc scripts from file systems after mount_all
Import /{system,vendor,odm}/etc/init/... after file systems are mounted

Bug: 23186545
Change-Id: Idb0cae9773f904c0330054c8b3e31eb87b2fb7cb
2015-08-21 10:14:43 -07:00
Tom Cherry
cb716f976b init: Queue Triggers instead of Actions
When init queues a trigger, it actually enqueues all of the Actions
that match with that given trigger.  This works currently because
all init scripts are loaded and therefore all Actions are available
before init starts queueing any triggers.

To support loading init scripts after init has started queueing
triggers, this change enqueues Trigger objects instead of their
matching Actions.  Each Trigger object then matches its associated
Actions during its execution.

Additionally, this makes a few cosmetic clean ups related to triggers.

Bug: 23186545
Change-Id: I5d177458e6df1c4b32b1072cf77e87ef952c87e4
2015-08-21 10:14:43 -07:00
Yusuke Sato
2ef82cffad am d1b11a04: am e656be33: Merge "Add |opts| argument to android_fork_execvp_ext"
* commit 'd1b11a04903be74ba6a47307d8c3ef2731e3f4ab':
  Add |opts| argument to android_fork_execvp_ext
2015-08-19 22:31:08 +00:00
Yusuke Sato
9962b04d00 am d1b11a04: am e656be33: Merge "Add |opts| argument to android_fork_execvp_ext"
* commit 'd1b11a04903be74ba6a47307d8c3ef2731e3f4ab':
  Add |opts| argument to android_fork_execvp_ext
2015-08-19 22:20:29 +00:00
Yusuke Sato
d81c3c6c45 Add |opts| argument to android_fork_execvp_ext
to allow the caller to send data to the child's stdin.

Bug: 21725996
Change-Id: I818f5cf61045286c8d64a91b6d50f05740329be1
2015-08-19 11:00:37 -07:00
Yusuke Sato
c52f66b548 am 885400fd: am 4d09db9d: Merge "perfboot.py: Add --end-tag option"
* commit '885400fdbabf9850bd680725c591cc00f2aa71fe':
  perfboot.py: Add --end-tag option
2015-08-18 05:55:34 +00:00
Yusuke Sato
8e9a1ae593 am 885400fd: am 4d09db9d: Merge "perfboot.py: Add --end-tag option"
* commit '885400fdbabf9850bd680725c591cc00f2aa71fe':
  perfboot.py: Add --end-tag option
2015-08-18 05:55:28 +00:00
Yusuke Sato
3966ebb74d perfboot.py: Add --end-tag option
The current behavior, which is to use tags[-1] for end_tag, is good
enough in most cases, but sometime it makes more sense to use a
different one as end_tag.

For example, when optimizing APK scanning code in package manager,
using 'boot_progress_pms_scan_end' as end_tag would give us quicker
benchmark iterations as well as more relevant numbers possibly with
a smaller standard deviation.

Change-Id: Ic6371c936b36d1d87e9742502fd8958682a3b7d5
2015-08-17 22:07:34 -07:00
Nick Kralevich
d717f86a3e am 64c30a79: am 084c00b8: Merge "init: add LOCAL_SANITIZE := integer"
* commit '64c30a79def4dc29749a86c00a970243a2a45f1e':
  init: add LOCAL_SANITIZE := integer
2015-08-17 01:15:17 +00:00
Nick Kralevich
d7f0a73f8d am 64c30a79: am 084c00b8: Merge "init: add LOCAL_SANITIZE := integer"
* commit '64c30a79def4dc29749a86c00a970243a2a45f1e':
  init: add LOCAL_SANITIZE := integer
2015-08-17 01:15:05 +00:00
Nick Kralevich
084c00b804 Merge "init: add LOCAL_SANITIZE := integer" 2015-08-16 15:37:35 +00:00
Nick Kralevich
f90b653667 init: add LOCAL_SANITIZE := integer
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Change-Id: If73e6b382f2ee645fec406805739f9684ddbb5f0
2015-08-15 15:24:23 +00:00
Nick Kralevich
38887c50c1 am 51ffedd2: am 1efef4c4: Merge "Revert "init: add LOCAL_SANITIZE := integer""
* commit '51ffedd264389730a76470408a122589f7ce3488':
  Revert "init: add LOCAL_SANITIZE := integer"
2015-08-13 18:27:42 +00:00
Nick Kralevich
1deb03179c am 51ffedd2: am 1efef4c4: Merge "Revert "init: add LOCAL_SANITIZE := integer""
* commit '51ffedd264389730a76470408a122589f7ce3488':
  Revert "init: add LOCAL_SANITIZE := integer"
2015-08-13 18:27:36 +00:00
Nick Kralevich
1efef4c49d Merge "Revert "init: add LOCAL_SANITIZE := integer"" 2015-08-13 18:15:11 +00:00
Nick Kralevich
c307b5b7f8 Revert "init: add LOCAL_SANITIZE := integer"
flounder isn't booting

This reverts commit aea73db1e3.

Bug: 23166814
Change-Id: I36c811d1ca30e2366066142d9282bb713dae315f
2015-08-13 18:10:50 +00:00
Nick Kralevich
864d4985ed am 4d74f2cb: am 0b973da5: Merge "init: add LOCAL_SANITIZE := integer"
* commit '4d74f2cb4c30aaf4dfd176b2f970dbf54e5c697d':
  init: add LOCAL_SANITIZE := integer
2015-08-12 19:22:11 +00:00
Nick Kralevich
9ec6fcfe09 am 4d74f2cb: am 0b973da5: Merge "init: add LOCAL_SANITIZE := integer"
* commit '4d74f2cb4c30aaf4dfd176b2f970dbf54e5c697d':
  init: add LOCAL_SANITIZE := integer
2015-08-12 19:21:58 +00:00
Nick Kralevich
0b973da532 Merge "init: add LOCAL_SANITIZE := integer" 2015-08-12 19:09:58 +00:00
Dan Albert
68ff9f2ca2 am e78292f2: am cef3508b: Merge "Add missing includes."
* commit 'e78292f2c5a1cffd9fdcb76e5be29f6d14445b93':
  Add missing includes.
2015-08-12 02:11:05 +00:00
Dan Albert
97a8cd957f am e78292f2: am cef3508b: Merge "Add missing includes."
* commit 'e78292f2c5a1cffd9fdcb76e5be29f6d14445b93':
  Add missing includes.
2015-08-12 02:10:16 +00:00
Dan Albert
cef3508bb6 Merge "Add missing includes." 2015-08-12 01:50:15 +00:00
Nick Kralevich
aea73db1e3 init: add LOCAL_SANITIZE := integer
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Change-Id: I5f542089753c8fcf7596fd70cfaa48a3caa5b140
2015-08-11 16:55:56 -07:00
Dan Albert
af9ba4dc6c Add missing includes.
Leaky header cleanup in libc++ means we don't get unistd.h
transitively any more.

Change-Id: I596c24eff418302b19afab6ad3caa55f52241e7c
2015-08-11 16:39:57 -07:00
Tom Cherry
9b005a328b am ba0f24c7: am 5573e3d8: Merge "init: replace strdup() in parse_config()"
* commit 'ba0f24c71767365ff730b763b9af257bad462809':
  init: replace strdup() in parse_config()
2015-08-11 21:05:59 +00:00
Tom Cherry
12e77877e6 am ba0f24c7: am 5573e3d8: Merge "init: replace strdup() in parse_config()"
* commit 'ba0f24c71767365ff730b763b9af257bad462809':
  init: replace strdup() in parse_config()
2015-08-11 21:05:53 +00:00
Tom Cherry
4ad60fbae5 init: replace strdup() in parse_config()
Previously, the action, command, and service structs contained char*s
that referenced memory within the buffer returned by the strdup() of
the input buffer of parse_config.  This prevented this entire memory
region from being freed, leaking contents that would never be referenced again.

The changes to convert the previous action, command, and service
structs to C++ classes created explicit ownership of the contents within
each class in the form of std::strings.  With these changes, there are
no remaining references to the memory allocated by this strdup(), which
can now be freed.

This commit replaces the strdup() with std::vector<char> to allow for
the copied string to be freed when it goes out of scope instead of
relying on the C strdup() and free() functions.

Change-Id: Id0a5f711e33363082ba201afda6b26043998cb1c
2015-08-10 14:26:03 -07:00
Tom Cherry
841066e778 am 4036f5ab: am 4bf3dc93: Merge "Create Service and ServiceManager classes"
* commit '4036f5ab2ffbe5a2e47d46aa376e9791385cc31b':
  Create Service and ServiceManager classes
2015-08-07 21:17:02 +00:00
Tom Cherry
2647d2e70e am 4036f5ab: am 4bf3dc93: Merge "Create Service and ServiceManager classes"
* commit '4036f5ab2ffbe5a2e47d46aa376e9791385cc31b':
  Create Service and ServiceManager classes
2015-08-07 21:13:04 +00:00
Tom Cherry
4bf3dc9345 Merge "Create Service and ServiceManager classes" 2015-08-07 19:29:58 +00:00
Tom Cherry
bac3299720 Create Service and ServiceManager classes
Change-Id: I363a5e4751ad83d2f4096882a6fbbeddca03acfe
2015-08-07 10:16:39 -07:00
Yasuhiro Matsuda
39ac947939 am b84e1f54: am 50de8224: Merge "Enable perfboot.py to install APKs before measurement."
* commit 'b84e1f540379c6af9ccfc22e779b67f67b8c210a':
  Enable perfboot.py to install APKs before measurement.
2015-08-06 12:40:27 +00:00
Yasuhiro Matsuda
fb35b7c463 am 9e2ed7b0: am 7f2e05e9: Merge "Fix incorrect exception handling in perfboot.py"
* commit '9e2ed7b080bbe0f01fb82d77b30f6d1df372490a':
  Fix incorrect exception handling in perfboot.py
2015-08-06 12:40:26 +00:00
Yasuhiro Matsuda
a25e258d65 am b84e1f54: am 50de8224: Merge "Enable perfboot.py to install APKs before measurement."
* commit 'b84e1f540379c6af9ccfc22e779b67f67b8c210a':
  Enable perfboot.py to install APKs before measurement.
2015-08-06 12:40:24 +00:00
Yasuhiro Matsuda
93e060e115 am 9e2ed7b0: am 7f2e05e9: Merge "Fix incorrect exception handling in perfboot.py"
* commit '9e2ed7b080bbe0f01fb82d77b30f6d1df372490a':
  Fix incorrect exception handling in perfboot.py
2015-08-06 12:40:22 +00:00
Yasuhiro Matsuda
50de8224a6 Merge "Enable perfboot.py to install APKs before measurement." 2015-08-06 03:55:04 +00:00
Yasuhiro Matsuda
c0822e83ad Enable perfboot.py to install APKs before measurement.
This CL adds --apk-dir option, which specifies the directory
that contains APK files to be installed before measuring
boot time.

BUG: 22207911
Change-Id: Ifeacf34c779248686443a9ef02485272c140a456
2015-08-06 11:02:17 +09:00
Yasuhiro Matsuda
f3d0d42f1a Fix incorrect exception handling in perfboot.py
RuntimeError used to be missed unintentionally.

BUG: 22207911
Change-Id: I69772350c22fac93d49745c3bc934dda7188bb77
2015-08-05 20:26:03 +09:00
Yasuhiro Matsuda
fdb80810a2 am ee640552: am 1ada513f: Merge "Fix perfboot.py to exit by Ctrl+C."
* commit 'ee6405527f11010e09a72c4eaf2c47bac170c49c':
  Fix perfboot.py to exit by Ctrl+C.
2015-08-05 02:41:02 +00:00
Yasuhiro Matsuda
75c09ba367 am ee640552: am 1ada513f: Merge "Fix perfboot.py to exit by Ctrl+C."
* commit 'ee6405527f11010e09a72c4eaf2c47bac170c49c':
  Fix perfboot.py to exit by Ctrl+C.
2015-08-05 02:39:00 +00:00
Yasuhiro Matsuda
1ada513f50 Merge "Fix perfboot.py to exit by Ctrl+C." 2015-08-05 02:26:27 +00:00
Yusuke Sato
056b97d509 am b57438c8: am e4154f46: Merge "perfboot.py: check 2 more event logs by default"
* commit 'b57438c848e377873aefd89f68afb7650a6043e9':
  perfboot.py: check 2 more event logs by default
2015-08-04 21:06:58 +00:00
Yusuke Sato
ba48c3f64a am b57438c8: am e4154f46: Merge "perfboot.py: check 2 more event logs by default"
* commit 'b57438c848e377873aefd89f68afb7650a6043e9':
  perfboot.py: check 2 more event logs by default
2015-08-04 21:05:59 +00:00
Yusuke Sato
43c4d998cf perfboot.py: check 2 more event logs by default
'sf_stop_bootanim' is useful for tracking the time wasted by
showing the 'outro' part of the boot animation.

'wm_boot_animation_done' is also useful for tracking user
perceived boot time.

(cherry-pick of cbcf2778c3)

Bug: 22207911
Change-Id: I3549338a2161fa29675993c239f57809270797f8
2015-08-04 12:06:36 -07:00
Yasuhiro Matsuda
59d32a7515 Fix perfboot.py to exit by Ctrl+C.
BUG: 22207911
Change-Id: I0cc41f834207efd2965483c8636bbc709e54358f
2015-08-04 17:48:41 +09:00
Yusuke Sato
9358ae91c9 am 69386e33: am 81fd50c3: Merge "perfboot.py: ignore tags not listed in /system/etc/event-log-tags"
* commit '69386e33b67eaee721b4e8d7bddbd4263302ff77':
  perfboot.py: ignore tags not listed in /system/etc/event-log-tags
2015-08-04 00:28:56 +00:00
Yusuke Sato
0ef97729c2 am 69386e33: am 81fd50c3: Merge "perfboot.py: ignore tags not listed in /system/etc/event-log-tags"
* commit '69386e33b67eaee721b4e8d7bddbd4263302ff77':
  perfboot.py: ignore tags not listed in /system/etc/event-log-tags
2015-08-04 00:28:44 +00:00
Yusuke Sato
e801cc0b4e perfboot.py: ignore tags not listed in /system/etc/event-log-tags
This is a follow-up CL for http://ag/739815/.

Bug: 22207911
Change-Id: Ie5f529abc4b18454cea8a75a1438a5ea65dd90ab
2015-08-03 15:56:53 -07:00
Yusuke Sato
f2a404b1f3 am 5e34b3ab: am 72488aa0: Merge "perfboot.py: warn if dm-verity is disabled"
* commit '5e34b3abdb3cbc167fa86dab7a746c94f2bd4c6f':
  perfboot.py: warn if dm-verity is disabled
2015-08-03 21:47:13 +00:00
Tom Cherry
087cd35b79 resolved conflicts for merge of 0070026c to mnc-dr-dev-plus-aosp
Change-Id: Ibc802572898b6913c1f5d94aaae19974bfc0eb85
2015-08-03 14:19:35 -07:00
Yusuke Sato
48f2879729 am 5e34b3ab: am 72488aa0: Merge "perfboot.py: warn if dm-verity is disabled"
* commit '5e34b3abdb3cbc167fa86dab7a746c94f2bd4c6f':
  perfboot.py: warn if dm-verity is disabled
2015-08-03 20:42:04 +00:00
Yusuke Sato
72488aa0fe Merge "perfboot.py: warn if dm-verity is disabled" 2015-08-03 20:26:47 +00:00
Yusuke Sato
b6c66dc0a3 perfboot.py: warn if dm-verity is disabled
Disabling the feature sometimes skews benchmark results.

Bug: 22207911
Change-Id: Idedc7eb14e3cc4e8687b0c0e2975f10a3c4154e5
2015-08-03 11:36:21 -07:00
Tom Cherry
b6545bf559 am 0070026c: am 4247ebfd: Merge "init: use std::vector<std::string> for argument passing"
* commit '0070026c1b87facf626042e8ba1e36877129af76':
  init: use std::vector<std::string> for argument passing
2015-08-03 18:11:16 +00:00
Yusuke Sato
adda8f7388 am 2f9e1db3: am b5d6ad81: Merge "Stop calling fsck on shutdown by default"
* commit '2f9e1db37416cdb580d870218b5fbfbed47a3758':
  Stop calling fsck on shutdown by default
2015-08-03 17:56:32 +00:00
Tom Cherry
4247ebfd2f Merge "init: use std::vector<std::string> for argument passing" 2015-08-03 17:51:39 +00:00
Lee Campbell
2fb050b893 am 150c05fe: am 0f918878: Merge "init: Adding header guard to tokenizer"
* commit '150c05feeb482de2b4026fc35e392fc8c0ecd2df':
  init: Adding header guard to tokenizer
2015-08-01 15:48:39 +00:00
Yusuke Sato
23ec3e468b am 2f9e1db3: am b5d6ad81: Merge "Stop calling fsck on shutdown by default"
* commit '2f9e1db37416cdb580d870218b5fbfbed47a3758':
  Stop calling fsck on shutdown by default
2015-07-31 23:30:07 +00:00
Yusuke Sato
b5d6ad81cb Merge "Stop calling fsck on shutdown by default" 2015-07-31 23:13:15 +00:00
Tom Cherry
96f67316a2 init: use std::vector<std::string> for argument passing
Change-Id: Ie7a64e65de3a20d0c7f7d8efc0f7c1ba121d07fe
2015-07-31 16:02:12 -07:00
Lee Campbell
7ff4bb7e47 am 150c05fe: am 0f918878: Merge "init: Adding header guard to tokenizer"
* commit '150c05feeb482de2b4026fc35e392fc8c0ecd2df':
  init: Adding header guard to tokenizer
2015-07-31 22:32:02 +00:00
Lee Campbell
06584400dd init: Adding header guard to tokenizer
Fixing missing header guard

BUG: 22843198
Change-Id: Ice5d29d343ffe093aae46d4ac3fd72de628fb12e
2015-07-30 18:48:50 -07:00
Tom Cherry
7da270df1d am a21d8562: am d548e30f: Merge "init: Create classes for Action and Command"
* commit 'a21d85620560896bbed0cd43db9ed3224ab4e974':
  init: Create classes for Action and Command
2015-07-30 21:31:38 +00:00