Fix fuzzer found null-deref in memory_quota (#27648)

pull/27609/head
Craig Tiller 3 years ago committed by GitHub
parent 8d8d07139c
commit 3dc5528c50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/lib/resource_quota/memory_quota.cc
  2. 1601
      test/core/resource_quota/memory_quota_fuzzer_corpus/testcase-replenish-nullchk
  3. 15
      test/core/resource_quota/memory_quota_fuzzer_corpus/testcase-replenish-nullchk-after-creduce

@ -376,7 +376,7 @@ void BasicMemoryQuota::Take(size_t amount) {
auto prior = free_bytes_.fetch_sub(amount, std::memory_order_acq_rel);
// If we push into overcommit, awake the reclaimer.
if (prior >= 0 && prior < static_cast<intptr_t>(amount)) {
reclaimer_activity_->ForceWakeup();
if (reclaimer_activity_ != nullptr) reclaimer_activity_->ForceWakeup();
}
}

@ -0,0 +1,15 @@
actions {
create_quota {}
}
actions {
create_allocator {}
}
actions{set_quota_size : 790} actions {
delete_quota {}
}
actions {
create_allocation {
max:
2
}
}
Loading…
Cancel
Save