Skip to content

Commit

Permalink
PolicyBuilder: Allow MADV_SEQUENTIAL in AllowLimitedMadvise()
Browse files Browse the repository at this point in the history
This is sometimes used to hint to the kernel that pages will be access sequentially and thus might be swapped out after read.
This is a useful annotation for read-ahead caches and is used by, for example, TinyVMM/Vanadium

PiperOrigin-RevId: 644729625
Change-Id: I770c86f271f7c7dd6eae563db85f1a53059ddf86
  • Loading branch information
cblichmann authored and copybara-github committed Jun 19, 2024
1 parent 131826f commit 0f282a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sandboxed_api/sandbox2/policybuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ PolicyBuilder& PolicyBuilder::AllowLimitedMadvise() {
allowed_complex_.limited_madvise = true;
return AddPolicyOnSyscall(__NR_madvise, {
ARG_32(2),
JEQ32(MADV_SEQUENTIAL, ALLOW),
JEQ32(MADV_DONTNEED, ALLOW),
JEQ32(MADV_REMOVE, ALLOW),
JEQ32(MADV_HUGEPAGE, ALLOW),
Expand Down

0 comments on commit 0f282a2

Please sign in to comment.