Commit graph

16271 commits

Author SHA1 Message Date
Pierre Imai
0967fc7e59 Copy the entire zero-separated DNS seach domain string.
The DNS search string contains zeros as domain separator. The resolver
code erroneously used strlcpy(), which resulted in only the first domain
to be copied. The code uses pointers into this string to access the
individual domains. Since the structure is zero-initialized, this bug only
resulted in zero-length domains instead of accessing unitialized memory.

BUG: 27312811
Change-Id: Ia9d066c405dfcc5e82d6766d93ead2ce574e7b0d
2016-02-29 16:50:38 +09:00
Elliott Hughes
17866357c5 Merge "Create logging sockets with SOCK_NONBLOCK..." 2016-02-28 15:54:44 +00:00
Elliott Hughes
0f67d5ffa4 Create logging sockets with SOCK_NONBLOCK...
...rather than calling fcntl on them directly after creation.

Bug: https://code.google.com/p/android/issues/detail?id=201440
Change-Id: Ia3941b7645455d69620b1a361902df009b5da2c5
2016-02-27 19:18:41 -08:00
Elliott Hughes
31adf6cd38 Merge "Improve FORTIFY failure diagnostics." 2016-02-28 00:30:31 +00:00
Elliott Hughes
b83d6747fa Improve FORTIFY failure diagnostics.
Our FORTIFY _chk functions' implementations were very repetitive and verbose
but not very helpful. We'd also screwed up and put the SSIZE_MAX checks where
they would never fire unless you actually had a buffer as large as half your
address space, which probably doesn't happen very often.

Factor out the duplication and take the opportunity to actually show details
like how big the overrun buffer was, or by how much it was overrun.

Also remove the obsolete FORTIFY event logging.

Also remove the unused __libc_fatal_no_abort.

This change doesn't improve the diagnostics from the optimized assembler
implementations.

Change-Id: I176a90701395404d50975b547a00bd2c654e1252
2016-02-26 22:06:17 -08:00
Neil Fuller
eb727252f2 Merge "Update timezone data to 2016a" 2016-02-26 11:23:28 +00:00
Elliott Hughes
a8f05fcc64 Merge "If you're going to use memset..." 2016-02-26 06:06:11 +00:00
Elliott Hughes
f86c4494ff If you're going to use memset...
...you'd better #include <string.h>.

Change-Id: I83e0877f4151fc764588e2d876e66d7712d41f61
2016-02-25 22:05:28 -08:00
Elliott Hughes
a8e75ba37d Merge "GCC doesn't like {}, and clang doesn't like {0}..." 2016-02-26 05:53:59 +00:00
Elliott Hughes
2c6c95348c GCC doesn't like {}, and clang doesn't like {0}...
...so memset it is, then.

I'll be glad when GCC is dead and we can use "= {}" like it's the 21st century.

Change-Id: I28d820d3926ac9bf44bf7c1e89e184726c840391
2016-02-25 21:51:50 -08:00
Elliott Hughes
d07d77e399 Merge "Fix a structure initialisation in pthread_exit()." 2016-02-26 04:59:51 +00:00
Anton Kirilov
6bd5cf60fa Fix a structure initialisation in pthread_exit().
The purpose of this change is to silence Valgrind's warning about a
syscall parameter pointing to uninitialised bytes.

Change-Id: I2737235f9ac288dbc8ec4be0c6f1cef181c9b7d7
2016-02-25 20:49:15 -08:00
Dimitry Ivanov
b4b98e750f Merge "[MIPS] Add __popcountsi2 to libgcc_compat.c" 2016-02-25 23:12:29 +00:00
Dimitry Ivanov
19acb698e8 [MIPS] Add __popcountsi2 to libgcc_compat.c
Also removed outdated genlibgcc_compat.py script
and references to it.

Bug: http://b/27340856
Change-Id: I7eef362364078867c60a27e72abba515f08b6651
2016-02-25 14:28:45 -08:00
Neil Fuller
92057af535 Update timezone data to 2016a
Changes affecting future time stamps

    America/Cayman will not observe daylight saving this year after all.
    Revert our guess that it would.  (Thanks to Matt Johnson.)

    Asia/Chita switches from +0800 to +0900 on 2016-03-27 at 02:00.
    (Thanks to Alexander Krivenyshev.)

    Asia/Tehran now has DST predictions for the year 2038 and later,
    to be March 21 00:00 to September 21 00:00.  This is likely better
    than predicting no DST, albeit off by a day every now and then.

  Changes affecting past and future time stamps

    America/Metlakatla switched from PST all year to AKST/AKDT on
    2015-11-01 at 02:00.  (Thanks to Steffen Thorsen.)

    America/Santa_Isabel has been removed, and replaced with a
    backward compatibility link to America/Tijuana.  Its contents were
    apparently based on a misreading of Mexican legislation.

  Changes affecting past time stamps

    Asia/Karachi's two transition times in 2002 were off by a minute.
    (Thanks to Matt Johnson.)

Bug: 26833368
(cherry-picked from commit 5408d8f39a)

Change-Id: I568ae45e0b38382507db3c244392ccc2edff29d3
2016-02-25 17:53:37 +00:00
Stephen Hines
e0959b4b16 Merge "Remove unused libm_clang variable." 2016-02-23 22:05:25 +00:00
Christopher Ferris
0a84f1a5eb Merge "Fix wrong guard values for 64 bit." 2016-02-23 19:15:57 +00:00
Christopher Ferris
0e2a026579 Fix wrong guard values for 64 bit.
I added the code to force alignments of 8 for 32 bit and 16 for 64 bit,
but I missed a couple of tests that failed due to this change. Fix the
failing tests.

Bug: 26739265
Change-Id: Ice9932d1419e59c07483c4c9fcdb84970844f0a6
2016-02-22 19:14:26 -08:00
Christopher Ferris
f2d516b3f9 Merge "Fix incorrect size of array." 2016-02-22 18:46:35 +00:00
Christopher Ferris
f499dc91e7 Fix incorrect size of array.
When using sscanf and "%4s", the array passed in must include space for
a nul terminator.

Bug: 26739265
Change-Id: I0140a6100ca370666ae61689087ba41b4914789d
2016-02-19 18:13:29 -08:00
Stephen Hines
64955c84c0 Remove unused libm_clang variable.
Bug: http://b/21899249

As part of the cleanup here, this unset/unused variable was missed.

Change-Id: I0e0f2640e2e975f3e154f68509aa791fd22053a9
2016-02-19 01:17:18 -08:00
Dimitry Ivanov
b539baab39 Merge "Improvements to dynamic linker messages" 2016-02-19 02:43:48 +00:00
Dimitry Ivanov
9f0a6954c6 Improvements to dynamic linker messages
Error messages now include executable name,
also linker doesn't abort if called on itself.

Change-Id: Ia17dd540919544b28062ed71751a1d79ee865206
2016-02-18 18:28:08 -08:00
Colin Cross
c95a4c8196 Merge changes Iac8109b3,I5ad67001,Ic1adb4df,I08a50349
* changes:
  malloc_debug: reread /proc/pid/maps when entry is missing
  Add backtrace_string and export to libmemunreachable
  Export malloc_backtrace
  Export malloc_iterate and friends
2016-02-19 01:55:10 +00:00
Colin Cross
d75d4bea54 malloc_debug: reread /proc/pid/maps when entry is missing
Reread /proc/pid/maps on demand in case a new library has been loaded.

Change-Id: Iac8109b3e6a07bf02c38300b21eecabf4bcd54df
2016-02-18 16:09:17 -08:00
Colin Cross
2c75991359 Add backtrace_string and export to libmemunreachable
Add backtrace_string to convert a malloc_debug backtrace to a string.
Also move the backtrace functions to libc_malloc_debug_backtrace so that
libmemunreachable can reuse them.

Change-Id: I5ad67001c0b4d184903c762863a8588181d4873b
2016-02-18 16:09:17 -08:00
Colin Cross
2d4721c0c5 Export malloc_backtrace
Change-Id: Ic1adb4dfd86b9ca698443a36263a3df2c91edda3
2016-02-18 16:09:16 -08:00
Colin Cross
869691c6f7 Export malloc_iterate and friends
Export malloc_iterate, malloc_enable, and malloc_disable to be used by
libmemunreachable.

Change-Id: I08a50349af82a95d096b6b4cbac37ababe4b9b06
2016-02-18 15:05:38 -08:00
Dimitry Ivanov
aca201358b Merge "Move gdb support functions to a separate file" 2016-02-18 22:12:26 +00:00
Dimitry Ivanov
6b788eeff2 Move gdb support functions to a separate file
Move gdb support functions and variables to
linker_gdb_support.h/cpp

Change-Id: I96c6592a7055715b18f1137367470fe80987263f
2016-02-18 12:32:56 -08:00
Christopher Ferris
4327ae07b9 Merge "Fix cfi directives for memmove/strlcpy." 2016-02-18 18:46:28 +00:00
Elliott Hughes
90ea63a862 Merge "Fix scope ids for link-local IPv6 addresses from getifaddrs(3)." 2016-02-18 18:35:00 +00:00
Nicolas Geoffray
be7a1eaf3a Merge "Revert "Move gdb support functions to a separate file"" 2016-02-18 09:31:41 +00:00
Nicolas Geoffray
0fa5410b0f Revert "Move gdb support functions to a separate file"
Was reverted on internal master already.

This reverts commit f8d051c81b.

Change-Id: Ia432f83bcce91366fb23f1bb87603a093b7f074d
2016-02-18 09:31:24 +00:00
Christopher Ferris
97b6e131fd Fix cfi directives for memmove/strlcpy.
Bug: 27227225
Change-Id: I47ca82daaadb3ec24cefc3c9aa4df7ed1798aced
2016-02-17 19:17:02 -08:00
Dimitry Ivanov
4dd56ac9a5 Merge changes Id6e60861,I0eacb3f0
* changes:
  Move gdb support functions to a separate file
  Use insert_link_map_into_debug_map for executable
2016-02-18 01:25:49 +00:00
Christopher Ferris
e73b27a1d3 Merge "Fix cfi directives in small strncmp case." 2016-02-18 01:18:26 +00:00
Christopher Ferris
de84e51f8c Fix cfi directives in small strncmp case.
Bug: 27227225
Change-Id: Id4f88fe288109a82822ad1b2291858c1c85b0ca7
2016-02-17 16:34:02 -08:00
Dimitry Ivanov
f8d051c81b Move gdb support functions to a separate file
Move gdb support functions and variables to
linker_gdb_support.h/cpp

Change-Id: Id6e608617016383b68283760361c567e58e574bc
2016-02-17 16:09:35 -08:00
Dimitry Ivanov
f3064e4bc7 Use insert_link_map_into_debug_map for executable
Use insert_link_map_into_debug_map to insert the main
executable's link_map to r_debug

Change-Id: I0eacb3f030ea3eb16ed50ad2011d604beece2d03
2016-02-17 15:25:25 -08:00
Elliott Hughes
7dac8b8aab Fix scope ids for link-local IPv6 addresses from getifaddrs(3).
Bug: http://b/27219454
Change-Id: I7a166ff5553565f7afdab18dd2c703af4d475ab4
2016-02-17 14:38:09 -08:00
Dimitry Ivanov
c347a10760 Merge "Update a comment for init_linker_info_for_gdb" 2016-02-17 22:20:22 +00:00
Dimitry Ivanov
6400129628 Update a comment for init_linker_info_for_gdb
Change-Id: I8e2895ecfcc6f77a180c3735342afc93be5923d3
2016-02-17 14:13:06 -08:00
Colin Cross
598cb89790 Merge "malloc_debug: reset TrackData mutex after fork" 2016-02-17 20:38:02 +00:00
Dimitry Ivanov
2de48bc809 Merge "Initialize linker link_map for gdb directly" 2016-02-17 00:00:30 +00:00
Dimitry Ivanov
acedcba331 Merge "Revert "Revert "Split out liblinker_malloc static library""" 2016-02-16 23:51:37 +00:00
Dimitry Ivanov
aa9cb26ead Revert "Revert "Split out liblinker_malloc static library""
This reverts commit 3bbeca7a1a.

Change-Id: I5a757fcd52a14442c2eb7ca53f7d1f1923a4efe9
2016-02-16 14:43:12 -08:00
Dimitry Ivanov
8d22dd53fe Initialize linker link_map for gdb directly
Remove unnecessary construction of soinfo when
initializing linker link_map for gdb.

Change-Id: Idf32cee56309aa9c9cf260efbd17a9deae9a756b
2016-02-16 14:39:15 -08:00
Dimitry Ivanov
b244d21672 Merge "linker: remove soinfo::entry" 2016-02-16 21:29:43 +00:00
Dimitry Ivanov
e687d067c6 linker: remove soinfo::entry
This field is used only once and only for main executable;
no need to carry it around in soinfo structure.

Change-Id: I7f80c64e0939e28966b6fed858891f9ce2a9e26b
2016-02-16 13:25:29 -08:00