Commit graph

32834 commits

Author SHA1 Message Date
Bowgo Tsai
da179e291c Merge "init: fix first stage mount failure due to /dev/device-mapper not found" into oc-dev
am: 22d73dd093  -s ours

Change-Id: I3a539032598bd7bccd36361ce593123313ecb4ac
2017-05-04 01:07:44 +00:00
TreeHugger Robot
22d73dd093 Merge "init: fix first stage mount failure due to /dev/device-mapper not found" into oc-dev 2017-05-04 01:00:51 +00:00
Bowgo Tsai
bfc9b6380d init: fix first stage mount failure due to /dev/device-mapper not found
It has been reported that fs_mgr failed to open /dev/device-mapper
during the first stage mount. It's because other uevent (e.g., i2c
charger device) happens to be sent at the same time we're triggering
the device-mapper uevent to be sent. Current implementation returns
COLDBOOT_STOP unconditionally so it will only process the first received
uevent, leaving device-mapper uevent unhandled when the race happens.

Fix this by only returning COLDBOOT_STOP when the received uevent->path
matches that of device mapper.

Bug: 37745254

Test: first stage mount /vendor with vboot 2.0 (avb) on bullhead
Test: first stage mount /vendor with vboot 1.0 on sailfish
Change-Id: I4a77093ec8f90a5ca981a088f34d082d0270533b
Merged-In: I4a77093ec8f90a5ca981a088f34d082d0270533b
(cherry picked from commit ea5fca4cd0)
2017-05-04 08:58:22 +08:00
Josh Gao
439f523d0c Merge "adb: use the actual wMaxPacketSize for usb endpoints." am: c7988b1f68 am: ff9d6425d4
am: 44190c3709

Change-Id: I50307f530f25647d9e95ddcf994a88a4d39fdcdc
2017-05-04 00:21:10 +00:00
Josh Gao
44190c3709 Merge "adb: use the actual wMaxPacketSize for usb endpoints." am: c7988b1f68
am: ff9d6425d4

Change-Id: Ie70ffa4af081c491c9aa7a1a4a23369f8987fdfc
2017-05-04 00:18:40 +00:00
Josh Gao
ff9d6425d4 Merge "adb: use the actual wMaxPacketSize for usb endpoints."
am: c7988b1f68

Change-Id: Ia81c0e97857823759c7f71ecfca252259d41fee5
2017-05-04 00:16:41 +00:00
Josh Gao
c7988b1f68 Merge "adb: use the actual wMaxPacketSize for usb endpoints." 2017-05-04 00:12:23 +00:00
Yueyao Zhu
39e4f5b602 Merge "Add dtbo image support for device tree overlay" am: 5eefcbdd3b am: 061003841e
am: aff3668634

Change-Id: I73fb4eb0c7d6b9b0d8eb2fabb63df09ccb736f9d
2017-05-04 00:01:39 +00:00
Yueyao Zhu
aff3668634 Merge "Add dtbo image support for device tree overlay" am: 5eefcbdd3b
am: 061003841e

Change-Id: Id822b0f97ef70f3eb28518390cf09990fdff9940
2017-05-03 23:59:10 +00:00
Yueyao Zhu
061003841e Merge "Add dtbo image support for device tree overlay"
am: 5eefcbdd3b

Change-Id: I9bc2bfd6f56482d8776e46da60d8b63d69f75ab5
2017-05-03 23:56:38 +00:00
Tom Cherry
b4f7e5b0c4 Merge "Make /data/data a symlink to /data/user/0" am: 49bbe16447 am: c43da33005
am: f95686e0cf

Change-Id: I081704dc6d7d60edaca979f6af2b1c4418ebc844
2017-05-03 23:54:23 +00:00
Tom Cherry
f95686e0cf Merge "Make /data/data a symlink to /data/user/0" am: 49bbe16447
am: c43da33005

Change-Id: I85aa1ad53b93241dba03f3076355daf1f7685843
2017-05-03 23:51:50 +00:00
Josh Gao
425d0db555 Merge "adb: enable -Wthread-safety on linux/darwin." am: 2983d2710e am: 0c91897714
am: d3f512ebe3

Change-Id: I4667c61be0734f5b545b14c5cde2d3d358f10081
2017-05-03 23:48:58 +00:00
Treehugger Robot
5eefcbdd3b Merge "Add dtbo image support for device tree overlay" 2017-05-03 23:48:25 +00:00
Josh Gao
d3f512ebe3 Merge "adb: enable -Wthread-safety on linux/darwin." am: 2983d2710e
am: 0c91897714

Change-Id: I8d08f4bd3533942533e8e070ae0d6439bd1eb622
2017-05-03 23:46:55 +00:00
Tom Cherry
c43da33005 Merge "Make /data/data a symlink to /data/user/0"
am: 49bbe16447

Change-Id: I3af2449abd0b1bb4d839d7a17239fe574ed2e88c
2017-05-03 23:46:50 +00:00
Josh Gao
0c91897714 Merge "adb: enable -Wthread-safety on linux/darwin."
am: 2983d2710e

Change-Id: I0fcbadd46a16028b2e69cba1f82975e4e50fd4cf
2017-05-03 23:44:00 +00:00
Tom Cherry
49bbe16447 Merge "Make /data/data a symlink to /data/user/0" 2017-05-03 23:43:00 +00:00
Josh Gao
2983d2710e Merge "adb: enable -Wthread-safety on linux/darwin." 2017-05-03 23:38:59 +00:00
Mark Salyzyn
b48c99a93d Merge changes Ieb44fa8f,I01b26fe5 am: e1e3e20337 am: d8dc29df8e
am: b519cb5e14

Change-Id: I0154f15f4b8b0dc7216ee16bc3f9eeb79fc90458
2017-05-03 23:38:40 +00:00
Mark Salyzyn
b519cb5e14 Merge changes Ieb44fa8f,I01b26fe5 am: e1e3e20337
am: d8dc29df8e

Change-Id: I71734f488e286aeeafb5f514c3eebd246f3ce5c1
2017-05-03 23:36:08 +00:00
Mark Salyzyn
d8dc29df8e Merge changes Ieb44fa8f,I01b26fe5
am: e1e3e20337

Change-Id: I6181e1d699dd721030c2a9080b89b51ab441d185
2017-05-03 23:33:08 +00:00
Treehugger Robot
e1e3e20337 Merge changes Ieb44fa8f,I01b26fe5
* changes:
  init: setup keyring before ueventd starts
  logd: refine permissions to access /data/system/packages.list
2017-05-03 23:24:14 +00:00
Tom Cherry
10cdd5bbf1 Merge "init: use do_exec() for init_user0" am: 5ad06cbb1c am: 577c75e78c
am: bc8a4ad7aa

Change-Id: I9985eb2751d14c6562b7559ffa6d0c72253df591
2017-05-03 22:30:41 +00:00
Tom Cherry
bc8a4ad7aa Merge "init: use do_exec() for init_user0" am: 5ad06cbb1c
am: 577c75e78c

Change-Id: I1a148c39f4f87df388641367bdec6b187723db9e
2017-05-03 22:28:06 +00:00
Tom Cherry
577c75e78c Merge "init: use do_exec() for init_user0"
am: 5ad06cbb1c

Change-Id: Id75cd629df7c73bdc2c7fe4fd8438f44a8c811b7
2017-05-03 22:25:36 +00:00
Treehugger Robot
5ad06cbb1c Merge "init: use do_exec() for init_user0" 2017-05-03 22:11:06 +00:00
Mark Salyzyn
4599627492 init: setup keyring before ueventd starts
Invent keyutils.h to supply capability to set session keyring.
The keyring will hold things like the FBE encryption keys.

Test: gTest logd-unit-tests --gtest_filter=logd.statistics
Bug: 37751120
Bug: 36645158
Change-Id: Ieb44fa8f53dda6cf506a6243498c72d7f7f3cde7
2017-05-03 21:51:04 +00:00
cjbao
d147cb5887 Make /data/data a symlink to /data/user/0
For legacy reason, /data/data is a real dir and /data/user/0 is a
symbolic link to it.  Overhead for linux kernel to walk through
symbolic link is not negligible. This is unnessary overhead to
carry over.  This patch is to make /data/user/0 a a real dir and
make legacy folder /data/data a symbolic link.  OTAed system does
not get impacted.

Test: Manual test
Change-Id: I419564a75f6ebf3154badb8725ba9831164592b6
Signed-off-by: cjbao <cathy.bao@intel.com>
2017-05-03 21:38:31 +00:00
Yueyao Zhu
e67da71dc1 Add dtbo image support for device tree overlay
Test: Used the built fastboot tool to run flashall on a device
Bug: 32969430
Bug: 36813951
Change-Id: If2db3055bb7250a57d9a78b0534df491b68b6224
2017-05-03 14:36:43 -07:00
Mark Salyzyn
d392ac160c logd: refine permissions to access /data/system/packages.list
Refine DAC security surrounding logd.daemon worker thread and add a
positive test for logd failure to access /data/system/packages.list.

- Add AID_PACKAGE_INFO to groups of worker thread.
- Move AID_SYSTEM to groups, setgid to AID_LOGD.
- Do not drop capabilities until after setting the uid and gids.
- Add a test that is part of logd.statistics test to check when
  packagelistparser appears broken.
- If /data/system/packages.list is encrypted, ensure we do not pick
  up the existing inode to ensure strong positive when finding access
  problems.
- Replace all occurrences of NULL with nullptr in gTest code for
  compliance with best practices.

Test: gTest logd-unit-tests --gtest_filter=logd.statistics
      (expect consistent failure, later CLs fix)
Bug: 37751120
Bug: 36645158
Change-Id: I01b26fe5e25203246ae432d272c8daa9c07cab54
2017-05-03 14:35:14 -07:00
Josh Gao
68f679c35b adb: enable -Wthread-safety on linux/darwin.
Delete the sysdeps/mutex tests that -Wthread-safety complains about.
We're using the standard library's std::mutex on all platforms now,
anyway.

Test: mma
Change-Id: I3bf958c72604b29dfb1d9c898d3c9aa34aed2685
2017-05-03 14:28:21 -07:00
Tom Cherry
5a86cb7694 init: use do_exec() for init_user0
Similar to what installkey used to do, init_user0 forks and
synchronously waits for vdc to return.  This is dangerous to do in
init however as init also processes properties from a single thread.

I'm not aware of any specific issues that this is currently causing,
but it's a good preventative measure to match what installkey does and
use do_exec().

Test: Boot bullhead, see that init_user0 still happens
Change-Id: I853c61594fe3d97e91bbb2319ebddf2bbe80d457
2017-05-03 13:25:08 -07:00
Daniel Cardenas
21fff17ed6 Partial revert of "libcutils: fs_config.c mark vendor, odm and oem partitions in duplicate" Revert just the wifi hardware part.
am: 6db432daf7

Change-Id: I7796ffcf07d6478ead19c5bab171a9ff4ce4f758
2017-05-03 19:42:52 +00:00
Josh Gao
ef3d343254 adb: use the actual wMaxPacketSize for usb endpoints.
Previously, adb was assuming a fixed maximum packet size of 1024 bytes
(the value for an endpoint connected via USB 3.0). When connected to an
endpoint that has an actual maximum packet size of 512 bytes (i.e.
every single device over USB 2.0), the following could occur:

    device sends amessage with 512 byte payload
    client reads amessage
    client tries to read payload with a length of 1024

In this scenario, the kernel will block, waiting for an additional
packet which won't arrive until something else gets sent across the
wire, which will result in the previous read failing, and the new
packet being dropped.

Bug: http://b/37783561
Test: python test_device.py on linux/darwin, with native/libusb
Change-Id: I556f5344945e22dd1533b076f662a97eea24628e
2017-05-03 12:32:39 -07:00
Daniel Cardenas
6db432daf7 Partial revert of
"libcutils: fs_config.c mark vendor, odm and oem partitions in duplicate"
Revert just the wifi hardware part.

This partially wqreverts commit fde19425f3.
b/37921982

Test: netflix, play movies, youtube
Change-Id: I1a47b66dbc2a74270eb4ef75c3a5b55624c2013d
2017-05-03 12:11:27 -07:00
Tom Cherry
214e45a5a7 Merge "ueventd: do not reference init's sehandle" am: 672dd970f4 am: e4988c9a34
am: 4c664d8c5c

Change-Id: I7da9e9417afcd8a2cfa9d7ac75d58c75cc39f21d
2017-05-03 18:25:46 +00:00
Tom Cherry
4c664d8c5c Merge "ueventd: do not reference init's sehandle" am: 672dd970f4
am: e4988c9a34

Change-Id: I3b33dea59f54f3807f2d1e1e7872f79f1dbada70
2017-05-03 18:23:15 +00:00
Tom Cherry
e4988c9a34 Merge "ueventd: do not reference init's sehandle"
am: 672dd970f4

Change-Id: I12378e6f1917cd31b42db6cde78d2f959bb6e4f5
2017-05-03 18:20:46 +00:00
Tom Cherry
672dd970f4 Merge "ueventd: do not reference init's sehandle" 2017-05-03 18:14:38 +00:00
Christopher Ferris
e44382f290 Merge "Move libc_logging to libasync_safe." am: deb19a631f am: 1e3dea0034
am: 8d9825533b

Change-Id: Ia85f6ee62834c1c34b00935bd1ed9c50924e10d0
2017-05-03 18:01:38 +00:00
Christopher Ferris
8d9825533b Merge "Move libc_logging to libasync_safe." am: deb19a631f
am: 1e3dea0034

Change-Id: I836179aa5e5b805017a0393d231fe9005259b013
2017-05-03 17:56:11 +00:00
Christopher Ferris
1e3dea0034 Merge "Move libc_logging to libasync_safe."
am: deb19a631f

Change-Id: Ia1ebf75cd3c0a9640fa5f2367fb40d00ffeca2ad
2017-05-03 17:52:01 +00:00
Christopher Ferris
deb19a631f Merge "Move libc_logging to libasync_safe." 2017-05-03 17:43:35 +00:00
Felipe Leme
b285e2a050 Don't display bugreport progress when it recedes, for real...
am: 53fd1730b6

Change-Id: Ic15b6cd479afd01747fa508063f50d2d0a6625e9
2017-05-03 17:31:54 +00:00
Mark Salyzyn
5cad367060 Merge "libcutils: convert fs_config.cpp" am: c50245e43e am: a255ab0cb0
am: 5f82055a2e

Change-Id: I93bdac8212b6d913c0851d4ef1145a1943a76e3b
2017-05-03 16:57:09 +00:00
Mark Salyzyn
5f82055a2e Merge "libcutils: convert fs_config.cpp" am: c50245e43e
am: a255ab0cb0

Change-Id: Ife5d12b9f4d3924b3903d91cd09e6592f4ee08b8
2017-05-03 16:54:40 +00:00
Mark Salyzyn
a255ab0cb0 Merge "libcutils: convert fs_config.cpp"
am: c50245e43e

Change-Id: I0681d0477f9782b0616ee65d8996db716541caab
2017-05-03 16:52:39 +00:00
Treehugger Robot
c50245e43e Merge "libcutils: convert fs_config.cpp" 2017-05-03 16:48:44 +00:00
Felipe Leme
378c2a0c4f Merge "Don't display bugreport progress when it recedes, for real..." am: 499af38623 am: 35d7f65654
am: eed955d7c6

Change-Id: I6781b7ae6f84c47c751b5f7284c2a8bcc2f61cc6
2017-05-03 15:33:03 +00:00