From: "Serge E. Hallyn" <serge@hallyn.com>
To: Gwendal Grignou <gwendal@google.com>
Cc: Gwendal Grignou <gwendal@chromium.org>,
dhowells@redhat.com, james.l.morris@oracle.com, serge@hallyn.com,
keyrings@vger.kernel.org,
Linux Kernel <linux-kernel@vger.kernel.org>,
linux-security-module@vger.kernel.org,
"Theodore Ts'o" <tytso@mit.edu>
Subject: Re: [PATCH] keyrings: Allow searching the user session keyring
Date: Fri, 20 May 2016 14:27:47 -0500 [thread overview]
Message-ID: <20160520192747.GA11802@mail.hallyn.com> (raw)
In-Reply-To: <CAMHSBOXGBC2skDB2KVsVJGB-W-j44gNWsVWv4H1-h2WXYENMMg@mail.gmail.com>
Sorry, I just don't know al lthe subtleties there, I think we just need
David's ack/nack here.
Quoting Gwendal Grignou (gwendal@google.com):
> Any feedback on this? It is mandatory if we want to mount a ecryptfs
> directory while the session keyring is used.
>
> Thanks,
> Gwendal.
>
> On Thu, Mar 17, 2016 at 10:04 AM, Gwendal Grignou <gwendal@chromium.org> wrote:
> > Resent to a larger audience.
> >
> > On Thu, Mar 10, 2016 at 2:20 PM, Gwendal Grignou <gwendal@chromium.org> wrote:
> >> Currently, if a session keyring exists, we are not searching in the
> >> user session or user keyrings.
> >>
> >> This is a problem when a session keyring exists and we want to use
> >> ecryptfs, who adds the needed key only in the user keyring.
> >>
> >> TEST=Without this change, mounting an ecryptfs "partition" fails when a
> >> session keyring exists:
> >> ...
> >> [ 2686.047522] Could not find key with description: [dd6f92bd8660b36c]
> >> ...
> >> Although the key exits:
> >> keyctl show @us
> >> Keyring
> >> 549666721 --alswrv 0 65534 keyring: _uid_ses.0
> >> 346719914 --alswrv 0 65534 \_ keyring: _uid.0
> >> 235623693 --alswrv 0 0 \_ user: dd6f92bd8660b36c
> >> 747773852 --alswrv 0 0 \_ user: 7025717e50fd74a2
> >> With this change, ecryptfs can see the keys it needs.
> >>
> >> Note that 'keyctl show' still only shows the session keyring by default.
> >> We need to specify 'keyctl show @us' to see the user session keyring
> >> when the session keyring exits.
> >>
> >> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> >> ---
> >> security/keys/process_keys.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
> >> index e6d50172..a77d66e 100644
> >> --- a/security/keys/process_keys.c
> >> +++ b/security/keys/process_keys.c
> >> @@ -395,8 +395,8 @@ key_ref_t search_my_process_keyrings(struct keyring_search_context *ctx)
> >> break;
> >> }
> >> }
> >> - /* or search the user-session keyring */
> >> - else if (ctx->cred->user->session_keyring) {
> >> + /* finally search the user-session keyring */
> >> + if (ctx->cred->user->session_keyring) {
> >> key_ref = keyring_search_aux(
> >> make_key_ref(ctx->cred->user->session_keyring, 1),
> >> ctx);
> >> --
> >> 2.7.0.rc3.207.g0ac5344
> >>
next prev parent reply other threads:[~2016-05-20 19:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1457648428-34445-1-git-send-email-gwendal@chromium.org>
2016-03-17 17:04 ` [PATCH] keyrings: Allow searching the user session keyring Gwendal Grignou
2016-05-03 18:34 ` Gwendal Grignou
2016-05-20 19:27 ` Serge E. Hallyn [this message]
2016-06-14 9:46 ` David Howells
2016-08-08 21:43 ` Gwendal Grignou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160520192747.GA11802@mail.hallyn.com \
--to=serge@hallyn.com \
--cc=dhowells@redhat.com \
--cc=gwendal@chromium.org \
--cc=gwendal@google.com \
--cc=james.l.morris@oracle.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox