diff --git a/0110-rxe-Fix-double-unlock-in-cq_ex-polling.patch b/0110-rxe-Fix-double-unlock-in-cq_ex-polling.patch new file mode 100644 index 0000000000000000000000000000000000000000..b0060aacab2627c515cbf72f778d78af0c987989 --- /dev/null +++ b/0110-rxe-Fix-double-unlock-in-cq_ex-polling.patch @@ -0,0 +1,35 @@ +From a72017437919e7b980a05b11a391c0a74c1cfac9 Mon Sep 17 00:00:00 2001 +From: Justin Funston +Date: Tue, 24 Jun 2025 10:23:18 -0700 +Subject: [PATCH 1/2] rxe: Fix double unlock in cq_ex polling + +[ Upstream commit 5e7aa41022adb9f8ab8de1edf5ab2f5ed412e97a ] + +Fix a bug in rxe cq_ex polling where the cq lock is unlocked twice causing +undefined behavior. According the man page, the user should call +`cq_end_poll` even if `cq_next_poll` returns ENOENT. This fix removes the +`pthread_spin_unlock` call in `cq_next_poll` so that it is correctly +called only once in `cq_end_poll`. + +Fixes: e3af50b ("Provider/rxe: Implement Ibv_create_cq_ex verb") +Signed-off-by: Justin Funston +Signed-off-by: Nicolas Morey +--- + providers/rxe/rxe.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/providers/rxe/rxe.c b/providers/rxe/rxe.c +index f17558946..0dbb007e5 100644 +--- a/providers/rxe/rxe.c ++++ b/providers/rxe/rxe.c +@@ -270,7 +270,6 @@ static int cq_next_poll(struct ibv_cq_ex *current) + + if (check_cq_queue_empty(cq)) { + store_consumer_index(cq->queue, cq->cur_index); +- pthread_spin_unlock(&cq->lock); + errno = ENOENT; + return errno; + } +-- +2.25.1 + diff --git a/rdma-core.spec b/rdma-core.spec index 33773defd99cacdcc27f3992bcca5f2a452e4ecb..0f85638f46ff51cbc3aa04064c980118f15ca72b 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -1,6 +1,6 @@ Name: rdma-core Version: 41.0 -Release: 40 +Release: 41 Summary: RDMA core userspace libraries and daemons License: GPLv2 or BSD Url: https://github.com/linux-rdma/rdma-core @@ -115,6 +115,7 @@ patch106: 0106-libhns-Clean-up-DCA-magic-number-warnings.patch patch107: 0107-libhns-Clean-up-space-tab-blank-line-warnings.patch patch108: 0108-libhns-Fix-wrong-WQE-data-when-QP-wraps-around.patch patch109: 0109-libhns-Fix-wrong-WQE-data-in-new-post-send-API-when-.patch +patch110: 0110-rxe-Fix-double-unlock-in-cq_ex-polling.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 @@ -367,6 +368,12 @@ fi %{_mandir}/* %changelog +* Tue Nov 11 2025 huangwenhua - 41.0-41 +- Type: bugfix +- ID: NA +- SUG: NA +- DESC: rxe: Fix double unlock in cq_ex polling + * Mon Nov 10 2025 Donghua Huang - 41.0-40 - Type: bugfix - ID: NA