From eb22e6a52b84f54756d069252858c7fb40c8a074 Mon Sep 17 00:00:00 2001 From: Dave Burke Date: Mon, 11 Feb 2013 19:48:43 +0000 Subject: [PATCH] Revert "Revert "init: Set ADDR_COMPAT_LAYOUT before spawning processes."" This reverts commit 87980b5c9fab12737196b8505e948186a210d96e Getting more reports of app crashes (e.g. 7990090), so given timeline for MR2, want to revert. Change-Id: Ic2d101d2d1156b3864d5c9b88aa8c94cd5aa345f --- init/init.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/init/init.c b/init/init.c index 6127fd38e..1c80d9cc4 100755 --- a/init/init.c +++ b/init/init.c @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef HAVE_SELINUX #include @@ -242,6 +243,21 @@ void service_start(struct service *svc, const char *dynamic_args) int fd, sz; umask(077); +#ifdef __arm__ + /* + * b/7188322 - Temporarily revert to the compat memory layout + * to avoid breaking third party apps. + * + * THIS WILL GO AWAY IN A FUTURE ANDROID RELEASE. + * + * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7dbaa466 + * changes the kernel mapping from bottom up to top-down. + * This breaks some programs which improperly embed + * an out of date copy of Android's linker. + */ + int current = personality(0xffffFFFF); + personality(current | ADDR_COMPAT_LAYOUT); +#endif if (properties_inited()) { get_property_workspace(&fd, &sz); sprintf(tmp, "%d,%d", dup(fd), sz);