From: David Howells <dhowells@redhat.com>
To: Eric Biggers <ebiggers3@gmail.com>
Cc: dhowells@redhat.com, keyrings@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, Eric Biggers <ebiggers@google.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] KEYS: fix keyctl_set_reqkey_keyring() to not leak thread keyrings
Date: Mon, 03 Apr 2017 16:52:02 +0100 [thread overview]
Message-ID: <3785.1491234722@warthog.procyon.org.uk> (raw)
In-Reply-To: <20170401233908.20786-1-ebiggers3@gmail.com>
Eric Biggers <ebiggers3@gmail.com> wrote:
> @@ -135,6 +135,9 @@ int install_thread_keyring_to_cred(struct cred *new)
> {
> struct key *keyring;
>
> + if (new->thread_keyring)
> + return -EEXIST;
> +
> keyring = keyring_alloc("_tid", new->uid, new->gid, new,
> KEY_POS_ALL | KEY_USR_VIEW,
> KEY_ALLOC_QUOTA_OVERRUN,
It would probably be better just to return 0 and change the comment on the
function to say that it sets a thread keyring if there isn't one already.
Same for the process keyring.
David
prev parent reply other threads:[~2017-04-03 15:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-01 23:39 [PATCH] KEYS: fix keyctl_set_reqkey_keyring() to not leak thread keyrings Eric Biggers
2017-04-03 15:52 ` David Howells [this message]
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=3785.1491234722@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=ebiggers3@gmail.com \
--cc=ebiggers@google.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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