From 084315a8eced1904dde79d53d1e73f713e9d6962 Mon Sep 17 00:00:00 2001 From: guoxiaoqi Date: Thu, 19 Nov 2020 14:37:40 +0800 Subject: [PATCH] fix CVE-2020-16125 --- ...ptr-to-handle-errors-in-look-for-exi.patch | 58 +++++++++++++++++++ gdm.spec | 8 ++- 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 display-Use-autoptr-to-handle-errors-in-look-for-exi.patch diff --git a/display-Use-autoptr-to-handle-errors-in-look-for-exi.patch b/display-Use-autoptr-to-handle-errors-in-look-for-exi.patch new file mode 100644 index 0000000..76adc34 --- /dev/null +++ b/display-Use-autoptr-to-handle-errors-in-look-for-exi.patch @@ -0,0 +1,58 @@ +From 4e6e5335d29c039bed820c43bfd1c19cb62539ff Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Tue, 27 Oct 2020 15:38:28 +0100 +Subject: [PATCH] display: Use autoptr to handle errors in look for existing + users + +It will make things just cleaner +--- + daemon/gdm-display.c | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c +index 5e193f2..a65cbf1 100644 +--- a/daemon/gdm-display.c ++++ b/daemon/gdm-display.c +@@ -539,9 +539,9 @@ gdm_display_real_prepare (GdmDisplay *self) + static void + look_for_existing_users_sync (GdmDisplay *self) + { +- GError *error = NULL; +- GVariant *call_result; +- GVariant *user_list; ++ g_autoptr(GError) error = NULL; ++ g_autoptr(GVariant) call_result = NULL; ++ g_autoptr(GVariant) user_list = NULL; + + self->priv->accountsservice_proxy = g_dbus_proxy_new_sync (self->priv->connection, + 0, NULL, +@@ -553,7 +553,7 @@ look_for_existing_users_sync (GdmDisplay *self) + + if (!self->priv->accountsservice_proxy) { + g_warning ("Failed to contact accountsservice: %s", error->message); +- goto out; ++ return FALSE; + } + + call_result = g_dbus_proxy_call_sync (self->priv->accountsservice_proxy, +@@ -566,15 +566,12 @@ look_for_existing_users_sync (GdmDisplay *self) + + if (!call_result) { + g_warning ("Failed to list cached users: %s", error->message); +- goto out; ++ return FALSE; + } + + g_variant_get (call_result, "(@ao)", &user_list); + self->priv->have_existing_user_accounts = g_variant_n_children (user_list) > 0; +- g_variant_unref (user_list); +- g_variant_unref (call_result); +-out: +- g_clear_error (&error); ++ return TRUE; + } + + gboolean +-- +1.8.3.1 + diff --git a/gdm.spec b/gdm.spec index 8850096..fe56054 100644 --- a/gdm.spec +++ b/gdm.spec @@ -1,12 +1,13 @@ Name: gdm Epoch: 1 Version: 3.30.1 -Release: 7 +Release: 8 Summary: A graphical display manager License: GPLv2+ URL: https://wiki.gnome.org/Projects/GDM Source0: http://download.gnome.org/sources/gdm/3.30/gdm-%{version}.tar.xz -Patch9000: 9000-add-openeuler-pam-config.patch +Patch0: 9000-add-openeuler-pam-config.patch +Patch1: display-Use-autoptr-to-handle-errors-in-look-for-exi.patch BuildRequires: pam-devel >= 0:0.99.8.1-11 desktop-file-utils >= 0.2.90 BuildRequires: libtool automake autoconf libattr-devel gettext-devel libdmx-devel @@ -161,6 +162,9 @@ fi %{_libdir}/pkgconfig/*.pc %changelog +* Thu Nov 19 2020 openEuler Buildteam - 1:3.30.1-8 +- fix CVE-2020-16125 + * Tue Jan 14 2020 openEuler Buildteam - 1:3.30.1-7 - Type:bugfix - Id:NA -- Gitee