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

health-check lacks iterator validation vulnerability #4327

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ydb/core/health_check/health_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1487,12 +1487,16 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
void FillVDiskStatus(const TString& vSlotId, Ydb::Monitoring::StorageVDiskStatus& storageVDiskStatus, TSelfCheckContext context) {
auto itVSlot = BSConfigVSlots.find(vSlotId);
const TEvInterconnect::TNodeInfo* nodeInfo = nullptr;

context.Location.mutable_storage()->mutable_pool()->mutable_group()->mutable_vdisk()->mutable_id()->Clear();
context.Location.mutable_storage()->mutable_pool()->mutable_group()->clear_id(); // you can see VDisks Group Id in vSlotId field
if (itVSlot != BSConfigVSlots.end()) {
TNodeId nodeId = itVSlot->second->vslotid().nodeid();
auto itNodeInfo = MergedNodeInfo.find(nodeId);
if (itNodeInfo != MergedNodeInfo.end()) {
nodeInfo = itNodeInfo->second;
}
context.Location.mutable_storage()->mutable_pool()->mutable_group()->mutable_vdisk()->add_id(GetVDiskId(*itVSlot->second));
context.Location.mutable_storage()->mutable_node()->set_id(nodeId);
} else {
context.Location.mutable_storage()->mutable_node()->clear_id();
Expand All @@ -1505,10 +1509,6 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
context.Location.mutable_storage()->mutable_node()->clear_port();
}

context.Location.mutable_storage()->mutable_pool()->mutable_group()->mutable_vdisk()->mutable_id()->Clear();
context.Location.mutable_storage()->mutable_pool()->mutable_group()->mutable_vdisk()->add_id(GetVDiskId(*itVSlot->second));
context.Location.mutable_storage()->mutable_pool()->mutable_group()->clear_id(); // you can see VDisks Group Id in vSlotId field

storageVDiskStatus.set_id(vSlotId);

if (itVSlot == BSConfigVSlots.end()) { // this report, in theory, can't happen because there was slot mention in bsc group info. this slot info have to exists in bsc too
Expand Down
Loading