Commit Graph

37723 Commits

Author SHA1 Message Date
Christopher Ferris c9dee84d81 Add support for only a .eh_frame.
Static executables only have a .eh_frame section and no .eh_frame_hdr
section. Add support for this by rearranging the class hierarchy and
creating a DwarfEhFrameWithHdr class and a DwarfEhFrame class to handle
the different cases.

Add new unit tests for DwarfEhFrame and for the new functionality.

Bug: 68820189

Test: Passes new unit tests, unwinds static executables.
Change-Id: I63d7cb8c52a686e96579a2266e18c0d06bbb6e63
2017-11-07 13:22:39 -08:00
Miodrag Dinic 173f91c9c8 Merge "MIPS[64]: codeflinger: Fix build due to unused variable warnings" am: 1e0b9672de
am: 50c1ad48cd

Change-Id: I642b1ce78a8966de10a839c3023259f645d2cb0f
2017-11-07 20:42:37 +00:00
Christopher Ferris 9a0ea3ee7a Merge "Fix nullptr dereference." am: 8e1ac14f40
am: 209841d764

Change-Id: Ifef7ecdcda2d52abe15113fcfdc148e3208e9d9d
2017-11-07 20:41:49 +00:00
Miodrag Dinic 50c1ad48cd Merge "MIPS[64]: codeflinger: Fix build due to unused variable warnings"
am: 1e0b9672de

Change-Id: Iaa3c0c2a7dc56a55a0544e43f6ff963af4c05d6d
2017-11-07 20:39:22 +00:00
Christopher Ferris 209841d764 Merge "Fix nullptr dereference."
am: 8e1ac14f40

Change-Id: I87d9a8c5fd09a717a119273c8a3f8d3a463e8e6c
2017-11-07 20:38:47 +00:00
Treehugger Robot 1e0b9672de Merge "MIPS[64]: codeflinger: Fix build due to unused variable warnings" 2017-11-07 20:34:34 +00:00
Christopher Ferris 8e1ac14f40 Merge "Fix nullptr dereference." 2017-11-07 20:30:42 +00:00
Elliott Hughes c330fcdf17 Merge "Don't include the build number in the adbd binary." am: d9984743e6
am: e8873379bc

Change-Id: Ib2890bf418820cdc7709b52bf33a7d7340cdac63
2017-11-07 20:16:20 +00:00
Elliott Hughes e8873379bc Merge "Don't include the build number in the adbd binary."
am: d9984743e6

Change-Id: Ifae8f8f4bd633aca5bb2096e0447b10c2accf1f5
2017-11-07 20:13:52 +00:00
Treehugger Robot d9984743e6 Merge "Don't include the build number in the adbd binary." 2017-11-07 20:04:40 +00:00
Elliott Hughes 6b970212fd Don't include the build number in the adbd binary.
We want repeatable builds for minimal OTAs.

(cherrypick of 2e93eda69cf20d9c04d56ea6bf1e2ea62ad62eb4.)

Bug: http://b/64634017
Bug: 64709603 (presubmit balking at the line above)
Test: repeated builds after `touch daemon/main.cpp` keep same md5sum
Change-Id: Iedeb44377ea45bbf20e2212760802198a57dc14a
2017-11-07 10:57:36 -08:00
Paul Elliott c6ed8f39d3 Buffer overrun in __android_log_is_loggable() fix
Fix for buffer overrun when a tag that is too big is sent to logd.
Buffer supplied is precisely the right size for max message length
however strlen will be run on the buffer, so need to ensure null
terminator, otherwise any strlen will go off the end of the buffer.
Also converted LogBuffer::Log() over to use the safer strnlen in the
case where it is measuring the buffer (and converted over to using
__android_log_is_loggable_len())

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
Test: liblog.android_log_buf_print__maxtag
Change-Id: I3cb8b25af55943fb0f4658657560eb2300f52961
2017-11-07 09:57:26 -08:00
Miodrag Dinic cc599273b4 MIPS[64]: codeflinger: Fix build due to unused variable warnings
Change-Id: Ie31d44ee74a218c83774df855be496ca862af8c5
Signed-off-by: Miodrag Dinic <miodrag.dinic@mips.com>
2017-11-06 16:38:49 +01:00
Christopher Ferris 13b86658b9 Fix nullptr dereference.
If an entry is found in .eh_frame_hdr, but it's not properly in .eh_frame,
then the code would crash. The assumption that the header always points
to valid fde data is not guaranteed.

Bug: 68813077

Test: Passes new unit test that crashed before the change.
Change-Id: I914d9bda0d442cd232e2a056ae490301a8850105
2017-11-05 14:01:43 -08:00
Luis Hector Chavez fae195b1e4 libcutils: Work around the lack of __mulodi4
The parent change ran into an issue where enabling UBSan on an i686
build caused it to use __mulodi4.

https://github.com/android-ndk/ndk/issues/184 documents linking against
libclang_rt.builtins-i686.a, but that's not available from soong either.

Bug: 62378620
Bug: 29412086
Test: x86 builds work again
Change-Id: I730d59558aa4ed28f8a11b5393e037111e320f29
2017-11-04 00:36:01 +00:00
Josh Gao cdea750576 crash_dump: don't inherit environment from parent.
Bug: http://b/68381717
Test: debuggerd_test
Change-Id: Ie1b342bc9901cb9ae9b79147899928a19052cbad
2017-11-03 16:57:56 -07:00
Connor O'Brien e09baa0f20 Merge "fastboot: handle small flash block sizes correctly" am: ebcfa44937
am: 5aff24e01d

Change-Id: I55f894d3393abf29504237fea973650ae1a0abc0
2017-11-03 21:33:05 +00:00
Connor O'Brien 5aff24e01d Merge "fastboot: handle small flash block sizes correctly"
am: ebcfa44937

Change-Id: I683e1722756d09b09c18d506f9e08e269b6e1921
2017-11-03 21:22:56 +00:00
Connor O'Brien ebcfa44937 Merge "fastboot: handle small flash block sizes correctly" 2017-11-03 21:15:34 +00:00
Luis Hector Chavez e97a4b9799 libcutils: Make uevent_kernel_* namespace-aware
This change adds user namespace-awareness to uevent_kernel_* in
libcutils. Instead of assuming that root is always uid 0, it detects
whether the uid 0 is mapped in the current user namespace and returns
the appropriately mapped uid (or the kernel's "overflowuid" in case it
is not mapped).

In older kernels, or those where user namespaces are not enabled, this
still uses uid 0 for root.

Bug: 62378620
Test: bullhead networking still works
Test: Android in Chrome OS can now receive netlink-related messages

Change-Id: I7ea3454e8f38b9c70c65294d6b2a99e5a88f9d70
2017-11-03 13:02:46 -07:00
Jin Qian a241632bcc Merge "fastboot: remove reference of deprecated make_ext4 code" am: 525205508f
am: 2089237ee8

Change-Id: Ib6db9a825a0ff0419e93821ac7022cdfbee87edc
2017-11-03 18:05:10 +00:00
Jin Qian 2089237ee8 Merge "fastboot: remove reference of deprecated make_ext4 code"
am: 525205508f

Change-Id: I3cb5a79fc9990e6fd613201592f1ae75bf477f4a
2017-11-03 17:41:09 +00:00
Jin Qian 525205508f Merge "fastboot: remove reference of deprecated make_ext4 code" 2017-11-03 17:28:26 +00:00
Chih-hung Hsieh 4d8089a86f Merge "Use -Werror in system/core/libpixelflinger" am: e3db2ab732
am: 9aedaa88e8

Change-Id: I0cb714e36470e618dcdb867461f64f823bba0ef3
2017-11-03 06:08:39 +00:00
Chih-hung Hsieh 9aedaa88e8 Merge "Use -Werror in system/core/libpixelflinger"
am: e3db2ab732

Change-Id: I9bd537c39f282d1f56c4054a9e9ac78ff5e8a538
2017-11-03 06:06:33 +00:00
Chih-hung Hsieh e3db2ab732 Merge "Use -Werror in system/core/libpixelflinger" 2017-11-03 06:03:20 +00:00
Chris Fries 3588ea7e2d Merge "Revert "delete toolbox/r.c"" am: 2f0c95a489
am: 3c8d352067

Change-Id: If0ec0d7f032f40961117509fca8c06cbc20cffe7
2017-11-03 04:49:37 +00:00
Chris Fries 3c8d352067 Merge "Revert "delete toolbox/r.c""
am: 2f0c95a489

Change-Id: Ief95542d970a070d3877a6a660fea7c5e14dea00
2017-11-03 04:46:25 +00:00
Treehugger Robot 2f0c95a489 Merge "Revert "delete toolbox/r.c"" 2017-11-03 04:42:27 +00:00
Tao Bao 9cd5e53128 Merge "fastboot: Don't give parsing error for unsupported 'getvar erase-block-size'." am: e5ff9b988c
am: 5cea27baad

Change-Id: Ia4626f4f1df1be9b3fc403f7f45e5398fae8e269
2017-11-03 03:39:47 +00:00
Tao Bao 5cea27baad Merge "fastboot: Don't give parsing error for unsupported 'getvar erase-block-size'."
am: e5ff9b988c

Change-Id: I037d5d1d9c09ab91fbbd770dfab038aaf3bcc300
2017-11-03 03:35:20 +00:00
Tao Bao e5ff9b988c Merge "fastboot: Don't give parsing error for unsupported 'getvar erase-block-size'." 2017-11-03 03:27:34 +00:00
Christopher Ferris 7ed0b9cc45 Merge "Only skip frames for local unwinds." am: 3eccc5f50e
am: 58e9c6a6b8

Change-Id: I5a36060a91b11f93b2a3d8101e509f2b366aa3f5
2017-11-03 02:07:04 +00:00
Christopher Ferris 58e9c6a6b8 Merge "Only skip frames for local unwinds."
am: 3eccc5f50e

Change-Id: I3ca928cc49a8bab00811b138669243e1649a5af6
2017-11-03 01:43:44 +00:00
Christopher Ferris 3eccc5f50e Merge "Only skip frames for local unwinds." 2017-11-03 01:36:28 +00:00
Christopher Ferris c56a499422 Only skip frames for local unwinds.
When doing a remote unwind, and there is a crash in the unwind stack
code or in libbacktrace, the old version would skip those frames.
This makes debugging crashes in those libraries a bit difficult.

Bug: 68820611

Test: Ran unit tests.
Test: kill -3 a zygote process and verify no frames in
Test: libunwindstack.so/libbacktrace.so.
Test: Forced a crash in libunwindstack.so and verified the tombstone
Test: contains the full crash.
Change-Id: I297e5b3775c87c0dddf57ebb423bd72ba1baf193
2017-11-02 16:22:52 -07:00
Tao Bao 67212f9083 fastboot: Don't give parsing error for unsupported 'getvar erase-block-size'.
Couldn't parse erase-block-size '0x'.
Couldn't parse logical-block-size '0x'.
mke2fs 1.43.3 (04-Sep-2016)
...

Some bootloaders explicitly return error on failed query (e.g. walleye),
while others return empty message (e.g. bullhead). We should just return
zero for empty message, instead of giving a misleading parsing error.

Test: `fastboot format userdata` on bullhead, with no parsing error.
Test: `fastboot format userdata` on walleye still works.
Change-Id: I194d41d24679929eccc65bfe895d6ab2a26315b7
2017-11-02 15:53:12 -07:00
Chih-Hung Hsieh c7f344e9a9 Use -Werror in system/core/libpixelflinger
* Remove unused local variables.
* Suppress/fix warning of unused functions, conditionally used variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: If92bc79f15a0486364da0389defbb2d43b3bd6ea
2017-11-02 15:16:18 -07:00
Jin Qian 988a51a9fe fastboot: remove reference of deprecated make_ext4 code
Bug: 64395169
Change-Id: Ida14996dc1488657e7bdeb34d6e767a8f6ed44ed
2017-11-02 15:13:46 -07:00
Connor O'Brien 6ef5c24b84 fastboot: handle small flash block sizes correctly
Erase block sizes smaller than the ext4 block size may be valid, but
can incorrectly result in a stripe width smaller than the stride
size. Instead of reporting these sizes as invalid, add a check to
enforce that raid_stripe_width >= raid_stride.

Bug: 68770797
Test: Hack fb_getvar to report small erase block size, run fastboot
-w and confirm it does not print a warning or set stripe_width smaller
than stride.
Signed-off-by: Connor O'Brien <connoro@google.com>

Change-Id: I689ce4bdd5b38bd0952bb6de54785cca39176010
2017-11-02 12:51:46 -07:00
Christopher Ferris 584ebea1d6 Merge "Add support for non-virtual thunk." am: 0d323c12df
am: a302ae3b6e

Change-Id: I5a1e361c897edfd1a7fd2f93404b4661d37d7a5d
2017-11-02 15:36:12 +00:00
Christopher Ferris a302ae3b6e Merge "Add support for non-virtual thunk."
am: 0d323c12df

Change-Id: I03c398b7d7df3b1dedf46447c57de896b28dc302
2017-11-02 15:34:03 +00:00
Christopher Ferris 0d323c12df Merge "Add support for non-virtual thunk." 2017-11-02 15:31:01 +00:00
Chris Fries 4a16646c95 Revert "delete toolbox/r.c"
This utility is always useful during device bringup, so let's bring it
back for debug builds.

This reverts commit 8a475f7e4a.

Change-Id: Ic4041afe538663f1e201ee1341dee247ab0d5ba2
2017-11-02 10:03:10 -05:00
tintin 6f1c539eae libnetutil: Check dhcp respose packet length am: 61f25d4a36 am: cee6d38c55 am: 29d054046f am: c29049f4f8 am: 3de04e9840 am: 19702dc499 am: 8191e9ba87 am: 804323c195 am: 4f5f00d879 am: 3a1ff1ad71 am: bab7b1ecd9 am: cdf0fc6018 am: 9f1398c6e3
am: d60dc7ef5c

Change-Id: I97b4dede2706944997b1925fa6233450bc155656
2017-11-02 03:31:32 +00:00
tintin d60dc7ef5c libnetutil: Check dhcp respose packet length am: 61f25d4a36 am: cee6d38c55 am: 29d054046f am: c29049f4f8 am: 3de04e9840 am: 19702dc499 am: 8191e9ba87 am: 804323c195 am: 4f5f00d879 am: 3a1ff1ad71 am: bab7b1ecd9 am: cdf0fc6018
am: 9f1398c6e3

Change-Id: I4c46a36846dd8f6588f29bc84de9bc3f1d7c088a
2017-11-02 03:28:42 +00:00
tintin 9f1398c6e3 libnetutil: Check dhcp respose packet length am: 61f25d4a36 am: cee6d38c55 am: 29d054046f am: c29049f4f8 am: 3de04e9840 am: 19702dc499 am: 8191e9ba87 am: 804323c195 am: 4f5f00d879 am: 3a1ff1ad71 am: bab7b1ecd9
am: cdf0fc6018

Change-Id: If9bc99849e62fe38cdf52180ff76390c452e0784
2017-11-02 03:25:33 +00:00
tintin cdf0fc6018 libnetutil: Check dhcp respose packet length am: 61f25d4a36 am: cee6d38c55 am: 29d054046f am: c29049f4f8 am: 3de04e9840 am: 19702dc499 am: 8191e9ba87 am: 804323c195 am: 4f5f00d879 am: 3a1ff1ad71
am: bab7b1ecd9

Change-Id: Id56f81b841d83b4b6fc75517fa165c0000dac663
2017-11-02 03:23:59 +00:00
tintin bab7b1ecd9 libnetutil: Check dhcp respose packet length am: 61f25d4a36 am: cee6d38c55 am: 29d054046f am: c29049f4f8 am: 3de04e9840 am: 19702dc499 am: 8191e9ba87 am: 804323c195 am: 4f5f00d879
am: 3a1ff1ad71

Change-Id: Ibea1269632e1700617b55f0ede7a0d9cc6442871
2017-11-02 03:21:57 +00:00
tintin 3a1ff1ad71 libnetutil: Check dhcp respose packet length am: 61f25d4a36 am: cee6d38c55 am: 29d054046f am: c29049f4f8 am: 3de04e9840 am: 19702dc499 am: 8191e9ba87 am: 804323c195
am: 4f5f00d879

Change-Id: Id2e1d882921b8a69f191e90032539a2e5835f05d
2017-11-02 03:18:53 +00:00