Skip to content

Commit

Permalink
[fix] resolve potential attack in linker connection building (#6752)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyu1994 authored Dec 14, 2024
1 parent 53e0ddf commit b33a12e
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 b33a12e

Please sign in to comment.