`RewindBlockIndex` reads `chainActive` (via `ChainActive()`) without holding `cs_main`:

https://github.com/bitcoin/bitcoin/blob/b2a6b0216192b6e8428f1a80b47f5178fccb961a/src/validation.cpp#L4314-L4331

(Please note that callers of `RewindBlockIndex` are _not_ allowed to hold `cs_main` since `RewindBlockIndex` indirectly calls `LimitValidationInterfaceQueue`.)
if (!AcceptBlockHeader(block, state, chainparams, &pindex))
        return false;
    
    
    
    bool fAlreadyHave = pindex->nStatus & BLOCK_HAVE_DATA;
    bool fHasMoreOrSameWork = (m_chain.Tip() ? pindex->nChainWork >= m_chain.Tip()->nChainWork : true);
    
    
    
    
    
    bool fTooFarAhead = (pindex->nHeight > int(m_chain.Height() + MIN_BLOCKS_TO_KEEP));
    
    
    
    
    
    
    if (fAlreadyHave) return true;
    if (!fRequested) {  
        if (pindex->nTx != 0) return true;    
        if (!fHasMoreOrSameWork) return true; 
        if (fTooFarAhead) return true;        
        
        
        
        
        if (pindex->nChainWork < nMinimumChainWork) return true;
    }