summaryrefslogtreecommitdiff
path: root/HISTORY.md
diff options
context:
space:
mode:
authorjsteemann <jan@arangodb.com>2019-04-08 14:54:36 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-04-08 14:57:25 -0700
commit313e8772856524d1a05419b11e4837ed4030427b (patch)
treedd9b8b086d85a7fea3054f65f3072c77f6f8cc75 /HISTORY.md
parent0bb555630f5e85a1471843f8dc0dabec297c1c49 (diff)
fix reading encrypted files beyond file boundaries (#5160)
Summary: This fix should help reading from encrypted files if the file-to-be-read is smaller than expected. For example, when using the encrypted env and making it read a journal file of exactly 0 bytes size, the encrypted env code crashes with SIGSEGV in its Decrypt function, as there is no check if the read attempts to read over the file's boundaries (as specified originally by the `dataSize` parameter). The most important problem this patch addresses is however that there is no size underlow check in `CTREncryptionProvider::CreateCipherStream`: The stream to be read will be initialized to a size of always `prefix.size() - (2 * blockSize)`. If the prefix however is smaller than twice the block size, this will obviously assume a _very_ large stream and read over the bounds. The patch adds a check here as follows: // If the prefix is smaller than twice the block size, we would below read a // very large chunk of the file (and very likely read over the bounds) assert(prefix.size() >= 2 * blockSize); if (prefix.size() < 2 * blockSize) { return Status::Corruption("Unable to read from file " + fname + ": read attempt would read beyond file bounds"); } so embedders can catch the error in their release builds. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5160 Differential Revision: D14834633 Pulled By: sagar0 fbshipit-source-id: 47aa39a6db8977252cede054c7eb9a663b9a3484
Diffstat (limited to 'HISTORY.md')
-rw-r--r--HISTORY.md1
1 files changed, 1 insertions, 0 deletions
diff --git a/HISTORY.md b/HISTORY.md
index 6c5464d50..f2bdcda11 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -6,6 +6,7 @@
### Public API Change
### Bug Fixes
* Fix a bug in 2PC where a sequence of txn prepare, memtable flush, and crash could result in losing the prepared transaction.
+* Fix a bug in Encryption Env which could cause encrypted files to be read beyond file boundaries.
## 6.1.0 (3/27/2019)
### New Features