You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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]>
0 commit comments