public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/glib2] cve-2026-58016-f44: Backport a patch to work around SELinux policies not allowing SYS_sched_setattr
@ 2026-08-11 10:36 Kalev Lember
  0 siblings, 0 replies; only message in thread
From: Kalev Lember @ 2026-08-11 10:36 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/glib2
            Branch : cve-2026-58016-f44
            Commit : a23372a417a7585eb79467275c2245a49383b3ea
            Author : Kalev Lember <klember@redhat.com>
            Date   : 2020-02-12T20:50:27+01:00
            Stats  : +46/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/glib2/c/a23372a417a7585eb79467275c2245a49383b3ea?branch=cve-2026-58016-f44

            Log:
            Backport a patch to work around SELinux policies not allowing SYS_sched_setattr

https://bugzilla.redhat.com/show_bug.cgi?id=1795524

---
diff --git a/0001-GThread-Check-if-sched_setattr-is-allowed-by-the-sys.patch b/0001-GThread-Check-if-sched_setattr-is-allowed-by-the-sys.patch
new file mode 100644
index 0000000..4deb21a
--- /dev/null
+++ b/0001-GThread-Check-if-sched_setattr-is-allowed-by-the-sys.patch
@@ -0,0 +1,39 @@
+From 9308ef9a4b82372c5c94e736a2ec68581309a1e3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
+Date: Mon, 10 Feb 2020 14:24:48 +0200
+Subject: [PATCH] GThread - Check if sched_setattr is allowed by the system
+ policies before depending on it
+
+On Fedora it's apparently not allowed so we'll have to fall back to the
+thread-spawner thread in GThreadPool instead.
+---
+ glib/gthread-posix.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c
+index 9df6d7994..271bb5dbc 100644
+--- a/glib/gthread-posix.c
++++ b/glib/gthread-posix.c
+@@ -1211,6 +1211,19 @@ g_system_thread_get_scheduler_settings (GThreadSchedulerSettings *scheduler_sett
+     }
+   while (res == -1);
+ 
++  /* Try setting them on the current thread to see if any system policies are
++   * in place that would disallow doing so */
++  res = syscall (SYS_sched_setattr, tid, scheduler_settings->attr, flags);
++  if (res == -1)
++    {
++      int errsv = errno;
++
++      g_debug ("Failed to set thread scheduler attributes: %s", g_strerror (errsv));
++      g_free (scheduler_settings->attr);
++
++      return FALSE;
++    }
++
+   return TRUE;
+ #else
+   return FALSE;
+-- 
+2.24.1
+

diff --git a/glib2.spec b/glib2.spec
index de3bf4d..86641da 100644
--- a/glib2.spec
+++ b/glib2.spec
@@ -2,7 +2,7 @@
 
 Name: glib2
 Version: 2.63.5
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: A library of handy utility functions
 
 License: LGPLv2+
@@ -11,6 +11,8 @@ Source0: http://download.gnome.org/sources/glib/2.63/glib-%{version}.tar.xz
 
 # https://gitlab.gnome.org/GNOME/glib/merge_requests/1339
 Patch0: CVE-2020-6750.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=1795524
+Patch1: 0001-GThread-Check-if-sched_setattr-is-allowed-by-the-sys.patch
 
 BuildRequires: chrpath
 BuildRequires: gcc
@@ -219,6 +221,10 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
 %{_datadir}/installed-tests
 
 %changelog
+* Wed Feb 12 2020 Kalev Lember <klember@redhat.com> - 2.63.5-3
+- Backport a patch to work around SELinux policies not allowing
+  SYS_sched_setattr (#1795524)
+
 * Fri Feb 07 2020 Michael Catanzaro <mcatanzaro@redhat.com> - 2.63.5-2
 - Add patch for CVE-2020-6750 and related issues.
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-11 10:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-11 10:36 [rpms/glib2] cve-2026-58016-f44: Backport a patch to work around SELinux policies not allowing SYS_sched_setattr Kalev Lember

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox