From 942c6fc7b7807c46a56909b5596733892eae985c Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 11 Jan 2012 13:28:10 +0000 Subject: testing/firefox: try fix for grsec kernels https://bugs.gentoo.org/show_bug.cgi?id=396275 --- testing/firefox/APKBUILD | 4 +++- testing/firefox/ff9-aslr-fix.patch | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 testing/firefox/ff9-aslr-fix.patch (limited to 'testing/firefox') diff --git a/testing/firefox/APKBUILD b/testing/firefox/APKBUILD index 010e7b3044..d90976e9bb 100644 --- a/testing/firefox/APKBUILD +++ b/testing/firefox/APKBUILD @@ -4,7 +4,7 @@ pkgname=firefox pkgver=9.0.1 _pkgver=$pkgver _xulver=9.0.1 -pkgrel=0 +pkgrel=1 pkgdesc="firefox web browser" url="http://www.firefox.com" arch="all" @@ -49,6 +49,7 @@ subpackages="" source="http://releases.mozilla.org/pub/mozilla.org/${pkgname}/releases/${pkgver}/source/${pkgname}-${_pkgver}.source.tar.bz2 mozconfig firefox-5.0-asciidel.patch + ff9-aslr-fix.patch firefox.desktop firefox-safe.desktop" @@ -114,5 +115,6 @@ __EOF__ md5sums="7cf2bd379792a9b232267c6a79680566 firefox-9.0.1.source.tar.bz2 3ba2cb7cda675e78eb0eeb0652ee3457 mozconfig 2328df219e042f6aaec361cbf83cf9e9 firefox-5.0-asciidel.patch +96b40acd003a0a586e408bf09ae5af1d ff9-aslr-fix.patch ba96924ece1d77453e462429037a2ce5 firefox.desktop 6f38a5899034b7786cb1f75ad42032b8 firefox-safe.desktop" diff --git a/testing/firefox/ff9-aslr-fix.patch b/testing/firefox/ff9-aslr-fix.patch new file mode 100644 index 0000000000..4e4297d0ed --- /dev/null +++ b/testing/firefox/ff9-aslr-fix.patch @@ -0,0 +1,40 @@ +--- ./js/src/jsgcchunk.cpp 2011-12-22 17:13:21.000000000 +0000 ++++ ./js/src/jsgcchunk.cpp 2011-12-22 17:18:31.000000000 +0000 +@@ -213,7 +213,7 @@ + #elif defined(XP_UNIX) + + /* Required on Solaris 10. Might improve performance elsewhere. */ +-# if defined(SOLARIS) && defined(MAP_ALIGN) ++# if (defined(SOLARIS) && defined(MAP_ALIGN)) || defined(MOZ_MEMORY_LINUX) + # define JS_GC_HAS_MAP_ALIGN + + static void * +--- ./js/src/jsgcchunk.cpp 2011-12-22 17:55:24.000000000 +0000 ++++ ./js/src/jsgcchunk.cpp 2011-12-22 18:02:24.000000000 +0000 +@@ -226,12 +226,24 @@ + #ifdef SOLARIS + void *p = mmap((caddr_t) alignment, size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_NOSYNC | MAP_ALIGN | MAP_ANON, -1, 0); ++ if (p == MAP_FAILED) ++ return NULL; + #else +- void *p = mmap((void *) alignment, size, PROT_READ | PROT_WRITE, +- MAP_PRIVATE | MAP_NOSYNC | MAP_ALIGN | MAP_ANON, -1, 0); +-#endif ++ void *p = mmap(NULL, size + alignment, PROT_READ | PROT_WRITE, ++ MAP_PRIVATE | MAP_NOSYNC | MAP_ANON, -1, 0); + if (p == MAP_FAILED) + return NULL; ++ uintptr_t aligned_ret; ++ size_t extra_size; ++ ++ aligned_ret = (uintptr_t)p + alignment - 1; ++ aligned_ret &= ~(alignment - 1); ++ extra_size = aligned_ret - (uintptr_t)p; ++ munmap(p, extra_size); ++ munmap(p + extra_size + size, alignment - extra_size); ++ p = (void *)aligned_ret; ++#endif ++ + return p; + } -- cgit v1.2.3