[scudo] Do not unmap the memory containing the this object in unmapRingBuffer (#83034)

This commit is contained in:
Fabio D'Urso 2024-02-27 00:00:20 +01:00 committed by GitHub
parent 54cff50791
commit cda413087c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1610,8 +1610,12 @@ private:
// is very important.
RB->RawStackDepotMap.unmap(RB->RawStackDepotMap.getBase(),
RB->RawStackDepotMap.getCapacity());
RB->RawRingBufferMap.unmap(RB->RawRingBufferMap.getBase(),
RB->RawRingBufferMap.getCapacity());
// Note that the `RB->RawRingBufferMap` is stored on the pages managed by
// itself. Take over the ownership before calling unmap() so that any
// operation along with unmap() won't touch inaccessible pages.
MemMapT RawRingBufferMap = RB->RawRingBufferMap;
RawRingBufferMap.unmap(RawRingBufferMap.getBase(),
RawRingBufferMap.getCapacity());
atomic_store(&RingBufferAddress, 0, memory_order_release);
}