-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-5606] (Backport) Failed ctxu may mutate cache
CR Number 2: Backported for v1.0.2 The configtx code maintains a map of the current config, as derived from the Config proto structure. This map stores references to a cached Config proto structure which is used when constructing the next Config structure. The problem arises when this map is used to construct a new Config to be applied, that it mutates the cached version of of the Config. This is generally fine, so long as the new Config applies successfully, but in the event of bad inputs, such as a bad certificate, the config update fails to apply and is rolled back, but the cache has been mutated and will not be rolled back with it. The observed issue occurs because this Config cache is also used in creating the new channel config template. So, because there is a bad certificate in the config cache, the new channel template attempts to bootstrap using the bad key material, detects the error, and aborts. As noted in the issue, restarting the orderer rebuilds this cache, and channel creation can occur normally once more. This CR fixes the code which constructs a new Config from the config map to create a copy of the cached config in-process, rather than taint the cache with potentially invalid data. Note, there may be novel ways to corrupt this cache which could cause other undesirable behavior. However, prior to the operation which mutates the cache, the config update has been validated to adheer to the security constraints of the channel (including all necessary admin signatures), so it requires in a sense, a conspiracy of channel administrators attempting to corrupt their own channel, so the security implications are limited or non-existant. Change-Id: I56bf6c8bc204785ef6634fd0352466ad3ab6d2af Signed-off-by: Jason Yellick <[email protected]>
- Loading branch information
Jason Yellick
committed
Aug 4, 2017
1 parent
2cab745
commit 0631ccd
Showing
4 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters