From: James Morris <james.l.morris@oracle.com>
To: keyrings@vger.kernel.org
Subject: Re: [PATCH] keyctl: use keyctl_read_alloc() in dump_key_tree_aux()
Date: Fri, 27 Oct 2017 08:06:01 +0000 [thread overview]
Message-ID: <alpine.LFD.2.20.1710271005480.3746@localhost> (raw)
In-Reply-To: <20171026210008.106248-1-ebiggers3@gmail.com>
On Thu, 26 Oct 2017, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> dump_key_tree_aux() (part of 'keyctl show') was racy: it allocated a
> buffer for the keyring contents, then read the keyring. But it's
> possible that keys are added to the keyring concurrently. This is
> problematic for two reasons. First, when keyctl_read() is passed a
> buffer that is too small, it is unspecified whether it is filled or not.
> Second, even if the buffer is filled, some keys (not necessarily even
> the newest ones) would be omitted from the listing.
>
> Switch to keyctl_read_alloc() which handles the "buffer too small" case
> correctly by retrying the read.
>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: James Morris <james.l.morris@oracle.com>
--
James Morris
<james.l.morris@oracle.com>
next prev parent reply other threads:[~2017-10-27 8:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 21:00 [PATCH] keyctl: use keyctl_read_alloc() in dump_key_tree_aux() Eric Biggers
2017-10-27 8:06 ` James Morris [this message]
2018-02-20 19:43 ` Eric Biggers
2018-05-08 18:09 ` Eric Biggers
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=alpine.LFD.2.20.1710271005480.3746@localhost \
--to=james.l.morris@oracle.com \
--cc=keyrings@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.