pop-os / cosmic-greeter

libcosmic greeter for greetd, which can be run inside cosmic-comp
GNU General Public License v3.0
60 stars 33 forks source link

[BUG] [SECURITY] Cosmic greeter crash when displays disconnect and unlocks user's desktop without auth #151

Open gmpinder opened 1 week ago

gmpinder commented 1 week ago

version: cosmic-greeter-1.0.0~alpha.2^git20241014.7366808-1.fc40.x86_64 os: Bazzite 40 (FROM Fedora Kinoite) display manager: SDDM

I've got my system setup with a KVM that disconnects my monitors from the PC when switching. I normally will lock my system (Super+Esc) before switching, but now when I switch back the greeter crashes and drops me into a fresh desktop session without making me login.

Drakulix commented 1 week ago

That doesn't sound like a cosmic-greeter crash (which wouldn't leave you with an open session), but a compositor crash (which indeed the "locked" state wouldn't survive, we need to fix that). Do you have a log for that crash? (journalctl --user _COMM=cosmic-comp)

gmpinder commented 1 week ago

Makes sense. Here's what I've got comic-comp-journal.log

ids1024 commented 1 week ago

Is this consistently reproducible? I don't seem to see this, though maybe I'm not testing the exact same situation.

It would be clearer to see what's going on in a debug build that produces a more complete backtrace.

But if https://github.com/pop-os/cosmic-comp/blob/eb64fdaf8fe4f5e6957a35e74004b183acc905c8/src/shell/mod.rs#L974 is failing, .active() is being called before .add_output() has added the output? Or after the output has been removed.

gmpinder commented 1 week ago

It's very consistent for me, like every time I perform the action of locking, switching the KVM, and switching back. I have 2 monitors plugged into the KVM. Both are 2560x1440. One goes up to 144Hz and the other up to 60Hz.

gmpinder commented 1 week ago

It would be clearer to see what's going on in a debug build that produces a more complete backtrace.

I'm running the COPR build of cosmic on a Fedora Atomic image. Is there an easy way for me to run a debug build?

LavaHeron commented 4 days ago

I found a very similar bug, maybe that helps. pop-os/cosmic-epoch#1214