From fa25aed975c4b134d4417785cbad693ba54e0b98 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Tue, 5 Nov 2024 03:53:55 +0300 Subject: [PATCH] import device-mapper-multipath-0.9.9-4.el10 --- ...ix-ontap-prioritizer-snprintf-limits.patch | 77 +++++++++++++++++++ SPECS/device-mapper-multipath.spec | 14 +++- 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0015-libmultipath-fix-ontap-prioritizer-snprintf-limits.patch diff --git a/SOURCES/0015-libmultipath-fix-ontap-prioritizer-snprintf-limits.patch b/SOURCES/0015-libmultipath-fix-ontap-prioritizer-snprintf-limits.patch new file mode 100644 index 0000000..b112cad --- /dev/null +++ b/SOURCES/0015-libmultipath-fix-ontap-prioritizer-snprintf-limits.patch @@ -0,0 +1,77 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 7 Aug 2024 18:59:10 -0400 +Subject: [PATCH] libmultipath: fix ontap prioritizer snprintf limits + +The ontap prioritizer functions dump_cdb() and process_sg_error() both +incorrectly set the snprintf() limits larger than the available space. +Instead of multiplying the number of elements to print by the size of an +element to calculate the limit, they multiplied the number of elements +to print by the maximum number of elements that the buffer could hold. + +Fix this by making these functions use strbufs instead. + +mwilck: removed log message in print_strbuf() failure case. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +Signed-off-by: Martin Wilck +--- + libmultipath/prioritizers/ontap.c | 24 +++++++++++------------- + 1 file changed, 11 insertions(+), 13 deletions(-) + +diff --git a/libmultipath/prioritizers/ontap.c b/libmultipath/prioritizers/ontap.c +index 117886ea..90eaf274 100644 +--- a/libmultipath/prioritizers/ontap.c ++++ b/libmultipath/prioritizers/ontap.c +@@ -23,6 +23,7 @@ + #include "prio.h" + #include "structs.h" + #include "unaligned.h" ++#include "strbuf.h" + + #define INQUIRY_CMD 0x12 + #define INQUIRY_CMDLEN 6 +@@ -35,32 +36,29 @@ + static void dump_cdb(unsigned char *cdb, int size) + { + int i; +- char buf[10*5+1]; +- char * p = &buf[0]; ++ STRBUF_ON_STACK(buf); + +- condlog(0, "- SCSI CDB: "); +- for (i=0; imasked_status, + io_hdr->host_status, io_hdr->driver_status); + if (io_hdr->sb_len_wr > 0) { +- condlog(0, "- SCSI sense data: "); +- for (i=0; isb_len_wr; i++) { +- p += snprintf(p, 128*(io_hdr->sb_len_wr-i), "0x%02x ", +- io_hdr->sbp[i]); ++ for (i = 0; i < io_hdr->sb_len_wr; i++) { ++ if (print_strbuf(&buf, "0x%02x ", io_hdr->sbp[i]) < 0) ++ return; + } +- condlog(0, "%s", buf); ++ condlog(0, "- SCSI sense data: %s", get_strbuf_str(&buf)); + } + } + diff --git a/SPECS/device-mapper-multipath.spec b/SPECS/device-mapper-multipath.spec index 51c4532..f92c5c7 100644 --- a/SPECS/device-mapper-multipath.spec +++ b/SPECS/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.9.9 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 URL: http://christophe.varoqui.free.fr/ @@ -24,6 +24,7 @@ Patch0011: 0011-RH-make-parse_vpd_pg83-match-scsi_id-output.patch Patch0012: 0012-RH-add-scsi-device-handlers-to-modules-load.d.patch Patch0013: 0013-RH-compile-with-libreadline-support.patch Patch0014: 0014-RH-Add-mpathcleanup.patch +Patch0015: 0015-libmultipath-fix-ontap-prioritizer-snprintf-limits.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -233,6 +234,17 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Tue Oct 29 2024 Troy Dawson - 0.9.9-4 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Fri Sep 13 2024 Benjamin Marzinski - 0.9.9-3 +- Add 0015-libmultipath-fix-ontap-prioritizer-snprintf-limits.patch +- Resolves: RHEL-49747 + +* Thu Sep 12 2024 Benjamin Marzinski - 0.9.9-2 +- Improve multiple OSCI tests + * Fri Jul 26 2024 Benjamin Marzinski - 0.9.9-1 - Update source to upstream version 0.9.9 * Previous patches 0014-0015 are included in the soruce tarball