From 53564ce16758d29623085d09e375d4ff65176e34 Mon Sep 17 00:00:00 2001 From: AlmaLinux RelEng Bot Date: Mon, 30 Mar 2026 10:38:24 -0400 Subject: [PATCH] import CS libblockdev-2.28-16.el9 --- ...-allow-suid-and-dev-set-on-fs-resize.patch | 26 ++++++++++ ...ling-lvcreate-with-empty-list-of-PVs.patch | 48 +++++++++++++++++++ ...neric-FS-resize-test-for-VFAT-resize.patch | 32 +++++++++++++ SPECS/libblockdev.spec | 17 ++++++- 4 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0016-Don-t-allow-suid-and-dev-set-on-fs-resize.patch create mode 100644 SOURCES/0017-lvm-dbus-Fix-calling-lvcreate-with-empty-list-of-PVs.patch create mode 100644 SOURCES/0018-Adjust-sizes-in-generic-FS-resize-test-for-VFAT-resize.patch diff --git a/SOURCES/0016-Don-t-allow-suid-and-dev-set-on-fs-resize.patch b/SOURCES/0016-Don-t-allow-suid-and-dev-set-on-fs-resize.patch new file mode 100644 index 0000000..36f3b4a --- /dev/null +++ b/SOURCES/0016-Don-t-allow-suid-and-dev-set-on-fs-resize.patch @@ -0,0 +1,26 @@ +From 2118ed49dcf6adf60c6c544667dbf71c54239b86 Mon Sep 17 00:00:00 2001 +From: Thomas Blume +Date: Fri, 16 May 2025 14:27:10 +0200 +Subject: [PATCH] Don't allow suid and dev set on fs resize + +Fixes: CVE-2025-6019 +--- + src/plugins/fs/generic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/plugins/fs/generic.c b/src/plugins/fs/generic.c +index ca08d19a..15b55271 100644 +--- a/src/plugins/fs/generic.c ++++ b/src/plugins/fs/generic.c +@@ -409,7 +409,7 @@ static gboolean xfs_resize_device (const gchar *device, guint64 new_size, const + "before resizing it.", device); + return FALSE; + } +- ret = bd_fs_mount (device, mountpoint, "xfs", NULL, NULL, error); ++ ret = bd_fs_mount (device, mountpoint, "xfs", "nosuid,nodev", NULL, error); + if (!ret) { + g_prefix_error (error, "Failed to mount '%s' before resizing it: ", device); + return FALSE; +-- +2.49.0 + diff --git a/SOURCES/0017-lvm-dbus-Fix-calling-lvcreate-with-empty-list-of-PVs.patch b/SOURCES/0017-lvm-dbus-Fix-calling-lvcreate-with-empty-list-of-PVs.patch new file mode 100644 index 0000000..fb6f125 --- /dev/null +++ b/SOURCES/0017-lvm-dbus-Fix-calling-lvcreate-with-empty-list-of-PVs.patch @@ -0,0 +1,48 @@ +From 21ff65eb84f4d1d498726712a8dbf703ac97f649 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Thu, 4 Sep 2025 15:51:35 +0200 +Subject: [PATCH] lvm-dbus: Fix calling lvcreate with empty list of PVs + +GLib really dislikes us calling 'g_variant_builder_end' on the +empty array in this case. + +Resolves: RHEL-113928 +--- + src/plugins/lvm-dbus.c | 2 +- + tests/lvm_dbus_tests.py | 7 +++++++ + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c +index a129d884..b5317b0d 100644 +--- a/src/plugins/lvm-dbus.c ++++ b/src/plugins/lvm-dbus.c +@@ -2061,7 +2061,7 @@ gboolean bd_lvm_lvcreate (const gchar *vg_name, const gchar *lv_name, guint64 si + GVariant *extra_params = NULL; + + /* build the array of PVs (object paths) */ +- if (pv_list) { ++ if (pv_list && *pv_list) { + g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); + for (pv=pv_list; *pv; pv++) { + path = get_object_path (*pv, error); +diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py +index bc8b3052..0a91f224 100644 +--- a/tests/lvm_dbus_tests.py ++++ b/tests/lvm_dbus_tests.py +@@ -725,6 +725,13 @@ class LvmTestLVcreateRemove(LvmPVVGLVTestCase): + succ = BlockDev.lvm_lvremove("testVG", "testLV", True, None) + self.assertTrue(succ) + ++ # no PVs specified ++ succ = BlockDev.lvm_lvcreate("testVG", "testLV", 512 * 1024**2, None, [], None) ++ self.assertTrue(succ) ++ ++ succ = BlockDev.lvm_lvremove("testVG", "testLV", True, None) ++ self.assertTrue(succ) ++ + # not enough space (only one PV) + with six.assertRaisesRegex(self, GLib.GError, "Insufficient free space"): + succ = BlockDev.lvm_lvcreate("testVG", "testLV", 1048 * 1024**2, None, [self.loop_dev], None) +-- +2.50.1 + diff --git a/SOURCES/0018-Adjust-sizes-in-generic-FS-resize-test-for-VFAT-resize.patch b/SOURCES/0018-Adjust-sizes-in-generic-FS-resize-test-for-VFAT-resize.patch new file mode 100644 index 0000000..bf641b8 --- /dev/null +++ b/SOURCES/0018-Adjust-sizes-in-generic-FS-resize-test-for-VFAT-resize.patch @@ -0,0 +1,32 @@ +From e00b55532172ef6ba6e70e86d27ae76661567a98 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 29 Oct 2025 15:49:20 +0100 +Subject: [PATCH] tests: Adjust sizes in generic FS resize test for VFAT resize + +Similar change to e75820f -- when shrinking, libparted can change +FAT from FAT32 to FAT16 but it can't change from FAT16 to FAT32 +when growing so we can't shrink (V)FAT below FAT32 minimal size +in our tests if we want to grow it back. +--- + tests/fs_test.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/fs_test.py b/tests/fs_test.py +index 7b5a6ac1..42140097 100644 +--- a/tests/fs_test.py ++++ b/tests/fs_test.py +@@ -1562,12 +1562,12 @@ def _test_generic_resize(self, mkfs_function, fs_info_func=None, info_size_func= + size = info_size_func(fs_info_func(self.loop_dev)) + + # shrink +- succ = BlockDev.fs_resize(self.loop_dev, 80 * 1024**2) ++ succ = BlockDev.fs_resize(self.loop_dev, 130 * 1024**2) + self.assertTrue(succ) + if info_size_func is not None and fs_info_func is not None: + new_size = info_size_func(fs_info_func(self.loop_dev)) + # do not check the size 100% precisely there may differences due to FS block size, etc. +- self.assertEqual(new_size, 80 * 1024**2) ++ self.assertEqual(new_size, 130 * 1024**2) + + # resize to maximum size + succ = BlockDev.fs_resize(self.loop_dev, 0) diff --git a/SPECS/libblockdev.spec b/SPECS/libblockdev.spec index 86605ee..7409420 100644 --- a/SPECS/libblockdev.spec +++ b/SPECS/libblockdev.spec @@ -129,7 +129,7 @@ Name: libblockdev Version: 2.28 -Release: 13%{?dist} +Release: 16%{?dist} Summary: A library for low-level manipulation with block devices License: LGPLv2+ URL: https://github.com/storaged-project/libblockdev @@ -150,6 +150,9 @@ Patch12: 0012-lvm-Add-support-for-starting-and-stopping-VG-locking.patch Patch13: 0013-tests-Remove_unreliable_nvme_attribute_checks.patch Patch14: 0014-nvme-Add-bd_nvme_is_tech_avail-to-the-API-file.patch Patch15: 0015-crypto-Add-a-function-to-set-persistent-flags-for-LU.patch +Patch16: 0016-Don-t-allow-suid-and-dev-set-on-fs-resize.patch +Patch17: 0017-lvm-dbus-Fix-calling-lvcreate-with-empty-list-of-PVs.patch +Patch18: 0018-Adjust-sizes-in-generic-FS-resize-test-for-VFAT-resize.patch BuildRequires: make BuildRequires: glib2-devel @@ -1048,6 +1051,18 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm} %files plugins-all %changelog +* Thu Oct 30 2025 Vojtech Trefny - 2.28-16 +- tests: Adjust sizes in generic FS resize test for VFAT resize + Resolves: RHEL-124142 + +* Mon Oct 06 2025 Vojtech Trefny - 2.28-15 +- lvm-dbus: Fix calling lvcreate with empty list of PVs + Resolves: RHEL-113928 + +* Mon Jun 23 2025 Vojtech Trefny - 2.28-14 +- Don't allow suid and dev set on fs resize + Resolves: RHEL-96039 + * Tue Mar 11 2025 Vojtech Trefny - 2.28-13 - crypto: Add a function to set persistent flags for LUKS Resolves: RHEL-82886