After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608539 - screen locking is vulnerable to a SysRq attack
screen locking is vulnerable to a SysRq attack
Status: RESOLVED INCOMPLETE
Product: gnome-shell
Classification: Core
Component: lock-screen
unspecified
Other Linux
: Normal critical
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-01-30 16:33 UTC by Josselin Mouette
Modified: 2015-03-05 20:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Josselin Mouette 2010-01-30 16:33:48 UTC
As described in http://bugs.debian.org/564079 you can easily kill the gnome-screensaver process if the SysRq keys are authorized. This pretty much defeats the idea of locking the screen.

Ths short-term solution is, of course, to disable the SysRq’s that can kill processes, but in the long term it would be better to make screen locking resilient to a loss of the controlling process. It’s annoying if you can’t get your session back because of a crash, but it’s much more annoying if someone else can get your session because of a vulnerability.

This would probably require a new X11 extension to lock the screen on the server side. This way, it would not be possible to unlock it in any other way than an already connected X11 client.
Comment 1 William Jon McCann 2010-01-30 20:18:24 UTC
Can you please summarize the issue here?  The other bug may get locked or go away and it also has lots of noise.  Thanks.
Comment 2 Josselin Mouette 2010-02-11 18:38:29 UTC
(Sorry for not replying earlier, I stopped receiving bugzilla emails 2 weeks ago because of a misconfiguration on my side.)

There are situations in which you can trick the Linux OOM killer into reaping the gnome-screensaver process. Most cases are non-obvious, but the Alt-SysRq-F combination will kill what the kernel thinks is the active process. If at the same time you get gnome-screensaver to do something (e.g. by moving the mouse) you can kill it.

Three solutions were proposed in this thread:
 - disable magic SysRq keys by default (and wait for people to re-enable them)
 - set /proc/self/oom_adj to -17 so that the process cannot be attacked by the OOM killer (a patch for this is coming)
 - a new X server extension that would lock the screen until an authenticated X client unlocks it - this has the advantage to work with anything that could possibly kill the gnome-screensaver process, but of course requires synchronisation with fd.o.
Comment 3 Josselin Mouette 2010-02-11 18:47:47 UTC
(In reply to comment #2)
>  - set /proc/self/oom_adj to -17 so that the process cannot be attacked by the
> OOM killer (a patch for this is coming)

Erm, the patch is not coming right now since it requires a setuid helper to do this /o\
Comment 4 Kiri 2010-02-19 10:25:27 UTC
This seems to me to be an issue of how a user has their system configured: not a GNOME bug. Requested features could assist.
Comment 5 Josselin Mouette 2010-02-27 13:34:12 UTC
(In reply to comment #4)
> This seems to me to be an issue of how a user has their system configured: not
> a GNOME bug. Requested features could assist.

I think it is a bug for gnome-screensaver to be vulnerable to any kind of attack that kills the process. It turns any DoS attack into a privilege escalation one.

It doesn’t mean we shouldn’t fix those attacks either, but it is a band-aid. Making screen locking resilient to a process crash would fix all such attacks at once.
Comment 6 Bastien Nocera 2014-08-19 21:10:01 UTC
The screen lock is implemented directly in gnome-shell, not in
gnome-screensaver (as it was with older version of GNOME 3 and GNOME 2.x).
Reassigning.
Comment 7 Bastien Nocera 2014-11-07 11:00:55 UTC
(In reply to comment #5)
<snip>
> Making screen locking resilient to a process crash would fix all such attacks
> at once.

I believe that was done in gnome-shell 3.9.2 (so 3.10 stable) in bug 691987. Can you confirm?
Comment 8 Florian Müllner 2015-03-05 09:51:04 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!
Comment 9 James 2015-03-05 19:41:45 UTC
(In reply to Florian Müllner from comment #8)
> Closing this bug report as no further information has been provided. Please
> feel free to reopen this bug report if you can provide the information that
> was asked for in a previous comment.
> Thanks!

What information is missing?
Comment 10 Florian Müllner 2015-03-05 20:16:44 UTC
(In reply to James from comment #9)
> What information is missing?


Quoting Bastien in comment #7:
> (In reply to comment #5)
> <snip>
> > Making screen locking resilient to a process crash would fix all such attacks
> > at once.
> 
> I believe that was done in gnome-shell 3.9.2 (so 3.10 stable) in bug 691987.
> Can you confirm?

So basically: gnome-shell will start locked when it crashed while locked, do you consider that good enough?