Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use-after-free in hashtableTwoPhasePopDelete #1626

Merged

Conversation

zuiderkwast
Copy link
Contributor

Use-after-free has been detect by address sanitizer, such as in this test run:

https://github.com/valkey-io/valkey/actions/runs/12981530413/job/36200075972?pr=1620#step:5:1339

hashtableShrinkIfNeeded may free one of the hash tables and invalidate the variables used by the fillBucketHole(ht, b, pos_in_bucket, table_index) just after, causing use-after-free. Fill bucket hole first and shrink afterwards is assumed to solve the issue. (Not reproduced locally.)

@zuiderkwast zuiderkwast added the test-failure An issue indicating a test failure label Jan 27, 2025
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.01%. Comparing base (a18fcdb) to head (3daefd7).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1626      +/-   ##
============================================
+ Coverage     70.84%   71.01%   +0.17%     
============================================
  Files           121      121              
  Lines         65169    65169              
============================================
+ Hits          46172    46283     +111     
+ Misses        18997    18886     -111     
Files with missing lines Coverage Δ
src/hashtable.c 78.08% <100.00%> (-0.43%) ⬇️

... and 8 files with indirect coverage changes

@zuiderkwast zuiderkwast merged commit 7699a3a into valkey-io:unstable Jan 27, 2025
50 checks passed
@zuiderkwast zuiderkwast deleted the hashtable-shrink-after-fill-holes branch January 27, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-failure An issue indicating a test failure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants