do not try to raise limits on-the-fly to avoid breaking the pledge(2)
This commit is contained in:
parent
246224933b
commit
3820ffb9c3
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.410 2019/02/22 16:48:13 robert Exp $
|
||||
# $OpenBSD: Makefile,v 1.411 2019/02/26 21:31:36 robert Exp $
|
||||
|
||||
.include <bsd.port.arch.mk>
|
||||
|
||||
@ -12,6 +12,7 @@ DPB_PROPERTIES+= lonesome
|
||||
COMMENT= Chromium browser
|
||||
|
||||
V= 72.0.3626.119
|
||||
REVISION= 0
|
||||
|
||||
DISTNAME= chromium-${V}
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
$OpenBSD: patch-base_allocator_partition_allocator_page_allocator_cc,v 1.1 2019/02/06 16:41:55 robert Exp $
|
||||
|
||||
Index: base/allocator/partition_allocator/page_allocator.cc
|
||||
--- base/allocator/partition_allocator/page_allocator.cc.orig
|
||||
+++ base/allocator/partition_allocator/page_allocator.cc
|
||||
@@ -114,7 +114,7 @@ void* AllocPages(void* address,
|
||||
uintptr_t align_base_mask = ~align_offset_mask;
|
||||
DCHECK(!(reinterpret_cast<uintptr_t>(address) & align_offset_mask));
|
||||
|
||||
-#if defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)
|
||||
+#if (defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)
|
||||
// On 64 bit Linux, we may need to adjust the address space limit for
|
||||
// guarded allocations.
|
||||
if (length >= kMinimumGuardedMemorySize) {
|
@ -1,34 +0,0 @@
|
||||
$OpenBSD: patch-base_allocator_partition_allocator_page_allocator_internals_posix_h,v 1.1 2019/02/06 16:41:55 robert Exp $
|
||||
|
||||
Index: base/allocator/partition_allocator/page_allocator_internals_posix.h
|
||||
--- base/allocator/partition_allocator/page_allocator_internals_posix.h.orig
|
||||
+++ base/allocator/partition_allocator/page_allocator_internals_posix.h
|
||||
@@ -14,7 +14,7 @@
|
||||
#if defined(OS_MACOSX)
|
||||
#include <mach/mach.h>
|
||||
#endif
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_BSD) || defined(OS_LINUX)
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <algorithm>
|
||||
@@ -48,8 +48,8 @@ int GetAccessFlags(PageAccessibilityConfiguration acce
|
||||
}
|
||||
}
|
||||
|
||||
-#if defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)
|
||||
-
|
||||
+#if (defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)
|
||||
+#define RLIMIT_AS RLIMIT_DATA
|
||||
// Multiple guarded memory regions may exceed the process address space limit.
|
||||
// This function will raise or lower the limit by |amount|.
|
||||
bool AdjustAddressSpaceLimit(int64_t amount) {
|
||||
@@ -134,7 +134,7 @@ void SetSystemPagesAccessInternal(
|
||||
void FreePagesInternal(void* address, size_t length) {
|
||||
CHECK(!munmap(address, length));
|
||||
|
||||
-#if defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)
|
||||
+#if (defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)
|
||||
// Restore the address space limit.
|
||||
if (length >= kMinimumGuardedMemorySize) {
|
||||
CHECK(AdjustAddressSpaceLimit(-base::checked_cast<int64_t>(length)));
|
Loading…
Reference in New Issue
Block a user