diff --git a/SOURCES/lvm2-2_02_188-fsadm-avoid-access-to-unbound-variable.patch b/SOURCES/lvm2-2_02_188-fsadm-avoid-access-to-unbound-variable.patch new file mode 100644 index 0000000..f4dac6c --- /dev/null +++ b/SOURCES/lvm2-2_02_188-fsadm-avoid-access-to-unbound-variable.patch @@ -0,0 +1,16 @@ + scripts/fsadm.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh +index 561c180..be4edf2 100755 +--- a/scripts/fsadm.sh ++++ b/scripts/fsadm.sh +@@ -163,7 +163,7 @@ cleanup() { + _FSADM_EXTOFF=$EXTOFF + export _FSADM_YES _FSADM_EXTOFF + unset FSADM_RUNNING +- test -n "$LVM_BINARY" && PATH=$_SAVEPATH ++ test -n "${LVM_BINARY-}" && PATH=$_SAVEPATH + dry exec "$LVM" lvresize $VERB $FORCE -r -L"${NEWSIZE_ORIG}b" "$VOLUME_ORIG" + fi + diff --git a/SOURCES/lvm2-2_02_188-vgextend-check-missing-device-during-block-size-chec.patch b/SOURCES/lvm2-2_02_188-vgextend-check-missing-device-during-block-size-chec.patch new file mode 100644 index 0000000..057cb5e --- /dev/null +++ b/SOURCES/lvm2-2_02_188-vgextend-check-missing-device-during-block-size-chec.patch @@ -0,0 +1,17 @@ + lib/metadata/metadata.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c +index 39f10fe..afd301d 100644 +--- a/lib/metadata/metadata.c ++++ b/lib/metadata/metadata.c +@@ -718,6 +718,9 @@ int vg_extend_each_pv(struct volume_group *vg, struct pvcreate_params *pp) + logical_block_size = 0; + physical_block_size = 0; + ++ if (!pvl->pv->dev) ++ continue; ++ + if (!dev_get_direct_block_sizes(pvl->pv->dev, &physical_block_size, &logical_block_size)) + continue; + diff --git a/SPECS/lvm2.spec b/SPECS/lvm2.spec index cd6cc62..8f9a8e9 100644 --- a/SPECS/lvm2.spec +++ b/SPECS/lvm2.spec @@ -33,7 +33,7 @@ %global boom_dir boom-%{boom_version} #%%global scratch .bz1628529_4 -%global scratch .4 +%global scratch .5 %if 0%{?rhel} %ifnarch i686 x86_64 ppc64le s390x @@ -53,15 +53,6 @@ %global enable_boom 0 %endif -%if %{enable_cluster} - %global configure_cluster --with-cluster=internal --with-clvmd=corosync - %if %{enable_cmirror} - %global configure_cmirror --enable-cmirrord - %endif -%else - %global configure_cluster --with-cluster=internal --with-clvmd=none -%endif - # Do not reset Release to 1 unless both lvm2 and device-mapper # versions are increased together. @@ -107,6 +98,10 @@ Patch18: lvm2-2_02_188-fsadm-enhance-error-handling.patch Patch19: lvm2-2_02_188-fsadm-better-check-for-getsize64-support.patch Patch20: lvm2-2_02_188-fsadm-fix-bash-artihmetic.patch Patch21: lvm2-2_02_188-fsadm-fix-unbound-variable-usage.patch +# BZ 1931862: +Patch22: lvm2-2_02_188-fsadm-avoid-access-to-unbound-variable.patch +# BZ 1926569: +Patch23: lvm2-2_02_188-vgextend-check-missing-device-during-block-size-chec.patch # BZ 1777364: Patch50: boom-etc-Remove-executable-permission-from-etc-default-bo.patch Patch51: boom-man-Fix-line-starting-with.patch @@ -186,6 +181,8 @@ or more physical volumes and creating one or more logical volumes %patch19 -p1 -b .fsadm_better_check_for_getsize64_support %patch20 -p1 -b .fsadm_fix_bash_artihmetic %patch21 -p1 -b .fsadm_fix_unbound_variable_usage +%patch22 -p1 -b .fsadm_avoid_access_to_unbound_variable +%patch23 -p1 -b .vgextend_check_missing_device_during_block_size_check %build %global _default_pid_dir /run @@ -196,41 +193,60 @@ or more physical volumes and creating one or more logical volumes %global _udevdir %{_prefix}/lib/udev/rules.d %global _tmpfilesdir %{_prefix}/lib/tmpfiles.d -%global configure_udev --with-udevdir=%{_udevdir} --enable-udev_sync - -%if %{enable_cache} -%global configure_cache --with-cache=internal +%configure \ + --with-default-dm-run-dir=%{_default_dm_run_dir} \ + --with-default-run-dir=%{_default_run_dir} \ + --with-default-pid-dir=%{_default_pid_dir} \ + --with-default-locking-dir=%{_default_locking_dir} \ + --with-usrlibdir=%{_libdir} \ + --enable-lvm1_fallback \ + --enable-fsadm \ + --with-pool=internal \ + --enable-write_install \ + --with-user= \ + --with-group= \ + --with-device-uid=0 \ + --with-device-gid=6 \ + --with-device-mode=0660 \ + --enable-pkgconfig \ + --enable-applib \ + --enable-cmdlib \ + --enable-dmeventd \ + --enable-blkid_wiping \ +%if %{enable_python} + --enable-python2-bindings \ %endif - +%if %{enable_cluster} + --with-cluster=internal --with-clvmd=corosync \ + %if %{enable_cmirror} + --enable-cmirrord \ + %endif +%else + --with-cluster=internal --with-clvmd=none \ +%endif + --with-udevdir=%{_udevdir} --enable-udev_sync \ %if %{enable_thin} -%global configure_thin --with-thin=internal + --with-thin=internal \ %endif - %if %{enable_lvmetad} -%global configure_lvmetad --enable-lvmetad -%endif - -%if %{enable_lockd_dlm} -%global configure_lockd_dlm --enable-lvmlockd-dlm + --enable-lvmetad \ %endif - -%if %{enable_lockd_sanlock} -%global configure_lockd_sanlock --enable-lvmlockd-sanlock +%if %{enable_cache} + --with-cache=internal \ %endif - %if %{enable_lvmpolld} -%global configure_lvmpolld --enable-lvmpolld + --enable-lvmpolld \ %endif - -%if %{enable_python} -%global configure_python --enable-python2-bindings +%if %{enable_lockd_dlm} + --enable-lvmlockd-dlm \ +%endif +%if %{enable_lockd_sanlock} + --enable-lvmlockd-sanlock \ %endif - %if %{enable_dmfilemapd} -%global configure_dmfilemapd --enable-dmfilemapd + --enable-dmfilemapd \ %endif -%configure --with-default-dm-run-dir=%{_default_dm_run_dir} --with-default-run-dir=%{_default_run_dir} --with-default-pid-dir=%{_default_pid_dir} --with-default-locking-dir=%{_default_locking_dir} --with-usrlibdir=%{_libdir} --enable-lvm1_fallback --enable-fsadm --with-pool=internal --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib --enable-dmeventd --enable-blkid_wiping %{?configure_python} %{?configure_cluster} %{?configure_cmirror} %{?configure_udev} %{?configure_thin} %{?configure_lvmetad} %{?configure_cache} %{?configure_lvmpolld} %{?configure_lockd_dlm} %{?configure_lockd_sanlock} %{?configure_dmfilemapd} make %{?_smp_mflags} V=1 @@ -987,6 +1003,10 @@ This package provides the python2 version of boom. %endif %changelog +* Thu Mar 11 2021 Marian Csontos - 7:2.02.187-6.el7_9.5 +- Fix fsadm failure due to accessing unbound variable. +- Fix segfault in vgextend when a PV is missing in the processed VG. + * Mon Feb 08 2021 Marian Csontos - 7:2.02.187-6.el7_9.4 - Fix fsadm behavior with missing parameters.