OSDN Git Service
Elliott Hughes [Mon, 16 Jul 2012 18:38:23 +0000 (11:38 -0700)]
Merge "bionic: Report linker relocation address to gdb"
Elliott Hughes [Mon, 16 Jul 2012 17:08:16 +0000 (10:08 -0700)]
Merge "linker: cleanup of undefined state handling, which is really dead code"
Robin Burchell [Thu, 5 Jul 2012 07:23:19 +0000 (09:23 +0200)]
linker: cleanup of undefined state handling, which is really dead code
Given that _elf_lookup (and thus, _do_lookup) cannot possibly return an
undefined symbol (due to the check for SHN_UNDEF in _elf_lookup), there's
no need for spurious checks for SHN_UNDEF on its return value.
Conflicts:
linker/linker.c
Change-Id: Ic73cf439924b45f72d4d9ba3f64a888c96cbbd9b
Elliott Hughes [Mon, 16 Jul 2012 17:00:38 +0000 (10:00 -0700)]
Merge "linker: Use SHN_UNDEF instead of describing what it is trying to do."
Robin Burchell [Thu, 5 Jul 2012 07:21:07 +0000 (09:21 +0200)]
linker: Use SHN_UNDEF instead of describing what it is trying to do.
Elliott Hughes [Mon, 16 Jul 2012 16:45:27 +0000 (09:45 -0700)]
Merge "Use std=gnu99 for the dynamic linker as well as libc."
Elliott Hughes [Mon, 16 Jul 2012 16:43:14 +0000 (09:43 -0700)]
Use std=gnu99 for the dynamic linker as well as libc.
Change-Id: I76dd78576c5af6eb6282555f069647b6260edc31
Elliott Hughes [Mon, 16 Jul 2012 16:39:24 +0000 (09:39 -0700)]
Merge "limits.h: Include page.h when relying on PAGE_SIZE"
Nick Kralevich [Mon, 16 Jul 2012 15:24:32 +0000 (08:24 -0700)]
Merge "FORTIFY_SOURCE: revert memcpy changes."
Ryan V. Bissell [Mon, 16 Jul 2012 07:16:18 +0000 (02:16 -0500)]
bionic: Report linker relocation address to gdb
GDB needs the runtime linker's base address in order to
locate the latter's ".text" and ".plt" sections, for the
purpose of detecting solib trampolines. It also can
potentially use this to calculate the relocated address
of rtld_db_dlactivity.
Bug: http://code.google.com/p/android/issues/detail?id=34856
Change-Id: I63d3e7ae4e20a684ceb25967f2241e7d58dd685d
Signed-off-by: Ryan V. Bissell <ryan@bissell.org>
Nick Kralevich [Sat, 14 Jul 2012 00:49:10 +0000 (17:49 -0700)]
FORTIFY_SOURCE: revert memcpy changes.
Performance regressions. Hopefully this is a temporary
rollback.
Bug:
6821003
Change-Id: I84abbb89e1739d506b583f2f1668f31534127764
Nick Kralevich [Fri, 13 Jul 2012 22:06:56 +0000 (15:06 -0700)]
Merge "FORTIFY_SOURCE: introduce __BIONIC_FORTIFY_UNKNOWN_SIZE macro"
Nick Kralevich [Fri, 13 Jul 2012 22:06:40 +0000 (15:06 -0700)]
Merge "FORTIFY_SOURCE: strlen check."
Nick Kralevich [Fri, 13 Jul 2012 21:52:26 +0000 (14:52 -0700)]
Merge "FORTIFY_SOURCE: restore __memcpy_chk()"
Nick Kralevich [Fri, 13 Jul 2012 21:46:36 +0000 (14:46 -0700)]
FORTIFY_SOURCE: introduce __BIONIC_FORTIFY_UNKNOWN_SIZE macro
Replace all occurances of "(size_t) -1" with a
__BIONIC_FORTIFY_UNKNOWN_SIZE macro.
Change-Id: I0b188f6cf31417d2dbef0e1bd759de3f9782873a
Nick Kralevich [Fri, 13 Jul 2012 18:27:06 +0000 (11:27 -0700)]
FORTIFY_SOURCE: strlen check.
This test is designed to detect code such as:
int main() {
char buf[10];
memcpy(buf, "
1234567890", sizeof(buf));
size_t len = strlen(buf); // segfault here with _FORTIFY_SOURCE
printf("%d\n", len);
return 0;
}
or anytime strlen reads beyond an object boundary. This should
help address memory leakage vulnerabilities and make other
unrelated vulnerabilities harder to exploit.
Change-Id: I354b425be7bef4713c85f6bab0e9738445e00182
Nick Kralevich [Fri, 13 Jul 2012 19:45:14 +0000 (12:45 -0700)]
FORTIFY_SOURCE: restore __memcpy_chk()
In our previous FORTIFY_SOURCE change, we started using a custom
inline for memcpy(), rather than using GCC's __builtin_memcpy_chk().
This allowed us to delete our copy of __memcpy_chk(), and replace it
by __memcpy_chk2().
Apparently GCC uses __memcpy_chk() outside of __builtin_memcpy_chk().
Specifically, __memcpy_chk() is used by __builtin__memMOVE_chk() under
certain optimization levels.
Keep the old __memcpy_chk() function around, and have it call into
__memcpy_chk2().
Change-Id: I2453930b24b8a492a3b6ed860e18d92a6b762b80
Nick Kralevich [Fri, 13 Jul 2012 14:57:57 +0000 (07:57 -0700)]
Merge "FORTIFY_SOURCE: enhanced memcpy protections."
Nick Kralevich [Thu, 12 Jul 2012 22:10:03 +0000 (15:10 -0700)]
FORTIFY_SOURCE: enhanced memcpy protections.
Two changes:
1) Detect memory read overruns.
For example:
int main() {
char buf[10];
memcpy(buf, "abcde", sizeof(buf));
sprintf("%s\n", buf);
}
because "abcde" is only 6 bytes, copying 10 bytes from it is a bug.
This particular bug will be detected at compile time. Other similar
bugs may be detected at runtime.
2) Detect overlapping buffers on memcpy()
It is a bug to call memcpy() on buffers which overlap. For
example, the following code is buggy:
char buf3[0x800];
char *first_half = &buf3[0x400];
char *second_half = &buf3[1];
memset(buf3, 0, sizeof(buf3));
memcpy(first_half, second_half, 0x400);
printf("1: %s\n", buf3);
We now detect this at compile and run time.
Change-Id: I092bd89f11f18e08e8a9dda0ca903aaea8e06d91
Nick Kralevich [Thu, 12 Jul 2012 17:06:27 +0000 (10:06 -0700)]
Merge "memmove: Don't call memcpy if regions overlap"
Nick Kralevich [Thu, 12 Jul 2012 00:34:04 +0000 (17:34 -0700)]
memmove: Don't call memcpy if regions overlap
memmove() unconditionally calls memcpy() if "dst" < "src". For
example, in the code below, memmove() would end up calling memcpy(),
even though the regions of memory overlap.
int main() {
char buf3[0x800];
char *dst = &buf3[1];
char *src = &buf3[0x400];
memset(buf3, 0, sizeof(buf3));
memmove(dst, src, 0x400);
printf("1: %s\n", buf3);
return 0;
}
Calling memcpy() on overlaping regions only works if you assume
that memcpy() copies from start to finish. On some architectures,
it's more efficient to call memcpy() from finish to start.
This is also triggering a failure in some of my code.
More reading:
* http://lwn.net/Articles/414467/
* https://bugzilla.redhat.com/show_bug.cgi?id=638477#c31 (comment 31)
Change-Id: I65a51ae3a52dd4af335fe5c278056b8c2cbd8948
Nick Kralevich [Tue, 10 Jul 2012 17:46:19 +0000 (10:46 -0700)]
Don't use -fstack-protector on ssp.c
libc's stack protector initialization routine (__guard_setup)
is in bionic/ssp.c. This code deliberately modifies the stack
canary. This code should never be compiled with -fstack-protector-all
otherwise it will crash (mismatched canary value).
Force bionic/ssp.c to be compiled with -fno-stack-protector
Change-Id: Ib95a5736e4bafe1a460d6b4e522ca660b417d8d6
Arun Raghavan [Tue, 10 Jan 2012 14:07:32 +0000 (19:37 +0530)]
limits.h: Include page.h when relying on PAGE_SIZE
limits.h relies on PAGE_SIZE being defined without actually including
page.h. Make sure this is included to avoid compilation failures.
Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Nick Kralevich [Mon, 9 Jul 2012 19:55:32 +0000 (12:55 -0700)]
Merge "FORTIFY_SOURCE: Add openat, fix bug"
Nick Kralevich [Mon, 2 Jul 2012 19:24:42 +0000 (12:24 -0700)]
FORTIFY_SOURCE: Add openat, fix bug
Add fortify_source support for openat(). This change requires that
an argument be supplied when using O_CREAT.
Fix unnecessary call to __open_2. If, at compile time, we know that
"flags" is constant and DOESN'T contain O_CREAT, the call to __open_2
is useless.
Change-Id: Ifcd29c4fb25e25656961d7552d672e161f0cfdbd
Nick Kralevich [Mon, 9 Jul 2012 19:28:35 +0000 (12:28 -0700)]
Merge "FORTIFY_SOURCE: add fgets support."
Andrew Hsieh [Mon, 9 Jul 2012 18:07:46 +0000 (11:07 -0700)]
am
67636eea: am
40e7ed58: Unhide rtld_db_dlactivity()
* commit '
67636eea20f7789e6689ee8cf6017e7d48735ca1':
Unhide rtld_db_dlactivity()
Andrew Hsieh [Mon, 9 Jul 2012 18:05:16 +0000 (11:05 -0700)]
am
40e7ed58: Unhide rtld_db_dlactivity()
* commit '
40e7ed58d73eae59d0cf2fed61284d16692e307b':
Unhide rtld_db_dlactivity()
Nick Kralevich [Tue, 3 Jul 2012 18:45:31 +0000 (11:45 -0700)]
FORTIFY_SOURCE: add fgets support.
Change-Id: I8c3410a90c71a3336c4ac8581618fa9330edf5e3
Andrew Hsieh [Mon, 2 Jul 2012 18:17:04 +0000 (11:17 -0700)]
Unhide rtld_db_dlactivity()
Since linker is built with -fvisibility=hidden rtld_db_dlactivity()
if hidden from gdb. Unhide it otherwise gdb may not know linker
activity and rescan solib
Change-Id: Ia8cd8d9738c6ea5696ba2ef0ebf2cf783f9ca70a
Rebecca Schultz Zavin [Thu, 28 Jun 2012 21:16:10 +0000 (14:16 -0700)]
Merge "Modify ion header"
Nick Kralevich [Wed, 27 Jun 2012 19:56:52 +0000 (12:56 -0700)]
Merge "FORTIFY_SOURCE: add open() checks"
Nick Kralevich [Tue, 26 Jun 2012 23:05:19 +0000 (16:05 -0700)]
libc: cleanups
Prefix private functions with underscores, to prevent name
conflicts.
Use __error__ instead of error, since occasionally programs will
create their own "#define error ...".
Change-Id: I7bb171df58aec5627e61896032a140db547fd95d
Nick Kralevich [Tue, 26 Jun 2012 22:08:06 +0000 (15:08 -0700)]
FORTIFY_SOURCE: add open() checks
Add a FORTIFY_SOURCE check which requires that you pass a
"mode" argument when calling open(..., O_CREAT). If a mode isn't
passed, then the file is created with "undefined" permissions.
Change-Id: I4427be4f9ce170c69da01af5b00fb05b03613a28
David 'Digit' Turner [Mon, 18 Jun 2012 23:24:17 +0000 (01:24 +0200)]
linker: improve loadable segment protection.
Use the functions in linker_phdr.c to load the PT_LOAD segments
in memory, and toggle their mapping's writable protection bit
as needed. In particular:
- when loading a library, load the segments then unprotected
them to allow relocations to work.
- when relocating the linker of the executable, unprotect
the segments loaded by the kernel to make relocations work
too.
- after all relocations are done, re-protect the segments,
and apply GNU RELRO protection if needed.
- just before calling the destructors, undo the GNU RELRO
protection.
Change-Id: I50e709f03958204b8d6140c0f51ebe24fe089a1b
David 'Digit' Turner [Mon, 18 Jun 2012 22:08:39 +0000 (00:08 +0200)]
linker: simplify code for dynamic and ARM exidx sections.
This moves the code that determines where the .dynamic and .ARM.exidx
sections are to a single place in soinfo_link_image().
Change-Id: I98adcb440577bed86442349f03f3c629c945efec
David 'Digit' Turner [Tue, 26 Jun 2012 08:34:41 +0000 (01:34 -0700)]
Merge "linker: rename load_offset to load_bias."
David 'Digit' Turner [Tue, 26 Jun 2012 08:34:31 +0000 (01:34 -0700)]
Merge "linker: avoid mapping the whole library before load."
David 'Digit' Turner [Tue, 26 Jun 2012 08:34:18 +0000 (01:34 -0700)]
Merge "linker: Add PAGE_START/OFFSET/END convenience macros"
David 'Digit' Turner [Tue, 26 Jun 2012 08:34:07 +0000 (01:34 -0700)]
Merge "linker: New sources to manage the ELF program header table."
Elliott Hughes [Mon, 25 Jun 2012 21:09:42 +0000 (14:09 -0700)]
am
5af97ca8: am
c7bab8cb: Merge "Enable sqrtf() x86 assembly code"
* commit '
5af97ca8514d9fb4175bff3a79abf26889b94530':
Enable sqrtf() x86 assembly code
Elliott Hughes [Mon, 25 Jun 2012 21:06:06 +0000 (14:06 -0700)]
am
c7bab8cb: Merge "Enable sqrtf() x86 assembly code"
* commit '
c7bab8cb8483e7869eabdbd4add7c9e5beeecc80':
Enable sqrtf() x86 assembly code
Elliott Hughes [Mon, 25 Jun 2012 17:46:41 +0000 (10:46 -0700)]
Merge "Enable sqrtf() x86 assembly code"
David 'Digit' Turner [Mon, 18 Jun 2012 21:38:46 +0000 (23:38 +0200)]
linker: rename load_offset to load_bias.
This patch changes the definition of the 'load_offset' field
in struct soinfo. The field is renamed because it is not the
basic load bias to add to every p_vaddr value read from the ELF
file to get the corresponding memory address.
This also slightly simplifies the relocation code.
+ Fix for proper load_bias computation for relocatable executables.
Change-Id: I72502c75a70751cba324deee7d313ae61f96609e
David 'Digit' Turner [Mon, 18 Jun 2012 16:13:49 +0000 (18:13 +0200)]
linker: avoid mapping the whole library before load.
This patch changes the load_library() function in the
dynamic linker to avoid reserving a huge read-only
address-space range just to read the ELF header and
program header (which are typically very small and easily
fit in the first page).
Instead, we use the functions in linker_phdr.c to only
load the data that we need in a temporary mmap-allocated
page of memory, which we release when the function exits.
This avoids issues when loading very large libraries, or
simply debug versions that only need to load a tiny percentage
of their overall file content in RAM.
Change-Id: Id3a189fad2119a870a1b3d43dd81380c54ea6044
David 'Digit' Turner [Mon, 18 Jun 2012 09:15:54 +0000 (11:15 +0200)]
linker: Add PAGE_START/OFFSET/END convenience macros
This patch adds a few macros related to memory pages to help
clarify some of the code in linker.c
Change-Id: I36c727132d257b1497398dd0a9e8a5a4505467ca
David 'Digit' Turner [Tue, 19 Jun 2012 09:21:29 +0000 (11:21 +0200)]
linker: New sources to manage the ELF program header table.
This patch introduces two new source files containing a set of functions
to manage the program header table in an ELF binary, including the ability
to load PT_LOAD segments, and apply PT_GNU_RELRO protection.
Note: the files are not used currently, this will appear in a series
of future patches that will gradually modify linker.c to use
the phdr_table_xxx functions properly.
Change-Id: Ia3d4c1ff5fc3e265d8258b64b492f4e643f51bdc
xqian6 [Mon, 25 Jun 2012 08:12:06 +0000 (16:12 +0800)]
Enable sqrtf() x86 assembly code
This patch can improve the sqrtf() performance.
Change-Id: Ic9d11d6a9ecd9b263f54d4878e13595e136b95ce
Evgeniy Stepanov [Fri, 22 Jun 2012 10:52:52 +0000 (14:52 +0400)]
Add module base to main executable's ARM_exidx.
BUG:
6697872
Change-Id: I448f4b86397307086231776da38a7af334a75fe5
Andrew Hsieh [Thu, 21 Jun 2012 02:00:55 +0000 (19:00 -0700)]
am
fa136e8c: am
a5948157: Merge "Define __stack_chk_fail_local.S"
* commit '
fa136e8ca71cb20956cd1792251869cac8bed257':
Define __stack_chk_fail_local.S
Andrew Hsieh [Thu, 21 Jun 2012 01:58:18 +0000 (18:58 -0700)]
am
a5948157: Merge "Define __stack_chk_fail_local.S"
* commit '
a5948157fd34acb2b1d1bfaf129901af865ab5fc':
Define __stack_chk_fail_local.S
Andrew Hsieh [Thu, 21 Jun 2012 01:37:47 +0000 (18:37 -0700)]
Merge "Define __stack_chk_fail_local.S"
Andrew Hsieh [Wed, 20 Jun 2012 06:35:51 +0000 (14:35 +0800)]
Define __stack_chk_fail_local.S
With -fstack-protector, x86 -m32 needs __stack_chk_fail_local
defined in crtbegin_*.o.
Include __stack_chk_fail_local.S in begin.S otherwise linker
(which is built w/o crt*) may not link.
Change-Id: Id242fcf3eff157264afe3b04f27288ab7991220a
The Android Open Source Project [Wed, 20 Jun 2012 15:28:23 +0000 (08:28 -0700)]
The Android Open Source Project [Wed, 20 Jun 2012 15:25:32 +0000 (08:25 -0700)]
Reconcile with jb-release
Change-Id: Ia5de9692e507a605d3b6937ec65da26169a3ea8e
The Android Automerger [Wed, 20 Jun 2012 13:59:21 +0000 (06:59 -0700)]
merge in jb-release history after reset to jb-dev
David 'Digit' Turner [Tue, 19 Jun 2012 21:51:28 +0000 (14:51 -0700)]
Merge "linker: reduce size by nearly 20KB"
Andy McFadden [Tue, 19 Jun 2012 18:33:19 +0000 (11:33 -0700)]
am
63c4179f: am
4d0128f1: Merge "Minor tweak to get memory around corrupted heap chunks dumped." into jb-dev
* commit '
63c4179f5951edc2d68700fe75659fbd34febe63':
Minor tweak to get memory around corrupted heap chunks dumped.
Andy McFadden [Tue, 19 Jun 2012 18:31:14 +0000 (11:31 -0700)]
am
4d0128f1: Merge "Minor tweak to get memory around corrupted heap chunks dumped." into jb-dev
* commit '
4d0128f13a3ca9f7a0c81b6e69f7e20d28e9e6e3':
Minor tweak to get memory around corrupted heap chunks dumped.
Andy McFadden [Tue, 19 Jun 2012 18:28:15 +0000 (11:28 -0700)]
Merge "Minor tweak to get memory around corrupted heap chunks dumped." into jb-dev
Ben Cheng [Tue, 19 Jun 2012 14:11:38 +0000 (07:11 -0700)]
Minor tweak to get memory around corrupted heap chunks dumped.
Change-Id: I8f72c5c7e23960b13fc53e2354cd74aca8aac3c0
David 'Digit' Turner [Tue, 19 Jun 2012 00:02:32 +0000 (02:02 +0200)]
linker: reduce size by nearly 20KB
This patch adds a trivial implementation of snprintf() that calls
our internal vsnprintf().
Inspection of the generated machine code showed that the linker
contained a full implementation of stdio's vfprintf. It was pulled
in because the pthread implementation uses snprintf() somewhere.
ProTip: It's possible to see why specific objects files are included
in a final binary by adding the following to your Android.mk, then
looking at the content of /tmp/MAP.TXT:
LOCAL_LDFLAGS += -Wl,-Map=/tmp/MAP.TXT
Change-Id: I325e71b0cad1d01116a2e00c09e30a80cb716aa3
Arve Hjønnevåg [Thu, 14 Jun 2012 23:13:16 +0000 (16:13 -0700)]
Merge "Add watchdog.h"
Nick Kralevich [Thu, 14 Jun 2012 20:48:18 +0000 (13:48 -0700)]
libc: make atoi, atol, and atoll pure functions
Change-Id: Ib831c079c865929b6c91d42f35e117f2e974808f
Nick Kralevich [Wed, 13 Jun 2012 23:57:27 +0000 (16:57 -0700)]
FORTIFY_SOURCE: add strlcpy / strlcat support
Add strlcpy / strlcat support to FORTIFY_SOURCE. This allows
us to do consistency checks on to ensure we don't overflow buffers
when the compiler is able to tell us the size of the buffer we're
dealing with.
Unlike previous changes, this change DOES NOT use the compiler's
builtin support. Instead, we do everything the compiler would
normally do.
Change-Id: I47c099a911382452eafd711f8e9bfe7c2d0a0d22
Arve Hjønnevåg [Thu, 14 Jun 2012 02:22:18 +0000 (19:22 -0700)]
Add watchdog.h
Change-Id: Ib12d437151ccfbd634e9f01acd8556c79977ca04
David 'Digit' Turner [Thu, 14 Jun 2012 04:45:52 +0000 (21:45 -0700)]
Merge "linker: small code-cleanup"
Nick Kralevich [Wed, 13 Jun 2012 23:13:32 +0000 (16:13 -0700)]
Merge "Don't mark realloc with __attribute__((malloc))"
Nick Kralevich [Wed, 13 Jun 2012 22:43:14 +0000 (15:43 -0700)]
Don't mark realloc with __attribute__((malloc))
According to
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
realloc should NOT be marked with __attribute__((malloc)). Quoting:
realloc-like functions do not have this property as the memory
pointed to does not have undefined content.
For reference, __mallocfunc is defined in sys/cdefs.h as:
#define __mallocfunc __attribute__((malloc))
Change-Id: I56083542ba92e4608dd7c55fb5596a138eb50cc9
David 'Digit' Turner [Tue, 12 Jun 2012 14:25:37 +0000 (16:25 +0200)]
linker: small code-cleanup
This patch adds to make the linker a little bit easier to understand
by making all functions that acts on a sofino object with a soinfo_
prefix.
This is to more easily distinguish functions that operate on global
state, and those that operate on individual libraries.
This should be purely stylistic, i.e. no feature/behaviour change.
Change-Id: Ie510d13d743aa4317644caefa9910b8af7e84f44
Nick Kralevich [Wed, 13 Jun 2012 18:03:42 +0000 (11:03 -0700)]
Merge "FORTIFY_SOURCE: add sprintf / vsprintf support"
Nick Kralevich [Tue, 12 Jun 2012 22:59:04 +0000 (15:59 -0700)]
FORTIFY_SOURCE: add sprintf / vsprintf support
sprintf FORTIFY_SOURCE protections are not available
on clang.
Also add various __attribute__s to stdio functions.
Change-Id: I936d1f9e55fe53a68885c4524b7b59e68fed218d
Nick Kralevich [Tue, 12 Jun 2012 23:34:46 +0000 (16:34 -0700)]
Merge "update filter.h / prctl.h / seccomp.h"
Robert Greenwalt [Tue, 12 Jun 2012 22:56:29 +0000 (15:56 -0700)]
am
c5cab345: am
028ccf5d: Merge "Avoid multiple dns lookups for the same query"
* commit '
c5cab3452d5ced55474e56497594579108670b51':
Avoid multiple dns lookups for the same query
Robert Greenwalt [Tue, 12 Jun 2012 22:52:56 +0000 (15:52 -0700)]
am
028ccf5d: Merge "Avoid multiple dns lookups for the same query"
* commit '
028ccf5d40dd9a945ea92aa79822c08c6f6aa1d2':
Avoid multiple dns lookups for the same query
Nick Kralevich [Tue, 12 Jun 2012 22:42:39 +0000 (15:42 -0700)]
update filter.h / prctl.h / seccomp.h
Pull in an updated version of filter.h / prctl.h / seccomp.h
from the linux kernel. Pulled from upstream kernel at
94fa83c424321189ca24fb6cb4c0d224cdedc72d
This file was generated using the following command:
cd bionic/libc/kernel/
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/seccomp.h
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/filter.h
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/prctl.h
Change-Id: I1ca996541d05b0d5927ab828a6ce49c09877ea01
Robert Greenwalt [Tue, 12 Jun 2012 22:06:23 +0000 (15:06 -0700)]
Merge "Avoid multiple dns lookups for the same query"
Nick Kralevich [Tue, 12 Jun 2012 15:50:57 +0000 (08:50 -0700)]
Merge "FORTIFY_SOURCE: add snprintf, vsnprintf"
Elliott Hughes [Tue, 12 Jun 2012 00:42:44 +0000 (17:42 -0700)]
am
20afd4e7: am
e0961445: Merge "Remove the meaningless on Linux if_dl.h header."
* commit '
20afd4e70c2f346d7cd03a7a3049f8de2d176d5c':
Remove the meaningless on Linux if_dl.h header.
Elliott Hughes [Tue, 12 Jun 2012 00:42:43 +0000 (17:42 -0700)]
am
571da80c: am
c75491e2: Merge "Remove an obsolete jamfile."
* commit '
571da80c58e13eac4d4fb29d38342879e5dede13':
Remove an obsolete jamfile.
Elliott Hughes [Tue, 12 Jun 2012 00:41:10 +0000 (17:41 -0700)]
am
e0961445: Merge "Remove the meaningless on Linux if_dl.h header."
* commit '
e0961445124b5ff39412da32578e14e0d1f6afd6':
Remove the meaningless on Linux if_dl.h header.
Elliott Hughes [Tue, 12 Jun 2012 00:41:04 +0000 (17:41 -0700)]
am
c75491e2: Merge "Remove an obsolete jamfile."
* commit '
c75491e291586540c213ae088fc75b71fc4d3752':
Remove an obsolete jamfile.
Elliott Hughes [Mon, 11 Jun 2012 23:49:57 +0000 (16:49 -0700)]
Merge "Remove the meaningless on Linux if_dl.h header."
Nick Kralevich [Mon, 11 Jun 2012 22:50:57 +0000 (15:50 -0700)]
FORTIFY_SOURCE: add snprintf, vsnprintf
Add _FORTIFY_SOURCE support for snprintf, vsnprintf
At this time, we opt out of these protections for clang, as clang
does not implement __builtin_va_arg_pack().
http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc
Change-Id: I73ebe5ec8dad1dca8898a76d6afb693a25f75375
Elliott Hughes [Mon, 11 Jun 2012 23:29:46 +0000 (16:29 -0700)]
Merge "Remove an obsolete jamfile."
Elliott Hughes [Mon, 11 Jun 2012 23:17:45 +0000 (16:17 -0700)]
Remove an obsolete jamfile.
Was bionic ever built with jam? Weird!
Change-Id: Iea9a7af8bf46ee8319963e642da48e3bb49f6c60
Nick Kralevich [Mon, 11 Jun 2012 23:11:20 +0000 (16:11 -0700)]
Merge "inet_ntop: pass the size of tmp to snprintf()"
Nick Kralevich [Mon, 11 Jun 2012 21:29:30 +0000 (14:29 -0700)]
inet_ntop: pass the size of tmp to snprintf()
Fix runtime error when snprintf() FORTIFY_SOURCE protections are
applied. The size passed to snprintf() is larger than the tmp
buffer size, which results in a runtime assertion failure.
Even though the size passed to snprintf is larger than the buffer,
there's no danger of overwriting the buffer because of the format
string passed to snprintf.
Change-Id: I35f0217d25f3b9c6d04c5a76c3238759c235545a
Rebecca Schultz Zavin [Mon, 11 Jun 2012 21:12:57 +0000 (14:12 -0700)]
Modify ion header
Change-Id: Ib963e8b064f7883bf098e006c70df20732496100
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Elliott Hughes [Mon, 11 Jun 2012 22:01:10 +0000 (15:01 -0700)]
Remove the meaningless on Linux if_dl.h header.
This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.
Reported to AOSP by Jun-ya Kato.
(cherry-pick of
5056f1fad1187cd67729bb04ba72397d78256f03.)
Change-Id: Ic67f674d2221497c8166994812bb5fc7f0831066
Elliott Hughes [Mon, 11 Jun 2012 22:09:57 +0000 (15:09 -0700)]
Merge "Remove the meaningless on Linux if_dl.h header."
Elliott Hughes [Mon, 11 Jun 2012 22:01:10 +0000 (15:01 -0700)]
Remove the meaningless on Linux if_dl.h header.
This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.
Reported to AOSP by Jun-ya Kato.
Change-Id: I111f9887f3812469b411b9cf5124d9dd624f19f7
Geremy Condra [Mon, 11 Jun 2012 19:17:12 +0000 (12:17 -0700)]
Merge "Added event logging for some spoofed DNS queries."
Geremy Condra [Mon, 11 Jun 2012 18:50:03 +0000 (11:50 -0700)]
Merge "Added actual event logging calls to the FORTIFY_SOURCE methods."
Geremy Condra [Sat, 9 Jun 2012 04:06:33 +0000 (21:06 -0700)]
Added event logging for some spoofed DNS queries.
Change-Id: I40909306e8cf922f1dd5a5685db89f732a709794
Geremy Condra [Fri, 8 Jun 2012 21:39:11 +0000 (14:39 -0700)]
Added actual event logging calls to the FORTIFY_SOURCE methods.
Change-Id: I3bf4fa8678c33187cb8ce4b75e666ddcd24403ab
The Android Open Source Project [Mon, 11 Jun 2012 16:23:11 +0000 (09:23 -0700)]
The Android Open Source Project [Mon, 11 Jun 2012 16:20:36 +0000 (09:20 -0700)]
Reconcile with jb-release
Change-Id: I7cbfbab55783f245c0854543843c2052c4c2e932
The Android Automerger [Mon, 11 Jun 2012 13:59:25 +0000 (06:59 -0700)]
merge in jb-release history after reset to jb-dev
Nick Kralevich [Thu, 7 Jun 2012 23:30:02 +0000 (16:30 -0700)]
_FORTIFY_SOURCE: check for integer overflows
Ensure that strcat / strncat check for integer overflows
when computing the length of the resulting string.
Change-Id: Ib806ad33a0d3b50876f384bc17787a28f0dddc37