Commit graph

34388 commits

Author SHA1 Message Date
Narayan Kamath
3765bf9bd4 zip_archive: reject files that don't start with an LFH signature.
am: 9dced16262

Change-Id: Iaca1185e09d1eb610d6b95bf40ec62e50676b40a
2017-10-04 10:51:05 +00:00
Narayan Kamath
9dced16262 zip_archive: reject files that don't start with an LFH signature.
Bug: 64211847
Test: zip_archive_test

(cherry picked from commit c1a56dcab7)

Merged-In: I275e7c4da05ceeb20401b560c72294f29ef63642
Change-Id: Ib89f0def696206ff427be27764c158fab88e4b5d
2017-09-20 15:14:11 +00:00
Adam Vartanian
94222586dc Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9 am: 33abf90994 am: 789673b15c am: 1436927851 am: d70e582d67 am: 62d5a78df3 am: 5b37a8ce87 am: 16e2001f0b am: e2b5839d4c -s ours
am: 84bdda1e6e  -s ours

Change-Id: I89c0f62474f46aeedb3635ad92454c979335c829
2017-09-11 11:23:24 +00:00
Adam Vartanian
84bdda1e6e Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9 am: 33abf90994 am: 789673b15c am: 1436927851 am: d70e582d67 am: 62d5a78df3 am: 5b37a8ce87 am: 16e2001f0b
am: e2b5839d4c  -s ours

Change-Id: I2b8d19a8582f8de19332705fc4dcdc3a23fa8da2
2017-09-11 11:18:54 +00:00
Adam Vartanian
e2b5839d4c Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9 am: 33abf90994 am: 789673b15c am: 1436927851 am: d70e582d67 am: 62d5a78df3 am: 5b37a8ce87
am: 16e2001f0b

Change-Id: I217092b993f50a6380cf76049ebb94a99505b4a0
2017-09-11 11:14:55 +00:00
Adam Vartanian
16e2001f0b Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9 am: 33abf90994 am: 789673b15c am: 1436927851 am: d70e582d67 am: 62d5a78df3
am: 5b37a8ce87

Change-Id: I9957d042e4b309f8071fe08c03177401051ec926
2017-09-11 11:10:53 +00:00
Adam Vartanian
5b37a8ce87 Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9 am: 33abf90994 am: 789673b15c am: 1436927851 am: d70e582d67
am: 62d5a78df3

Change-Id: If605b2b03790475250c3a5c9627b9f6177c01226
2017-09-11 11:06:21 +00:00
Adam Vartanian
62d5a78df3 Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9 am: 33abf90994 am: 789673b15c am: 1436927851
am: d70e582d67

Change-Id: Ia12301ba4850284d81de3a4ed2fe3f519a6859fc
2017-09-11 11:02:51 +00:00
Adam Vartanian
d70e582d67 Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9 am: 33abf90994 am: 789673b15c
am: 1436927851

Change-Id: Ia81a894419957960682a221159449f3e92d06b03
2017-09-11 10:58:21 +00:00
Adam Vartanian
1436927851 Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9 am: 33abf90994
am: 789673b15c

Change-Id: I352f33cf5a9a402a17f7a0f2c8739b54256392c2
2017-09-11 10:54:22 +00:00
Adam Vartanian
789673b15c Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9
am: 33abf90994

Change-Id: I5509908232bd838a229c1c2f3a35e0960a741288
2017-09-11 10:50:21 +00:00
Adam Vartanian
33abf90994 Fix integer overflow in utf{16,32}_to_utf8_length
am: f0a43dede9

Change-Id: Ie8e67d97272102eee952c21d82cf06c6a50f1ea9
2017-09-11 10:46:20 +00:00
Adam Vartanian
f0a43dede9 Fix integer overflow in utf{16,32}_to_utf8_length
Without an explicit check, the return value can wrap around and return
a value that is far too small to hold the data from the resulting
conversion.

No CTS test is provided because it would need to allocate at least
SSIZE_MAX / 2 bytes of UTF-16 data, which is unreasonable on 64-bit
devices.

Bug: 37723026
Test: run cts -p android.security
Change-Id: Ie2606b92b9eab1acfe8ce4663b43b81156a4cad7
Merged-In: I56ba5e31657633b7f33685dd8839d4b3b998e586
2017-09-11 10:46:06 +01:00
Adam Vartanian
6e2bf89dc7 Fix integer overflow in utf{16,32}_to_utf8_length
am: 47efc676c8

Change-Id: Id54a1e644fc02a2923c6bf165205d16e43cf5eb2
2017-09-11 09:26:42 +00:00
Adam Vartanian
47efc676c8 Fix integer overflow in utf{16,32}_to_utf8_length
Without an explicit check, the return value can wrap around and return
a value that is far too small to hold the data from the resulting
conversion.

No CTS test is provided because it would need to allocate at least
SSIZE_MAX / 2 bytes of UTF-16 data, which is unreasonable on 64-bit
devices.

Bug: 37723026
Test: run cts -p android.security
Change-Id: I56ba5e31657633b7f33685dd8839d4b3b998e586
2017-09-07 10:36:19 +01:00
Josh Gao
30b69aab46 debuggerd_handler: print pid and process name.
Bug: http://b/64483618
Test: manual

(cherry picked from commit 81e6c0b613)

Change-Id: Icd957ccd21c2ce072f4cdf973b94de08fb0c5567
2017-08-11 22:01:36 -07:00
Jin Qian
c2ca105575 fastboot: add mke2fs and e2fsdroid to build package
Bug: 23686092
Bug: 63849632
Change-Id: Iff0d92b7174597d43ee646847888aedc2080052a
(cherry picked from commit 6ce78321a2)
2017-08-03 14:50:17 -07:00
Jin Qian
92064ef073 fastboot: call mke2fs to format ext4 filesystem on windows
Bug: 35219933
Change-Id: I0cc8c165176e8dc9cbe4b6a52679937bc872e2d0
(cherry picked from commit 29fc859a6d)
2017-08-03 14:40:43 -07:00
Jin Qian
ffef31cef1 fastboot: call mke2fs tools to generate ext4 image
Set MKE2FS_CONFIG to empty to use mke2fs default configs

Test: fastboot --wipe-and-use-fbe
Bug: 35219933
Change-Id: Ibc97bb125899e1f1fe820d53709fdb2ab291c171
(cherry picked from commit d14d7c14cb)
2017-08-03 14:39:12 -07:00
Christine Hallstrom
c1f776d7d1 DO NOT MERGE ANYWHERE make /data/misc/bluetooth owner to be bluetooth am: 2e06a0ff6e -s ours am: 3c31204e68 -s ours
am: 3a66fd2174  -s ours

Change-Id: I5a2222a551bdfe4077f061131a99c9951cd9c152
2017-07-27 22:38:35 +00:00
Christine Hallstrom
3a66fd2174 DO NOT MERGE ANYWHERE make /data/misc/bluetooth owner to be bluetooth am: 2e06a0ff6e -s ours
am: 3c31204e68  -s ours

Change-Id: I251108805c58aabdd41f31a015a6760ea36878e0
2017-07-27 22:35:35 +00:00
Christine Hallstrom
3c31204e68 DO NOT MERGE ANYWHERE make /data/misc/bluetooth owner to be bluetooth
am: 2e06a0ff6e  -s ours

Change-Id: Ib595080a5bd778e6f844657c785708a37277633f
2017-07-27 22:33:22 +00:00
Christine Hallstrom
2e06a0ff6e DO NOT MERGE ANYWHERE make /data/misc/bluetooth owner to be bluetooth
Bug: 62410937
Change-Id: Ic6ddba03ee6316dc54d5d41b35c90fe3d9057723
2017-07-27 20:55:12 +00:00
TreeHugger Robot
4ee59e0b51 Merge "adbd: add logging to troubleshoot usb issues." into oc-dr1-dev 2017-07-27 15:26:00 +00:00
Josh Gao
8f484a6896 adbd: add logging to troubleshoot usb issues.
Bug: http://b/63899881
Bug: http://b/63901259
Bug: http://b/63904904
Test: treehugger
Change-Id: Ifbc3caa6b416093bf8e127194003747c910352dc
(cherry picked from commit 184f571cfd)
2017-07-27 00:34:31 -07:00
Siqi Lin
b9b76de6ff rootdir: record last build fingerprint
We can't copy /default.prop so just write the value of
$(ro.build.fingerprint) to /data/misc/recovery/ro.build.fingerprint
and rotate it after reboot instead.

Bug: 62793047
Test: manual - reboot phone and check /data/misc/recovery
Change-Id: I130a4b7a01d9e1bfe9baecde2781626eb72e768b
2017-07-26 13:40:15 -07:00
Wei Wang
b7a8764a12 Do not umount roofs even if it is R/W.
Latest device has rootfs instead of "/system" mount point

(cherry picked from commit a01c27eef8)

Bug: 37737296
Test: adb remount, reboot, and check log
Change-Id: I315ecf71e85255fc55c3a80619920b456bad0956
2017-07-25 11:39:22 -07:00
TreeHugger Robot
53ce94588b Merge "DO NOT MERGE ANYWHERE tombstoned: Avoid creating the tombstoned_java_trace socket." into oc-dr1-dev 2017-07-25 15:05:01 +00:00
Narayan Kamath
ed218dd556 DO NOT MERGE ANYWHERE tombstoned: Avoid creating the tombstoned_java_trace socket.
Its use is hard-wired off by default. This fixes an SELinux
denial when init tries to create it. We see a denail because
the SELinux aspects of these changes have been reverted on DR
because it's the same API level as oc-dev.

Test: manual
Bug: 63350870

Change-Id: I8b18a25bc14ad9cf79825596ce70483530dd3a8b
2017-07-25 13:17:01 +01:00
Wei Wang
63a1d0a5f9 init: Fire shutdown trigger for thermal shutdown
Recent change in init has bring normal shutdown sequence in
thermal-shutdown condition. This CL will make sure init fire shutdown
trigger where holds custom shutdown actions for vendor SoC/platform.

(cherry picked from commit 1be2212319)

Bug: 63686426
Test: adb shell setprop sys.powerctl thermal-shutdown
Change-Id: Ieb8579fdf9c30c1a81d60466a7375c9784f3ca98
2017-07-24 14:59:52 -07:00
Jiyong Park
c034a43d44 Add [test] section for /data/[nativetest|benchmarktest]
We have both system and vendor tests in the same directory
/data/nativetest. Since we can't distinguish system and vendor tests at
runtime, we choose to run all of them with the legacy namespace
configuration where /system/lib and /vendor/lib are both accessible
without any restriction. Furthermore, /system/lib/vndk-sp is added to
the list of accessible directories for tests since some libs (such as
libion.so) exist only in the directory but not in /system/lib.

This will change in the future when we install system and vendor tests
into different directories (vendor tests goes into ./vendor subdir).
Then, we will run the tests with [system] or [vendor] configurations
depending on their paths.

Bug: 63597267
Test: run bionic-unit-tests
Test: run linker-unit-tests
Change-Id: I810003b2da0b30335200c130f484ea7b041f9f80
2017-07-20 15:28:00 +09:00
TreeHugger Robot
b6962f2e44 Merge "init: Do full shutdown even for thermal shutdown" into oc-dr1-dev 2017-07-20 06:02:00 +00:00
TreeHugger Robot
6a55adc92b Merge "dump stack before kill all" into oc-dr1-dev 2017-07-20 03:38:56 +00:00
Keun-young Park
c111537f5d init: Do full shutdown even for thermal shutdown
- Skipping SIGTERM / SIGKILL / umount brings race between block
  device driver and fs layer. Do umount before shutting down.
- Reduce timeout to 1 sec for thermal shutdown and skip other time
  taking part like fsck.
- Refactor waiting part to check time in ms so that 1 sec can
  have enough resolution.

bug: 63686426
Test: adb shell setprop sys.powerctl thermal-shutdown, adb shell setprop sys.powerctl reboot and check dmesg
Merged-In: I048bac767b328c8d656a97fe65dde5f2b5bf4ae5
Change-Id: I048bac767b328c8d656a97fe65dde5f2b5bf4ae5
2017-07-19 18:38:20 -07:00
Luke Song
74a5f22d9f Merge "healthd: restructure healthd_mode_charger" into oc-dr1-dev 2017-07-20 01:02:06 +00:00
Keun-young Park
366c51ec1e dump stack before kill all
- If problematic process is from user, kill all kills
  it and dump does not show problematic process.

bug: 37737296
Test: reboot and check log

Merged-In: Iaa4f7d12f5a40fa7528c6672567c36e30b140372
Change-Id: Iaa4f7d12f5a40fa7528c6672567c36e30b140372
2017-07-19 17:11:36 -07:00
TreeHugger Robot
c5aba9702e Merge "/data/nativetest[64] processes are running with the new ns config" into oc-dr1-dev 2017-07-19 00:25:33 +00:00
Luke Song
7f386dcab9 healthd: restructure healthd_mode_charger
Refactor drawing code into separate class, and allow for split screen
drawing with offset.

Bug: 63541890
Test: Verify charging mode animation
Change-Id: I6c089460f55b8c2f75f4aa3153a5736f6f434b51
2017-07-18 15:06:46 -07:00
Keun-young Park
45ae1b2754 Do not umount /vendor, /system, and /oem even if they are R/W.
- /vendor, /system, /oem can be remounted to R/W for development
  purpose.

- In such case, umounting these partitions can lead into some processes
  not running properly during shutdown or blocking umount of fs.

- So skip them. As it is dev feature, it is up to each developer to
  understand the risk. But for normal adb sync - reboot should be ok
  as shutdown involves sync operations.

bug: 37737296
Test: adb remount,reboot, and check last kmsg

(cherry picked from commit 6e12b3887e)

Change-Id: Ia92a20aa672e68f695818e451ba2ae53af8f5ab9
2017-07-18 10:32:27 -07:00
Jiyong Park
9d1e50b809 /data/nativetest[64] processes are running with the new ns config
Native tests under /data/nativetest[64] directory is now running with
the same linker namespace configuration as /system/bin/* processes.

This allows us to stop mimicing the linker namespace configuration of the
/system/bin/* processes using LD_LIBRARY_PATH.

Bug: 63597267
Test: run bionic-unit-tests
Test: run linker-unit-tests
Change-Id: If8e2ed0b8016e4e07bf6829735b8e02f952042d0
2017-07-18 16:45:05 +09:00
Mark Salyzyn
3ec9aa4a91 rootdir: record last build signature and kernel version
(cherry pick from commit 93394034a2)

Rotate /default.prop and /proc/version into /data/misc/recovery/
as an aid in determining the vintage of the LAST_LOGCAT and
LAST_DMESG in the bugreport collection.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: manually confirm content rotation through reboots
Bug: 62793047
Change-Id: Ibbe546c76041f20e308e58e5548939afac75db97
2017-07-14 14:49:50 -07:00
Wei Wang
cea7028cf4 Merge "init: Support custom shutdown actions" into oc-dr1-dev 2017-07-06 22:36:47 +00:00
Jin Qian
041f849548 init: require e2fsdroid and mke2fs when building init
init calls fs_mgr to format ext4 partitions. This requires
e2fsdroid and mke2fs in /system/bin/

Bug: 35219933
Change-Id: Ia32fe438cd9b9332f8e18e0cbe7f61bd050adcb1
2017-07-06 11:45:06 -07:00
Keun-young Park
3b15f44041 Merge "add "shutdown critical" to service" into oc-dr1-dev 2017-07-06 17:14:23 +00:00
TreeHugger Robot
7be26793eb Merge "init: add info logs in first stage mount if we have to poll" into oc-dr1-dev 2017-07-06 16:15:11 +00:00
TreeHugger Robot
3d7422dbfe Merge "fs_mgr: replace make_ext4 api with e2fsprogs" into oc-dr1-dev 2017-07-06 14:24:04 +00:00
Tom Cherry
c680bfeaf2 init: add info logs in first stage mount if we have to poll
It's not a error case if we do not find a device that we're attempting
to regenerate uevents for during first stage mount, but it is likely
to increase boot time, so we log a message to attribute this delay.

Bug: 63327193
Test: Boot bullhead, sailfish

Merged-In: I97c2e5aefd218bbdd87717ff3c375381f725de08
Change-Id: I97c2e5aefd218bbdd87717ff3c375381f725de08
(cherry picked from commit 322e176f6a)
2017-07-06 13:04:23 +08:00
Wei Wang
5d4d6f7269 init: Support custom shutdown actions
We have been seeing panics and errors during shutdown sequence in
some vendor's platform, and it is required to disable error handling
during shutdown.

This CL separates the shutdown request to execute another "shutdown"
trigger at the beginning of shutdown stage. And vendor can use this
trigger to add custom commands needed for shutting down gracefully.

Bug: 38203024
Bug: 62084631
Test: device reboot/shutdown
Change-Id: I3fac4ed59f06667d86e477ee55ed391cf113717f
(cherry picked from commit eeab491efd)
2017-07-06 02:30:14 +00:00
Keun-young Park
d266d37e4c add "shutdown critical" to service
- "shutdown critical" prevents killing the service during
  shutdown. And the service will be started if not running.
- Without it, services will be killed by SIGTERM / SIGKILL during shutdown.
- Even services with "shutdown critical" will be killed if shutdown
  times out.
- Removes ueventd and vold from hard coded list. Each service's rc will
  be updated to add "shutdown critical". watchdogd is still kept in the list.

bug: 37626581
Test: reboot and check last kmsg

(cherry picked from commit cccb34fce8)

Change-Id: I3c6aeb7151e64beca4b435f843ae64455217262d
2017-07-06 00:54:02 +00:00
TreeHugger Robot
5c5c544e80 Merge "init: rename mke2fs tools with _static suffix" into oc-dr1-dev 2017-07-05 22:33:35 +00:00