spark-instrumented-optimizer/common
Josh Rosen f340b6b306 [SPARK-22997] Add additional defenses against use of freed MemoryBlocks
## What changes were proposed in this pull request?

This patch modifies Spark's `MemoryAllocator` implementations so that `free(MemoryBlock)` mutates the passed block to clear pointers (in the off-heap case) or null out references to backing `long[]` arrays (in the on-heap case). The goal of this change is to add an extra layer of defense against use-after-free bugs because currently it's hard to detect corruption caused by blind writes to freed memory blocks.

## How was this patch tested?

New unit tests in `PlatformSuite`, including new tests for existing functionality because we did not have sufficient mutation coverage of the on-heap memory allocator's pooling logic.

Author: Josh Rosen <joshrosen@databricks.com>

Closes #20191 from JoshRosen/SPARK-22997-add-defenses-against-use-after-free-bugs-in-memory-allocator.
2018-01-10 00:45:47 -08:00
..
kvstore [MINOR] Fix a bunch of typos 2018-01-02 07:10:19 +09:00
network-common [SPARK-21475][CORE][2ND ATTEMPT] Change to use NIO's Files API for external shuffle service 2018-01-04 11:39:42 -08:00
network-shuffle [SPARK-21475][CORE][2ND ATTEMPT] Change to use NIO's Files API for external shuffle service 2018-01-04 11:39:42 -08:00
network-yarn [SPARK-17321][YARN] Avoid writing shuffle metadata to disk if NM recovery is disabled 2017-08-31 09:26:20 +08:00
sketch [MINOR] Fix a bunch of typos 2018-01-02 07:10:19 +09:00
tags [SPARK-20453] Bump master branch version to 2.3.0-SNAPSHOT 2017-04-24 21:48:04 -07:00
unsafe [SPARK-22997] Add additional defenses against use of freed MemoryBlocks 2018-01-10 00:45:47 -08:00