udisks2: Hardening measure of CVE-2025-6019

Refer [1], CVE-2025-6019 is strongly related to udisk daemon, and
this is a hardening measure related to this.

[1] https://cdn2.qualys.com/2025/06/17/suse15-pam-udisks-lpe.txt
[2] https://security-tracker.debian.org/tracker/CVE-2025-6019
[3] https://ubuntu.com/blog/udisks-libblockdev-lpe-vulnerability-fixes-available

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Changqing Li 2025-07-03 14:07:02 +08:00 committed by Khem Raj
parent 1978c871f1
commit 5ffd6f7cb7
No known key found for this signature in database
GPG Key ID: BB053355919D3314
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,51 @@
From d0d04a381036b79df91616552706d515639bb762 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Wed, 4 Jun 2025 15:26:46 +0200
Subject: [PATCH] udiskslinuxfilesystemhelpers: Mount private mounts with
'nodev,nosuid'
The private mount done in take_filesystem_ownership() should always
default to 'nodev,nosuid' for security and 'errors=remount-ro' for
selected filesystem types to handle an corrupted filesystem. This is
consistent with mount options calculation for regular mounts.
CVE: CVE-2025-6019
Upstream-Status: Backport [ https://github.com/storaged-project/udisks/commit/5e7277debea926370e587408517560afe87d28c9 ]
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
src/udiskslinuxfilesystemhelpers.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/udiskslinuxfilesystemhelpers.c b/src/udiskslinuxfilesystemhelpers.c
index 7c5fc037..9eb7742c 100644
--- a/src/udiskslinuxfilesystemhelpers.c
+++ b/src/udiskslinuxfilesystemhelpers.c
@@ -123,6 +123,7 @@ take_filesystem_ownership (const gchar *device,
{
gchar *mountpoint = NULL;
+ const gchar *mount_opts;
GError *local_error = NULL;
gboolean unmount = FALSE;
gboolean success = TRUE;
@@ -151,8 +152,15 @@ take_filesystem_ownership (const gchar *device,
goto out;
}
+ mount_opts = "nodev,nosuid";
+ if (g_strcmp0 (fstype, "ext2") == 0 ||
+ g_strcmp0 (fstype, "ext3") == 0 ||
+ g_strcmp0 (fstype, "ext4") == 0 ||
+ g_strcmp0 (fstype, "jfs") == 0)
+ mount_opts = "nodev,nosuid,errors=remount-ro";
+
/* TODO: mount to a private mount namespace */
- if (!bd_fs_mount (device, mountpoint, fstype, NULL, NULL, &local_error))
+ if (!bd_fs_mount (device, mountpoint, fstype, mount_opts, NULL, &local_error))
{
g_set_error (error, UDISKS_ERROR, UDISKS_ERROR_FAILED,
"Cannot mount %s at %s: %s",
--
2.34.1

View File

@ -20,6 +20,7 @@ RDEPENDS:${PN} = "acl"
SRC_URI = " \
git://github.com/storaged-project/udisks.git;branch=2.10.x-branch;protocol=https \
file://0001-Makefile.am-Dont-include-buildpath.patch \
file://CVE-2025-6019.patch \
"
SRCREV = "18c9faf089e306ad6f3f51f5cb887a6b9aa08350"