From dd27532916a5d6954d8ce240eca065534cc4458d Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Apr 20 2021 12:40:08 +0000 Subject: * Tue Apr 20 2021 Tomas Bzatek - 2.9.2-4 - Fix a couple of issues found by Coverity (#1938890) - Ignore systemd "Extended Boot Loader" GPT partition Resolves: #1938890 --- diff --git a/udisks-2.10.0-Ignore-Extended-Boot-Loader-GPT-partition.patch b/udisks-2.10.0-Ignore-Extended-Boot-Loader-GPT-partition.patch new file mode 100644 index 0000000..1f98913 --- /dev/null +++ b/udisks-2.10.0-Ignore-Extended-Boot-Loader-GPT-partition.patch @@ -0,0 +1,29 @@ +From 79eed9aa35fbf1c5131b44b50b407742f68e2f61 Mon Sep 17 00:00:00 2001 +From: Florian Ziegler +Date: Sat, 17 Apr 2021 13:31:31 +0200 +Subject: [PATCH 8/8] Ignore "Extended Boot Loader" GPT partition + +--- + data/80-udisks2.rules | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/data/80-udisks2.rules b/data/80-udisks2.rules +index fb50f48a..39bfa28b 100644 +--- a/data/80-udisks2.rules ++++ b/data/80-udisks2.rules +@@ -135,6 +135,12 @@ ENV{ID_PART_ENTRY_SCHEME}=="gpt", \ + ENV{ID_PART_ENTRY_TYPE}=="c12a7328-f81f-11d2-ba4b-00a0c93ec93b|21686148-6449-6e6f-744e-656564454649|a19d880f-05fc-4d3b-a006-743f0f84911e|e6d6d379-f507-44c2-a23c-238f2a3df928|e3c9e316-0b5c-4db8-817d-f92df00215ae|de94bba4-06d1-4d40-a16a-bfd50179d6ac", \ + ENV{UDISKS_IGNORE}="1" + ++# special Extended Boot Loader partition (XBOOTLDR) ++# see https://systemd.io/BOOT_LOADER_SPECIFICATION/ ++ENV{ID_PART_ENTRY_SCHEME}=="gpt", \ ++ ENV{ID_PART_ENTRY_TYPE}=="bc13c2ff-59e6-4262-a352-b275fd6f7172", \ ++ ENV{UDISKS_IGNORE}="1" ++ + # ZFS member partitions + ENV{ID_PART_ENTRY_SCHEME}=="gpt", \ + ENV{ID_FS_TYPE}=="zfs_member", ENV{ID_PART_ENTRY_TYPE}=="6a898cc3-1dd2-11b2-99a6-080020736631", \ +-- +2.30.2 + diff --git a/udisks-2.10.0-g_mkdtemp-leak.patch b/udisks-2.10.0-g_mkdtemp-leak.patch new file mode 100644 index 0000000..58d58cd --- /dev/null +++ b/udisks-2.10.0-g_mkdtemp-leak.patch @@ -0,0 +1,32 @@ +From fcdec5d58ba2bbe6d7ecf7168ab1a11282763041 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Fri, 16 Apr 2021 18:15:03 +0200 +Subject: [PATCH 5/8] udiskslinuxfilesystemhelpers: Fix leaking string in case + g_mkdtemp() fails + +--- + src/udiskslinuxfilesystemhelpers.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/udiskslinuxfilesystemhelpers.c b/src/udiskslinuxfilesystemhelpers.c +index 74d83152..7c5fc037 100644 +--- a/src/udiskslinuxfilesystemhelpers.c ++++ b/src/udiskslinuxfilesystemhelpers.c +@@ -142,11 +142,11 @@ take_filesystem_ownership (const gchar *device, + else + { + /* device is not mounted, we need to mount it */ +- mountpoint = g_mkdtemp (g_strdup ("/run/udisks2/temp-mount-XXXXXX")); +- if (mountpoint == NULL) ++ mountpoint = g_strdup ("/run/udisks2/temp-mount-XXXXXX"); ++ if (g_mkdtemp (mountpoint) == NULL) + { + g_set_error (error, UDISKS_ERROR, UDISKS_ERROR_FAILED, +- "Cannot create temporary mountpoint."); ++ "Cannot create temporary mountpoint: %m."); + success = FALSE; + goto out; + } +-- +2.30.2 + diff --git a/udisks-2.10.0-mdraid-g_source_attach.patch b/udisks-2.10.0-mdraid-g_source_attach.patch new file mode 100644 index 0000000..9fb9911 --- /dev/null +++ b/udisks-2.10.0-mdraid-g_source_attach.patch @@ -0,0 +1,44 @@ +From cd458666a93fe9d07f3718e88f3169f01a11a63e Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Fri, 16 Apr 2021 18:36:16 +0200 +Subject: [PATCH 7/8] udiskslinuxmdraidobject: Handle source attach failure + gracefully + +Only negligible theoretical chance to hit this, reported by Coverity. +--- + src/udiskslinuxmdraidobject.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/udiskslinuxmdraidobject.c b/src/udiskslinuxmdraidobject.c +index 20ca89c5..828c7058 100644 +--- a/src/udiskslinuxmdraidobject.c ++++ b/src/udiskslinuxmdraidobject.c +@@ -468,7 +468,8 @@ watch_attr (UDisksLinuxDevice *device, + GError *error = NULL; + gchar *path = NULL; + GIOChannel *channel = NULL; +- GSource *ret = NULL;; ++ GSource *ret = NULL; ++ guint source_id; + + g_return_val_if_fail (UDISKS_IS_LINUX_DEVICE (device), NULL); + +@@ -478,9 +479,14 @@ watch_attr (UDisksLinuxDevice *device, + { + ret = g_io_create_watch (channel, G_IO_ERR); + g_source_set_callback (ret, callback, user_data, NULL); +- g_source_attach (ret, g_main_context_get_thread_default ()); ++ source_id = g_source_attach (ret, g_main_context_get_thread_default ()); + g_source_unref (ret); + g_io_channel_unref (channel); /* the keeps a reference to this object */ ++ if (source_id == 0) ++ { ++ /* something bad happened while attaching the source */ ++ ret = NULL; ++ } + } + else + { +-- +2.30.2 + diff --git a/udisks-2.10.0-mdraid-iochannel-data.patch b/udisks-2.10.0-mdraid-iochannel-data.patch new file mode 100644 index 0000000..51daf79 --- /dev/null +++ b/udisks-2.10.0-mdraid-iochannel-data.patch @@ -0,0 +1,47 @@ +From 0353b5f2f9c586d872750423259b6ef6cc375625 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Fri, 16 Apr 2021 18:22:46 +0200 +Subject: [PATCH 6/8] udiskslinuxmdraidobject: Optimize unused data out from + the g_io_channel_read_to_end() call + +Looking into glib sources the g_io_channel_read_to_end() function +can handle NULL output pointers just fine and since the data is thrown +right away it's pointless to have them assigned. +--- + src/udiskslinuxmdraidobject.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/udiskslinuxmdraidobject.c b/src/udiskslinuxmdraidobject.c +index 759ff5f4..20ca89c5 100644 +--- a/src/udiskslinuxmdraidobject.c ++++ b/src/udiskslinuxmdraidobject.c +@@ -503,8 +503,6 @@ attr_changed (GIOChannel *channel, + UDisksLinuxMDRaidObject *object = UDISKS_LINUX_MDRAID_OBJECT (user_data); + gboolean bail = FALSE; + GError *error = NULL; +- gchar *str = NULL; +- gsize len = 0; + + if (cond & ~G_IO_ERR) + goto out; +@@ -518,7 +516,7 @@ attr_changed (GIOChannel *channel, + goto out; + } + +- if (g_io_channel_read_to_end (channel, &str, &len, &error) != G_IO_STATUS_NORMAL) ++ if (g_io_channel_read_to_end (channel, NULL, NULL, &error) != G_IO_STATUS_NORMAL) + { + udisks_debug ("Error reading (uuid %s): %s (%s, %d)", + object->uuid, error->message, g_quark_to_string (error->domain), error->code); +@@ -527,8 +525,6 @@ attr_changed (GIOChannel *channel, + goto out; + } + +- g_free (str); +- + /* synthesize uevent */ + if (object->raid_device != NULL) + udisks_linux_mdraid_object_uevent (object, "change", object->raid_device, FALSE); +-- +2.30.2 + diff --git a/udisks2.spec b/udisks2.spec index 3dd19bd..c1b16fe 100644 --- a/udisks2.spec +++ b/udisks2.spec @@ -22,20 +22,20 @@ %define build_date %(date '+%Y%m%d') -# bcache is not available on RHEL -%if (0%{?rhel}) || %{with_bcache} == 0 +# bcache and zram are not available on RHEL +%if (0%{?rhel}) %define with_bcache 0 +%define with_zram 0 %endif # btrfs is not available on RHEL > 7 -%if 0%{?rhel} > 7 || %{with_btrfs} == 0 +%if 0%{?rhel} > 7 %define with_btrfs 0 %endif # feature parity with existing RHEL 7 packages %if (0%{?rhel}) && (0%{?rhel} <= 7) %define with_lsm 0 -%define with_zram 0 %define with_lvmcache 0 %endif @@ -48,7 +48,7 @@ Name: udisks2 Summary: Disk Manager Version: 2.9.2 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ URL: https://github.com/storaged-project/udisks Source0: https://github.com/storaged-project/udisks/releases/download/udisks-%{version}/udisks-%{version}.tar.bz2 @@ -58,6 +58,10 @@ Patch2: udisks-2.10.0-module-names.patch Patch3: udisks-2.10.0-ata_conf_apply_GTask.patch # https://github.com/storaged-project/udisks/pull/847 Patch4: ignore-apple-boot-part.patch +Patch5: udisks-2.10.0-g_mkdtemp-leak.patch +Patch6: udisks-2.10.0-mdraid-iochannel-data.patch +Patch7: udisks-2.10.0-mdraid-g_source_attach.patch +Patch8: udisks-2.10.0-Ignore-Extended-Boot-Loader-GPT-partition.patch BuildRequires: make BuildRequires: glib2-devel >= %{glib2_version} @@ -433,6 +437,10 @@ fi %endif %changelog +* Tue Apr 20 2021 Tomas Bzatek - 2.9.2-4 +- Fix a couple of issues found by Coverity (#1938890) +- Ignore systemd "Extended Boot Loader" GPT partition + * Fri Apr 16 2021 Mohan Boddu - 2.9.2-3 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937