Commit f2d183f4 authored by Anton Bikineev's avatar Anton Bikineev Committed by Chromium LUCI CQ

PartitionAlloc: Flag OOM in case PA fails to commit reserved memory.

For Windows, this is already handled.

Bug: 1162241
Change-Id: I157f6eb7a249fd8b930ac751807aa46b34914383
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2620258
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841879}
parent e7481ab5
......@@ -8,6 +8,7 @@
#include <errno.h>
#include <sys/mman.h>
#include "base/allocator/partition_allocator/oom.h"
#include "base/allocator/partition_allocator/partition_alloc_check.h"
#include "base/check_op.h"
#include "base/notreached.h"
......@@ -216,8 +217,11 @@ void SetSystemPagesAccessInternal(
void* address,
size_t length,
PageAccessibilityConfiguration accessibility) {
PA_PCHECK(0 == HANDLE_EINTR(
mprotect(address, length, GetAccessFlags(accessibility))));
const int ret =
HANDLE_EINTR(mprotect(address, length, GetAccessFlags(accessibility)));
if (ret == -1 && errno == ENOMEM)
OOM_CRASH(length);
PA_PCHECK(0 == ret);
}
void FreePagesInternal(void* address, size_t length) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment