From: James Morris <james.l.morris@oracle.com>
To: Eric Biggers <ebiggers3@gmail.com>
Cc: keyrings@vger.kernel.org, David Howells <dhowells@redhat.com>,
Ben Hutchings <ben@decadent.org.uk>,
Xiao Yang <yangx.jy@cn.fujitsu.com>,
Eric Biggers <ebiggers@google.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] KEYS: return full count in keyring_read() if buffer is too small
Date: Fri, 27 Oct 2017 10:04:31 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.20.1710271004150.3746@localhost> (raw)
In-Reply-To: <20171026205644.105471-1-ebiggers3@gmail.com>
On Thu, 26 Oct 2017, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> Commit e645016abc80 ("KEYS: fix writing past end of user-supplied buffer
> in keyring_read()") made keyring_read() stop corrupting userspace memory
> when the user-supplied buffer is too small. However it also made the
> return value in that case be the short buffer size rather than the size
> required, yet keyctl_read() is actually documented to return the size
> required. Therefore, switch it over to the documented behavior.
>
> Note that for now we continue to have it fill the short buffer, since it
> did that before (pre-v3.13) and dump_key_tree_aux() in keyutils arguably
> relies on it.
>
> Fixes: e645016abc80 ("KEYS: fix writing past end of user-supplied buffer in keyring_read()")
> Reported-by: Ben Hutchings <ben@decadent.org.uk>
> Cc: <stable@vger.kernel.org> # v3.13+
> Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: James Morris <james.l.morris@oracle.com>
--
James Morris
<james.l.morris@oracle.com>
prev parent reply other threads:[~2017-10-27 8:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 20:56 [PATCH] KEYS: return full count in keyring_read() if buffer is too small Eric Biggers
2017-10-27 8:04 ` James Morris [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=alpine.LFD.2.20.1710271004150.3746@localhost \
--to=james.l.morris@oracle.com \
--cc=ben@decadent.org.uk \
--cc=dhowells@redhat.com \
--cc=ebiggers3@gmail.com \
--cc=ebiggers@google.com \
--cc=keyrings@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=yangx.jy@cn.fujitsu.com \
/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