Bug 1598951 Part 2 - Don't record random numbers in jemalloc, r=glandium.

Depends on D58437

Differential Revision: https://phabricator.services.mozilla.com/D58440

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Hackett 2020-01-10 05:26:10 +00:00
Родитель 3a7b9515de
Коммит f74708b30a
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -2810,8 +2810,12 @@ void* arena_t::MallocSmall(size_t aSize, bool aZero) {
// arc4random. So we temporarily disable mRandomizeSmallAllocations to
// skip this case and then re-enable it
mRandomizeSmallAllocations = false;
mozilla::Maybe<uint64_t> prngState1 = mozilla::RandomUint64();
mozilla::Maybe<uint64_t> prngState2 = mozilla::RandomUint64();
mozilla::Maybe<uint64_t> prngState1, prngState2;
{
mozilla::recordreplay::AutoEnsurePassThroughThreadEvents pt;
prngState1 = mozilla::RandomUint64();
prngState2 = mozilla::RandomUint64();
}
void* backing =
base_alloc(sizeof(mozilla::non_crypto::XorShift128PlusRNG));
mPRNG = new (backing) mozilla::non_crypto::XorShift128PlusRNG(
@ -3542,7 +3546,11 @@ arena_t* ArenaCollection::CreateArena(bool aIsPrivate,
// arena, stopping them from getting data they may want
while (true) {
mozilla::Maybe<uint64_t> maybeRandomId = mozilla::RandomUint64();
mozilla::Maybe<uint64_t> maybeRandomId;
{
mozilla::recordreplay::AutoEnsurePassThroughThreadEvents pt;
maybeRandomId = mozilla::RandomUint64();
}
MOZ_RELEASE_ASSERT(maybeRandomId.isSome());
// Keep looping until we ensure that the random number we just generated

Просмотреть файл

@ -10,6 +10,7 @@ SOURCES += [
'/mfbt/Assertions.cpp',
'/mfbt/Poison.cpp',
'/mfbt/RandomNum.cpp',
'/mfbt/RecordReplay.cpp',
'/mfbt/TaggedAnonymousMemory.cpp',
'/mfbt/Unused.cpp',
'Replay.cpp',