Accepting request 510027 from home:alarrosa:branches:GNOME:Factory

- Add
  gnome-shell-1036494-Consistently-handle-createExtensionObject-errors.patch,
  gnome-shell-1036494-Catch-import-errors.patch and
  gnome-shell-1036494-Consistently-handle-initExtension-errors.patch
  to handle correctly extensions that fail to load (bsc#1036494,
  bgo#781728, CVE-2017-8288).

OBS-URL: https://build.opensuse.org/request/show/510027
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-shell?expand=0&rev=309
This commit is contained in:
Dominique Leuenberger 2017-07-13 08:44:43 +00:00 committed by Git OBS Bridge
parent 4a847fa9a7
commit db8a4dd9d2
5 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,18 @@
Index: gnome-shell-3.20.4/js/ui/extensionSystem.js
===================================================================
--- gnome-shell-3.20.4.orig/js/ui/extensionSystem.js
+++ gnome-shell-3.20.4/js/ui/extensionSystem.js
@@ -224,7 +224,12 @@ function initExtension(uuid) {
let extensionState = null;
ExtensionUtils.installImporter(extension);
- extensionModule = extension.imports.extension;
+ try {
+ extensionModule = extension.imports.extension;
+ } catch(e) {
+ logExtensionError(uuid, e);
+ return false;
+ }
if (extensionModule.init) {
try {

View File

@ -0,0 +1,52 @@
Index: gnome-shell-3.20.4/js/ui/extensionDownloader.js
===================================================================
--- gnome-shell-3.20.4.orig/js/ui/extensionDownloader.js
+++ gnome-shell-3.20.4/js/ui/extensionDownloader.js
@@ -130,12 +130,14 @@ function updateExtension(uuid) {
FileUtils.recursivelyMoveDir(extensionDir, oldExtensionTmpDir);
FileUtils.recursivelyMoveDir(newExtensionTmpDir, extensionDir);
- let extension = ExtensionUtils.createExtensionObject(uuid, extensionDir, ExtensionUtils.ExtensionType.PER_USER);
+ let extension = null;
try {
+ extension = ExtensionUtils.createExtensionObject(uuid, extensionDir, ExtensionUtils.ExtensionType.PER_USER);
ExtensionSystem.loadExtension(extension);
} catch(e) {
- ExtensionSystem.unloadExtension(extension);
+ if (extension)
+ ExtensionSystem.unloadExtension(extension);
logError(e, 'Error loading extension %s'.format(uuid));
@@ -242,9 +244,8 @@ const InstallExtensionDialog = new Lang.
global.settings.set_strv(ExtensionSystem.ENABLED_EXTENSIONS_KEY, enabledExtensions);
}
- let extension = ExtensionUtils.createExtensionObject(uuid, dir, ExtensionUtils.ExtensionType.PER_USER);
-
try {
+ let extension = ExtensionUtils.createExtensionObject(uuid, dir, ExtensionUtils.ExtensionType.PER_USER);
ExtensionSystem.loadExtension(extension);
} catch(e) {
uninstallExtension(uuid);
Index: gnome-shell-3.20.4/js/ui/extensionSystem.js
===================================================================
--- gnome-shell-3.20.4.orig/js/ui/extensionSystem.js
+++ gnome-shell-3.20.4/js/ui/extensionSystem.js
@@ -198,7 +198,14 @@ function reloadExtension(oldExtension) {
unloadExtension(oldExtension);
// Now, recreate the extension and load it.
- let newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type);
+ let newExtension;
+ try {
+ newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type);
+ } catch(e) {
+ logExtensionError(uuid, e);
+ return;
+ }
+
loadExtension(newExtension);
}

View File

@ -0,0 +1,17 @@
Index: gnome-shell-3.20.4/js/ui/extensionSystem.js
===================================================================
--- gnome-shell-3.20.4.orig/js/ui/extensionSystem.js
+++ gnome-shell-3.20.4/js/ui/extensionSystem.js
@@ -217,8 +217,10 @@ function initExtension(uuid) {
throw new Error("Extension was not properly created. Call loadExtension first");
let extensionJs = dir.get_child('extension.js');
- if (!extensionJs.query_exists(null))
- throw new Error('Missing extension.js');
+ if (!extensionJs.query_exists(null)) {
+ logExtensionError(uuid, new Error('Missing extension.js'));
+ return false;
+ }
let extensionModule;
let extensionState = null;

View File

@ -1,4 +1,13 @@
-------------------------------------------------------------------
Tue Jul 11 11:24:48 UTC 2017 - alarrosa@suse.com
- Add
gnome-shell-1036494-Consistently-handle-createExtensionObject-errors.patch,
gnome-shell-1036494-Catch-import-errors.patch and
gnome-shell-1036494-Consistently-handle-initExtension-errors.patch
to handle correctly extensions that fail to load (bsc#1036494,
bgo#781728, CVE-2017-8288).
-------------------------------------------------------------------
Mon Jul 10 10:00:39 UTC 2017 - qzheng@suse.com
- Enable gnome-shell-878951-hide-list-with-no-user.patch on

View File

@ -60,6 +60,12 @@ Patch13: gnome-shell-login-fix-session-button-can-be-clicked.patch
Patch14: gnome-shell-portalhelper-fixes.patch
# PATCH-FEATURE-SLE gnome-shell-1007468-lock-screen-SUSE-logo-missing.patch xwang@suse.com -- Add SUSE logo on lock screen for GNOME theme.
Patch15: gnome-shell-1007468-lock-screen-SUSE-logo-missing.patch
# PATCH-FIX-UPSTREAM gnome-shell-1036494-Consistently-handle-createExtensionObject-errors.patch bsc#1036494 bgo#781728 alarrosa@suse.com -- Handle errors consistently
Patch16: gnome-shell-1036494-Consistently-handle-createExtensionObject-errors.patch
# PATCH-FIX-UPSTREAM gnome-shell-1036494-Catch-import-errors.patch bsc#1036494 bgo#781728 alarrosa@suse.com -- Catch import errors
Patch17: gnome-shell-1036494-Catch-import-errors.patch
# PATCH-FIX-UPSTREAM gnome-shell-1036494-Consistently-handle-initExtension-errors.patch bsc#1036494 bgo#781728 alarrosa@suse.com -- Handle errors consistently
Patch18: gnome-shell-1036494-Consistently-handle-initExtension-errors.patch
## NOTE: Keep SLE Classic pathes at bottom.
## NOTE: Keep SLE Classic pathes at bottom.
# PATCH-FEATURE-SLE gs-sle-classic-ext.patch bnc#862615 cxiong@suse.com -- add SLE Classic support
@ -205,6 +211,10 @@ into GNOME Shell calendar.
%patch5 -p1
%patch13 -p1
%patch14 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%if !0%{?is_opensuse}
%patch1000 -p1
translation-update-upstream