uuidd fix open lock state issue
This commit is contained in:
parent
a80698097d
commit
9dd90e70ea
70
backport-uuidd-fix-open-lock-state-issue.patch
Normal file
70
backport-uuidd-fix-open-lock-state-issue.patch
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
From f38b0efd86a407dc82a074ed31a1fc38104109d6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Karel Zak <kzak@redhat.com>
|
||||||
|
Date: Tue, 19 Mar 2024 10:41:51 +0800
|
||||||
|
Subject: [PATCH] uuidd: fix open/lock state issue
|
||||||
|
|
||||||
|
* warn on open/lock state issue
|
||||||
|
|
||||||
|
* enable access to /var/lib/libuuid/, because ProtectSystem=strict make it read-only
|
||||||
|
|
||||||
|
openat(AT_FDCWD, "/var/lib/libuuid/clock.txt",
|
||||||
|
O_RDWR|O_CREAT|O_CLOEXEC, 0660) = -1 EROFS (Read-only file system)
|
||||||
|
|
||||||
|
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2040366
|
||||||
|
Upstream: http://github.com/util-linux/util-linux/commit/f27876f9c1056bf41fd940d5c4990b4277e0024f
|
||||||
|
Upstream: http://github.com/util-linux/util-linux/commit/417982d0236a12756923d88e627f5e4facf8951c
|
||||||
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||||
|
---
|
||||||
|
misc-utils/uuidd.c | 9 ++++++---
|
||||||
|
misc-utils/uuidd.service.in | 1 +
|
||||||
|
2 files changed, 7 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c
|
||||||
|
index af24efc..715a75b 100644
|
||||||
|
--- a/misc-utils/uuidd.c
|
||||||
|
+++ b/misc-utils/uuidd.c
|
||||||
|
@@ -461,7 +461,8 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
|
||||||
|
break;
|
||||||
|
case UUIDD_OP_TIME_UUID:
|
||||||
|
num = 1;
|
||||||
|
- __uuid_generate_time(uu, &num);
|
||||||
|
+ if (__uuid_generate_time(uu, &num) < 0 && !uuidd_cxt->quiet)
|
||||||
|
+ warnx(_("failed to open/lock clock counter"));
|
||||||
|
if (uuidd_cxt->debug) {
|
||||||
|
uuid_unparse(uu, str);
|
||||||
|
fprintf(stderr, _("Generated time UUID: %s\n"), str);
|
||||||
|
@@ -471,7 +472,8 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
|
||||||
|
break;
|
||||||
|
case UUIDD_OP_RANDOM_UUID:
|
||||||
|
num = 1;
|
||||||
|
- __uuid_generate_random(uu, &num);
|
||||||
|
+ if (__uuid_generate_time(uu, &num) < 0 && !uuidd_cxt->quiet)
|
||||||
|
+ warnx(_("failed to open/lock clock counter"));
|
||||||
|
if (uuidd_cxt->debug) {
|
||||||
|
uuid_unparse(uu, str);
|
||||||
|
fprintf(stderr, _("Generated random UUID: %s\n"), str);
|
||||||
|
@@ -480,7 +482,8 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
|
||||||
|
reply_len = sizeof(uu);
|
||||||
|
break;
|
||||||
|
case UUIDD_OP_BULK_TIME_UUID:
|
||||||
|
- __uuid_generate_time(uu, &num);
|
||||||
|
+ if (__uuid_generate_time(uu, &num) < 0 && !uuidd_cxt->quiet)
|
||||||
|
+ warnx(_("failed to open/lock clock counter"));
|
||||||
|
if (uuidd_cxt->debug) {
|
||||||
|
uuid_unparse(uu, str);
|
||||||
|
fprintf(stderr, P_("Generated time UUID %s "
|
||||||
|
diff --git a/misc-utils/uuidd.service.in b/misc-utils/uuidd.service.in
|
||||||
|
index b4c9c46..e64ca59 100644
|
||||||
|
--- a/misc-utils/uuidd.service.in
|
||||||
|
+++ b/misc-utils/uuidd.service.in
|
||||||
|
@@ -18,6 +18,7 @@ ProtectKernelModules=yes
|
||||||
|
ProtectControlGroups=yes
|
||||||
|
RestrictAddressFamilies=AF_UNIX
|
||||||
|
MemoryDenyWriteExecute=yes
|
||||||
|
+ReadWritePaths=/var/lib/libuuid/
|
||||||
|
SystemCallFilter=@default @file-system @basic-io @system-service @signal @io-event @network-io
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: util-linux
|
Name: util-linux
|
||||||
Version: 2.35.2
|
Version: 2.35.2
|
||||||
Release: 14
|
Release: 15
|
||||||
Summary: A random collection of Linux utilities
|
Summary: A random collection of Linux utilities
|
||||||
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
|
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
|
||||||
URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
|
URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
|
||||||
@ -86,6 +86,7 @@ Patch6005: backport-lscpu-use-SMBIOS-tables-on-ARM-for-lscpu.patch
|
|||||||
Patch9000: Add-check-to-resolve-uname26-version-test-failed.patch
|
Patch9000: Add-check-to-resolve-uname26-version-test-failed.patch
|
||||||
Patch9001: modify-rescuemode-chinese-error.patch
|
Patch9001: modify-rescuemode-chinese-error.patch
|
||||||
Patch9002: huawei-bios-model-name.patch
|
Patch9002: huawei-bios-model-name.patch
|
||||||
|
Patch9003: backport-uuidd-fix-open-lock-state-issue.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The util-linux package contains a random collection of files that
|
The util-linux package contains a random collection of files that
|
||||||
@ -432,6 +433,13 @@ fi
|
|||||||
%{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*}
|
%{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Mar 19 2024 cenhuilin <cenhuilin@kylinos.cn> - 2.35.2-15
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:sync community patches
|
||||||
|
backport-uuidd-fix-open-lock-state-issue.patch
|
||||||
|
|
||||||
* Wed Mar 6 2024 liyanan <liyanan61@h-partners.com> - 2.35.2-14
|
* Wed Mar 6 2024 liyanan <liyanan61@h-partners.com> - 2.35.2-14
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- CVE:NA
|
- CVE:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user