-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] pam_fscrypt doesn't locks and clear keyring after logout #57
Comments
Looking at the logs, everything seems normal, except that for user UID=1001, OpenSession is called twice and CloseSession is called once. This makes me think that something about your setup is causesing two sessions to be opened, but only one to be closed. Are there any more logs for fscrypt? My guess would be it is related to sddm. The second thing is that permission denied at end of the logs. I would guess it is caused by CloseSession being called without root privileges. I'll add some more logging to try to figure this out. This is still arch Linux with the PAM setup you described previously? |
Yeah it's still Archlinux. I tried to login with console and it still looks like pam_fscrypt module doesn't work as expected on session close. Side question: should fscrypt search it's metadata under every filesystem such as tmpfs,debugfs and son on which aren't relevant to it? As you can see it can clutter logs with denial messages. |
I found some misconfiguration with pam systemd_user module which invoked pam_fscrypt on it's own, it think that was the reason why 2 sessions were opened. Keyrings/caches are still not cleared but logs should be clearer. I post them later. |
Encrypted directory status before login:
Root keyring before login:
Encrypted directory view before login:
user1 logs in:
Encrypted directory status after user1 login:
root keyring after user1 login:
Encrypted directory view after user1 login:
user1 logout:
Encrypted directory status after user1 logout:
root keyring after user1 logout:
Encrypted directory view after user1 logout:
|
It's clear that encrypted directory isn't locked and keyring isn't cleared after logout. I found this line interesting: |
The PR I just pushed should have fixed the issue. When logging out, your session keyring was going away before the key could be cleared. This isn't really a problem, as fscrypt removes the key from the user keyring anyway. |
Please reopen this if my fix didn't work. |
Thank you for fixing issues I reported. Unfortunately I have another one.
I created
user1
and created encrypted directory under his homedir usingpam_passphrase
method.I added following fscrypt pam session module to my pam config:
session optional pam_fscrypt.so drop_caches lock_policies debug
When
user1
logs in encrypted directory is correctly unlocked but after logout it's still unlocked and avalaible in plaintext.user1
key is still available inroot
keyring.Invoking
fscrypt purge
manually correctly removesuser1
keys and lock encrypted directory.The text was updated successfully, but these errors were encountered: