10 ms·
Does anyone know why lockscreens in Linux have been such a joke? I remember trying Ubuntu couple years ago and when waking up my laptop it would show me my enti
by gambiting 6y ago
Does anyone know why lockscreens in Linux have been such a joke? I remember trying Ubuntu couple years ago and when waking up my laptop it would show me my entire desktop with all the information displayed right there in the open for about 10-20 seconds before suddenly engaging the lockscreen. All you had to do was close the lid and open it again and you could just copy whatever was on the screen before the lock screen appeared. I guess it's because the lockscreen was a separate process that had to start up? Still, what an awful awful design.
- astrange 6y agoBad design in X11 which can't be fixed. https://news.ycombinator.com/item?id=25801693 https://news.ycombinator.com/item?id=25801693
- formerly_proven 6y agoX11 design flaws you say? https://github.com/swaywm/swaylock/issues/162 https://github.com/swaywm/swaylock/issues/162 https://github.com/swaywm/swaylock/issues/158 https://github.com/swaywm/swaylock/issues/158 https://github.com/swaywm/swaylock/issues/10 https://github.com/swaywm/swaylock/issues/10
- chrismorgan 6y agoI’m not familiar with the details of the design flaw and whether or not Wayland fixes it, but those links don’t contradict this being an X-specific design flaw. I get the impression that swaylock is a direct port of i3lock, and thus stands a fair chance of being written and architected in an X style, rather than taking advantage of any superior form that Wayland may support but X didn’t. Expressed otherwise: just because someone’s written one piece of bad software for Wayland doesn’t mean Wayland doesn’t allow you to write good software. (Whereas I get the impression from what I’m reading that X makes it impossible to write a good screen locker, if by that you require that it be crash-proof and use the usual platform toolkit for the UI.) (Remember in this that I’m saying I don’t know. I’d like to hear if Wayland does have a good answer to this, or from anyone with definite knowledge that it doesn’t.)
- waheoo 6y agoI think they're simply saying that lock screens are hard to get right and that shitting on x11 at every chance you get doesn't help anything.
- bionade24 6y agoIf you've ever looked in the bugtracker of a big X11 screenlocker, you would love to have this small amount of bugs. In fact, some of the bugs you posted are alread solved and I can't find one bug related to displaying. Giving the display to the user could also lie in other code parts. We'll see how this ends, but it's already a huge gain that not every Everyday Linux user has experienced such things by themselves.
- j-james 6y agoI'm surprised he doesn't mention XSecureLock. Its entire focus is on preventing issues like this with modularity and redundancy. https://github.com/google/xsecurelock https://github.com/google/xsecurelock
- bionade24 6y agoI fear it's as secure as vsftpd: Secure until a large amount of users use it and find bugs.
- toast0 6y agoThe underlying design issues are: a) there's no Xserver concept of a lock screen which would be hard to fix, I suspect. How would you signal X to lock/unlock; what would it do if the lock client wasn't connected, etc. b) there's no atomic way to transfer mouse/keyboard grab to another window, which means you can't have a reliable, crash reduced screen locker that supervises a beautiful password checking program; it has to be the same program. This could probably be fixed with an X extension; yes, an extension is a lot of work, and yes, you'd have to deal with fragmentation, but you could keep the untoolkited password dialog in case the extension isn't present, nobody would see it unless they did something odd, so it's fine. Another issue is that I think I've seen some linux systems don't launch the screen locker until resume, instead of locking before suspend; that's not ideal, because the screen locker will take time to launch and lock the screen (more so if it's got a fancy initialization routine and is a large binary/many libraries to load). An option could be running a dedicated screen lock Xserver on a different VT, and (securely) switching to that one somehow. But that would probably involve changes to multiple layers at the same time, which is hard to pull off in Linux. People would complain about the bloat of running a second Xserver, regardless of the actual bloat or imcreased utility.
- josefx 6y ago> and yes, you'd have to deal with fragmentation, Why not just require that it is there? Is there even a valid reason for someone to keep the extension out unless it is to give another "this is the reason X sucks" speech?
- toast0 6y agoBecause, IIRC, xscreensaver is launched on demand (idle timer, power management), and that's a terrible time to detect the extension and tell a user that they won't be able to resume their session, because their Xserver is too old. Also, because of piecemeal releases, and remote X. You might update Xscreensaver, but not your X server or desktop environment. You might have a dedicated X terminal which can't easily have its server component updated, but you run remote sessions that have an updated Xscreensaver. (Btw, if you do this, you're pretty dedicated in 2021)
- sontek 6y agoJWZ has been complaining about these screensavers for a decade. His screensaver from 20 years ago still doesn't have these issues. Its not an X11 problem. - https://bit.ly/3o2qekz https://bit.ly/3o2qekz - https://bit.ly/38Y6pGO https://bit.ly/38Y6pGO (using bit.ly because he gives a testicle if referrer is HN :P)
- nic_wilson 6y agoTo others, you'll definitely still want to copy paste that URL into a new tab rather than clicking directly. :~)
- metafunctor 6y agoI don't understand the part about JWZ's testicles, so here are the links without bit.ly tracking for those whose ad blockers don't allow them: - https://www.jwz.org/blog/2021/01/i-told-you-so-2021-edition/ https://www.jwz.org/blog/2021/01/i-told-you-so-2021-edition/ - https://www.jwz.org/xscreensaver/toolkits.html https://www.jwz.org/xscreensaver/toolkits.html [Edit]: I understand now. My browser doesn't send referrer URLs, and I think that's the real fix instead of using something like bit.ly!
- gambiting 6y agoYou still get the testicles if you click this link, at least using Chrome you do. It's because the referrer field is set to HN so they know where the traffic is coming from.
- notyourday 6y agoI do not understand. There's an xl and its PAM-checking derivative xl-more that just work. They do nothing fancy - paint a window over everything and wait for the password to be typed in. No animation. No graphics. No anything. No enter unlock password dialog. I am sure there could be some edge cases but I'm having a hard time identifying them.
- datenwolf 6y agoIt's not an X11 design flaw. The very concept of locking the screen is flawed. A flaw that also haunts Wayland, BTW. The concept of screen lockers is having a special layer, that can't be bypassed, which a locker creates. The whole security then hinges on the locker not crashing. X11 does have such a layer. Wayland compositors also implement it through such a layer. And for either the situation is, that if the locker crashes, that layer is destroyed by implication and the session exposed. That's a flawed concept. What you really want is detachable graphics session. On the text console one can effortlessly use screen or tmux and to "lock" the session simply detach and exit to the regular login getty. You want exactly the same, but for X11. And there's no obstacle in printiple to implement this. It's just that the Xorg server can't detach. Almost all of the required code is there, fundamentally it'd be the same code that's executed during a VT switch. In the meantime one can use Xpra with Xvfb to create detachable X11 sessions, which then however lack GPU acceleration.
- zadler 6y agoIt’s amazing to me that The most popular display managers on Linux have this flaw. Perhaps there is a workaround involving switching to another tty?
- arbitrage 6y agothat's a really good point! your comment reminded me that that is what we used to do in the lab at university, a long time ago. switching to a different terminal, then locking that, was much more fool proof. perhaps not for security, but rather because X11 was so damned buggy and crashy, that you might need to have access to that terminal to get back into your workstation without forcing a reboot.
- Blikkentrekker 6y agoPerhaps outside of display servers altogether, implementing an authentication system that keeps track of what user currently owns what v.t., and allowing only that user, or root, to switch to that v.t..
- shawnz 6y ago
- bionade24 6y agoBecause X11 is such a joke. The problem is solved by wlroots and layer-shell, other Wayland compositors probably have similar things. Swaylock works 100%ly reliable until now (For me). I had problems with every other X11 screenlocker I used in the past. My unusual setup with a docking station and two monitors on it often caused crazy bugs. Edit: For me stuff
- Munksgaard 6y agoWhat's your take on the issues listed by formerly_proven[0]? 0: https://news.ycombinator.com/item?id=25844338 https://news.ycombinator.com/item?id=25844338
- bionade24 6y agoI'll edit it to (for me). With working on an X11 desktop everyday, it felt like everyone has at least once experienced such an issue. To be fair to swaylock, they actually fixed some of those issues, in contrast to kscreenlocker which are just ignoring most edge-case bugs, because it's nearly impossible to fix them.
- Androider 6y agoIt's still a fundamentally flawed design, because the system fails open when the locker crashes. So it seems Sway / Wayland actually didn't learn anything in this area, and suffers from exactly the same problem as X11 when it comes to the lockscreen.
- PurpleFoxy 6y agoIt seems like most of the complaints I see about distros have actually been solved problems for years but held back by poor distro defaults. I have been recommending fedora to people for a while because their defaults are far more modern and sane rather than clinging on to python 2 and X11
- bionade24 6y ago
- globular-toast 6y agoI've seen Windows do that too. It's not just Linux. My guess is that these lock screens are all bolted on afterwards rather than being in the design from the ground up.
- Jonnax 6y agoWindows 10 or some ancient version of Windows?
- josefx 6y agoThere had been recent bugs on windows 10 where you could navigate your way to a desktop session through the input assistance dialogs (mashing the shift button). They fixed it by removing one of the links in the UI. In older Windows I think it was a mix of help and printer dialogs.
- saagarjha 6y agoI've seen this happen on macOS too.
- AnIdiotOnTheNet 6y ago> I've seen Windows do that too. Really? I have never seen this in Windows. Don't get me wrong, I've seen plenty of lock screen failures in Windows, usually in the form of it suddenly being unresponsive, just never anything that actually gave me access to the locked session again. The closest I've seen is when using RDP, if the Window has been minimized or hidden or otherwise has had reason not to update its display, then locked due to timeout, it will briefly show the last image it rendered when reactivated before updating and showing the lock screen. P.S.: As other users have pointed out, Windows does have some known lock screen bypasses using accessibility and help dialogs, but in regards to merely crashing the lock screen, I haven't seen it behave in an insecure way.
- joefife 6y agoI see this maybe once a week. It only seems to happen when I'm waking the PC.
- 3np 6y agoslock has never surprised or disappointed me.
- ekimekim 6y agoI've experienced an issue where the window blacking out the screen would get moved aside, it was something to do with plugging and unplugging monitors and somehow the screen contents would become visible. I probably couldn't reproduce it if I tried. I wasn't too concerned about it since it still blocked all user input, but if you had sensitive info visible it could definitely be an issue.
- boblivion 6y agohttps://www.jwz.org/xscreensaver/toolkits.html https://www.jwz.org/xscreensaver/toolkits.html Good post on the topic
- mici 6y agoThis link does not show what you think it will show (pretty much NSFW). The thread was linked below (or above, to this same parent), or see: https://web.archive.org/web/20210116101222/https://www.jwz.org/blog/2021/01/i-told-you-so-2021-edition/ https://web.archive.org/web/20210116101222/https://www.jwz.o...
- gambiting 6y agoUhm, this link doesn't lead where you think it does. Or the owner of the website is specifically redirecting HN traffic.
- Tsiklon 6y agoJudging by the redirect to the image macro of a testicle in an egg cup, specifically calling out HN, I think we can assume the author of that article does not appreciate links to his website from HN
- kowlo 6y agoI clicked the link specifically seeking out this testicle in an egg cup, however, all I got was an article on XScreenSaver. How do I get the testicle in an egg cup?
- minxomat 6y agoStill happening on Linux mint for me.
- f1refly 6y agoFor x lockscreens this is solved by making sure the lock launches _before_ the system is suspended, I'm not sure how many distros do it like that though.
- josephg 6y agoCan anyone explain why a crash in xscreensaver results in the computer being unlocked? It seems like this whole class of bugs could be fixed pretty easily by having a simple process watchdog run xscreensaver as a child process, and re-launch it if it crashes without first signalling that the desktop has been unlocked.
- josefx 6y ago> and re-launch it if it crashes without first signalling that the desktop has been unlocked. Might be better to just exit the session or load a minimalistic replacement lock program (like the original xscreensaver) to avoid an infinite crash loop.
- josephg 6y agoMaybe! An infinite crash loop is also usually better than a security vulnerability, so I think it would be a win even without that. Also this bug (and probably most other bugs xscreensaver has had over the years) wouldn't result in an infinite crash loop anyway.
- segfaultbuserr 6y agoKDE has a failsafe mechanism. If the screen locker has crashed, it shows a black screen of death with a huge error message. > The screen locker is broken and unlocking is not possible anymore. In order to unlock, switch to a virtual terminal (e.g. Ctrl+Alt+F2), log in and execute the command: "loginctl unlock session c2". Afterwards switch back to the running session. I think it's a reasonable design.
- bionade24 6y agoNo, it's not failsafe. I know a person where only one screen of two got locked, the second one remained operational.
- segfaultbuserr 6y agoOkay, let's call it an "incomplete failsafe". I don't want to discuss the correct terminology, but the idea itself.
- pojntfx 6y agoX11 problem. Wayland fixes that and is the default on Fedora etc. as of 2021.
- krick 6y agoOh, so Wayland is finally ready to replace X11?
- canofbars 6y agoWhether wayland is ready for you basically comes down to 2 questions: * Do you use a nvidia GPU * Do you need to screen share from electron or other x11 only applications (MS teams, etc) Its ready if you said no to both of those.
- bionade24 6y agoYou can use MS teams in Chromium or Firefox. The secret is that Browsers disable 3rd Party cookies per default for a year now or so and Microsoft has not reacted to it yet.
- xorcist 6y ago> Do you need to screen share from electron or other x11 only applications Doesn't XWayland solve this?
- gspr 6y agoScreen sharing of X11 windows from a Firefox running on Wayland works fine for me under Sway. Sharing of other Wayland windows, or the whole screen, however, does not.
- Kelamir 6y agoI use i3lock, no such issues with it.
- Illniyar 6y agoThis happens to me regularly with macOS too, so perhaps it's harder then you imagine.
- speedgoose 6y agoNever happened to me on Windows, so it shouldn't be that hard.
- joshuaissac 6y agoIt happens to me on Windows 10 if I close the laptop lid to lock the desktop and send it to sleep. When I open it again, the desktop is accessible for a few seconds (sometimes long enough to launch programs) before the lock screen activates and I have to input my password. The workaround I use is to manually lock with Win+L before closing the lid.
- passivate 6y agoWould you mind posting a video? I have never seen this occurring in any version of Windows.
- joshuaissac 6y agoI tried a few times but it cannot be reliably reproduced. It successfully locked every time I tried today.
- mmis1000 6y agoWindows have multiple desktop sessions(the normal user session, and the safe desktop). Even if you ever able to crash the one that host lock screen without bsod. You still won't be able to go back to the normal desktop.
- sbarre 6y agoYep, also happens to me on my macOS 10.15 iMac.. It will go to sleep, then when I wake it up, I get a flash of my desktop before the lock screen shows.. Too fast to write anything down by hand, but you could certainly point a 60fps camera at it and get something I'm sure.
- anthk 6y agoSlock is good.
- smolder 6y agoI don't dispute the bad design, but FYI, there was also a very recent exploit for accessing bitlocker drives on Windows without login credentials, making use of accessibility features on the lockscreen.
- deleted 6y ago[deleted]
- monopoledance 6y agoIn the past I also had some information leaks with an Nvidia discrete graphics card, which seemed to not clear its RAM or something. I think it even persisted over restarts or similar complete session terminations. So I assume, driver issues may play into this too.
- deleted 6y ago[deleted]