Bug 352617 - Locked desktop becomes visible for a few seconds after resuming before lockscreen appears
Summary: Locked desktop becomes visible for a few seconds after resuming before locksc...
Status: RESOLVED FIXED
Alias: None
Product: kscreenlocker
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-12 13:44 UTC by Najjar
Modified: 2015-12-16 07:11 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Najjar 2015-09-12 13:44:41 UTC
This is a possible variant of https://bugs.kde.org/show_bug.cgi?id=348850 & https://bugs.kde.org/show_bug.cgi?id=344427 or caused by the same component(s)

On a laptop, when sending the OS into standby, then resuming again (such as closing the lid, then opening it), the lockscreen doesn't immediately show. It always shows the current desktop, sometimes long enough to manipulate it (today it was enough to open NM applet and trying to connect to WiFi after I thought that KDE decided no need for a lockscreen today!)

When it's quick, it shows the current session (which is a security issue). When it's longer you can move the mouse around or even type something (another security issue where it could be used to execute a script that kills lockscreen)

Here's the output of qdbus org.kde.KWin /KWin supportInformation: https://paste.kde.org/puaufjov1
I don't have glxinfo, but compositing is enabled in System Settings

Reproducible: Always

Steps to Reproduce:
1. Send the PC into standby
2. Resume
3. Session appears first, then lockscreen

Actual Results:  
Session appears first (completely usable), then lockscreen loads

Expected Results:  
Lockscreen is the first thing that loads. Session isn't visible
Comment 1 Martin Flöser 2015-09-15 09:02:28 UTC
* are you using logind?
* how do you send the PC into standby?
Comment 2 Najjar 2015-09-15 09:48:39 UTC
Yes, I'm using logind & SDDM

I usually send it through the power button. I've set it to Standby when clicked. It resumes when I open the lid
Comment 3 Martin Flöser 2015-09-15 10:23:15 UTC
> I've set it to Standby when clicked

where did you configure that?
Comment 4 Najjar 2015-09-15 10:32:26 UTC
The KDE Power Management (PowerDevil)
Comment 5 Martin Flöser 2015-09-15 11:44:40 UTC
I'm currently trying to reproduce, but my power button do not work.

Can you please verify with the tool xev whether the button reports key events? Maybe they are handled in the linux kernel without ever reaching our software....
Comment 6 Najjar 2015-09-15 11:53:40 UTC
Are you looking for a particular event? I can't post all of the output, because when I clicked the power button, it went into standby and I typed my password

Anyway, it's not about the power button. The problem can still be reproduced when clicking the button in the App Launcher IIRC
Comment 7 Martin Flöser 2015-09-15 12:08:50 UTC
>  The problem can still be reproduced when clicking the button in the App Launcher IIRC

Including that you can interact with the system? That the screen "looks" unlocked is normal, but it should be impossible to interact with keyboard/mouse.
Comment 8 Najjar 2015-09-15 12:17:56 UTC
The interaction with a mouse/keyboard happened after a particularly heavy IO operation (I think I was doing some work on a VM. I don't remember the exact things I was doing that day). I've only noticed it long enough this once
Comment 9 Martin Flöser 2015-09-15 12:23:06 UTC
> The interaction with a mouse/keyboard happened after a particularly heavy IO operation

ah that's a particular important piece of information. I guess there is nothing we can do about that. If ksmserver needs to be swapped in it might be that the logind timeout is reached before ksmserver had a chance to handle the suspend request. That's unfortunate but I don't see what we can do about it.
Comment 10 Martin Flöser 2015-09-15 12:25:00 UTC
for what is worth to mention: Wayland will make such situations impossible. As the lock screen will move into the compositor we can be sure that the lock screen functionality will not be swapped out and that input events will reach the compositor only after the suspend request.
Comment 11 Najjar 2015-09-15 12:38:27 UTC
I did heavy IO that night, but it was done some time before standby (and I went to do other things after)

Wouldn't this be an attack angle (the timeout)? The standby process went without problems, and if logind timed out, why did the lockscreen appear on resume?
Comment 12 Martin Flöser 2015-09-15 12:59:06 UTC
> I did heavy IO that night, but it was done some time before standby (and I went to do other things after)

it might be that ksmserver was swapped out and not needed before, so be swapped in again.

> Wouldn't this be an attack angle (the timeout)?

yes, but only if the system is already owned.

> The standby process went without problems, and if logind timed out, why did the lockscreen appear on resume?

the signal was emitted, it was just that ksmserver did not handle the request yet. So after resume it handled it but had no idea that the system already resumed again.
Comment 13 Najjar 2015-09-15 13:05:18 UTC
> the signal was emitted, it was just that ksmserver did not handle the request yet. So after resume it handled it but had no idea that the system already resumed again.

Makes sense

So what becomes of this bug report then?
Comment 14 Martin Flöser 2015-09-15 14:22:53 UTC
> So what becomes of this bug report then?

not sure yet. I haven't completely made up my mind whether there is a chance that we can do anything about it.
Comment 15 Najjar 2015-09-19 09:37:29 UTC
It happened again. No heavy IO, just a day of regular internet browsing and some films in MP4 (VLC)

This time, it was for about a second and a half, but I definitely moved the mouse around
Comment 16 Martin Flöser 2015-09-19 11:33:02 UTC
> but I definitely moved the mouse around

moving mouse around is fine, but did it react to clicks?
Comment 17 Najjar 2015-09-19 11:35:52 UTC
I didn't get enough time to click, and I don't know how I can reproduce it

In the original report (the first time) it was much longer, and I was able to open NM-applet and disconnect/connect
Comment 18 Martin Flöser 2015-12-15 17:24:29 UTC
any news? Did it happen again?
Comment 19 Najjar 2015-12-15 18:49:51 UTC
No, not exactly
The screen was visible, and the cursor moved around, but I couldn't click anything.
Comment 20 Najjar 2015-12-15 18:54:49 UTC
I hit submit when I meant to hit enter.
To clarify further, even though the time of visibility was long, the screen wasn't reactive (it was similar to a picture). The items didn't respond to clicking
Comment 21 Martin Flöser 2015-12-16 07:11:17 UTC
ok, that matches the known limitations: the screen locks, but the greeter doesn't show. We improved that in 5.5 significantly.