From 1023a6e4e674d3bd93ce5c9a19c01b8ef156aaaa Mon Sep 17 00:00:00 2001 From: SiXiang Jing Date: Wed, 5 Nov 2025 07:45:16 +0000 Subject: [PATCH] lib/nvmf: fix CVE-2025-57275 Signed-off-by: SiXiang Jing --- ...umber-of-NVMe-oF-registrants-when-up.patch | 35 +++++++++++++++++++ spdk.spec | 6 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0031-lib-nvmf-limit-number-of-NVMe-oF-registrants-when-up.patch diff --git a/0031-lib-nvmf-limit-number-of-NVMe-oF-registrants-when-up.patch b/0031-lib-nvmf-limit-number-of-NVMe-oF-registrants-when-up.patch new file mode 100644 index 0000000..7938e94 --- /dev/null +++ b/0031-lib-nvmf-limit-number-of-NVMe-oF-registrants-when-up.patch @@ -0,0 +1,35 @@ +From 9745f696d0e0c1839da6426fba155c60a49051f1 Mon Sep 17 00:00:00 2001 +From: Tomasz Zawadzki +Date: Thu, 6 Nov 2025 03:49:34 +0800 +Subject: [PATCH] [Backport]NVMF: lib nvmf limit number of NVMe-oF registrants when up +Reference:https://gitee.com/src-openeuler/spdk/commit/1deb6ee549ad8193718a2fe17891fa6bb8a5a79d +Conflict:no +--- + lib/nvmf/subsystem.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + + +diff --git a/lib/nvmf/subsystem.c b/lib/nvmf/subsystem.c +index 5729524..9f94e0d 100644 +--- a/lib/nvmf/subsystem.c ++++ b/lib/nvmf/subsystem.c +@@ -1994,9 +1994,14 @@ nvmf_ns_update_reservation_info(struct spdk_nvmf_ns *ns) + } + + TAILQ_FOREACH_SAFE(reg, &ns->registrants, link, tmp) { +- spdk_uuid_fmt_lower(info.registrants[i].host_uuid, sizeof(info.registrants[i].host_uuid), +- ®->hostid); +- info.registrants[i++].rkey = reg->rkey; ++ if (i < SPDK_NVMF_MAX_NUM_REGISTRANTS) { ++ spdk_uuid_fmt_lower(info.registrants[i].host_uuid, sizeof(info.registrants[i].host_uuid), ++ ®->hostid); ++ info.registrants[i++].rkey = reg->rkey; ++ } else { ++ SPDK_ERRLOG("More registrants that can fit into reservation info, truncating\n"); ++ break; ++ } + } + + info.num_regs = i; +-- +2.43.0 diff --git a/spdk.spec b/spdk.spec index 81941eb..7f8654e 100644 --- a/spdk.spec +++ b/spdk.spec @@ -3,7 +3,7 @@ Name: spdk Version: 21.01.1 -Release: 17 +Release: 18 Summary: Set of libraries and utilities for high performance user-mode storage License: BSD and MIT URL: http://spdk.io @@ -38,6 +38,7 @@ Patch27: 0027--nvme-cuse-Add-ctrlr_lock-for-cuse-register-and-unreg.patch Patch28: 0028-fixed-use-after-free-detected-by-Coverity.patch Patch29: 0029-scripts-Do-msr-existence-check-only-on-x86_64-machin.patch Patch30: 0030-vhost-add-vhost-interrupt-coalescing-based-on-virtio.patch +Patch31: 0031-lib-nvmf-limit-number-of-NVMe-oF-registrants-when-up.patch %define package_version %{version}-%{release} @@ -208,6 +209,9 @@ mv doc/output/html/ %{install_docdir} %changelog +* Wed Nov 5 2025 SiXiang Jing - 21.01.1-18 +- lib/nvmf: fix CVE-2025-57275 + * Sat May 10 2025 jiaqingtong - 21.01.1-17 - vhost: add vhost interrupt coalescing model -- Gitee