Skip to content

Commit

Permalink
resolve potential attack in linker connection building
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyu1994 committed Dec 13, 2024
1 parent 53e0ddf commit 916c887
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/network/linkers_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ void Linkers::ListenThread(int incoming_cnt) {
}
int* ptr_in_rank = reinterpret_cast<int*>(buffer);
int in_rank = *ptr_in_rank;
if (in_rank < 0 && in_rank >= num_machines_) {
Log::Fatal("Invalid rank %d found during initialization of linkers. The world size is %d", in_rank, num_machines_);
}
// add new socket
SetLinker(in_rank, handler);
++connected_cnt;
Expand Down

0 comments on commit 916c887

Please sign in to comment.