diff --git a/.gitignore b/.gitignore index 7c40d6c..a8d57cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/perftest-4.2-0.8.g0e24e67.tar.gz +SOURCES/perftest-4.4-0.29.g817ec38.tar.gz diff --git a/.perftest.metadata b/.perftest.metadata index a346025..3e8bcdf 100644 --- a/.perftest.metadata +++ b/.perftest.metadata @@ -1 +1 @@ -398cb7cff2dfcf1d1e67a44c9bd4b98df9983e30 SOURCES/perftest-4.2-0.8.g0e24e67.tar.gz +26e318b80b7e2464a139a056332f2400864d4f61 SOURCES/perftest-4.4-0.29.g817ec38.tar.gz diff --git a/SOURCES/0001-Don-t-call-ibv_qp_to_qp_ex-when-hardware-does-not-su.patch b/SOURCES/0001-Don-t-call-ibv_qp_to_qp_ex-when-hardware-does-not-su.patch new file mode 100644 index 0000000..3751384 --- /dev/null +++ b/SOURCES/0001-Don-t-call-ibv_qp_to_qp_ex-when-hardware-does-not-su.patch @@ -0,0 +1,73 @@ +From d30e91efc80d058ddad80913f40dffb1e68c841b Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Fri, 24 Jul 2020 09:09:00 +0800 +Subject: [PATCH] Don't call ibv_qp_to_qp_ex when hardware does not support + extended QP + +The sizeof 'struct ibv_qp' allocated by ibv_create_qp is 160. +If the memory holds the 'struct ibv_qp' was allocated at the +upper boundary of a memory page, cast it to 'struct verbs_qp', +whose size is 360, may across the memory page boundary. It will +trigger invalid memory access to the next memory page. + +The issue can be reproduced with OPA and QIB HCA. + +For example run over OPA: + Server Node: $ ib_read_bw -F -N -n 1000 -u 20 -q 257 -s 4194304 + Client Node: $ ib_read_bw -F -N -n 1000 -u 20 -q 257 -s 4194304 + + Program received signal SIGSEGV, Segmentation fault. + ibv_qp_to_qp_ex (qp=0x5555557a5f10) at libibverbs/verbs.c:624 + 624 if (vqp->comp_mask & VERBS_QP_EX) + (gdb) bt + #0 ibv_qp_to_qp_ex (qp=0x5555557a5f10) at libibverbs/verbs.c:624 + #1 0x000055555556af4a in create_reg_qp_main (ctx=ctx@entry=0x7fffffffd500, user_param=user_param@entry=0x7fffffffd670, i=i@entry=21, num_of_qps=num_of_qps@entry=128) at src/perftest_resources.c:1597 + #2 0x000055555556b6d7 in create_qp_main (num_of_qps=, i=21, user_param=0x7fffffffd670, ctx=0x7fffffffd500) at src/perftest_resources.c:1613 + #3 ctx_init (ctx=0x7fffffffd500, user_param=0x7fffffffd670) at src/perftest_resources.c:1552 + #4 0x0000555555558e9c in main (argc=, argv=) at src/read_bw.c:149 + +624 if (vqp->comp_mask & VERBS_QP_EX) +(gdb) p qp +$1 = (struct ibv_qp *) 0x5555557a5f10 +(gdb) p vqp +$2 = (struct verbs_qp *) 0x5555557a5f10 +(gdb) p *qp +$3 = {context = 0x55555578ad00, qp_context = 0x0, .... +(gdb) p *vqp +Cannot access memory at address 0x5555557a6000 + +Signed-off-by: Honggang Li +--- + src/perftest_resources.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/src/perftest_resources.c b/src/perftest_resources.c +index 56b78bba2c4b..499820c93185 100755 +--- a/src/perftest_resources.c ++++ b/src/perftest_resources.c +@@ -1649,14 +1649,16 @@ int create_reg_qp_main(struct pingpong_context *ctx, + return FAILURE; + } + #ifdef HAVE_IBV_WR_API +- ctx->qpx[i] = ibv_qp_to_qp_ex(ctx->qp[i]); +- #ifdef HAVE_MLX5DV +- if (user_param->connection_type == DC) +- { +- ctx->dv_qp[i] = mlx5dv_qp_ex_from_ibv_qp_ex(ctx->qpx[i]); ++ if (!user_param->use_old_post_send) { ++ ctx->qpx[i] = ibv_qp_to_qp_ex(ctx->qp[i]); ++ #ifdef HAVE_MLX5DV ++ if (user_param->connection_type == DC) ++ { ++ ctx->dv_qp[i] = mlx5dv_qp_ex_from_ibv_qp_ex(ctx->qpx[i]); ++ } ++ #endif + } + #endif +- #endif + + return SUCCESS; + } +-- +2.25.4 + diff --git a/SOURCES/perftest-4.2-cflags.patch b/SOURCES/perftest-4.2-cflags.patch deleted file mode 100644 index 10613a9..0000000 --- a/SOURCES/perftest-4.2-cflags.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: perftest-4.2/configure.ac -=================================================================== ---- perftest-4.2.orig/configure.ac -+++ perftest-4.2/configure.ac -@@ -310,7 +310,7 @@ if [test $HAVE_EXP_OOO_ATTR = yes]; then - AC_DEFINE([HAVE_EXP_OOO_ATTR], [1], [Have Experimental Out of order data placement support]) - fi - --CFLAGS="-g -Wall -D_GNU_SOURCE -O3 $CFLAGS" -+CFLAGS+=" -g -Wall -D_GNU_SOURCE -O3 $CFLAGS" - LIBS=$LIBS" -lpthread" - AC_SUBST([LIBUMAD]) - AC_SUBST([LIBMATH]) diff --git a/SPECS/perftest.spec b/SPECS/perftest.spec index ec351bf..83ff363 100644 --- a/SPECS/perftest.spec +++ b/SPECS/perftest.spec @@ -1,16 +1,14 @@ Name: perftest Summary: IB Performance Tests -Version: 4.2 -%define minor_release 0.8 -%define git_hash g0e24e67 -Release: 2%{?dist} +Version: 4.4 +%define minor_release 0.29 +%define git_hash g817ec38 +Release: 3%{?dist} License: GPLv2 or BSD -Group: Productivity/Networking/Diagnostic Source0: https://github.com/linux-rdma/perftest/releases/download/V%{version}-%{minor_release}/perftest-%{version}-%{minor_release}.%{git_hash}.tar.gz Source1: ib_atomic_bw.1 -Patch1: perftest-4.2-cflags.patch +Patch1: 0001-Don-t-call-ibv_qp_to_qp_ex-when-hardware-does-not-su.patch Url: http://www.openfabrics.org -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libibverbs-devel > 1.1.4, librdmacm-devel > 1.0.14 BuildRequires: libibumad-devel > 1.3.6 BuildRequires: autoconf, automake, libtool @@ -32,7 +30,6 @@ autoreconf --force --install make V=1 %{?_smp_mflags} %install -rm -rf %{buildroot} for file in ib_{atomic,read,send,write}_{lat,bw}; do install -D -m 0755 $file %{buildroot}%{_bindir}/$file done @@ -48,12 +45,23 @@ done popd %files -%defattr(-, root, root) %doc README COPYING %{_bindir}/* %{_mandir}/man1/* %changelog +* Fri Jul 24 2020 Honggang Li - 4.4-3 +- Fix segment fault with large QP numbers +- Resolves: rhbz#1859358 + +* Mon May 25 2020 Honggang Li - 4.4-2 +- Update to upstream 4.4-0.29.g817ec38 tarball +- Resolves: rhbz#1832709 + +* Wed Apr 15 2020 Honggang Li - 4.4-1 +- Update to upstream 4.4-0.23.g89e176a tarball +- Resolves: rhbz#1817830 + * Mon Jul 23 2018 Jarod Wilson - 4.2-2 - Update to upstream 4.2-0.8.g0e24e67 tarball