From e949923e0eb3afd07f26badd329401a664d41137 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 2 Jul 2020 16:14:49 +0800 Subject: [PATCH 1/2] fix build error --- 0000-extend-fdesc-array.patch | 4 ++-- fix-stringop-truncation-build-error.patch | 13 +++++++++++++ libpsm2.spec | 8 ++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 fix-stringop-truncation-build-error.patch diff --git a/0000-extend-fdesc-array.patch b/0000-extend-fdesc-array.patch index 4729057..1ecc90b 100644 --- a/0000-extend-fdesc-array.patch +++ b/0000-extend-fdesc-array.patch @@ -1,5 +1,5 @@ ---- psm_utils.c.orig 2018-03-14 21:12:33.678607767 -0400 -+++ psm_utils.c 2018-03-14 21:11:04.696909162 -0400 +--- a/psm_utils.c 2018-03-14 21:12:33.678607767 -0400 ++++ b/psm_utils.c 2018-03-14 21:11:04.696909162 -0400 @@ -951,7 +951,7 @@ struct psmi_faultinj_spec *psmi_faultinj union psmi_envvar_val env_fi; char fvals_str[128]; diff --git a/fix-stringop-truncation-build-error.patch b/fix-stringop-truncation-build-error.patch new file mode 100644 index 0000000..15ee17d --- /dev/null +++ b/fix-stringop-truncation-build-error.patch @@ -0,0 +1,13 @@ +diff -Naur opa-psm2-PSM2_10.3.58/psm_ep.c opa-psm2-PSM2_10.3.58_new/psm_ep.c +--- opa-psm2-PSM2_10.3.58/psm_ep.c 2018-05-08 03:44:29.000000000 +0800 ++++ opa-psm2-PSM2_10.3.58_new/psm_ep.c 2020-07-01 17:09:40.229405374 +0800 +@@ -1495,8 +1495,7 @@ + + b_new = (char *)devstr; + e = b_new + len; +- strncpy(e, devstring, len - 1); +- e[len - 1] = '\0'; ++ strncpy(e, devstring, len); + ee = e + len; + i = 0; + while (e < ee && *e && i < PTL_MAX_INIT) { diff --git a/libpsm2.spec b/libpsm2.spec index 500dc3e..6df1a6a 100644 --- a/libpsm2.spec +++ b/libpsm2.spec @@ -1,6 +1,6 @@ Name: libpsm2 Version: 10.3.58 -Release: 5 +Release: 6 Summary: Intel PSM Libraries License: BSD or GPLv2 URL: https://github.com/01org/opa-psm2/ @@ -8,6 +8,7 @@ URL: https://github.com/01org/opa-psm2/ Source0: https://github.com/intel/opa-psm2/archive/PSM2_10.3.58.tar.gz #extend fdesc array Patch0: 0000-extend-fdesc-array.patch +Patch1: fix-stringop-truncation-build-error.patch ExclusiveArch: x86_64 BuildRequires: libuuid-devel numactl-devel @@ -37,7 +38,7 @@ Development package for the Intel PSM library Support for MPIs linked with PSM versions less than 2 %prep -%autosetup -n opa-psm2-PSM2_10.3.58 -p0 +%autosetup -n opa-psm2-PSM2_10.3.58 -p1 %build %make_build @@ -72,6 +73,9 @@ rm -f %{buildroot}%{_libdir}/*.a %{_sysconfdir}/modprobe.d/libpsm2-compat.conf %changelog +* Thu Jul 02 2020 lingsheng - 10.3.58-6 +- Fix stringop-truncation build error + * Tue Mar 17 2020 yanglijin - 10.3.58-5 - fix provides -- Gitee From 0ac6691531279d1bbfb0281116785cff3f95086a Mon Sep 17 00:00:00 2001 From: root Date: Thu, 2 Jul 2020 16:21:13 +0800 Subject: [PATCH 2/2] fix build error --- libpsm2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpsm2.spec b/libpsm2.spec index 6df1a6a..d4a9afa 100644 --- a/libpsm2.spec +++ b/libpsm2.spec @@ -73,7 +73,7 @@ rm -f %{buildroot}%{_libdir}/*.a %{_sysconfdir}/modprobe.d/libpsm2-compat.conf %changelog -* Thu Jul 02 2020 lingsheng - 10.3.58-6 +* Thu Jul 02 2020 senlin - 10.3.58-6 - Fix stringop-truncation build error * Tue Mar 17 2020 yanglijin - 10.3.58-5 -- Gitee