From 7fac014ff5178e1dddbe6a215594d944d0613a5c Mon Sep 17 00:00:00 2001 From: Kamal Heib Date: Fri, 25 Apr 2025 09:20:32 -0400 Subject: [PATCH] Fix data corruption in bnxt_re Resolves: RHEL-77285 Signed-off-by: Kamal Heib --- ...the-data-copy-during-the-low-latency.patch | 34 +++++++++++++++++++ rdma-core.spec | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch diff --git a/0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch b/0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch new file mode 100644 index 0000000..08ac16b --- /dev/null +++ b/0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch @@ -0,0 +1,34 @@ +From 9558f227b158291bc3eb7044938d711e388802ce Mon Sep 17 00:00:00 2001 +From: Selvin Xavier +Date: Mon, 10 Mar 2025 07:38:03 -0700 +Subject: [PATCH] bnxt_re/lib: Fix the data copy during the low latency push + path + +The pointer used in the destination buffer is not correctly +type casted, because of which the data gets corrupted while copying. +The issue is seen in the previous adapters that has the low latency +push enabled. Fixing the pointer casting. + +Fixes: 52d0870c3eac ("bnxt_re/lib: Enable low latency push") +Reported-By: Kamal Heib +Signed-off-by: Selvin Xavier +--- + providers/bnxt_re/main.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/providers/bnxt_re/main.h b/providers/bnxt_re/main.h +index 7a9d48e1cf01..067b0c18df8d 100644 +--- a/providers/bnxt_re/main.h ++++ b/providers/bnxt_re/main.h +@@ -598,7 +598,7 @@ static inline void bnxt_re_copy_data_to_pb(struct bnxt_re_push_buffer *pbuf, + int indx; + + for (indx = 0; indx < idx; indx++) { +- dst = (uintptr_t *)(pbuf->pbuf + 2 * (indx + offset)); ++ dst = (uintptr_t *)(pbuf->pbuf) + 2 * indx + offset; + src = (uintptr_t *)(pbuf->wqe[indx]); + mmio_write64(dst, *src); + +-- +2.49.0 + diff --git a/rdma-core.spec b/rdma-core.spec index ef1601f..bd9f9d4 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -10,6 +10,7 @@ Summary: RDMA core userspace libraries and daemons License: GPLv2 or BSD Url: https://github.com/linux-rdma/rdma-core Source: https://github.com/linux-rdma/rdma-core/releases/download/v%{version}/%{name}-%{version}.tar.gz +Patch0001: 0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch Patch9999: 9999-udev-keep-NAME_KERNEL-as-default-interface-naming-co.patch # Do not build static libs by default. %define with_static %{?_with_static: 1} %{?!_with_static: 0} @@ -280,6 +281,7 @@ easy, object-oriented access to IB verbs. %prep %setup -q +%patch 0001 -p1 %if 0%{?rhel} %patch 9999 -p1 %endif