Skip to content

Commit ddee67c

Browse files
committed
[Macros] Update executable plugin sandbox profile to prohibit file-read
Except for dylibs.
1 parent e490466 commit ddee67c

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)