Bug 224440 - kwin crashes if the plugin specified in kwinrc does not exist or does no have all the required methods
Summary: kwin crashes if the plugin specified in kwinrc does not exist or does no have...
Alias: None
Product: kwin
Classification: Plasma
Component: kdecorations (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: HI major (vote)
Target Milestone: ---
Assignee: KWin default assignee
Depends on:
Reported: 2010-01-27 10:00 UTC by Jaime Torres
Modified: 2011-04-28 15:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.7.0


Note You need to log in before you can comment on or make changes to this bug.
Description Jaime Torres 2010-01-27 10:00:24 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Unfortunately, playing with systemsettings, I changed to a kwin decoration that did not have a required method, and kwin crashed in an assert.

The worst part is that I could not modify the kwin decoration after that because systemsettings also crashes when trying to modify it.

Also, this could generate a denial of service for KDESC, if a malicious program changes .kde(x)/share/config/kwinrc and modifies the PluginLib in the [Style] section to something that is not a kwin decoration plugin (or does not exists at all).

A solution is to load a known default plugin in that case.

You could reproduce it easily changing kwinrc. But be ready to play from the console to restart any window manager.
Comment 1 Martin Flöser 2010-01-27 10:10:36 UTC
You have specified "Compiled sources": are you using trunk or the 4.4 branch? In case of trunk what's your svn revision?
Comment 2 Jaime Torres 2010-01-27 10:13:15 UTC
trunk revision 1080161
Comment 3 Martin Flöser 2010-01-27 10:31:36 UTC
So it's the new decoration kcm. May I ask which decoration you tried? I'm somewhat surprised that the kcm loaded with an ABI incompatible decoration. It should crash as well...

In case of a not existing decoration it should fallback to Oxygen. In case of an ABI missmatch it's difficult. KWin in general provides binary compatability for window decorations, but we currently use an Unstable API as well, which is meant to be used only by decorations shipped with KDE SC. Unfortunatelly there are some external decorations using it although it is marked as unstable (and I don't think of Nitrogen or Aurorae as both are shipped with 4.4).
Comment 4 lucas 2010-01-27 10:42:16 UTC
Does not meet KWin HI priority status as it's not a common occurance.
Comment 5 lucas 2010-01-27 10:44:05 UTC
Misread, reverting priority.
Comment 6 Jaime Torres 2010-01-27 11:15:46 UTC
What I tried I think was kde3_nitrogen.so (until today late I can not provide more details).
I saw 3 keramik decorations in the settings and changed to the bottom keramik, and kwin crashed.
Then I tried to restart kwin (after setting the DISPLAY variable), and it crashed, then changed kwinrc with something strange and it crashed (I was curious). Then I used one of the plugin strings I saw in the console, and it worked again.
Comment 7 Martin Flöser 2010-01-27 11:47:01 UTC
Yes nitrogen for 4.3 is binary incompatible with 4.4. In case of distribution packages the distribution should conflict the packages and remove nitrogen on update to 4.4. So it's only an issue for us poor souls compiling from trunk ;-)
Comment 8 Jaime Torres 2010-01-27 19:53:08 UTC
in revision 1081093 (just a few minutes ago), when the plugin in kwinrc is set to a non existing .so, it defaults to oxygen, good, but if the .so exists and is not a kwin plugin, I see in the console:
The library ...../kde4/lib/....so is not a KWin plugin.
KWin will close now...
And then, no window manager.
Comment 9 lucas 2010-01-28 05:11:15 UTC
SVN commit 1081285 by lmurray:

If the loaded decoration library isn't a valid decoration load the
default decoration instead of dying.
CCBUG: 224440

 M  +8 -0      kdecoration_plugins_p.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1081285
Comment 10 lucas 2010-01-28 05:14:06 UTC
SVN commit 1081286 by lmurray:

Backport r1081285:
If the loaded decoration library isn't a valid decoration load the
default decoration instead of dying.
CCBUG: 224440

 M  +8 -0      kdecoration_plugins_p.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1081286
Comment 11 Martin Flöser 2011-04-28 15:55:21 UTC
Git commit 11dd4504b592180d38666872cd12fd5d4de90b81 by Martin Gräßlin.
Committed on 28/04/2011 at 15:56.
Pushed by graesslin into branch 'master'.

KWin does not require a decoration plugin any more

With config option "NoPlugin" in group "Style" it is possible to
no request that KWin should be run without a decoration plugin.
This is a change for Plasma Active to properly support no decorations.

As well if a decoration plugin cannot be loaded, KWin will no longer
exit, but continue to run just without a decoration. As a nice
side-effect changes in Oxygen no longer destroy my kwin build ;-)

BUG: 224440
FIXED-IN: 4.7.0
CCMAIL: sebas@kde.org

M  +1    -1    kwin/client.cpp     
M  +4    -2    kwin/composite.cpp     
M  +5    -1    kwin/libkdecorations/kdecoration_plugins_p.cpp     
M  +14   -3    kwin/plugins.cpp     
M  +7    -0    kwin/plugins.h     
M  +18   -6    kwin/workspace.cpp     
M  +24   -0    kwin/workspace.h