From 80395b976871ba1468629d4261bc9e24cbf6960cac4601231f47573af56339af Mon Sep 17 00:00:00 2001 From: Nikolay Gueorguiev Date: Mon, 12 Feb 2024 15:48:46 +0000 Subject: [PATCH 1/3] Accepting request 1146219 from home:ngueorguiev:branches:hardware - Upgrade to version 2.4.1 (jsc#PED-3285) * Handle systems with `/sys/kernel/security/lockdown` enabled * Consistency check: Fix accounting of reserved cores and CPUs * Trace: Fix display of version information * Doxygen config: Remove unused options - Removed obsolete patch qclib-sys-kernel-security-lockdown-enabled.patch OBS-URL: https://build.opensuse.org/request/show/1146219 OBS-URL: https://build.opensuse.org/package/show/hardware/qclib?expand=0&rev=45 --- qclib-2.4.0.tar.gz | 3 -- qclib-2.4.1.tar.gz | 3 ++ ...sys-kernel-security-lockdown-enabled.patch | 51 ------------------- qclib.changes | 10 ++++ qclib.spec | 6 +-- 5 files changed, 16 insertions(+), 57 deletions(-) delete mode 100644 qclib-2.4.0.tar.gz create mode 100644 qclib-2.4.1.tar.gz delete mode 100644 qclib-sys-kernel-security-lockdown-enabled.patch diff --git a/qclib-2.4.0.tar.gz b/qclib-2.4.0.tar.gz deleted file mode 100644 index 1910391..0000000 --- a/qclib-2.4.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aa4f58e6e2f4b7e41312f9e756f70f08952d0418d4c498de23fc731a4d32cb27 -size 94455 diff --git a/qclib-2.4.1.tar.gz b/qclib-2.4.1.tar.gz new file mode 100644 index 0000000..2f00f47 --- /dev/null +++ b/qclib-2.4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62a7159c570e2651e74bbeb47880d8f2f1ee97db55376f45fd53db269b09cc4f +size 93843 diff --git a/qclib-sys-kernel-security-lockdown-enabled.patch b/qclib-sys-kernel-security-lockdown-enabled.patch deleted file mode 100644 index 7f2899e..0000000 --- a/qclib-sys-kernel-security-lockdown-enabled.patch +++ /dev/null @@ -1,51 +0,0 @@ -commit 73f9792009be42fe652ae897d390852f18bf445a -Author: Stefan Raspl -Date: Thu Sep 7 22:47:16 2023 +0200 - - Handle systems with /sys/kernel/security/lockdown enabled - - Hypfs becomes inaccessible when /sys/kernel/security/lockdown is enabled, as - is the case with e.g. secure booted systems. - To reproduce, run - - echo integrity > /sys/kernel/security/lockdown - - Since qclib conceptually only requires access to /proc/sysinfo at a minimum, - we simply skip hypfs in this case. - - Signed-off-by: Stefan Raspl - -diff --git a/query_capacity_hypfs.c b/query_capacity_hypfs.c -index 9845e88b..3907c269 100644 ---- a/query_capacity_hypfs.c -+++ b/query_capacity_hypfs.c -@@ -617,7 +617,7 @@ static int qc_read_diag_file(struct qc_handle *hdl, const char *dbgfs, struct hy - out_fail: - free(priv->data); - priv->data = NULL; -- rc = -1; -+ rc = 1; - out: - free(fpath); - -@@ -942,14 +942,18 @@ static int qc_hypfs_open(struct qc_handle *hdl, char **buf) { - /* if z/VM diag file exists, the LPAR diag file's content - isn't valid, so we're done after handling the z/VM file */ - priv->diag = QC_HYPFS_ZVM; -- if ((rc = qc_read_diag_file(hdl, dbgfs, priv)) != 0) -+ if ((rc = qc_read_diag_file(hdl, dbgfs, priv)) != 0) { -+ rc = 0; // not a fatal error - we just skip this source - goto out; -+ } - priv->avail = HYPFS_AVAIL_BIN_ZVM; - } else { - qc_debug(hdl, "No z/VM diag file found, must be an LPAR\n"); - priv->diag = QC_HYPFS_LPAR; -- if ((rc = qc_read_diag_file(hdl, dbgfs, priv)) != 0) -+ if ((rc = qc_read_diag_file(hdl, dbgfs, priv)) != 0) { -+ rc = 0; // not a fatal error - we just skip this source - goto out; -+ } - priv->avail = HYPFS_AVAIL_BIN_LPAR; - } - } else { diff --git a/qclib.changes b/qclib.changes index eb25ee7..e66c57b 100644 --- a/qclib.changes +++ b/qclib.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Feb 12 16:48:47 UTC 2024 - Nikolay Gueorguiev + +- Upgrade to version 2.4.1 (jsc#PED-3285) + * Handle systems with `/sys/kernel/security/lockdown` enabled + * Consistency check: Fix accounting of reserved cores and CPUs + * Trace: Fix display of version information + * Doxygen config: Remove unused options +- Removed obsolete patch qclib-sys-kernel-security-lockdown-enabled.patch + ------------------------------------------------------------------- Wed Oct 25 06:16:21 UTC 2023 - Nikolay Gueorguiev diff --git a/qclib.spec b/qclib.spec index 46f3e1b..ced5999 100644 --- a/qclib.spec +++ b/qclib.spec @@ -1,7 +1,7 @@ # # spec file for package qclib # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %global _lto_cflags %{?_lto_cflags} -ffat-lto-objects Name: qclib -Version: 2.4.0 +Version: 2.4.1 Release: 0 Summary: Query Capacity library License: BSD-3-Clause @@ -37,7 +37,7 @@ BuildRequires: glibc-devel %endif # -Patch001: qclib-sys-kernel-security-lockdown-enabled.patch +### Patch001: qclib-sys-kernel-security-lockdown-enabled.patch %description qclib provides a C API for extraction of system information for Linux on z From 13477be5d8d3bf26f9beecbc5fae9525bbb1e719fb321157b2c5f1bacf56c796 Mon Sep 17 00:00:00 2001 From: Nikolay Gueorguiev Date: Fri, 19 Apr 2024 12:24:54 +0000 Subject: [PATCH 2/3] Accepting request 1169171 from home:ngueorguiev:branches:hardware - Applied a patch to change the _PATH_MOUNTED (bsc#1222143) * qclib-change-_PATH_MOUNTED.patch OBS-URL: https://build.opensuse.org/request/show/1169171 OBS-URL: https://build.opensuse.org/package/show/hardware/qclib?expand=0&rev=46 --- qclib-change-_PATH_MOUNTED.patch | 12 ++++++++++++ qclib.changes | 6 ++++++ qclib.spec | 1 + 3 files changed, 19 insertions(+) create mode 100644 qclib-change-_PATH_MOUNTED.patch diff --git a/qclib-change-_PATH_MOUNTED.patch b/qclib-change-_PATH_MOUNTED.patch new file mode 100644 index 0000000..9709057 --- /dev/null +++ b/qclib-change-_PATH_MOUNTED.patch @@ -0,0 +1,12 @@ +--- qclib-2.4.1.orig/query_capacity_hypfs.c 2023-12-17 23:06:06.000000000 +0100 ++++ qclib-2.4.1.changed/query_capacity_hypfs.c 2024-04-19 13:35:35.683106609 +0200 +@@ -11,6 +11,9 @@ + + #include "query_capacity_data.h" + ++/* Workaround changing '/etc/mtab' to '/proc/self/mounts' */ ++#define _PATH_MOUNTED "/proc/self/mounts" ++/* */ + + #define QC_HYPFS_LPAR "/s390_hypfs/diag_204" + #define QC_HYPFS_ZVM "/s390_hypfs/diag_2fc" diff --git a/qclib.changes b/qclib.changes index e66c57b..1f61be9 100644 --- a/qclib.changes +++ b/qclib.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 19 11:55:09 UTC 2024 - Nikolay Gueorguiev + +- Applied a patch to change the _PATH_MOUNTED (bsc#1222143) + * qclib-change-_PATH_MOUNTED.patch + ------------------------------------------------------------------- Mon Feb 12 16:48:47 UTC 2024 - Nikolay Gueorguiev diff --git a/qclib.spec b/qclib.spec index ced5999..45dadc9 100644 --- a/qclib.spec +++ b/qclib.spec @@ -38,6 +38,7 @@ BuildRequires: glibc-devel # ### Patch001: qclib-sys-kernel-security-lockdown-enabled.patch +Patch001: qclib-change-_PATH_MOUNTED.patch %description qclib provides a C API for extraction of system information for Linux on z From 6c917192782013d0c1fd9d890081d3ea7786ca936e1e7478f9041ed1d3529d2b Mon Sep 17 00:00:00 2001 From: Nikolay Gueorguiev Date: Fri, 19 Apr 2024 15:22:53 +0000 Subject: [PATCH 3/3] Accepting request 1169240 from home:ngueorguiev:branches:hardware Changed the patch qclib-change-_PATH_MOUNTED.patch OBS-URL: https://build.opensuse.org/request/show/1169240 OBS-URL: https://build.opensuse.org/package/show/hardware/qclib?expand=0&rev=47 --- qclib-change-_PATH_MOUNTED.patch | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/qclib-change-_PATH_MOUNTED.patch b/qclib-change-_PATH_MOUNTED.patch index 9709057..f23752a 100644 --- a/qclib-change-_PATH_MOUNTED.patch +++ b/qclib-change-_PATH_MOUNTED.patch @@ -1,12 +1,31 @@ --- qclib-2.4.1.orig/query_capacity_hypfs.c 2023-12-17 23:06:06.000000000 +0100 -+++ qclib-2.4.1.changed/query_capacity_hypfs.c 2024-04-19 13:35:35.683106609 +0200 -@@ -11,6 +11,9 @@ ++++ qclib-2.4.1.changed/query_capacity_hypfs.c 2024-04-19 17:07:09.007848701 +0200 +@@ -11,6 +11,7 @@ #include "query_capacity_data.h" -+/* Workaround changing '/etc/mtab' to '/proc/self/mounts' */ -+#define _PATH_MOUNTED "/proc/self/mounts" -+/* */ ++#define N_PATH_MOUNTED "/proc/self/mounts" #define QC_HYPFS_LPAR "/s390_hypfs/diag_204" #define QC_HYPFS_ZVM "/s390_hypfs/diag_2fc" +@@ -830,9 +831,9 @@ + } + qc_debug(hdl, "Locate mount point of %s\n", fstype); + *mp = NULL; +- mounts = setmntent(_PATH_MOUNTED, "r"); ++ mounts = setmntent(N_PATH_MOUNTED, "r"); + if (!mounts) { +- qc_debug(hdl, "Error: Failed to open %s\n", _PATH_MOUNTED); ++ qc_debug(hdl, "Error: Failed to open %s\n", N_PATH_MOUNTED); + return -1; + } + while ((mntbuf = getmntent(mounts)) != NULL) { +@@ -848,7 +849,7 @@ + } + endmntent(mounts); + if (!*mp) { +- qc_debug(hdl, "%s not mounted according to '%s'\n", fstype, _PATH_MOUNTED); ++ qc_debug(hdl, "%s not mounted according to '%s'\n", fstype, N_PATH_MOUNTED); + return 1; + } + qc_debug(hdl, "%s mounted at '%s'\n", fstype, *mp);