Skip to content

Commit 53449f9

Browse files
committed
[GR-51177] Randomized entry points for untrusted code
PullRequest: graal/16526
2 parents 0a91558 + 84946c3 commit 53449f9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

docs/security/polyglot-sandbox.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,11 @@ Absent knowledge of the random key, the attacker cannot predict the encrypted co
464464

465465
GraalVM blinds all immediate values and data embedded in code pages of runtime compiled guest code down to a size of four bytes.
466466

467+
### Randomized Function Entry Points
468+
469+
A predictable code layout makes it easier for attackers to find gadgets that have been introduced, for example, via the aforementioned JIT spray attack.
470+
While runtime compiled methods are already placed in memory that is subject to address space layout randomization (ASLR) by the operating system, GraalVM additionally pads the starting offset of functions with a random number of trap instructions.
471+
467472
### Speculative Execution Attack Mitigations
468473

469474
Speculative execution attacks such as Spectre exploit the fact that a CPU may transiently execute instructions based on branch prediction information.
@@ -472,8 +477,7 @@ However, the execution may have caused side effects in the micro-architectural s
472477
For example, data may have been pulled into the cache during transient execution - a side-channel that can be read by timing data access.
473478

474479
GraalVM protects against Spectre attacks by inserting speculative execution barrier instructions in runtime compiled guest code to prevent attackers from crafting speculative execution gadgets.
475-
A speculative execution barrier is placed at each target of a conditional branch to stop speculative execution based on the pattern history table (Spectre V1).
476-
Speculative execution barriers are also placed at each possible indirect branch target to stop speculative execution based on the branch target buffer (Spectre V2).
480+
A speculative execution barrier is placed at each target of a conditional branch that is relevant to Java memory safety to stop speculative execution.
477481

478482
## Sharing Execution Engines
479483

sdk/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
This changelog summarizes major changes between GraalVM SDK versions. The main focus is on APIs exported by GraalVM SDK.
44

5+
## Version 24.1.0
6+
* GR-51177 Enable random offsets of runtime compiled function entry points for the UNTRUSTED polyglot sandbox policy.
7+
58
## Version 24.0.0
69
* (GR-49334) Deprecated the `FileSystems#allowLanguageHomeAccess()` method and introduced `FileSystem#allowInternalResourceAccess()` as a replacement. To ensure compatibility, both methods now provide support for language homes and internal resources.
710
* (GR-49386) Added `Value#readBuffer(long, byte[], int, int)` to enable bulk reads of buffers into byte arrays.

0 commit comments

Comments
 (0)