summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorDave Burke <daveburke@google.com>2013-02-12 01:05:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-02-12 01:05:42 +0000
commit9e76a29752ff9d047e98c34c1cb93e7e2a27ebcd (patch)
tree02e321656f7fb5de0044a9b32bbdcf910abc2607 /init
parent79ebef0797370438674096ca02221ea7f5177ba6 (diff)
parenteb22e6a52b84f54756d069252858c7fb40c8a074 (diff)
downloadsystem_core-9e76a29752ff9d047e98c34c1cb93e7e2a27ebcd.zip
system_core-9e76a29752ff9d047e98c34c1cb93e7e2a27ebcd.tar.gz
system_core-9e76a29752ff9d047e98c34c1cb93e7e2a27ebcd.tar.bz2
Merge "Revert "Revert "init: Set ADDR_COMPAT_LAYOUT before spawning processes."""
Diffstat (limited to 'init')
-rwxr-xr-xinit/init.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c
index bfaf983..48d8559 100755
--- a/init/init.c
+++ b/init/init.c
@@ -31,6 +31,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <sys/personality.h>
#include <selinux/selinux.h>
#include <selinux/label.h>
@@ -241,6 +242,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);