Commit graph

13548 commits

Author SHA1 Message Date
Colin Cross
b67afb3eb5 Add .PHONY for phony bionic test targets
Bug: 24384320
Change-Id: I41038ff8b34391d03ce1e204e30e5ae34ec56614
2015-09-25 14:36:15 -07:00
Christopher Ferris
931e1399f1 Merge "Add cortex-a53.a57 target for 32 bit big/little." 2015-09-25 16:29:33 +00:00
Christopher Ferris
70a9f0a3bc Merge "Fix over read in strcpy/stpcpy/strcat." 2015-09-24 21:26:40 +00:00
Christopher Ferris
fdfcfce7c6 Fix over read in strcpy/stpcpy/strcat.
This bug will happen when these circumstances are met:

- Destination address & 0x7 == 1, strlen of src is 11, 12, 13.
- Destination address & 0x7 == 2, strlen of src is 10, 11, 12.
- Destination address & 0x7 == 3, strlen of src is 9, 10, 11.
- Destination address & 0x7 == 4, strlen of src is 8, 9, 10.

In these cases, the dest alignment code does a ldr which reads 4 bytes,
and it will read past the end of the source. In most cases, this is
probably benign, but if this crosses into a new page it could cause a
crash.

Fix the labels in the cortex-a9 strcat.

Modify the overread test to vary the dst alignment to expost this bug.
Also, shrink the strcat/strlcat overread cases since the dst alignment
variation increases the runtime too much.

Bug: 24345899
Change-Id: Ib34a559bfcebd89861985b29cae6c1e47b5b5855
2015-09-24 14:17:36 -07:00
Christopher Ferris
54ee0407dc Add cortex-a53.a57 target for 32 bit big/little.
The routines optimized for cortex-a7 and cortex-a53 cause performance
drops on cortex-a57. Instead create a target that is the middle ground
that works relatively well on either core.

Change-Id: Ie2b6cc9a59a01c7b30602ee368b2b90f5e886289
2015-09-24 14:00:00 -07:00
Dan Albert
c38cee59dc Merge "Prevent the build system from hiding our ABI." 2015-09-23 20:08:09 +00:00
Elliott Hughes
cb696c50c2 Merge "Remove libpagemap include hack." 2015-09-23 18:49:22 +00:00
Elliott Hughes
7660a088cd Remove libpagemap include hack.
Change-Id: I4c75ae4e311342c9ab4f317026904f893e931384
2015-09-22 22:40:22 -07:00
Elliott Hughes
8d92afe322 Merge "Fix another duplicate maps parser." 2015-09-23 00:18:50 +00:00
Dan Albert
0aa96aedbe Prevent the build system from hiding our ABI.
Unfortunately --exclude-libs (now passed globally) clobbers our
version script, so we have to prevent the build system from using this
flag.

Bug: http://b/24166967
Change-Id: I33c766d399c418fdc17983c8c0a56608d463201e
2015-09-22 16:49:40 -07:00
Elliott Hughes
15dfd63aba Fix another duplicate maps parser.
Change-Id: Icb69f59ffbd0d5de7f727142260fae152d36a904
2015-09-22 16:40:14 -07:00
Elliott Hughes
9e3a249152 Merge "Clean up /proc/<pid>/maps sscanfs." 2015-09-22 22:49:20 +00:00
Elliott Hughes
0dec228921 Clean up /proc/<pid>/maps sscanfs.
sscanf will swallow whitespace for us.

Change-Id: I59931cbad00f0144fd33ed4749ac0aaad15e6de6
2015-09-22 15:45:50 -07:00
Jorge Lucangeli Obes
dd51453904 Merge "Add preliminary OEM UID/GID support." 2015-09-22 21:53:39 +00:00
Elliott Hughes
efcb5d9d4c Merge "Remove some <sys/cdefs.h> cruft." 2015-09-22 21:52:28 +00:00
Yabin Cui
3d00f79f98 Merge "Increase alternative signal stack size on 64-bit devices." 2015-09-22 20:44:05 +00:00
Jorge Lucangeli Obes
a39e30141d Add preliminary OEM UID/GID support.
Until we implement full support for passwd/group files, add a simple
way to use the new OEM UID/GID range (5000-5999).

oem_XXX -> 5000 + XXX iff 0 <= XXX < 1000.

Bug: 23225475

Change-Id: If48b88135d5df538313414f747d6c4c63bf0a103
2015-09-22 13:33:17 -07:00
Elliott Hughes
822c40a338 Merge "<netinet/udp.h> should include <linux/udp.h>." 2015-09-22 20:19:14 +00:00
Elliott Hughes
44ddb31e75 Remove some <sys/cdefs.h> cruft.
In particular, we don't need to record the peculiarities of every
version of GCC ever shipped. It just makes this file harder to follow.

Change-Id: Ie9035d78eae86b4aed9dff3576c6f54e268aaced
2015-09-22 13:00:21 -07:00
Elliott Hughes
f8a2243ebe <netinet/udp.h> should include <linux/udp.h>.
The comment about "other stuff" referred to pre-uapi headers. Everything
in the current <linux/udp.h> should be exposed to userspace. The only
problem is that BSD and Linux use different names for the members of
struct udphdr. We can move the Linux udphdr out of the way and use an
anonymous union to get the best of both worlds. (Though unfortunately
this means that code that includes <linux/udp.h> directly instead of
using <netinet/udp.h> now won't have any definition of struct udphdr.
We've taken the stance in the past that you shouldn't include a linux/
header if there's a standard equivalent --- you should rely on us
transitively including it for you.)

Change-Id: Ie625892441b0edd8df3b76d3fcf2cbe299077bc4
2015-09-22 12:34:13 -07:00
Yabin Cui
33ac04a215 Increase alternative signal stack size on 64-bit devices.
Bug: 23041777
Bug: 24187462
Change-Id: I7d84c0cc775a74753a3e8e101169c0fb5dbf7437
2015-09-22 11:18:26 -07:00
Dan Albert
1399759118 Merge "Add a hint about using --no-isolate for GDB." 2015-09-18 21:18:06 +00:00
Christopher Ferris
777bd95c63 Merge "Import scsi headers." 2015-09-18 20:44:58 +00:00
Greg Hackmann
96b1323a40 Merge "Define WIFCONTINUED()" 2015-09-18 20:39:07 +00:00
Greg Hackmann
7c4604518b Merge "Fix SOCK_* flag definitions" 2015-09-18 20:38:54 +00:00
Greg Hackmann
c6043f6b27 Define WIFCONTINUED()
Change-Id: Id0feebd90d0525f3b479eb119b942eae8ca568d1
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-09-18 13:37:53 -07:00
Greg Hackmann
d75abb9614 Fix SOCK_* flag definitions
MIPS and the rest of the world only disagree on the first two SOCK_*
constants, so restructure the #ifdef accordingly.

As a deliberate side effect, this fixes SOCK_DCCP being missing on
non-MIPS platforms.

Change-Id: I2267008f1121a7eebe1ed9097afab6e612bce7f0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-09-18 13:37:53 -07:00
Dan Albert
1af434cc02 Add a hint about using --no-isolate for GDB.
Change-Id: Ib9df5ed986a1c4082c9c7cd793a4d670be21ca66
2015-09-18 13:17:02 -07:00
Elliott Hughes
355f3d0c12 Merge "Fix mips FP abi bug in the linker." 2015-09-18 15:20:40 +00:00
Christopher Ferris
6048173b36 Import scsi headers.
Linux's scsi headers are a mix of userspace-facing and kernel-facing
declarations that can't be directly used by userspace.  The glibc
maintainers manually copy-and-pasted these definitions into their own
scsi headers and haven't substantially updated them in 15 years.  musl
has a similar set of definitions in its scsi headers.

This change generates the scsi headers from external/kernel-headers,
using the updated generation script so that the single modified scsi.h
takes the place of the non-modified one.

Change-Id: Ic14d155aa534b0edc1ee686d61113ce5cdf0e6af
2015-09-17 21:22:44 -07:00
Christopher Ferris
d9639559cc Merge "Add support for manually modified kernel headers." 2015-09-18 04:15:32 +00:00
Christopher Ferris
d12c332018 Add support for manually modified kernel headers.
This changes the scripts so that if some kernel files exists
in external/kernel-headers/modified, that they will be preferred
over the same files found in original. This is to support the case
where the kernel headers cannot be taken without some small modifications.

Included with this change, is a general cleanup of the python scripts.

This also modifies the generate uapi headers script to indicate if the
source of the modified headers has changed.

Change-Id: Id13523b244ced52a2ecd9f1399c43996dd8296fa
2015-09-17 21:02:52 -07:00
Dan Willemsen
353e7e5d11 Merge "Update Android.bp for setjmp cookies" 2015-09-17 22:34:35 +00:00
Dan Willemsen
35e91a10e0 Update Android.bp for setjmp cookies
Change-Id: I57245e4eedf9b8e1edc7de46208be5aa47c94b28
2015-09-17 15:28:45 -07:00
Douglas Leung
dccc40883a Fix mips FP abi bug in the linker.
Change-Id: I1ffab938eb06f9dc0963ee15bc10eca216618792
2015-09-17 15:17:06 -07:00
Josh Gao
57866a6dde Merge changes Iea8d03de,I2014f959
* changes:
  Implement setjmp cookies on x86_64.
  Implement setjmp cookies on x86.
2015-09-17 22:14:41 +00:00
Josh Gao
2342e643d4 Implement setjmp cookies on x86_64.
Bug: http://b/23942752
Change-Id: Iea8d03de1dd9ca5a128c072c94b10de3a8056348
2015-09-17 14:51:44 -07:00
Josh Gao
85c14fb086 Implement setjmp cookies on x86.
Bug: http://b/23942752
Change-Id: I2014f95989d0ab094b225234d98ccee477166c9d
2015-09-17 14:51:44 -07:00
Josh Gao
823cff847b Merge changes I81408ef0,Id0eb8d06
* changes:
  Implement setjmp cookies on AArch64.
  Implement setjmp cookies on ARM.
2015-09-17 21:09:23 +00:00
Josh Gao
54db0df8d6 Implement setjmp cookies on AArch64.
Bug: http://b/23942752
Change-Id: I81408ef0dd53010140b51e3083d357d3f2961112
2015-09-17 14:07:24 -07:00
Josh Gao
7fda8d2aa4 Implement setjmp cookies on ARM.
Reuse the top bits of _JB_SIGFLAG field previously used to store a
boolean to store a cookie that's validated by [sig]longjmp to make it
harder to use as a ROP gadget. Additionally, encrypt saved registers
with the cookie so that an attacker can't modify a register's value to
a specific value without knowing the cookie.

Bug: http://b/23942752
Change-Id: Id0eb8d06916e89d5d776bfcaa9458f8826717ba3
2015-09-17 14:07:24 -07:00
Dan Willemsen
90fc8e2487 Merge "Add Android.bp for libc/libm/libdl" 2015-09-17 19:31:07 +00:00
Yabin Cui
cbd0a15be8 Merge "Fix the way to get main thread stack start address." 2015-09-17 02:37:20 +00:00
Dan Willemsen
208ae17e5f Add Android.bp for libc/libm/libdl
Change-Id: I3537363849ba1244348996ff17c5ace1b95dbeee
2015-09-16 16:50:01 -07:00
Mor-sarid, Nitzan
569333293a Fix the way to get main thread stack start address.
For previous way to get the stack using the [stack] string from
/proc/self/task/<pid>/maps is not enough. On x86/x86_64, if an
alternative signal stack is used while a task switch happens,
the [stack] indicator may no longer be correct.

Instead, stack_start from /proc/self/stat which is always inside
the main stack, is used to find the main stack in /proc/self/maps.

Change-Id: Ieb010e71518b57560d541cd3b3563e5aa9660750
Signed-off-by: Nitzan Mor-sarid <nitzan.mor-sarid@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
2015-09-16 11:45:13 -07:00
Elliott Hughes
14545d4ce3 Merge "Move several FreeBSD functions to OpenBSD." 2015-09-15 15:13:35 +00:00
Elliott Hughes
44c8ac8bd7 Merge "Sync with upstream NetBSD lib/libc/regex." 2015-09-15 15:05:21 +00:00
Elliott Hughes
26a8322972 Move several FreeBSD functions to OpenBSD.
There's no difference between the two BSDs for these functions, so let's go
with the majority.

Change-Id: Ic296f23153a48bed5ad152f5b31989c4e00e60bd
2015-09-14 19:01:58 -07:00
Elliott Hughes
71927a8237 Sync with upstream NetBSD lib/libc/regex.
Bug: http://b/22850181
Change-Id: I11a51a2031e68a953ccd5691da98c699c7d01904
2015-09-14 18:45:52 -07:00
Dan Albert
cd0ed2f174 Merge "CMSG_DATA should return an unsigned char*." 2015-09-11 17:39:12 +00:00