From 835a8a43de1620fcb450510713cbdeb859b318d5 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Tue, 16 Jan 2024 22:54:08 -0500 Subject: [PATCH] device-mapper-multipath-0.9.7-5 Add 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch * Fix auto_resize code to avoid a segfault Add 0015-multipathd-fix-auto-resize-configuration.patch * Fix auto_resize default value --- ...ull-pointer-dereference-in-uev_updat.patch | 27 ++++++++++++ ...ipathd-fix-auto-resize-configuration.patch | 42 +++++++++++++++++++ device-mapper-multipath.spec | 10 ++++- 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch create mode 100644 0015-multipathd-fix-auto-resize-configuration.patch diff --git a/0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch b/0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch new file mode 100644 index 0000000..7655591 --- /dev/null +++ b/0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Tue, 16 Jan 2024 00:54:37 -0500 +Subject: [PATCH] multipathd: fix null pointer dereference in uev_update_path + +The Auto-resize code added a check that deferences pp->mpp without +checking that it's non-NULL. Fix it. + +Fixes: 981b83ad1 ("multipathd: Add auto_resize config option") +Signed-off-by: Benjamin Marzinski +--- + multipathd/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipathd/main.c b/multipathd/main.c +index 230c9d10..57c04364 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -1653,7 +1653,7 @@ uev_update_path (struct uevent *uev, struct vectors * vecs) + } + } + } +- if (auto_resize != AUTO_RESIZE_NEVER && ++ if (auto_resize != AUTO_RESIZE_NEVER && mpp && + !mpp->wait_for_udev) { + struct pathgroup *pgp; + struct path *pp2; diff --git a/0015-multipathd-fix-auto-resize-configuration.patch b/0015-multipathd-fix-auto-resize-configuration.patch new file mode 100644 index 0000000..35e4d48 --- /dev/null +++ b/0015-multipathd-fix-auto-resize-configuration.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Tue, 16 Jan 2024 01:11:02 -0500 +Subject: [PATCH] multipathd: fix auto-resize configuration + +The code acted like AUTO_RESIZE_UNDEFINED didn't exist, but since +conf->auto_resize was never set to AUTO_RESIZE_NEVER, the default was in +fact AUTO_RESIZE_UNDEFINED, which ended up getting treated like +AUTO_RESIZE_GROW_SHRINK. Remove AUTO_RESIZE_UNDEFINED and explicitly +default auto_resize tp AUTO_RESIZE_NEVER. + +Fixes: 981b83ad1 ("multipathd: Add auto_resize config option") +Signed-off-by: Benjamin Marzinski +--- + libmultipath/config.c | 1 + + libmultipath/structs.h | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libmultipath/config.c b/libmultipath/config.c +index 4544f484..3d5943d3 100644 +--- a/libmultipath/config.c ++++ b/libmultipath/config.c +@@ -927,6 +927,7 @@ int _init_config (const char *file, struct config *conf) + conf->retrigger_tries = DEFAULT_RETRIGGER_TRIES; + conf->retrigger_delay = DEFAULT_RETRIGGER_DELAY; + conf->uev_wait_timeout = DEFAULT_UEV_WAIT_TIMEOUT; ++ conf->auto_resize = DEFAULT_AUTO_RESIZE; + conf->remove_retries = 0; + conf->ghost_delay = DEFAULT_GHOST_DELAY; + conf->all_tg_pt = DEFAULT_ALL_TG_PT; +diff --git a/libmultipath/structs.h b/libmultipath/structs.h +index a1aac1b4..734905e2 100644 +--- a/libmultipath/structs.h ++++ b/libmultipath/structs.h +@@ -180,7 +180,6 @@ enum queue_mode_states { + }; + + enum auto_resize_state { +- AUTO_RESIZE_UNDEF = 0, + AUTO_RESIZE_NEVER, + AUTO_RESIZE_GROW_ONLY, + AUTO_RESIZE_GROW_SHRINK, diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 2a92a06..b448595 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.9.7 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 URL: http://christophe.varoqui.free.fr/ @@ -23,6 +23,8 @@ Patch0010: 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch Patch0011: 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch Patch0012: 0012-RH-compile-with-libreadline-support.patch Patch0013: 0013-RH-Add-mpathcleanup.patch +Patch0014: 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch +Patch0015: 0015-multipathd-fix-auto-resize-configuration.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -231,6 +233,12 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Tue Jan 16 2024 Benjamin Marzinski - 0.9.7-5 +- Add 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch + * Fix auto_resize code to avoid a segfault +- Add 0015-multipathd-fix-auto-resize-configuration.patch + * Fix auto_resize default value + * Thu Nov 30 2023 Benjamin Marzinski - 0.9.7-4 - Use modulesloaddir macro for installing scsi_dh.conf