-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Link user keychain to session keychain #3246
Conversation
This prevents odd "mount(2)" errors with mount-chroot.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I could not mount my encrypted chroot on a Lenovo Thinkpad 13 running Version 59.0.3071.71 (Official Build) beta (64-bit) without this fix. |
I signed it! |
CLAs look good, thanks! |
Is this overkill, with potentially bad side-effects? Would it be better to just make sure the decrypt key ends up in the appropriate keyring to begin with? |
I don't really know about these keyrings, but linking the user keyring in the session keyring seems ok. On samus-release/R58-9334.72.0, I see this right after login:
While on samus-release/R61-9647.0.0 (ext4 crypto) the link is not setup (there is a dircrypt keyring instead):
But after linking it looks like this, which seems to make sense.
|
My concern is that they may be unlinked for a reason (ARC++ or multi-profile is usually a good guess). What shows up if you print out the keyrings right after unwrapping the keys for the chroot? Can we somehow only make those keys accessible where they need to be? |
Without this patch:
(then mount fails and keys are immediately cleared from With this patch:
Then, on umount, |
Thank you for the patch! To use ext4 encryption on Chrome OS, we are applying a local patch to upstart to share a single session keyring among all user processes. So, instead of linking the root's user keyring to the current session keyring, how about setting up a new session keyring?
The resulting keyring will look like this:
|
@@ -247,6 +247,8 @@ $passphrase" | ecryptfs-rewrap-passphrase "$wrappedfnek" - | |||
error 1 "Failed to decrypt $NAME." | |||
fi | |||
|
|||
keyctl link @u @s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add keyctl new_session >/dev/null
before this line, and I think that'll solve the concern. No need to link the current keyring here (we don't need it in this process).
@hshmt Thanks for the insight! From offline discussion, we don't even need to link the old |
See dnschneid#3246 for a more complete explanation of the issue.
See #3246 for a more complete explanation of the issue.
I am not sure that this solution is the right one for the reasons given below:
I will try to find a "better" fix once I find time to debug the process! Kapil. Update: First of all let me eat humble pie and admit that the solution implemented does indeed seem to be correct.
|
I'm really glad this all makes sense to someone here. Thanks for looking into it! |
This prevents odd "mount(2)" errors with mount-chroot.