From da2f3ba5211edcb535176b7c4384370f63a70d87 Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Wed, 18 Dec 2024 10:36:05 -0800 Subject: [PATCH] net_ib: fix out of bounds read in ncclIbGdrSupport on non-RDMA kernel Fixes #1469 --- src/transport/net_ib.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transport/net_ib.cc b/src/transport/net_ib.cc index 6d7778442..d3863da7a 100644 --- a/src/transport/net_ib.cc +++ b/src/transport/net_ib.cc @@ -586,7 +586,8 @@ ncclResult_t ncclIbGdrSupport() { // or created under a different path like `/sys/kernel/` or `/sys/` (depending on your ib_peer_mem module) const char* memory_peers_paths[] = {"/sys/kernel/mm/memory_peers/amdkfd/version", "/sys/kernel/memory_peers/amdkfd/version", - "/sys/memory_peers/amdkfd/version"}; + "/sys/memory_peers/amdkfd/version", + NULL}; int i = 0; while (memory_peers_paths[i]) {