From 6070524ad5032505a9b907fedbd3bcbe73f2ce91 Mon Sep 17 00:00:00 2001 From: Maurizio Lombardi Date: Thu, 22 Feb 2024 14:53:26 +0100 Subject: [PATCH] Backport stack-smashing fix Resolves: RHEL-13107 Signed-off-by: Maurizio Lombardi --- ...ntation-fault-when-getting-host-init.patch | 29 +++++++++++++++++++ nvme-cli.spec | 7 ++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0004-nvme-Fixed-segmentation-fault-when-getting-host-init.patch diff --git a/0004-nvme-Fixed-segmentation-fault-when-getting-host-init.patch b/0004-nvme-Fixed-segmentation-fault-when-getting-host-init.patch new file mode 100644 index 0000000..0029be0 --- /dev/null +++ b/0004-nvme-Fixed-segmentation-fault-when-getting-host-init.patch @@ -0,0 +1,29 @@ +From 2f30d87d5c258fd97f78b0705bb92519d8a2498d Mon Sep 17 00:00:00 2001 +From: "da Cunha, Leonardo" +Date: Wed, 11 Oct 2023 09:01:44 -0700 +Subject: [PATCH] nvme: Fixed segmentation fault when getting host initiated + telemetry + +Signed-off-by: leonardo.da.cunha +--- + nvme.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/nvme.c b/nvme.c +index b9e56a48f0a5..73d74afdfd73 100644 +--- a/nvme.c ++++ b/nvme.c +@@ -851,6 +851,10 @@ static int __get_telemetry_log_host(struct nvme_dev *dev, + _cleanup_free_ struct nvme_telemetry_log *log = NULL; + int err; + ++ log = nvme_alloc(sizeof(*log)); ++ if (!log) ++ return -errno; ++ + err = nvme_cli_get_log_telemetry_host(dev, 0, + NVME_LOG_TELEM_BLOCK_SIZE, + log); +-- +2.39.3 + diff --git a/nvme-cli.spec b/nvme-cli.spec index 653d14a..f51199a 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,7 +3,7 @@ Name: nvme-cli Version: 2.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -13,6 +13,7 @@ Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Patch0: 0001-udev-rules-set-ctrl_loss_tmo-to-1-for-ONTAP-NVMe-TCP.patch Patch1: 0002-udev-rules-rename-netapp-udev-rule.patch Patch2: 0003-Revert-fabrics-Use-corresponding-hostid-when-hostnqn.patch +Patch3: 0004-nvme-Fixed-segmentation-fault-when-getting-host-init.patch BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ @@ -37,6 +38,7 @@ nvme-cli provides NVM-Express user space tooling for Linux. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} @@ -92,6 +94,9 @@ if [ $1 -eq 1 ] || [ $1 -eq 2 ]; then fi %changelog +* Thu Feb 22 2024 Maurizio Lombardi - 2.6-5 +- Fix for RHEL-13107 + * Mon Nov 13 2023 Maurizio Lombardi - 2.6-4 - Fix for RHEL-16216 (revert 1:1 mapping between hostnqn and hostid)