From 6d8b2421bc087f142a1edfb5f60a53040a5eac82 Mon Sep 17 00:00:00 2001 From: Rajat Chopra Date: Wed, 22 May 2019 21:19:36 -0700 Subject: [PATCH 1/2] Update debian dependencies in README (#228) 'fakeroot' is needed for building deb packages --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index abfd1cd..7f0a72f 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ To install NCCL on the system, create a package then install it as root. Debian/Ubuntu : ```shell $ # Install tools to create debian packages -$ sudo apt install build-essential devscripts debhelper +$ sudo apt install build-essential devscripts debhelper fakeroot $ # Build NCCL deb package $ make pkg.debian.build $ ls build/pkg/deb/ From 37e4f8729e5e6604ab739b2353064139af43fe2d Mon Sep 17 00:00:00 2001 From: Felix Abecassis Date: Fri, 21 Jun 2019 01:25:08 -0700 Subject: [PATCH 2/2] Fix out-of-bounds read in ncclStrToCpuset (#233) The affinityStr string was not null-terminated but was passed to strlen(3). Signed-off-by: Felix Abecassis --- src/init.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/init.cc b/src/init.cc index 80af287..66a4865 100644 --- a/src/init.cc +++ b/src/init.cc @@ -879,10 +879,12 @@ static ncclResult_t getCpuGpuAffinity(int cudaDev, cpu_set_t* mask) { path[PATH_MAX-1] = '\0'; int fd; SYSCHECKVAL(open(path, O_RDONLY), "open", fd); - char affinityStr[sizeof(cpu_set_t)*2]; + char affinityStr[sizeof(cpu_set_t)*2 + 1]; int r = read(fd, affinityStr, sizeof(cpu_set_t)*2); - if (r > 0) + if (r > 0) { + affinityStr[r] = '\0'; NCCLCHECK(ncclStrToCpuset(affinityStr, mask)); + } close(fd); free(cudaPath); return ncclSuccess;