diff --git a/backport-exit-exec-in-child-process-if-setup-fails.patch b/backport-exit-exec-in-child-process-if-setup-fails.patch new file mode 100644 index 0000000000000000000000000000000000000000..024cf36495758b2454f7d40d23aa9e1d026db2a1 --- /dev/null +++ b/backport-exit-exec-in-child-process-if-setup-fails.patch @@ -0,0 +1,34 @@ +From c4a5ac8bba611206e062c0955fb605bfc0f48b0f Mon Sep 17 00:00:00 2001 +From: Mark Zhang +Date: Fri, 26 Apr 2024 14:17:55 +0300 +Subject: [PATCH] librdmacm: Fix an overflow bug in qsort comparison function + +The comparison function dev_cmp() doesn't work with 64b pointers in some +cases, as it casts the pointer to int. For example it's not able to sort +this list: + {0xfffe0c2f0b00, 0xaaac741b4a90, 0xaaac741b4d70} + +Fixes: e5d371cb0af0 ("librdmacm: Globally store and sort IB device list") +Signed-off-by: Mark Zhang +Reviewed-by: Leon Romanovsky +Signed-off-by: Yishai Hadas +--- + librdmacm/cma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librdmacm/cma.c b/librdmacm/cma.c +index 53ec833..2d83fa7 100644 +--- a/librdmacm/cma.c ++++ b/librdmacm/cma.c +@@ -310,7 +310,7 @@ static void remove_cma_dev(struct cma_device *cma_dev) + + static int dev_cmp(const void *a, const void *b) + { +- return (int)(*(char *const *)a - *(char *const *)b); ++ return (*(uintptr_t *)a > *(uintptr_t *)b) - (*(uintptr_t *)a < *(uintptr_t *)b); + } + + static int sync_devices_list(void) +-- +2.27.0 + diff --git a/rdma-core.spec b/rdma-core.spec index dae16298c5609a9a14ee71ee4c297146dbb4a4b5..ba23e30e5c89a380ec4f991fd1ae35090a282882 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -1,6 +1,6 @@ Name: rdma-core Version: 35.1 -Release: 4 +Release: 5 Summary: RDMA core userspace libraries and daemons License: GPLv2 or BSD Url: https://github.com/linux-rdma/rdma-core @@ -17,6 +17,7 @@ Patch7: 0007-libhns-Add-support-for-direct-wqe.patch Patch8: 0008-libhns-Use-new-SQ-doorbell-register-for-HIP09.patch Patch9: 0009-rdma-core-Add-sw64-architecture.patch Patch10: 0010-add-loongarch64-support-for-rdma-core.patch +Patch11: backport-exit-exec-in-child-process-if-setup-fails.patch BuildRequires: binutils cmake >= 2.8.11 gcc libudev-devel pkgconfig pkgconfig(libnl-3.0) BuildRequires: pkgconfig(libnl-route-3.0) valgrind-devel systemd systemd-devel @@ -261,6 +262,12 @@ fi %{_mandir}/* %changelog +* Tue Jun 18 2024 zhangyaqi - 35.1-5 +- Type:feature +- ID:NA +- SUG:NA +- DESC:Exit exec in child process if setup fails + * Thu Mar 16 2023 Wenlong Zhang - 35.1-4 - Type:feature - CVE:NA