-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Limit manifest's change set size #490
Comments
Reasoning? |
The same as the one described in vulnerability number 1 of the ALICE post which the cited PR fixes.
|
I see. Good catch. |
What I would like to understand is why this wasn't caught with the (current and previous) Tove/ALICE tests. |
ALICE would have to see a lot of writes going into MANIFEST, which doesn't happen as often as writes which go into the value log. If run long enough, on a powerful machine, this might trigger, I reckon. There's a time gap between write and sync, a crash should happen at that time and must leave some garbage data appended to the file. |
This seems like a serious issue, so I'd like to have you @manishrjain check whether it's indeed something we should fix or it's not relevant to the current codebase anymore. |
This PR limits the amount of memory we allocated for reading the manifest changes set's size. When a manifest file is corrupted, in the worst case we might end up allocating more than 4GB. This PR ensures we don't over-allocate the byte slice. Fixes #490
This PR limits the amount of memory we allocated for reading the manifest changes set's size. When a manifest file is corrupted, in the worst case we might end up allocating more than 4GB. This PR ensures we don't over-allocate the byte slice. Fixes hypermodeinc/badger#490
(In a similar way as it was done for the value log replay.)
https://github.com/dgraph-io/badger/blob/dc0df253d239ff6abe3ffbbcdf3cb1e49e646369/manifest.go#L356-L357
The text was updated successfully, but these errors were encountered: