Skip to content

Commit 08207ee

Browse files
authored
Merge pull request #63952 from rintaro/macros-sandbox-read-dylib
[Macros] Update executable plugin sandbox profile to prohibit file-read
2 parents f20eaac + ddee67c commit 08207ee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Basic/Sandbox.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ static StringRef sandboxProfile(llvm::BumpPtrAllocator &Alloc) {
2121
// Import the system sandbox profile.
2222
contents += "(import \"system.sb\")\n";
2323

24-
// Allow reading all files, we need to read various system files.
25-
contents += "(allow file-read*)\n";
24+
// Allow reading file metadata of any files.
25+
contents += "(allow file-read-metadata)\n";
26+
27+
// Allow reading dylibs.
28+
contents += "(allow file-read* (regex #\"\\.dylib$\"))\n";
2629

2730
// This is required to launch any processes (execve(2)).
2831
contents += "(allow process-exec*)\n";

0 commit comments

Comments
 (0)